22
a
Using 3-digits with chopping 1.37
3
→ 2.571353 → 2.57
–71.37
2
→ –71.87 → –13.0 81.37
→ 10.96 →
10.9 –
0.35 –0.12
This represents an error of
7 .
178 043053
. 12
. 043053
. =
− =
t
ε
b
Using 3-digits with chopping 35
. 37
. 1
8 37
. 1
7 37
. 1
− +
− =
y 35
. 37
. 1
8 37
. 1
63 .
5 −
+ ×
− =
y 35
. 37
. 1
8 71
. 7
− +
− =
y 35
. 37
. 1
29 .
− ×
= y
35 .
397 .
− =
y 047
. =
y This represents an error of
2 .
9 043053
. 47
. 043053
. =
− =
t
ε
Hence, the second form is superior because it tends to minimize round-off error.
4.3 a For this case, x
i
= 0 and h = x. Thus, the Taylor series is
⋅ ⋅
⋅ +
+ =
+ 3
+ 2
3 3
2
x f
x f
x f
f x
f For the exponential function,
1
3
= =
= =
f f
f f
Substituting these values yields,
23 ⋅
⋅ ⋅
+ +
= +
3 1
+ 2
1 1
3 2
x x
x x
f which is the Maclaurin series expansion.
b
The true value is e
–1
= 0.367879 and the step size is h = x
i+1
– x
i
= 1 – 0.25 = 0.75. The complete Taylor series to the third-order term is
3 2
3 2
1
h e
h e
h e
e x
f
i i
i i
x x
x x
i −
− −
− +
− +
− =
Zero-order approximation:
778801 .
1
25 .
= =
−
e f
7 .
111 100
367879 .
778801 .
367879 .
= −
=
t
ε First-order approximation:
1947 .
75 .
778801 .
778801 .
1 =
− =
f
1 .
47 100
367879 .
1947 .
367879 .
= −
=
t
ε Second-order approximation:
413738 .
2 75
. 778801
. 75
. 778801
. 778801
. 1
2
= +
− =
f
5 .
12 100
367879 .
413738 .
367879 .
= −
=
t
ε Third-order approximation:
358978 .
6 75
. 778801
. 2
75 .
778801 .
75 .
778801 .
778801 .
1
3 2
= −
+ −
= f
42 .
2 100
367879 .
358978 .
367879 .
= −
=
t
ε
4.4
Use ε
s
= 0.5 ×10
2–2
= 0.5. The true value = cos π4 = 0.707107…
zero-order:
24
1 4
cos ≅
⎟ ⎠
⎞ ⎜
⎝ ⎛
π
42 .
41 100
707107 .
1 707107
. =
− =
t
ε first-order:
691575 .
2 4
1 4
cos
2
= −
≅ ⎟
⎠ ⎞
⎜ ⎝
⎛ π
π
6 .
44 100
691575 .
1 691575
. 19
. 2
100 707107
. 691575
. 707107
.
= −
= =
− =
a t
ε ε
second-order:
707429 .
24 4
691575 .
4 cos
4
= +
≅ ⎟
⎠ ⎞
⎜ ⎝
⎛ π
π
24 .
2 100
707429 .
691575 .
707429 .
456 .
100 707107
. 707429
. 707107
.
= −
= =
− =
a t
ε ε
third-order:
707103 .
720 4
707429 .
4 cos
6
= −
≅ ⎟
⎠ ⎞
⎜ ⎝
⎛ π
π
046 .
100 707103
. 707429
. 707103
. 0005
. 100
707107 .
707103 .
707107 .
= −
= =
− =
a t
ε ε
Because ε
a
0.5, we can terminate the computation.
4.5
Use ε
s
= 0.5 ×10
2–2
= 0.5. The true value = sin π4 = 0.707107…
zero-order:
25
785398 .
4 sin
≅ ⎟
⎠ ⎞
⎜ ⎝
⎛
π
1 .
11 100
707107 .
785398 .
707107 .
= −
=
t
ε first-order:
704653 .
6 4
785398 .
4 sin
3
= −
≅ ⎟
⎠ ⎞
⎜ ⎝
⎛ π
π
46 .
11 100
704653 .
785398 .
704653 .
347 .
100 707107
. 704653
. 707107
.
= −
= =
− =
a t
ε ε
second-order:
707143 .
120 4
704653 .
4 sin
5
= +
≅ ⎟
⎠ ⎞
⎜ ⎝
⎛ π
π
352 .
100 707143
. 704653
. 707143
. 0051
. 100
707107 .
707143 .
707107 .
= −
= =
− =
a t
ε ε
Because ε
a
0.5, we can terminate the computation.
4.6
The true value is f2 = 102. zero order:
8 .
160 100
102 62
102 62
1 2
= −
− =
− =
=
t
f f
ε first order:
1 .
92 100
102 8
102 8
1 70
62 2
70 7
1 12
1 75
1
2
= −
= =
+ −
= =
+ −
=
t
f f
ε
second order:
26 5
. 24
100 102
77 102
77 1
2 138
8 2
138 12
1 150
1
2
= −
= =
+ =
= −
=
t
f f
ε
third order:
. 100
102 102
102 102
1 6
150 77
2 150
1
3 3
= −
= =
+ =
=
t
f f
ε
Because we are working with a third-order polynomial, the error is zero. This is due to the fact that cubics have zero fourth and higher derivatives.
4.7 The true value is ln3 = 1.098612