32bit vs. 64bit
Jaroslav Hajek
highegg at gmail.com
Sat Mar 14 13:08:14 CDT 2009
On Sat, Mar 14, 2009 at 6:28 PM, Michael D. Godfrey
<godfrey at isl.stanford.edu> wrote:
>>
>> RNDr. Jaroslav Hajek wrote:
>> When comparing results on architectures that have guard
>> > bits, the
>> > results obviously depend on the number of registers, unless
>> > you use
>> > -ffloat-store.
>
> This and other architecture differences in optimization, etc., can
> explain this behavior. The Fortran coded version (compiled with
> gfortran) also produces a different result for the difference of the 2
> vectors. (All the other results, as displayed as floating point output,
> match exactly.)
Yes, and as Sergei noted, x86_64 actually doesn't use guard bits,
because it supports quadruple precision (128-bit fp).
>
> One reason for pointing this out is that Matlab claims "bit exact"
> results across supported architectures.
That's interesting, given that they certainly rely on external
libraries (ACML or MKL, SuiteSparse...). I wonder how they make these
to be "bit exact".
> This is at considerable
> cost to them, and I think it is not a sensible objective.
Let me think what it's good for ... so that when you have an unstable
algorithm depending on rounding errors, you can get the same wrong
results on all architectures?
> In any case,
> they can only try to do this because they only ship binaries.
>
Right. For Octave such an objective would not even make sense.
>
> In any case, rounding error analysis get less attention these days
> than it deserves. Courses in numerical error analysis, even using good old
> texts like Wilkinson or Forsythe and Moler, are hardly taught anymore...
>
Personally I believe that one of the main reasons is that double
precision became the standard in scientific computing, most influenced
by C, probably. 16 digits are ridiculously many when your technical
data typically has 2-3 correct digits.
Who needs the Kahan summation when you actually have 10 spare digits
of precision? Of course, there are many legitimate reasons for double
precision in many cases (like ability to solve more ill-conditioned
linear problems), but still I'm convinced that single precision is now
seriously underused.
In the good old days (though I'm probably too young to talk seriously
about those) when Fortran and single precision ruled, error analysis
was just more important for computations to actually work.
cheers
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
More information about the Bug-octave
mailing list