Aleksandar:
You should be suspicious of any expression that has a matrix inverse in
it, especially if it also has the matrix itself, as in A X A^{-1}. If the
condition number of the matrix is far from unity, you're going to lose
something like log(condition number) of digits from the best internal
precision. If the calculation proceeds entirely in the floating-point
unit on one processor, and you lose five decimal digits there, you end
up with memory precision -- which is probably just fine. If the compiler
has a store into memory in the midst of the calculation, you could lose
those five digits from memory precision, which is what you're remarking
about.
Golub and Van Loan describe condition estimation on pp 128-130 of the
third edition of "Matrix Computations" (ISBN 0-8018-5418-8 [paper] or
0-8018-5413-X [hard]). The condition number they find interesting for
answering the question "how many correct digits do I have" is
\kappa_\infty = || A ||_\infty || A^{-1} ||_\infty, where || A ||_\infty
is the maximum of the sums of the absolute values of the elements of each
column of A. If you have factors of A, it is possible to get estimates
of the condition number with o(n^2) more operations, instead of the o(n^3)
that would be required to get A^{-1}.
Whenever possible, formulate a problem that has a matrix inverse in it as
a solution of a linear system, because that's much less work. Computing a
matrix inverse is more costly than a matrix multiply -- and then you still
have the multiply to do after computing the inverse. Factoring the matrix
plus doing a backsolve is cheaper. For least-squares problems (which
you don't have if you're working with quaternions), use orthogonal
factorization (e.g. QR) because that doesn't square the condition number.
--
Van Snyder | What fraction of Americans believe
[log in to unmask] | Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Sean O'Keefe, George Bush, the Pope, or anybody else.
|