How to Measure Errors

LAPACK routines return four types of floating-point output arguments:

*Scalar*, such as an eigenvalue of a matrix,*Vector*, such as the solutionof a linear system*x*,*Ax*=*b**Matrix*, such as a matrix inverse, and*A*^{-1}*Subspace*, such as the space spanned by one or more eigenvectors of a matrix.

First consider *scalars*. Let the scalar
be an approximation of
the true answer .
We can measure the difference between
and
either by the **absolute error**
,
or, if
is nonzero, by the **relative error**
.
Alternatively, it is sometimes more convenient
to use
instead of the standard expression
for relative error (see section 4.2.1).
If the relative error of
is, say **10 ^{-5}**, then we say that
is

In order to measure the error in *vectors*, we need to measure the *size*
or *norm* of a vector ** x**. A popular norm
is the magnitude of the largest component,
,
which we denote
.
This is read

If
is an approximation to the
exact vector ** x**, we will refer to
as the
absolute error in
(where

Thus, we would say that approximates

Errors in *matrices* may also be measured with norms.
The most obvious
generalization of
to matrices would appear to be
,
but this does not have certain
important mathematical properties that make deriving error bounds
convenient (see section 4.2.1).
Instead, we will use
,
where ** A** is an

so is accurate to 1 decimal digit.

Here is some related notation we will use in our error bounds.
The **condition number of a matrix** ** A** is defined as
,
where

LAPACK error estimation routines typically compute a variable called

Now we consider errors in *subspaces*. Subspaces are the
outputs of routines that compute eigenvectors and invariant
subspaces of matrices. We need a careful definition
of error in these cases for the following reason. The nonzero vector ** x** is called a

One can show that does not change when either or

as above, then for any nonzero scalars and .

Here is another way to interpret the angle
between
and
.
Suppose
is a unit vector (
).
Then there is a scalar
such that

The approximation holds when is much less than 1 (less than .1 will do nicely). If is an approximate eigenvector with error bound , where

then for .

Some LAPACK routines also return subspaces spanned by more than one vector, such as the invariant subspaces of matrices returned by xGEESX. The notion of angle between subspaces also applies here; see section 4.2.1 for details.

Finally, many of our error bounds will contain a factor ** p(n)** (or