# Error Analysis

In practice, most computations are performed with rounding errors. Besides, you often need to solve a system `Ax = b`, where the data (the elements of A and b) are not known exactly. Therefore, it is important to understand how the data errors and rounding errors can affect the solution x.

Data perturbations. If x is the exact solution of `Ax = b`, and `x + δx` is the exact solution of a perturbed problem `(A + δA)x = (b + δb)`, then

where

In other words, relative errors in A or b may be amplified in the solution vector x by a factor `κ(A) = ||A|| ||A-1||` called the condition number of A.

Rounding errors have the same effect as relative perturbations `c(n)ε` in the original data. Here `ε` is the machine precision, and `c(n)` is a modest function of the matrix order n. The corresponding solution error is

`||δx||/||x||≤ c(n)κ(A)ε`. (The value of `c(n)` is seldom greater than 10n.)

Thus, if your matrix A is ill-conditioned (that is, its condition number `κ(A)` is very large), then the error in the solution x is also large; you may even encounter a complete loss of precision. LAPACK provides routines that allow you to estimate `κ(A)` (see Routines for Estimating the Condition Number) and also give you a more precise estimate for the actual solution error (see Refining the Solution and Estimating Its Error).

Parent topic: LAPACK Routines: Linear Equations