These are the human proofs of Newton's method for square root, at full length.
Newton's square root iteration squares the quantity (x - r)/(x + r), converges from every positive start, and terminates in floating point full
This proof shows: correctness, termination, global-convergence, order.
Let a>0, r=a, x0>0 and xk+1=(xk+a/xk)/2. Write ek=xk−r and tk=(xk−r)/(xk+r). For NEWTON-SQRT, a is replaced by m and x0=1, so the x of line L3 is x1 and pass k computes xk+1.
Lemma (the exact error formula). For every xk>0, xk+1>0 and
Proof.xk+1±r=(xk2+a±2rxk)/(2xk)=(xk±r)2/(2xk), using a=r2. Positivity is clear. Divide the two forms; xk+1+r>0, so tk+1 is defined. □
Claim 1 (global convergence). For every x0>0: ∣t0∣<1, tk=t02k, xk≥r for k≥1, xk+1≤xk for k≥1, xk→r, and if no ek is zero, ek+1/ek2→1/(2r).
Proof. Since x0>0 and r>0, ∣x0−r∣<x0+r, so ∣t0∣<1; the lemma gives tk=t02k→0. Solving t=(x−r)/(x+r) for x gives xk=r(1+tk)/(1−tk), so xk→r. For k≥1, ek=ek−12/(2xk−1)≥0. Then xk+1−xk=(a−xk2)/(2xk)≤0. Finally ek+1/ek2=1/(2xk)→1/(2r). □
Claim 2 (the reduced start). If 1/2≤m<2 and x0=1, then ∣t0∣≤3−22<0.1716, and for k≥1 the relative error satisfies
0≤rxk−r=1−tk2tk≤1−0.17162k2⋅0.17162k.
For k=5 the bound is below 1.1⋅10−24<u=2−53.
Proof.∣t0∣=∣1−m∣/(1+m). The function s↦∣1−s∣/(1+s) decreases on (0,1] and increases on [1,∞), so on [1/2,2] its maximum is at an end. Both ends give (2−1)/(2+1)=(2−1)2=3−22≈0.17157. The formula for the relative error follows from xk=r(1+tk)/(1−tk), with tk=t02k≥0 for k≥1. For k=5, 0.171632<5.5⋅10−25. □
Claim 3 (termination and the range reduction). In binary64, NEWTON-SQRT returns for every input after at most kmax passes, and the loop also ends when kmax=∞. Line L2 is exact, and a=m⋅2e.
Proof. Line L2: write a=f⋅2E with 1/2≤f<1; if E is even take m=f, e=E/2, otherwise m=2f, e=(E−1)/2. Multiplying by 2 is exact, 1/2≤m<2 and a=m⋅4e. In the loop, the computed x and m/x are positive (the quotient of two positive normal numbers in [1/4,4] does not underflow), so every x is a positive floating-point number. Line L7 runs only after line L6 found y<x, so the values of x in successive passes strictly decrease. There are finitely many floating-point numbers in (0,2], so line L6 must eventually return. The final multiplication by 2e is exact because m⋅2e lies in the normal range for every finite positive binary64 a. □
What is not proved here. That the returned value is within one unit in the last place of a and that the loop uses at most 5 passes in binary64 are observed on random tests (see the main page), not proved. A proof needs a rounding analysis of the last two passes near m. ■