A137 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

A13 · Lesson 7 · Order of convergence and safeguarded root finding

Measuring how fast a method closes in, and making a fast one safe

Bisection never fails but crawls. Newton flies but can be thrown anywhere by a bad start. Real solvers combine them: keep a bracket that's guaranteed to contain the root, take the fast step when it lands inside the bracket and actually helps, and fall back to bisection when it doesn't. That's how scipy.optimize.brentq and every robust root finder in a simulator work. To compare methods honestly you need one number for speed, the order of convergence, and a way to measure it from a run.

  • Each stem is log10⁡ of the error after n steps, starting from the same error e0 (with all constants set to 1).
  • Linear convergence (rate ρ) is a straight line falling log10⁡(1/ρ) per step. The secant method (order 1.618) and Newton (order 2) curve downward ever faster: each step multiplies the number of correct digits by the order.
  • Make e0 larger (a worse start): every method takes longer, but the superlinear ones lose only a step or two.

Predict

A method's errors are 10−2, 10−3, 10−4.5, 10−6.75. What's its order?

Name it

Order of convergence

A sequence converges with order p if en+1≈Cenp:

MethodOrderNew evaluations per step
bisection1 (rate ½)1
fixed-point iteration1 (rate |g′(x*)|)1
secant1.6181
Newton22 (f and f′)
Halley33 (f, f′ and f″)

To estimate p from three successive errors (or from successive steps, when the root is unknown):

p≈ln⁡(en+1/en)ln⁡(en/en−1)

The efficiency index p1/w, for w evaluations per step, compares methods per unit of work: secant 1.618, Newton 1.414, Halley 1.442.

Safeguarded root finding

Keep a bracket [a, b] with f(a) and f(b) of opposite sign. Each step:

  1. Propose a fast step (Newton, secant, or inverse quadratic interpolation through three points).
  2. Accept it if it lands inside the bracket and shrinks the problem enough (Brent's test: the step must be less than half the one before last).
  3. Otherwise take a bisection step.
  4. Update the bracket so it still has a sign change.

The result can't do worse than bisection and is usually as fast as the secant method. Brent's method is this scheme with inverse quadratic interpolation; it's the default scalar root finder in most libraries.

Accelerating a linear sequence

If xn converges linearly, Aitken's Δ² formula x^=xn+2−(xn+2−xn+1)2xn+2−2xn+1+xn usually lands much closer, by assuming the error shrinks by the same factor each step.

Worked example

Newton's iterates for 2 have errors 8.6×10−2, 2.45×10−3, 2.12×10−6. Estimate the order.

Show the solution
  1. Log of the newer error ratio. ln⁡2.12×10−62.45×10−3=−7.05
  2. Log of the older error ratio. ln⁡2.45×10−38.6×10−2=−3.56
  3. Their quotient is the order. −7.05−3.56=1.98 Quadratic, as theory says.

Answer the order is about 1.98, quadratic.

Worked example

Apply Aitken's formula to x←cos⁡x from 1: 0.540302, 0.857553, 0.654290.

Show the solution
  1. The denominator. With x0,x1,x2 the three iterates, x2−2x1+x0=0.654290−1.715106+0.540302=−0.520514
  2. Aitken's formula. The numerator is (x2−x1)2=(−0.203263)2: x^=0.654290−(−0.203263)2−0.520514=0.654290+0.0413160.520514=0.733665
  3. Compare with the fixed point. Against 0.739085, one formula took the error from 0.085 to 0.005.

Answer x^=0.733665, an error of 0.005 against the last iterate's 0.085.

Worked example

Newton costs one function and one derivative evaluation per step; the secant method costs one function evaluation. If a derivative costs as much as a function, which converges faster per evaluation?

Show the solution
  1. Newton's index. Order 2 per step, using 2 evaluations, gives 21/2=1.414 per evaluation.
  2. The secant method's index. Its order is 1+52=1.618 with 1 evaluation, an index of 1.618.
  3. Compare. The secant method wins: per unit of work it multiplies the number of correct digits by 1.618 against Newton's 1.414.
  4. When Newton wins. If the derivative is nearly free (as in polynomials evaluated with Horner's rule), Newton's index rises toward 2 and it wins instead.

Answer the secant method, with an efficiency index of 1.618 per evaluation against Newton's 1.414.

Check

A method's successive errors are 0.1, 0.03162 and 0.005623. What's its order?

Check

A method of order 2 needs 2 function evaluations per step. What's its efficiency index?

Check

Newton's method starts with error 0.1 (take C = 1). How many steps until the error is below 10−12?

Check

Apply Aitken's Δ² formula to 0.6967, 0.767, 0.72.

Check

A safeguarded solver falls back to bisection every step on a nasty function. At worst, how many steps does it need to get within 1 × 10⁻⁶ of a root bracketed 1 wide?

Check

A safeguarded solver's Newton step lands outside the current bracket. What should it do?

Check

A method of order 1.618 starts with error 0.1 (take C = 1).

(a)

How many steps until the error is below 10−12?

Check

Aitken's formula is x^=x2−(x2−x1)2x2−2x1+x0.

Step 1

A sequence is exactly xn=L+Krn. What is x2?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Explain why

Why does a safeguarded method converge as fast as the secant method on good problems but never slower than bisection on bad ones?

Practice

Keep practicing

9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.