MATH2033 (2023–2024)
Introduction to Scientific Computation
Finite-Digit Arithmetic
PROBLEM SHEET SOLUTIONS
Solution to Problem 1
a We can compute that
4 1 12 5 17
x+y = + = + = .
5 3 15 15 15
b i) We can compute that
x ⊕ y = f l (f l (x) + f l (y)) = f l (0.8 + 0.333) = f l(1.133) = 1.13.
ii) We can compute that
x ⊕ y = f l (f l (x) + f l (y)) = f l (0.8 + 0.333) = f l(1.133) = 1.13.
c The absolute error is
17
− 1.13 = 3.33 . . . × 10−3 .
15
Solution to Problem 2
a We can compute that
4 1 4
x×y = × = .
5 3 15
b i) We can compute that
x⊗y = f l (f l (x) × f l (y)) = f l (0.8 × 0.333) = f l(0.2664) = 0.266.
ii) We can compute that
x⊗y = f l (f l (x) × f l (y)) = f l (0.8 × 0.333) = f l(0.2664) = 0.266.
c The absolute error is
4
− 0.266 = 6.66 . . . × 10−4 .
15
Page 1 of 2
Solution to Problem 3
a We can compute that
1 3 3 11 9 3 2 3 40 99 139
x−y +z = − + = − + = + = + = .
3 11 20 33 33 20 33 20 660 660 660
b i) We can compute that
(x y) ⊕ z = (0.333 0.272) ⊕ 0.15 = 0.061 ⊕ 0.15 = 0.211.
ii) We can compute that
(x y) ⊕ z = (0.333 0.273) ⊕ 0.15 = 0.06 ⊕ 0.15 = 0.21.
c The absolute error in the approximation obtained in part b i) is
139
− 0.211 = 3.93 . . . × 10−4 .
660
The absolute error in the approximation obtained in part b ii) is
139
− 0.21 = 6.06 . . . × 10−4 .
660
References
• Burden, Faires & Burden, Numerical Analysis, 10E
– Section 1.2
Page 2 of 2