Problem 3         Due 1/29/01

In this problem we examine the combination of
algorithm error and machine round off error.  A
rather bizzare formula for calculating the
derivative of a function is given by:

df/dx = (-3f(x)+4f(x+h)-f(x+2h))/2h

(Actually, this is very useful as an approximation
to a derivative at x when the function cannot be
evaluated for arguments less than x)

In this problem I want you to:

a).  Using pencil and paper, derive the algorithm error
and round off error for this formula.  Determine the
optimum value of h as a function of the machine precision,
and an estimate of the resulting minimum error for arbitrary
functions f(x).  (Hint: it will be similar to a center-difference
formula result)

b).  Determine the error this formula makes in calculating
the derivative of f(x)=exp(x) over the range [-0.01:.01] (averaging
over alot of points smooths out the round off error!),
and graphically compare the results both to the forward 
difference formula in today's example and to the estimate
derived in part (a).  Mark the predicted optimum value of h
and minimum error on the graph with 'o'.  Note that the 
range of the plot will be different from the example, due to 
the different optimum value of h.  Don't forget to label all the
curves and points on your graph!