advanced26 min studyLesson 31 in Mathematics

Conditioning and backward error

Separate sensitivity of a mathematical problem from the stability of the algorithm that solves it.

On this page

What you’ll understand

  • Distinguish forward error, backward error, and a residual.
  • Estimate sensitivity in a declared norm and perturbation model.
  • Explain why backward stability alone cannot promise an accurate answer.

An answer with sixteen printed digits can still be wrong in its first useful digit. Numerical reliability starts before choosing an algorithm: which inputs are uncertain, what counts as a small change, and how strongly does the requested output respond? Conditioning describes that mathematical sensitivity. Stability describes how an algorithm handles the problem it receives. Keeping these questions separate prevents blaming a good solver for information already absent from its data, or excusing a poor computation merely because its residual looks small.

Measure the problem before measuring the program

Write the mathematical problem as a map y=F(d) from data to an answer. Forward error compares a computed answer with F(d). Absolute error uses their distance; relative error divides by a chosen answer scale. When the exact answer is zero, relative error with that denominator is undefined, so an absolute tolerance or an external physical scale is necessary. The norm, units, and quantities allowed to vary are part of the statement, rather than optional reporting details.

For a differentiable scalar map with nonzero input and output, a local relative condition number follows from the derivative. It predicts amplification for sufficiently small input perturbations, not a universal bound for arbitrary changes. A large value signals sensitivity inherent in the map. For example, subtracting a fixed reference from a nearly equal measured value can magnify relative uncertainty enormously, even when the subtraction itself is performed exactly. More arithmetic precision cannot recover measurement digits that were never supplied.

κF(d)=∣dF′(d)F(d)∣,∣ΔF∣∣F(d)∣≈κF(d)∣Δd∣∣d∣\kappa_F(d)=\left|\frac{dF'(d)}{F(d)}\right|,\qquad \frac{|\Delta F|}{|F(d)|}\approx\kappa_F(d)\frac{|\Delta d|}{|d|}
This scalar first-order relation assumes differentiability and dF(d)≠0. The perturbation must remain small enough for the linear approximation to be useful.↔ Scroll wide equations horizontally.

Ask which nearby problem was solved

Backward error asks whether the computed answer is the exact solution for slightly changed data. This reverses the usual comparison: instead of moving the answer, move the inputs. An algorithm is backward stable when those changes can be bounded at roughly the arithmetic rounding level, with appropriate problem-size factors. The allowed changes matter. Perturbing every matrix entry independently is a different claim from perturbing only a measured right-hand side or preserving a matrix's symmetry.

For a linear system, the residual is b minus A times the computed vector. It is precisely a right-hand-side perturbation that makes that vector exact while A stays fixed, up to sign convention. A small unscaled residual is not automatically impressive: multiplying every equation by a huge or tiny common factor changes its size without changing the solution. Normalize using meaningful data scales, and check whether residual evaluation itself needs higher precision when cancellation is severe.

r=b−Ax^,Ax^=b−r,η=∥r∥∥A∥∥x^∥+∥b∥r=b-A\widehat x,\qquad A\widehat x=b-r,\qquad \eta=\frac{\|r\|}{\|A\|\|\widehat x\|+\|b\|}
The residual certifies an exact right-hand-side change −r. The displayed normwise scaled residual is a common backward-error diagnostic; a structured or componentwise claim needs its own perturbation model.↔ Scroll wide equations horizontally.

Combine algorithm quality with sensitivity

For an invertible matrix and a compatible operator norm, A inverse converts residual into solution error. Its norm may be enormous in a direction that the residual happens to occupy. The product of the matrix norm and inverse norm is the matrix condition number. Thus a tiny backward error and a large condition number can coexist with substantial forward error. This is a consequence of the geometry of nearly collapsed directions, not a contradiction in the error definitions.

A useful report includes the computed quantity, a scaled residual, an estimate of conditioning, and the uncertainty already present in the data. If the requested accuracy is unsupported, reformulate the observable, collect better data, regularize with an explicitly stated modeling assumption, or increase precision when arithmetic error dominates. Merely requesting a tighter solver tolerance may spend time without improving trustworthy digits. Residual checks and refinement help diagnose the computation; they do not change the information content of an ill-conditioned problem.

∥x−x^∥≤∥A−1∥∥r∥,κ(A)=∥A∥∥A−1∥\|x-\widehat x\|\le\|A^{-1}\|\|r\|,\qquad \kappa(A)=\|A\|\|A^{-1}\|
These statements assume A is nonsingular and the vector and matrix norms are compatible. They separate residual size from the error amplification allowed by the problem.↔ Scroll wide equations horizontally.

A tiny residual in a sensitive direction

Let A=diag(1,0.001), b=(1,0.001), and a computed answer be (1,1.01). Use the Euclidean norm to assess it.

  1. The exact solution is x=(1,1). Multiplication gives A times the computed vector equal to (1,0.00101), hence the residual is (0,−0.00001) with norm 10⁻⁵.

  2. The solution error is (0,0.01), with norm 0.01. Since the inverse matrix is diag(1,1000), its norm is 1000 and the residual bound is exactly 1000×10⁻⁵=0.01 in this example.

  3. The matrix norm is one, so κ₂(A)=1000. The relative solution error is 0.01/√2≈0.007071, although the relative right-hand-side residual is approximately 0.00001.

  4. The normwise scaled residual is about 10⁻⁵/(√2.0201+√1.000001)≈4.13×10⁻⁶. This small diagnostic cannot alone certify a requested relative solution tolerance of 10⁻⁴.

The result

The small residual is real, but it lies in the direction the inverse amplifies most strongly. Conditioning explains the larger forward error.

Explore the model

Interactive lab

Interactive lab · vectors

Declare the direction as well as the size

Rotate a single vector and change its magnitude. Which angle puts all its size in the vertical projection? In the worked matrix that direction would be amplified by 1000 under A inverse. The lab shows the vector and projections only; it does not apply A, estimate conditioning, or simulate a solver.

Declare the direction as well as the sizePlayback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Current readings: x component: 1.393; y component: 0.975; Magnitude: 1.7. All parameters are adjustable with the labeled controls below.−7.46−3.7303.737.46−3.5−1.7501.753.5xyvvₓ = 1.39
Vectorx / y projectionsTrace marker
x component
1.393
y component
0.975
Magnitude
1.7
t = 0 s

Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA perturbation's direction can matter as much as its norm; connect the displayed projection to an explicitly stated operator.

Check your understanding

A backward-stable solver receives severely ill-conditioned data. What follows?

Try it yourself

For A=diag(2,0.02), b=(2,0.02), and computed x=(1,1.1), find the residual norm and actual error norm.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Multiply each coordinate separately, then compare with the exact vector (1,1).

Compare with the solution

A times computed x is (2,0.022), so r=(0,−0.002) and its norm is 0.002. The error norm is 0.1. Here ||A inverse||₂=50, so the bound 50×0.002=0.1 is attained. The condition number is 2×50=100.

Take it with you

  • Conditioning belongs to a specified problem and perturbation model.
  • Backward error asks which nearby data make the computed answer exact.
  • Small residuals need scaling and sensitivity information before they imply accurate answers.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.