Library / Computational Thinking DPF
Jump to passage
In this reading

Link to current text

Published source confirmed at last check

Source changed 2026-10-03 05:29:54 UTC · snapshot created 2026-10-03 05:30:57 UTC · last check 2026-10-03 07:00:10 UTC

CMP.8:5.2 - Repair an unstable evaluation without changing its target

Compute f(x)=sqrt(1+x)-1 for a small positive x. Under binary64 round-to-nearest arithmetic, take x=10^-16. The addition can round 1+x to 1, so the direct expression returns zero. The positive mathematical answer is about 5*10^-17.

Rationalizing gives the same real-valued function:

f(x)=x/(sqrt(1+x)+1).

Even when the computed square root is 1, this expression returns approximately 5*10^-17, preserving the small contribution through the numerator. Near positive zero, the relative condition number is (sqrt(1+x)+1)/(2*sqrt(1+x)), which tends to 1. The failure of the direct expression therefore comes from its evaluation, not a large relative sensitivity to x.

This repair assumes the receiving requirement concerns f(x). If it instead asks for an accurate derivative obtained by subtracting nearby rounded function values, that is a new computation. The value repair alone supplies no error bound for that differentiation.