32bit vs. 64bit

Sergei Steshenko sergstesh at yahoo.com
Sat Mar 14 05:41:02 CDT 2009





--- On Sat, 3/14/09, Jaroslav Hajek <highegg at gmail.com> wrote:

> From: Jaroslav Hajek <highegg at gmail.com>
> Subject: Re: 32bit vs. 64bit
> To: "Michael D. Godfrey" <godfrey at isl.stanford.edu>
> Cc: bug at octave.org
> Date: Saturday, March 14, 2009, 1:50 AM
> On Sat, Mar 14, 2009 at 8:40 AM, Michael D. Godfrey
> <godfrey at isl.stanford.edu> wrote:
> > This is really a question:
> >
> > I have some 64bit x86 architecture machines and one
> > 32bit.  Compiling the same Octave 3.1.54+ on 64bit
> > and 32bit results in Octaves that differ by a small
> amount
> > when computing very small differences.  The
> difference
> > is surely within rounding error.
> >
> > The question is: is anyone surprised that the
> identical inputs
> > on 32 and 64 bit produce differing results?  Or, more
> interesting,
> > does anyone know why this happens?  All identical
> arithmetic
> > operations on floating point numbers should produce
> identical
> > results on the two architectures.
> >
> > To give an idea of the difference, the residual
> difference between
> > two vectors which formally should be the same (zero)
> is:
> >
> > 64 bit:   -8.21e-14
> > 32bit:    -1.58e-13
> >
> > So, if anyone thinks that the results on 32bit and
> 64bit should match
> > exactly, I will try to figure out where the difference
> occurs.  (There is
> > lots of computing down the paths: use of elementary
> functions
> > e, sin, cos, log, ... and a lot of other transforms.)
>  Also, the 32bit
> > and 64bit gcc and gfortran may not generate excatly
> the same code.
> >
> > Michael
> >
> 
> When comparing results on architectures that have guard
> bits, the
> results obviously depend on the number of registers, unless
> you use
> -ffloat-store. If you link to external BLAS and LAPACK,
> those need to
> be compiled using these options, too (which will degrade
> their
> performance). You should also specify -mieee-fp, which
> should prevent
> optimizations that change fp results.
> 
> 
> -- 
> RNDr. Jaroslav Hajek
> computing expert & GNU Octave developer
> Aeronautical Research and Test Institute (VZLU)
> Prague, Czech Republic
> url: www.highegg.matfyz.cz
> 

Also, AFAIR, 64 bits (x86_64) machines do not use 80 bits arithmetic while
32 bits machines (IA32) may use it.

Regards,
  Sergei,


      



More information about the Bug-octave mailing list