"Raymond Toy" <t...
@rtp.ericsson.se> wrote in message
The article to which you refer,
> Joe> There is another benefit to using the extra precision: the
> Joe> of instability in numeric algorithms will be smaller. Naive
> Joe> may be far less likely to get bogus answers.
> I'm not a numerical analyst and don't pretend to be, but I disagree
> with this statement. If the extra precision was always available, I'd
> agree. But usually you'll have to convert that 80-bit float to a
> 64-bit float and that's where you lose.
> Somewhere on the web there's an article by Kahan about fused
> multiply/add operations that some machines provide. Not exactly the
> same, but I think it hints at the subtleties.
``Matlab's Loss is Nobody's Gain''
is available at
Matlab is a numerical computation package that is quite popular.
Matlab versions prior to 5.0 used the full precision available
in the hardware (64-bit mantissa) and rounded to double precision
when storing the results in memory. Upon version 5 on Windows,
Matlab changed to using double-precision (53-bit mantissa) in
Kahan argues that this is a mistake and the extra precision should
be turned back on. To quote Kahan, ``Why not get different results
that are better results whenever the hardware affords the opportunity?''
This paper also talks about the `Fused Multiply Accumulate' instruction
(FMAC) which computes
(fp-round (+ s (* r q)))
(fp-round (+ s (fp-round (* r q))))
(assume fp-round is a function that maps the exact result into the nearest
result that can be represented in a floating point number).
Kahan notes that FMAC in general produces more accurate answers, but that
there are subtle problems with using it indiscriminately. In particular,
when evaluating an expression like this: (- (* u v) (* r q)), do you
want to round the (* u v) or the (* r q) prior to using the FMAC
instruction? It almost never matters, but if u = r and v = q, FMAC can
produce a non-zero answer whereas rounding both produces a zero.
However, this does not argue against using as much precision as possible.