Error Analysis
In practice, most computations are performed with rounding errors. Besides, you often need to solve a system
, where the data (the elements of
Ax
=
b
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
x
+
δ
x
(
, then this estimate, given up to linear terms of perturbations, holds:
A
+
δ
A
)(x
+
δ
x
) = (b
+
δ
b
)
where
A
+
δ
A
is nonsingular and

In other words, relative errors in
called the
condition number of
A
or
b
may be amplified in the solution vector
x
by a factor
κ
(A
) = ||A
|| ||A
-1
||A
.
Rounding errors
have the same effect as relative perturbations
c
(n
)ε
ε
x
such that 1 +
x
> 1; and
c
(n
)n
. The corresponding solution error is
||
. (The value of
δ
x
||/||x
||≤
c
(n
)κ
(A
)ε
c
(n
)n
.)
Machine precision depends on the data type used.
For example, it is usually defined in the
float.h
file as
FLT_EPSILON
the
float
datatype and
DBL_EPSILON
for the
double
datatype.Thus, if your matrix
is very large), then the error in the solution
(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).
A
is
ill-conditioned (that is, its condition number
κ
(A
)x
can also be large; you might even encounter a complete loss of precision. LAPACK provides routines that allow you to estimate
κ
(A
)