3.2 Experimental error investigation
Source: Error-tradeoff ideas from Computational Physics (Landau, Páez, Bordeianu), §3.2. Rewritten in original wording. Continues 3.1 Errors.
An algorithm is not “done” when it prints a number. You still have to decide:
- Does it converge, and how fast?
- Even if it converges, how many digits are real?
- What did those digits cost (steps, and therefore round-off)?
“Just run longer” is not a method. Some expansions only work in a patch of parameter space and stall. Even a series that is uniformly convergent can lose digits if you keep adding terms: approximation error falls, round-off error climbs, and the sum of the two has a best , not an infinite one. A cheaper algorithm is often more accurate for that reason — fewer steps, less garbage.
Two errors, one
Let the method take steps. Approximation error falls as a power of ; round-off climbs like a random walk. Their sum has a best , not an infinite one. Walk , , the check, and — at each step pick the matching equation (lookalikes included).
Theorem (best ). Total error is smallest near the where . Past that trough, extra steps buy round-off, not truth.
On a realistic integrator you would see a steep drop (power-law convergence), then a noisy slow rise. The trough for a careful double-precision run often sits around on that plot — roughly fourteen digits — before the walk upward begins. Quit before the uptick.
Plot of the relative error versus . The negative of that ordinate is the number of decimal places you can defend: if , then .
Approximation vs round-off
1 / 3Why can adding more terms of a convergent series make the printed answer worse?
Pick an answer to see if you are right.
You do not know
If you already had the exact answer, you would not be computing. You might have a cousin problem with a known result, and you can tune the method there. Or you watch itself — the guide above walks and the log–log slope .
A straight steep drop on that plot means you are in the converging region. When the line flattens and then wanders upward, round-off has arrived. A good production sits just before that change.
In the mantissa you will see the same story without a plot: stable digits march rightward as grows, then the last places start to flicker and the flicker slowly gets worse. Stop before the flicker.
Stationary point of the cartoon
The same walk sets . For a general power,
Slide and on the first chart; the dashed line is that . For , this is .
A method with reaches its trough at smaller (higher power in the denominator of ). Fewer steps also means a shorter random walk, so the round-off piece is smaller too. The “better” algorithm is not only faster — it is often cleaner.
The best N
1 / 2For $\epsilon_{\mathrm{tot}}=\alpha N^{-\beta}+\sqrt{N}\,\epsilon_m$, the model minimum solves…
Pick an answer to see if you are right.
Lab: estimate the double-precision trough
Pick (a working double-precision scale). Implement and . Report in scientific notation with three digits after the decimal.
Input: alpha beta eps_m. Print as :.3e.
Those two cases are the lesson’s cartoons: wants on the order of steps; wants a few thousand — and a smaller . Check the first chart’s dashed line against your function.
Next: 3.3 Errors with power series.