Conditioning tells us how sensitive a problem is. Now the other half: does an algorithm add more error than the problem forces? Two formulas that are equal in exact arithmetic can behave very differently in floating point.
An algorithm $\tilde{f}$ for $f$ is backward stable if for every input $x$, $$\tilde{f}(x) = f(\tilde{x})\quad\text{for some } \tilde{x} \text{ with } \frac{|\tilde{x} - x|}{|x|} = O(u).$$ In words: the computed answer is the exact answer to a slightly changed question. An algorithm that magnifies its own rounding errors far beyond that is unstable.
Key idea
Why it works
Worked example: Same formula, two algorithms
- $200^{2} - 4 = 39996$ rounds to $40000$, and $\sqrt{40000} = 200.0$.
- First formula: $\frac{200 - 200.0}{2} = 0$. Every digit is lost to cancellation.
- Second formula (the first times the conjugate over itself): $\frac{2}{400.0} = 0.005000$, right to all 4 digits.
- The root itself is well-conditioned; the first formula is unstable for it, the second is stable.
Answer: $0$ versus $0.005000$
Worked example: An unstable recurrence
- An error $\epsilon$ in $I_{n-1}$ becomes $n\epsilon$ in size in $I_n$, so after 20 steps the error is $20!\,\epsilon$.
- $20! \approx 2.4 \times 10^{18}$, so the error is about $2.4 \times 10^{18} \times 10^{-16} \approx 243$.
- But $0 < I_{20} < \frac{1}{21}$: the computed value is garbage. Running the recurrence backward, $I_{n-1} = \frac{1 - I_n}{n}$, divides errors by $n$ each step: stable.
Answer: about $243$
Worked example: A stable method on a hard problem
- Relative error $\approx \kappa u \approx 10^{10} \times 10^{-16} = 10^{-6}$.
- About 6 correct digits: the method did its job; the problem allows no more.
Answer: about 6 digits
Common mistake