Proofs: Dekker's method
These are the human proofs of Dekker's method, at full length.
Correctness and termination of Dekker's method full
This proof shows: correctness, termination.
We work in exact arithmetic for the decisions, with as in line L4; in exact arithmetic take and . Let be continuous on with , and write for the width of the current bracket.
Theorem 1 (invariant). At each test of line L4: and lie in , and are nonzero with opposite signs, and . So a root lies strictly between and , and a return at L4 gives .
Proof. At the first pass the first two claims are the hypothesis, and line L3 gives the third by a swap, which keeps the first two. Suppose the claims hold at the test of L4 and the method does not return. Lines L5 to L7 produce strictly between and : L6 replaces any outside the open interval between and by , which is also strictly inside ; if , L7 sets , which lies strictly between and because . So lies strictly between and , hence in . If the method returns a root. Otherwise, at L9, if has the sign of , then the old (now ) has the opposite sign, and the new contrapoint is ; if not, stays. In both cases and have opposite signs, and line L3 of the next pass restores . The intermediate value theorem gives the root. Since is the midpoint, , so the test means .
Lemma 2 (progress). If a pass does not return, the width after it satisfies .
Proof. The new point lies between and with (by L7, or because and ). If the contrapoint stays, the new bracket is between and , and since lies between and , . If the contrapoint becomes the old , the new bracket is between the old and , so . Since the pass did not return, , so . In both cases . A swap at L3 does not change .
Theorem 3 (termination). Let and . DEKKER returns within passes, so with at most evaluations of . For any it ends within passes.
Proof. at every pass. By Lemma 2, after passes that do not return, , so . Each pass costs one evaluation, the start two. The loop has passes.
In binary64 with , is at least one unit in the last place of when , so each pass moves to a different floating point number and the width shrinks; the bound of Theorem 3 does not apply, and is the guarantee. Near with the floor can underflow; a positive avoids this.
Local behavior. Theorem 3 is the only bound for general continuous , and it is linear in . The page shows functions ( and ) that need hundreds of steps. Near a simple root of a function the accepted steps are secant steps, which converge with order ; this is the classical local theory of the secant method, and the observed log ratios in the example are 1.61 to 1.66.