If we know the form of a method's error, we can cancel its leading term by combining two results. For a central difference, $$D(h) = f'(x) + c_2h^{2} + c_4h^{4} + \cdots$$ The constants $c_2, c_4$ are unknown, but they are the same for every $h$, and that is enough.
Key idea
Why it works
Worked example: Extrapolating a central difference
- The error is $O(h^{2})$, so use $\frac{4D(0.1) - D(0.2)}{3} = \frac{4.0066700 - 1.0066800}{3}$.
- $= 0.9999967$, an error of about $3.3 \times 10^{-6}$.
- $D(0.1)$ alone was off by $1.7 \times 10^{-3}$: one subtraction bought about three more digits.
Answer: $0.9999967$
Worked example: Estimating the error for free
- $\frac{D(0.1) - D(0.2)}{3} = \frac{1.0016675 - 1.0066800}{3} \approx -0.0016708$.
- So the true value is about $1.0016675 - 0.0016708 \approx 0.99999$; indeed the actual error of $D(0.1)$ is $0.0016675$.
Answer: about $-0.00167$
Worked example: An order-1 method
- For $p = 1$: $2A(h/2) - A(h) = 2(2.7874) - 2.8588 = 2.7160$.
- The exact value is $e \approx 2.7183$: the error fell from $0.069$ to $0.002$.
- Using $\frac{4A(h/2) - A(h)}{3}$ here would cancel a term that is not there and leave the $h$ term only partly removed.
Answer: $2.7160$
Extrapolation is cheap: it needs no new function values, only arithmetic on results already computed. It is also a safety check. If the extrapolated value and $A(h/2)$ differ by much more than the estimated error, the assumed form of the error is wrong, perhaps because $h$ is not yet small enough.
The idea goes further: with three results one can cancel two error terms, and repeating it on the trapezoid rule gives Romberg integration. The one requirement is that the error really behaves like $ch^{p}$; for a function that is not smooth enough, or with $h$ so small that round-off matters, extrapolation does not help.
Common mistake