A forward-difference estimate of the derivative of (with in radians) is required at
PHYSICS · Subjective · Fermi University Physics · Mathematical Methods for Physics · Numerical and computational mathematics · Numerical and computational mathematics
Computational Physics, Ch Numbers a machine can hold, and the two errors that follow
Problem
A forward-difference estimate of the derivative of f(x)=sin(100x) (with x in radians) is required at x=0.01rad, using ϵmach=2.220446×10−16.
(a) Using hopt≈2ϵmach∣f/f′′∣, predict, before looking at any table, the decade of h at which the forward-difference error should be smallest.
(b) A one-decade-per-row run at x=0.01rad, in binary64, recorded the following errors of the forward-difference estimate against the exact derivative:
h=10−7: 4.2×10−4; h=10−8: 4.2×10−5; h=10−9: 4.2×10−6; h=10−10: 1.4×10−6; h=10−11: 5.3×10−6; h=10−12: 5.8×10−6.
State which row turns over, and say whether it agrees with the prediction of part (a) to the precision that an order-of-magnitude argument can support.