Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Computational Methods

Summer 2022

HOMEWORK 2

1.   (a) Let f (x) = sin x sx. Find the multiplicity of the root r = 0. Then use MATLAB’s root finding command, fzero, with the initial guess x = 0.1, to locate a root. What are the forward and backward errors of fzero’s response?

(b) Backward error and forward error are not always of similar sizes. Verify this in the case of a linear function by finding the relationship between the forward and backward error for finding a root of f (x) = ax s b.

If we know f (~r) =  10 8  for some approximate root ~r, can we guarantee ~r is accurate?  Describe the problems (i.e.  a range of a and b) for which accuracy is guaranteed.  Suppose by accuracy we mean the forward error is less than ε = 10 6 .

2.   (a) In double precision floating point arithmetic, is it true or false that 1 + x > 1 for the values (i) x = 2 52, (ii) x = 2 53, and x = 2 53 + 2 60 . Explain your choice for each case.

(b) Explain why between 253 and 254, the only double precision floating point num- bers that exist are the even numbers.

(c) Convert x = (10.2)10 to binary, then express it as a normalized single-precision floating point number fl(x) (i.e. in the form 士1.mantissa ×2F ), using the round- to-nearest rule. [Note this is single-precision, so the mantissa only contains 23 bits.]

3.  (Optional, not graded) Express (10.2)10  as a computer word.  (You will need to read the supplementary notes about how exponents are stored with an exponent bias.)