next up previous

Exercise 6: An illustration of the error analysis of the previous exercise.

To illustrate the error analysis of the previous exercise, approximate the derivative of at x = 0 with the centered difference formula and compare with the exact value of the derivative using step sizes ranging from to . Use xmgr to produce a log--log plot of the error. On your computer, what appears to be a choice of h that minimizes the sum of the rounding/precision error and the truncation error for this calculation? Show how your results change when you use 32 bit, 64 bit, and 128 bit precision in your floating point calculations.