Truncation Error vs. Roundoff Error in Finite Differences
Summary
When approximating derivatives with finite differences, truncation error shrinks as the step size decreases — but roundoff error grows. Below a certain , floating-point noise wins. Central differences reach truncation error and are usually preferable to forward differences.
Forward difference
A first-order forward approximation:
From Taylor expansion about :
Rearranging:
So the truncation error of the forward-difference formula is — halving roughly halves the discretization error.
Roundoff error and catastrophic cancellation
In floating-point arithmetic, subtracting two nearly equal numbers loses significant digits. Example:
| Quantity | Value |
|---|---|
The true difference is dominated by floating-point noise rather than the mathematical signal. This is catastrophic cancellation.
Trade-off:
- Smaller → smaller truncation error
- Too small → larger relative roundoff error
There is an optimal step size that balances both effects.
Central difference — why it is better
Expand both directions:
Subtracting:
Solve for :
The central-difference formula has truncation error — one order better than forward difference — while even-order terms cancel by symmetry.
Takeaways
- Truncation error comes from the Taylor-series approximation; it decreases as .
- Roundoff error grows when is too small because of catastrophic cancellation.
- Central differences give accuracy and are the standard choice when both and are available.
- In practice, choose using a balance rule (often related to machine epsilon and the scale of ).
References & code
Add notes, plots, or experiments here when ready.
