Вы находитесь на странице: 1из 2

School of Mathematics, Thapar Institute of Engineering & Technology, Patiala

UMA011 : Numerical Analysisis

Assignment 1

Floating Point Arithmetic and Errors

1. Compute the absolute error and relative error in approximations of x by x∗.


a. x = π, x∗ = 22/7
b. x= 2 , x∗ = 1.414

2. Find the largest interval in which x∗ must lie to approximate x with relative error at most 10−4 for
each value of x.
(a) x   (b) x  2

3. Use three-digit rounding arithmetic to perform the following calculations. Compute the
absolute error and relative error with the exact value determined to at least five digits.

a. 3  ( 5  7)

b. (121 − 0.327) − 119

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. a. Evaluate the polynomial f ( x)  x 3  7 x 2  8 x  3.5 at x  1.37 using 3-digit


arithmetic with chopping. Evaluate the percent relative error.
b. Evaluate f ( x)  x 3  6.1x 2  3.2 x  1.5 at x  4.71 in nested form by using three digit rounding
arithmetic and hence find the relative error.(Find exact value of the polynomial using 3 digits with
rounding)

6. Use four-digit rounding arithmetic and the formulas to find the most accurate approximations to the roots
of the following quadratic equations. Compute the relative error.

1 2 123 1
a. x  x 0
3 4 6
b. 1.002 x 2  11.01x  0.01265  0

7. Show that the function leads to unstable computation when x  0. Rewrite the function to avoid loss of
significance. Further check the stability of f (x) in the equivalent definition.

a. f ( x )  1  cos( x)

b. f ( x)  e x  cos( x)

c. 1  cos( x)
f ( x) 
x2

8. −
Discuss the condition and stability of−the function f ( x)  x  x 2  1 at x  11111 , using
six significant digits floating point rounding arithmetic. Find a stable way to compute
function.

9. Suppose that a function f ( x)  x  1  x is computed by the following algorithm for large values of x
using six digit rounding arithmetic

x0 : x  123456
x1 :  x0  1
x2 :  x1
x3 :  x0

f ( x)  x 4  x 2  x3

By considering the condition k ( x3 ) of the sub problem 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.

Вам также может понравиться