From first principles
Derive a correction using the observed imbalance
For a computed solution \(\widehat x\) of \(Ax=b\), evaluate \(r=b-A\widehat x\). Assume \(A\) is nonsingular. Subtract the equation for \(\widehat x\) from the exact equation to identify the missing correction,
If the matrix factors are already available, a correction solve uses those factors at much lower cost than a fresh factorization. In floating point suppose the solve acts like an exact solve with a matrix \(M\) close to \(A\). Ignoring rounding in the residual and final addition for the moment, the update gives
where \(e_k=x_k-x_*\). A norm of the error propagation matrix below one gives a contraction. Accurate residual evaluation matters because its own rounding error becomes new correction data. A tiny change in the iterate can mean either that the equations are satisfied or that small corrections are being rounded away. The scaled residual distinguishes these cases.
Background · Residual
A small residual tests the computed equation. Converting it into an error estimate needs information on the inverse or the troublesome singular directions.
Derivation and applications
Show why a componentwise backward error survives a change of units
Equations and unknowns often have very different numerical scales. A componentwise backward error measures how much each coefficient and measured load must change relative to its own magnitude to make a computed state exact. For fixed \(\widehat x\), ask for perturbations satisfying \((A+\Delta A)\widehat x=b+\Delta b\) with \(|\Delta A|\le\eta|A|\) and \(|\Delta b|\le\eta|b|\), entrywise. The residual then obeys
Each row can attain any imbalance between these two extremes by choosing signs for its coefficient and load perturbations and scaling them together. Therefore the smallest admissible common relative tolerance is
A zero denominator means that row has zero imbalance for the specified state; assign its ratio zero. Now change equation units with a positive diagonal \(D\) and coordinate scales with another positive diagonal \(S\). Use \(A'=DAS,\ b'=Db,\ \widehat x'=S^{-1}\widehat x\). Direct substitution gives
Every row ratio is unchanged. The plain norm of a residual can instead change by orders of magnitude under exactly the same re-expression. A small componentwise error means a nearby model fits; the forward uncertainty also depends on the conditioning of that model.
Worked example
Compare two differently scaled balances
For \(A=\operatorname{diag}(2,1000)\), \(b=(2,1000)^T\), and \(\widehat x=(1.01,0.999)^T\), the residual is \((-0.020,1)^T\). Row ratios are
The first equation sets the backward error despite the larger absolute residual in the second.
Second application
Change coordinate and equation units simultaneously
For a scalar balance \(3x=12\), test \(\widehat x=3.9\). Its backward error is
Express \(x=100x'\) and multiply the equation by \(0.01\). The transformed equation is \(3x'=0.12\), with \(\widehat x'=0.039\), residual \(0.003\), and denominator \(0.237\). Their ratio again gives \(0.01266\), verifying invariance directly.
A correction equation
Suppose a large matrix has already been factored at modest precision. Let \(x\) be the resulting approximation and recompute \(r=b-Ax\) using the original coefficients. The exact missing correction solves \(Ad=r\). Reusing the approximate factors is cheap because the expensive elimination has finished. If their effective matrix is \(M\), one refinement step solves \(Md=r\) and updates \(x\leftarrow x+d\). Forming the residual from the factors themselves could erase the very discrepancy being measured.
With \(e=x_\star-x\), the residual equals \(Ae\) in exact arithmetic. Substitution yields
Thus a sufficient convergence condition in a chosen induced norm is \(\|I-M^{-1}A\|<1\). The size of the initial error affects how many corrections are needed, while the quality of the approximate inverse controls the contraction. The availability of more accurate residual arithmetic matters once cancellation in \(b-Ax\) competes with the true defect.
Diagonal model for imperfect factors
Take \(A=\operatorname{diag}(3,7)\), \(b=(3,7)^T\), and use \(M=\operatorname{diag}(3,8)\) throughout. The first approximate solve gives
Its residual is \((0,0.875)^T\), and the inexpensive correction is \((0,0.109375)^T\). Hence the second component becomes 0.984375. The corresponding errors in that coordinate decrease from \(1/8\) to \(1/64\). Each further update divides the error by eight because \(1-7/8=1/8\). The exact first component stays fixed.
If the incorrect factor were 3 instead of 8 in the second equation, its error multiplier would be \(1-7/3=-4/3\). Iterating would alternate across the solution with increasing amplitude. Extra residual accuracy could reveal that failure promptly but could never turn this correction matrix into a contraction.
Asking which equation was solved
A backward error asks for the smallest perturbation of the input for which the computed vector is exact. For relative, componentwise changes to both coefficients and load, \(|\Delta A|\leq\eta|A|\) and \(|\Delta b|\leq\eta|b|\), the rowwise correction must absorb \(r_i\). The triangle inequality bounds its capacity by \(\eta(|A||x|+|b|)_i\). Choosing perturbation signs independently within each row attains this capacity, giving
A row with zero denominator and zero residual contributes zero. In the example's second row the initial backward error is \(0.875/(7\cdot0.875+7)=1/15\), even though its forward error is one eighth of the true component. After one correction the denominator is 13.890625 and the residual is 0.109375. The resulting backward error is \(1/127\). Uniformly changing that row's units leaves both ratios unchanged.
A stopping decision
Record the residual obtained using the original data and monitor the size of each accepted correction. Once the residual is comparable to accumulated rounding in its evaluation, more corrections may stagnate. A small backward error then certifies compatibility with nearly identical equations. Converting it to a forward accuracy statement also needs sensitivity information about those equations and the particular output of interest.
Separate data accuracy from solve accuracy
Suppose the second load in the diagonal example was measured as \(7.00\pm0.07\). Even an exact linear solve then gives a second coordinate known only to about 0.01. The initial solve error of 0.125 matters relative to that scale. Two corrections already reduce this error to about 0.00195. Further corrections improve the numerical solution of the nominal input but cannot resolve variation in the measured load. Stating both uncertainties clarifies the practical value of the last digits.
Track residual error through the correction equation
Let the approximate correction solve use a nonsingular matrix \(M\). Suppose residual evaluation returns \(\hat r=Ae+\delta r\), where \(\delta r\) includes accumulated rounding, and the state update has an additional absolute error \(\delta x\). One correction yields \(e_{\rm new}=(I-M^{-1}A)e-M^{-1}\delta r-\delta x\) if \(e=x_\star-x\). A contraction \(\|I-M^{-1}A\|\le q<1\) shrinks the first term, but every iteration injects new errors. If their combined effect is bounded by \(d\), induction gives
This inequality separates an initial geometric improvement from a possible long-run floor. A residual-evaluation bound must use scales of the terms being subtracted, such as \(|b|+|A||x|\), rather than the size of the tiny mathematical residual alone. Also distinguish errors in evaluating the residual from the final rounding of \(x+d\): very small corrections may be accurate but cannot change a stored state if they fall below its local spacing. Computing residuals in higher precision helps only when that residual error is a limiting contribution.
Resolve a correction lost in a cancellation
Consider the decimal thought experiment \(1000x_1+x_2=1001,\ x_1+x_2=2\), whose exact state is \((1,1)^T\). Store the candidate \((1.00,0.990)^T\) and evaluate terms using three significant decimal digits with rounding to nearest. Even if the original input coefficients and load are kept exactly, evaluating the first row naively makes \(1000+0.990\) round to \(1.00\times10^3\); the rounded representation of the right-hand side 1001 is also \(1.00\times10^3\). A residual assembled entirely in that low precision therefore sees a first component of zero. The second component, \(2-1.99=0.01\), remains visible.
Computing the residual using the original data with adequate precision gives \((0.01,0.01)^T\). Subtracting these two correction equations yields \(999d_1=0\), hence \(d_1=0,\ d_2=0.01\), recovering the exact state in one exact correction solve. If instead the low-precision residual \((0,0.01)^T\) is used with the same exact correction matrix, subtraction yields \(999d_1=-0.01\), giving \(d_1\approx-0.00001001,\ d_2\approx0.01001001\). Part of the estimated correction is now allocated to a coordinate that was already exact.
The example uses an exact correction solve to isolate the residual effect. Low-precision factors introduce a separate perturbation. If 1001 had first been irreversibly stored as 1000 in the only surviving copy of the problem, later high-precision arithmetic could not restore the intended equation. Preserving the original coefficients and loads is therefore part of the method whenever refinement is expected to recover accuracy relative to higher-precision input data.
One can estimate which digit was lost without rerunning the solve. The absolute first-row summands have total magnitude about one thousand, while their desired residual is one hundredth. The computation is extracting a quantity roughly one hundred thousand times smaller than its large terms. By comparison the corresponding factor in the second row is only a few hundred. Precision can therefore be inadequate in one equation long before it limits the others.
Change parameters · Explore the worked calculation
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.