SI 211: Numerical Analysis HW1 2018231036 顾怡恬
SI 211: Numerical Analysis HW1 2018231036 顾怡恬
SI 211: Numerical Analysis HW1 2018231036 顾怡恬
1. (a) Numerical approximation error is -1.5460e-13. This error comes from the
limitation of the floating numbers. sin(10000π) cannot be exactly 0 because
π is an infinite non-repeating decimal.
(b)
a0 = 𝑥 ∆a0 = 𝑒𝑝𝑠 ∆a0 |𝑥=10−10 ≈ 𝑒𝑝𝑠
4 4
a1 = 10 ∗ 𝑎0 ∆a1 = 10 ∗ ∆a0 + 𝑒𝑝𝑠 ∆a1 |𝑥=10−10 ≈ 1.0001 × 104 𝑒𝑝𝑠
a2 = sin(a1 ) ∆a2 = |cos(𝑎1 )| ∗ ∆a1 + 𝑒𝑝𝑠 ∆a2 |𝑥=10−10 ≈ 1.0002 × 104 𝑒𝑝𝑠
𝑎2 𝑎2 ∆a2
a3 = ∆a3 = |− ∗ ∆a0 | + | | + 𝑒𝑝𝑠 ∆a3 |𝑥=10−10 ≈ 2.0002 × 1014 𝑒𝑝𝑠
𝑎0 𝑎02 𝑎0
3. (a)
a0 = 𝑥 b0 = 1
a1 = cos(𝑥) b1 = −sin(𝑥)
a2 = 𝑎1 ∗ 𝑎1 b2 = 𝑎1 ∗ 𝑏1 + 𝑏1 ∗ 𝑎1
a3 = sin(𝑎1 ) b3 = cos(𝑎1 ) ∗ 𝑏1
a4 = 𝑎2 ∗ 𝑎3 b4 = 𝑏2 ∗ 𝑎3 + 𝑎2 ∗ 𝑏3
𝑓(𝑥) = a4 f ′ (𝑥) = 𝑏4
(b)
a0 = 0 ∆a0 = 𝑒𝑝𝑠(0) = 0
a1 = 1 ∆a1 = − sin(0) + 𝑒𝑝𝑠 ≈ 2.0 ∗ 10−16
a2 = 1 ∆a2 = 𝑎1 ∗ ∆a1 + 𝑏1 ∗ ∆a1 + 𝑒𝑝𝑠 ≈ 6.0 ∗ 10−16
SI 211: Numerical Analysis HW1 2018231036 顾怡恬
b0 = 1 ∆b0 = 𝑒𝑝𝑠(0) = 0
b1 = 0 ∆b1 = |−cos(𝑎0 )| ∗ ∆a0 + 𝑒𝑝𝑠(0) = 0
b2 = 2 ∗ 𝑎1 ∗ 𝑏1 = 0 ∆b2 = 2 ∗ |𝑏1 | ∗ ∆a1 + 2 ∗ |𝑎1 | ∗ ∆b1 + 𝑒𝑝𝑠(0) = 0
b3 = cos(𝑎1 ) ∗ 𝑏1 ∆b3 = |cos(𝑎1 )| ∗ ∆b1 + |𝑏1 | ∗ |sin(𝑎1 )| ∗ ∆a1 + 𝑒𝑝𝑠(0) = 0
b4 = 𝑏2 ∗ 𝑎3 + 𝑎2 ∗ 𝑏3 ∆b4 = |𝑏3 | ∗ ∆a2 + |𝑎2 | ∗ ∆b3 + |𝑏2 | ∗ ∆a3 + |𝑎3 | ∗ ∆b2 + 𝑒𝑝𝑠(0) =
0
So the numerical error that is associated with evaluating the derivative is 0.