Numerical Differentiation, Part II 13
(a) Let f(x) = sin xand x0=π. Because the error in the approximate value
hf(x0)−f(x0−h)
herror
(b) Now, take x0= 0. Because the error in the approximate value of the derivative
10.459697 0.459697
(c) The rate of convergence in part (b) is what one would expect from the given
formula; the rate of convergence is higher than expected in part (a). Recall
15. Consider the following formula for approximating the first derivative of an ar-
bitrary function:
f0(x0) = −2f(x0−3h)+9f(x0−2h)−18f(x0−h) + 11f(x0)
6h+1
4h3f(4)(ξ),
where x0−3h < ξ < x0.
(a) Suppose that the function values used in the above formula contain round-
off/data errors which are bounded in absolute value by and that the
absolute value of the fourth derivative is bounded by M. Derive a bound
for the approximation error associated with the above formula as a function
of ,Mand h.
(b) Suppose = 5.96 ×10−8(machine precision in IEEE standard single preci-
sion). Determine the value for the step size hwhich minimizes the bound
on the error when approximating the value of the derivative of f(x) = ex
at x0= 1.