Sie sind auf Seite 1von 1

School of Mathematics, Thapar University, Patiala

UMA032 : Numerical and Statistical Methods


Assignment 1
Floating Point Arithmetic and Errors
1. Find the absolute, percentage, and relative errors if x = 0.005998 is chopped and rounded to three decimal
digits.

2. Round-off the following numbers correct to four significant figures: 58.3643, 979.267, 7.7265, 56.395, 0.065738
and 7326853000.

3. The following numbers are given in a decimal computer with a four digit normalized mantissa: A = 0.4523e−
4, B = 0.2115e−3, and C = 0.2583e1. Perform the following operations, and indicate the error in the result,
assuming symmetric rounding: (i) (A + B) + C (ii) A − B (iii) A/C (iv) (AB)/C.

4. The error in the measurement of area of a circle is not allowed to exceed 0.5%. How accurately the radius
should be measured.
√ √ √
5. Calculate the sum of 3, 5, and 7 to four significant digits and find its absolute and relative errors.
√ √
6. Find the relative error in taking the difference of numbers 5.5 = 2.345 and 6.1 = 2.470. Numbers should
be correct to four significant figures.

7.342
7. Find the relative error in calculation of , where numbers 7.342 and 0.241 are correct to three decimal
0.241
places. Determine the smallest interval in which true result lies.

8. Associative and distributive laws are not always valid in case of normalized floating-point representation.
Let a = 0.5555e1, b = 0.4545e1, c = 0.4535e1. Show that
a(b − c) 6= ab − ac.
Further let a = 0.5665e1, b = 0.5556e − 1, c = 0.5644e1. Show that
(a + b) − c 6= (a − c) + b.

9. Find the root of smallest magnitude of the equation x2 − 400x + 1 = 0 using quadratic formula. Work in
floating-point arithmetic using a four-decimal place mantissa.

10. Calculate the value of x2 + 2x − 2 and (2x − 2) + x2 where x = 0.7320e0, using normalized point arithmetic
and proves that they are not the same. Compare with the value of (x2 − 2) + 2x.

11. (i) Consider the stability (by calculating the condition number) of 1 + x − 1 when x is near 0. Rewrite the
expression to rid it of subtractive cancellation.
(ii) Rewrite ex − cos x to be stable when x is near 0.

12. Suppose that a function f (x) = ln(x + 1) − ln(x), is computed by the following algorithm for large values of
x using six digit rounding arithmetic
x0 : = x = 12345
x1 : = x0 + 1
x2 : = ln x1
x3 : = ln x0
f (x) := x4 : = x2 − x3 .
By considering the condition κ(x3 ) of the subproblem of evaluating the function, show that such a function
evaluation is not stable. Also propose the modification of function evaluation so that algorithm will become
stable.

Das könnte Ihnen auch gefallen