Assignment NM 2
Assignment NM 2
Assignment NM 2
(2) In the following problems, show all the steps involved in the computation.
(i) Using 5−digit rounding and chopping, compute 37654 + 25.874 − 37679.
(ii) Let a = 0.00456, b = 0.123, c = 0.128. Using 3-digit rounding and chopping, compute
(a + b) + c and a + (b + c). What is your conclusion?
(iii) Let a = 2, b = 0.6, c = 0.602. Using 3−digit rounding and chopping, compute (a × b) + (a ×
c). What is your conclusion?
(3) Let x, y, and z be real numbers whose floating point approximations in a computing device co-
incide with x, y, and z, respectively. Show that the relative error in computing x(y + z) equals
ε1 + ε2 − ε1 ε2 , where ε1 = Er ( f l(y + z)) and ε2 = Er ( f l(x × f l(y + z))).
(5) Let xA = 3.14 and yA = 2.651 be obtained from the numbers xT and yT respectively using 4-digit
rounding. For any such values of xT and yT , find the smallest interval that contains
(i) xT + yT (ii) xT /yT (iii) xT × yT .
(6) Let x < 0 < y be such that the approximate numbers xA and yA has seven and nine significant digits
with x and y respectively. Show that zA := xA − yA has at least six significant digits when compared
to z := x − y.
(7) Let xT be a real number. Let xA = 2.5 be an approximate value of xT with an absolute error at
most 0.01. The function f (x) = x3 is evaluated at x = xA instead of x = xT . Estimate the resulting
absolute error.
(9) Find the condition number at a point x = c for the following functions
(i) f (x) = x2 , (ii) g(x) = π x , (iii) h(x) = bx .
2
sin (x)
(10) check for stability of computing the function h(x) = 1−cos 2 x for values of x very close to 0. Run
in Matlab and see the output for x = 10 (−7.97) for the function h(x) and also try with some non-
negative number less than x, for instance, x = 10−8 . Note that for any x ∈ R, h(x) = 1.