Conditioning, Stability & Backward Error Analysis

the condition number

If conditioning is the idea that some problems amplify input errors, the condition number is the single number that says by how much. It is the 'gain knob' of the problem: feed in a wobble of size epsilon at the input, and the output wobbles by roughly (condition number) times epsilon. A condition number of 1 means the problem passes errors through unchanged; a condition number of 10^6 means it magnifies them a millionfold.

The standard meaning is the relative condition number. For a problem y = f(x), it answers: if x changes by a small relative amount, what is the worst-case relative change in y, in the limit of tiny perturbations? In symbols, kappa = (relative change in output) / (relative change in input), maximized over the direction of the perturbation. For a smooth scalar function this works out to kappa = |x f'(x) / f(x)|, which you can compute with a derivative. There is also an absolute version, but the relative one is usually what you want because computers carry a fixed number of significant digits, not a fixed absolute error.

The condition number gives the famous rule of thumb for digit loss: a problem with condition number about 10^k can lose roughly k significant digits of accuracy, no matter what algorithm you use. In double precision you start with about 16 digits, so a condition number near 10^16 can leave you with essentially none. Crucially this loss is a property of the problem alone — it would happen even with a perfect, infinitely-careful algorithm — which is why estimating the condition number is part of trusting any numerical answer.

For f(x) = sqrt(x), kappa = |x f'(x)/f(x)| = |x (1/(2 sqrt(x))) / sqrt(x)| = 1/2 — square root is well-conditioned everywhere. For subtraction f(a,b) = a - b with a ~ b, the condition number blows up as a approaches b, signalling catastrophic cancellation.

A small derivative-based formula tells you in advance which inputs are dangerous.

A large condition number is a verdict on the problem, not on your code. It cannot be fixed by a better algorithm — only by reformulating the problem or carrying more precision.

Also called
kappacond