Work in the float32 arithmetic of the harmonic-series example
PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Numerical and computational mathematics · Numerical and computational mathematics
Scientific Computing for Physicists, Ch The numerical toolkit closed: backward error and the audit of a library routine
Problem
Work in the float32 arithmetic of the harmonic-series example, with ϵmach=2−23 and every operation rounded to nearest.
((a)) For three terms, write the recursively computed sum fl(fl(x1+x2)+x3) with one rounding factor (1+δk) per addition, and show that to first order in ϵmach the effective perturbations on x1, x2 and x3 are δ2+δ3, δ2+δ3 and δ3. Explain how this pattern gives the bound (N−1)ϵmach/2 for N terms, and evaluate it for N=220.
((b)) The float32 value stored for 0.1 is x=0.10000000149011612. Add x to itself N=220 times in float32, once with a plain running total and once with Kahan's update, and give the relative error of each against the exact sum Nx. Explain why Nx=104857.6015625 is exact.
((c)) State whether each error respects its bound, and what the comparison shows about growth with N.