These are the human proofs of Secant method, at full length.
The secant method ends, converges near a simple root, and has order (1 + 5^(1/2))/2 full
This proof shows: correctness, termination, local-convergence, order.
We write xk−1,xk for the values of x0,x1 at the start of pass k of the loop of lines L3 to L10, so the starting points are x0,x1 and pass k computes xk+1. Let ek=xk−x∗, fk=f(xk), and let f[a,b] and f[a,b,c] be the first and second divided differences.
Claim 1 (termination and flags). SECANT returns after at most kmax passes and kmax+2 evaluations of f. A result with the flag "root" is an exact zero of f; a result with the flag "converged" passed the test of line L8.
Proof. Lines L1 and L2 make two evaluations, each pass makes at most one (line L9), and the loop of line L3 runs at most kmax times. Lines L1, L2 and L9 return only when the value is exactly 0, and line L8 only after its test. The division in line L5 is defined because line L4 has checked f1=f0. □
Lemma (the error identity). Let f∈C2 on an interval I that holds xk−1, xk and x∗, with xk−1=xk and f[xk−1,xk]=0. Then
ek+1=f[xk−1,xk]f[xk−1,xk,x∗]ekek−1,
and there are ξk,ηk∈I with f[xk−1,xk,x∗]=21f′′(ξk) and f[xk−1,xk]=f′(ηk).
Proof. Line L5 gives xk+1=xk−fk/f[xk−1,xk]. Since f(x∗)=0, fk=fk−f(x∗)=f[xk,x∗]ek (if xk=x∗ both sides are 0, with f[x∗,x∗]=f′(x∗)). So
By the definition of the second divided difference, f[xk−1,xk]−f[xk,x∗]=(xk−1−x∗)f[xk−1,xk,x∗]=ek−1f[xk−1,xk,x∗]. This gives the identity. The mean value forms of divided differences give ξk and ηk in the smallest interval that holds the points, which lies in I. □
Claim 2 (local convergence). Let f∈C2 on I=[x∗−r,x∗+r] with f(x∗)=0 and f′=0 on I, let M=maxI∣f′′∣/(2minI∣f′∣), and let x0=x1 in I with M∣e0∣≤1/2 and M∣e1∣≤1/2. Then in exact arithmetic, with kmax=∞ and a zero tolerance, every xk lies in I, ∣ek+1∣≤M∣ek∣∣ek−1∣≤21∣ek∣, and xk→x∗.
Proof. By induction on k≥1 we show: xk−1,xk∈I, M∣ek−1∣≤1/2 and M∣ek∣≤1/2. This holds for k=1. Assume it for k. If fk=0 the method returns at line L2 or L9 with xk=x∗, since f′=0 on I makes x∗ the only zero in I. Otherwise xk=x∗. The points xk−1 and xk differ: for k=1 by assumption, and for k≥2 because xk=xk−1+s with s=0 only if fk−1=0, which has already returned. By the mean value theorem f[xk−1,xk]=f′(η)=0, so fk=fk−1 and line L4 does not stop. The lemma gives ∣ek+1∣≤M∣ek∣∣ek−1∣≤21∣ek∣≤r, so xk+1∈I and M∣ek+1∣≤21M∣ek∣≤1/2. This completes the induction. Then ∣ek+1∣≤21∣ek∣ for all k≥1, so ∣ek∣≤21−k∣e1∣→0. □
Claim 3 (order φ). Under the hypotheses of Claim 2, assume also that f′′(x∗)=0 and that no ek is zero. Let φ=(1+5)/2 and C=∣f′′(x∗)/(2f′(x∗))∣. Then
k→∞lim∣ek∣φ∣ek+1∣=C1/φ.
Proof. Let Mk=∣ek+1∣/(∣ek∣∣ek−1∣). By the lemma Mk=∣f′′(ξk)∣/(2∣f′(ηk)∣), and since xk−1,xk→x∗, both ξk and ηk tend to x∗, so Mk→C>0 by continuity. Let yk=∣ek+1∣/∣ek∣φ. Since φ2=φ+1, we have (1−φ)(−φ)=φ2−φ=1, and so
yk−11−φ=∣ek∣1−φ∣ek−1∣−φ(1−φ)=∣ek∣1−φ∣ek−1∣.
Hence yk=Mk∣ek∣∣ek−1∣/∣ek∣φ=Mkyk−11−φ. Take logarithms, use 1−φ=−1/φ, and set ρ=1/φ≈0.618<1:
lnyk=lnMk−ρlnyk−1.
Let L=lnC/(1+ρ), zk=lnyk−L and ϵk=lnMk−lnC. Then zk=ϵk−ρzk−1, so ∣zk∣≤∣ϵk∣+ρ∣zk−1∣, with ϵk→0.
The sequence zk tends to 0. Let E=supk∣ϵk∣<∞. By induction ∣zk∣≤E/(1−ρ)+∣z1∣, so (zk) is bounded. Let λ=limsup∣zk∣. Taking the limit superior in ∣zk∣≤∣ϵk∣+ρ∣zk−1∣ gives λ≤0+ρλ, so λ=0.
So lnyk→L, and yk→eL=C1/(1+ρ). Since 1+ρ=1+1/φ=(φ+1)/φ=φ2/φ=φ, the limit is C1/φ. □
Floating point. Claim 1 holds in floating point as stated. Claims 2 and 3 hold in exact arithmetic; in floating point the iterates follow them until the error reaches the limiting accuracy. ■