Week1 Handout
Week1 Handout
1/3 ≈ 0.3333...?
3
|{z}
| {z } × 10
7.3824563 (2)
exponent
| {z }
# of digits base
A toy floating-point system, D3
9.99 × 1010
0.01 × 10−10 .
Property 1. We can have a + b = a even when b ̸= 0.
In D3 , take
a = 1.00 × 100
and
b = 1.00 × 10−3 .
Then, mathematically,
(math) a + b = 1.001.
(D3 ) a + b = |{z}
1.00 1A = a.
3 digits
a = 1.01, b = 1.00.
Let us compare
First, a2 − b 2 :
a + b = 2.01
a − b = 0.01 = 1.00 × 10−2
(a + b)(a − b) = 2.01 × 10−2 .
f (n+1) (s)
Rn (x) = (x − x0 )n+1
(n + 1)!
f (n+1) (s)
Rn (x) = (x − x0 )n+1
(n + 1)!
An important issue to consider
1 2 1 1 1 2n
Tn (x) = 1 − x + x 4 − x 6 + ... + (−1)n x
2! 4! 6! (2n)!
• The remainder is
| cos(n+1) (s)| ≤ 1
Hence,
1
|Rn (x)| = |x|(n+1)
(n + 1)!
Now, using Python, evaluate Rn (x) at x = 0.15 for different values
of n and verify it becomes smaller as n increases.