# Iterative refinement

Iterative refinement is an iterative method proposed by James H. Wilkinson to improve the accuracy of numerical solutions to systems of linear equations.[1][2]

When solving a linear system ${\displaystyle \,\mathrm {A} \,\mathbf {x} =\mathbf {b} \,,}$ due to the compounded accumulation of rounding errors, the computed solution ${\displaystyle {\hat {\mathbf {x} }}}$ may sometimes deviate from the exact solution ${\displaystyle \mathbf {x} _{\star }\,.}$ Starting with ${\displaystyle \mathbf {x} _{1}={\hat {\mathbf {x} }}\,,}$ iterative refinement computes a sequence ${\displaystyle \{\,\mathbf {x} _{1},\,\mathbf {x} _{2},\,\mathbf {x} _{3},\,...\}}$ which converges to ${\displaystyle \mathbf {x} _{\star }\,,}$ when certain assumptions are met.

## Description

For ${\displaystyle m=1,2,3,...\,,}$ the mth iteration of iterative refinement consists of three steps:

 (i) Compute the residualerror rm ${\displaystyle \mathbf {r} _{m}=\mathbf {b} -\mathrm {A} \mathbf {x} _{m}\,.}$ (ii) Solve the system for the correction,cm,that removes the residual error ${\displaystyle \mathrm {A} \,\mathbf {c} _{m}=\mathbf {r} _{m}\,.}$ (iii) Add the correction to get therevised next solution xm+1 ${\displaystyle \mathbf {x} _{m+1}=\mathbf {x} _{m}+\mathbf {c} _{m}\,.}$

The crucial reasoning for the refinement algorithm is that although the solution for cm in step (ii) may indeed be troubled by similar errors as the first solution, ${\displaystyle {\hat {\mathbf {x} }}}$, the calculation of the residual rm in step (i), in comparison, is numerically nearly exact: You may not know the right answer very well, but you know quite accurately just how far the solution you have in hand is from producing the correct outcome (b). If the residual is small in some sense, then the correction must also be small, and should at the very least steer the current estimate of the answer, xm, closer to the desired one, ${\displaystyle \mathbf {x} _{\star }\,.}$

The iterations will stop on their own when the residual rm is zero, or close enough to zero that the corresponding correction cm is too small to change the solution xm which produced it; alternatively, the algorithm stops when rm is too small to convince the linear algebraist monitoring the progress that it is worth continuing with any further refinements.

## Error analysis

As a rule of thumb, iterative refinement for Gaussian elimination produces a solution correct to working precision if double the working precision is used in the computation of r, e.g. by using quad or double extended precision IEEE 754 floating point, and if A is not too ill-conditioned (and the iteration and the rate of convergence are determined by the condition number of A).[3]

More formally, assuming that each step (ii) can be solved reasonably accurately, i.e., in mathematical terms, for every m, we have

${\displaystyle \mathrm {A} \,\left(\mathrm {I+F} _{m}\right)\mathbf {c} _{m}=\mathbf {r} _{m}}$

where ‖Fm < 1, the relative error in the mth iterate of iterative refinement satisfies

${\displaystyle {\frac {\lVert \mathbf {x} _{m}-\mathbf {x} _{\star }\rVert _{\infty }}{\lVert \mathbf {x} _{\star }\rVert _{\infty }}}\leq {\bigl (}\sigma \,\kappa (\mathrm {A} )\,\varepsilon _{1}{\bigr )}^{m}+\mu _{1}\,\varepsilon _{1}+n\,\kappa (\mathrm {A} )\,\mu _{2}\,\varepsilon _{2}}$

where

if A is "not too badly conditioned", which in this context means

0 < σ κ(A) ε1 ≪ 1

and implies that μ1 and μ2 are of order unity.

The distinction of ε1 and ε2 is intended to allow mixed-precision evaluation of rm where intermediate results are computed with unit round-off ε2 before the final result is rounded (or truncated) with unit round-off ε1. All other computations are assumed to be carried out with unit round-off ε1.

## References

1. ^ Wilkinson, James H. (1963). Rounding Errors in Algebraic Processes. Englewood Cliffs, NJ: Prentice Hall.
2. ^ Moler, Cleve B. (April 1967). "Iterative refinement in floating point". Journal of the ACM. New York, NY: Association for Computing Machinery. 14 (2): 316–321. doi:10.1145/321386.321394.
3. ^ Higham, Nicholas (2002). Accuracy and Stability of Numerical Algorithms (2 ed.). SIAM. p. 232.