Repeating a Rule: Fixed-Point Iteration and Inverse Quadratic Interpolation
Fixed-point iteration and why its error shrinks by the factor |g′|, Newton as a special case, inverse quadratic interpolation without a derivative, and how Brent’s method combines the fast steps with bisection.
Last updated:
Warm-up: what do you already know?
1. On a scientific calculator set to radians, type any number and press = so that it is stored in Ans.
Then type cos(Ans) and press = again and again. What happens to the displayed number?
A: It grows without bound
The cosine always lies between and , so the displayed number stays in that range.
B: It settles on one number, 0.7390851…
Each press replaces by . The number settles where pressing the key changes nothing:
a number that equals its own cosine. This lesson explains why it settles, and how fast.
C: It jumps among the same few numbers forever
That can happen to other rules, but not to the cosine key.
Check it on the calculator. The emulator below does exactly this, key by key.
The guide shows the keys; press them yourself.
An iteration that repeats one rule
In bisection, regula falsi and Newton–Raphson and the secant method we looked for a root:
a number with . Here is another way to pose a question.
Take a function and look for a number that leaves unchanged:
Such a number is a fixed point of . To find it, start anywhere and apply the rule again and again:
This is fixed-point iteration. The calculator experiment is exactly this with .
The fixed point is , the root of . Starting from , with the error :
| Error | |||
|---|---|---|---|
| 0 | 1.00000 | 0.261 | |
| 1 | 0.54030 | 0.199 | 0.76 |
| 2 | 0.85755 | 0.118 | 0.60 |
| 3 | 0.65429 | 0.0848 | 0.72 |
| 4 | 0.79348 | 0.0544 | 0.64 |
| 5 | 0.70137 | 0.0377 | 0.69 |
| 6 | 0.76396 | 0.0249 | 0.66 |
| 7 | 0.72210 | 0.0170 | 0.68 |
| 8 | 0.75042 | 0.0113 | 0.67 |
The iterates jump to both sides of , and the error shrinks by a factor that seems to settle near 0.67.
That is linear convergence, like bisection but with a different factor.
Where does the number come from?
Work it out: the error after one step is . Replace near by its tangent line there.
What does the error become?
Solution
Near the tangent gives . Subtracting leaves .
Each step multiplies the error by .
So the ratio tends to . For the cosine, and , which matches the last rows of the table.
This gives the rule:
- if and the start is close enough, the iteration converges, linearly, with factor ;
- if , the iterates move away from ;
- if , this test does not decide the outcome: the iteration neither converges nor runs away because of the derivative alone, and it can cycle. For we have , and from the start 1 the iterates are forever;
- if , the error shrinks faster than linearly.
With the factor 0.6736 each step gains correct digits, so one more digit costs about 5.8 steps.
A signed factor explains the zigzag: is negative here, so the error changes sides at every step.
The same equation, different rules
One equation can be rewritten as in many ways, and the choice of decides everything.
For (the root is ) here are three rules, with evaluated at the root:
| Rule | What happens | |
|---|---|---|
| from 1 it gives 1, 2, 1, 2, … forever | ||
| from 1.5 it gives 1.5, 1.75, 2.8125, 8.72, … and runs away | ||
| from 1.5 it gives 1.5, 1.41667, 1.414216, … and the digits double |
The third rule is Newton’s method. In general, Newton’s method for is the fixed-point iteration with .
Differentiate , using the quotient rule for the fraction:
At the root , so as long as . The error factor is zero, and that is why Newton’s method is faster than linear:
the quadratic convergence of Newton–Raphson is the case .
Why quadratic? When the tangent to at the fixed point is horizontal, so the tangent approximation gives 0 and does not tell us how large the error is.
The next term in the approximation of near (the second-order Taylor expansion, with the second derivative) gives its size:
The new error is about a constant times the square of the previous error, and that is quadratic convergence.
For Newton’s method, differentiating once more and substituting gives
So the convergence is quadratic exactly when . When the quadratic term vanishes as well, and the convergence is faster still.
A check on the third rule of the table: for we get , and the errors of the three values in the table, computed without rounding, are , and .
From the first error the formula predicts , close to , and from the second .
Try it. The lab draws each rule as a staircase: from go up to the curve , then across to the line , which gives .
A fixed point is where the curve crosses the line. Pick a rule, decide how the iteration will end, and watch.
The lab needs JavaScript. The table above shows the same rules from the starts given there.
A real example: a slope that is computed once
Return to the implied volatility of the SPX option from Newton–Raphson and the secant method, with the root .
Newton recomputes the slope (vega) at every step. What if we compute it once, at the start , where vega is , and keep it fixed?
This is a fixed-point iteration with , and its factor is:
The factor is tiny because vega hardly changes between 0.3 and the root.
The computed errors:
| Step | at the estimate | Error | Error ratio |
|---|---|---|---|
| 0 | 286.7 | ||
| 1 | 0.465 | 0.0016 | |
| 2 | 0.0068 | ||
| 3 | 0.0068 | ||
| 4 | 0.0068 | ||
| 5 | 0.0068 |
The first step is identical to Newton’s, since the slope is the same.
After that the ratio is the predicted 0.0068: linear, but with two correct digits gained per step.
Four steps bring the error below , one more than Newton, and the slope was computed once.
The method is cheap per step and needs no new derivative, but it is only as good as the slope you froze:
from a start far away, where vega is very different, the factor is no longer small.
Try it. The lab freezes the slope of Newton’s method for at a number you choose, , and asks you to bring the error down in as few steps as you can.
The lab needs JavaScript. The table above shows the frozen slope on the option problem.
Inverse quadratic interpolation: more points, no derivative
The secant method draws a line through two points. With three points we can fit a parabola, which follows the curve more closely.
The difficulty is that a parabola may miss the -axis, and when it crosses it we must choose between two crossings.
The trick of inverse quadratic interpolation is to swap the roles:
fit as a quadratic function of . The point we want is the one where , so we evaluate the parabola at .
There is no equation to solve and exactly one answer. For three points , , with distinct values , build the quadratic function as a sum of three terms, one for each point.
The term of the point is
When the numerator equals the denominator, and the term equals .
When or the numerator is zero, and the term equals 0.
The other two terms are built in the same way around and , so the sum of the three is a quadratic function of that equals at , at and at :
it passes through the three points. Substituting , the numerator of the first term is , and likewise in the other two.
The result is the formula
In the next step the oldest point is dropped and the new one is added.
The method uses only values of , like the secant method.
Its convergence order is about (the real root of ), between the secant method’s 1.62 and Newton’s 2.
Take the same option problem, with the three starting points , and , where equals , and :
| Step | Estimate | at the estimate | Error |
|---|---|---|---|
| 1 | 0.16057147540169 | ||
| 2 | 0.16293391142215 | ||
| 3 | 0.16295375688372 | ||
| 4 | 0.16295375229691 |
Four steps, as many as the secant method needs (five each by the explorer’s rule, see the extended ladder below), without a derivative (the errors are computed in high-precision arithmetic; in double precision the last one is limited by rounding, at the order of ).
The cost: the formula divides by differences of the values , so it fails if two of them are equal, and if the three points are badly spread the parabola can send the next point far away.
There is also no bracket.
Try it. The lab draws the inverse parabola sideways through three points of the curve and marks where it crosses the axis.
Drag the points, estimate the crossing, then check; step to the next round and watch the points change.
Compare with the secant line through the last two points.
The lab needs JavaScript. The table above shows the same rounds for the option problem.
Brent’s method: speed with a guarantee
The fast methods so far buy speed with certainty: Newton, the secant method and fixed-point iteration keep no bracket, and regula falsi keeps one but an end can stay fixed, so the bracket width need not shrink to 0.
Bisection halves the bracket at every step, but it is slow. Brent’s method keeps both.
It keeps a bracket around the root, as bisection does. At each step it tries a fast candidate, inverse quadratic interpolation or the secant step.
If the candidate falls inside the bracket and the bracket shrinks enough, it is accepted; otherwise the method falls back on a bisection step.
The bracket therefore always shrinks, so the root is never lost, and when the function is well behaved the fast steps do most of the work.
This is the method behind SciPy’s brentq, the usual library choice for one equation in one unknown on an interval where the sign changes.
The test for a good short step has two parts. The candidate must lie well inside the bracket:
less than three quarters of the bracket’s width from the best point.
And it must be shorter than half the step before last, so that the method really is faster than halving.
A candidate that fails either part is dropped, and the method bisects.
Open the lab, predict each decision, and see which functions make Brent fall back on bisection and which let the fast steps run.
The lab needs JavaScript. Brent’s method is the one behind SciPy’s brentq.
The ladder, extended
Steps to reach on the implied-volatility problem, counted by two stopping rules:
| Method | Steps, true error below | Steps, the explorer’s rule | Needs | Main risk |
|---|---|---|---|---|
| Bisection | 32 | 43 | a bracket | slow |
| Regula falsi | 4 | 5 | a bracket | an end can stay fixed |
| Secant | 4 | 5 | two starts | may diverge |
| Slope fixed once | 4 | 6 | one slope | slow if it changes |
| Inverse quadratic | 4 | 5 | three starts | equal values, a wild parabola |
| Newton–Raphson | 3 | 3 | and a good start | flat slope, cycles, divergence |
The count depends on the stopping rule. In the first column we stop when the true error, the distance from the root, is below (the root is known here from high-precision arithmetic).
A program does not know the root, so the explorer’s rule, also used in the table of steps in Newton–Raphson and the secant method, stops when both the step and are at most ; this costs one or two more steps, and 11 more for bisection.
In exact arithmetic Newton needs 4 steps by the explorer’s rule; in double precision is exactly 0 at the third step, so the explorer stops there.
By either rule the inverse quadratic method and the secant method need the same number of steps here.
| Brent | safe by design | a bracket | a more complex program |
(The starting points are those of the examples above. Brent’s method has no entry in the steps column because its count depends on how many of its steps are fast ones.)
Continue learning
The next step is the practice session for this lecture: predicting the factor by hand, the usual mistakes and a Python implementation.
You can also revisit the explorer of Newton–Raphson and the secant method and see which of its examples would behave like the three rules of the table above.
My tutorial on fixed-point iteration is at the end of the Newton–Raphson and the secant method.