PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Computational Physics · Scientific programming for physicists
Scientific Computing for Physicists, Ch Letting the computer do advanced algebra: operators, series and differentiated programs
Problem
A program computes x without a square-root routine, by three Newton steps yk+1=21(yk+x/yk) from y0=1.
((a)) Write the dual-number rules for addition, multiplication by a real constant and division that this loop needs. Run the loop on x=2+ε by hand and report the value and the ε part after each step.
((b)) Compare the final value with 2 and the final ε part with the derivative of x at x=2, giving both relative differences.
((c)) Forward-mode differentiation is exact to rounding, yet the ε part is not 1/(22). Exactly what has it differentiated, and what does this imply for differentiating a program that only approximates the function we care about?