32bit vs. 64bit

Sergei Steshenko sergstesh at yahoo.com
Sat Mar 14 14:13:58 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: sergstesh at yahoo.com, bug at octave.org
> Date: Saturday, March 14, 2009, 11:08 AM
> On Sat, Mar 14, 2009 at 6:28 PM, Michael D. Godfrey
> <godfrey at isl.stanford.edu> wrote:
[snip]

>  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

Well, it depends on what you're doing.

Let's have a look at this example :

octave:2> cos(2 * pi / 4096)
ans =  9.9999882345170e-01

.

The point is that, of course, cos(0) == 1.0, and the difference is

octave:4> cos(0) - cos(2 * pi / 8192)
ans =  2.9413711777337e-07

, which is less than single precision resolution - about 1e-6.

You need 2 * pi / 4096 angular step for 4096 points FFT, i.e. with single
precision some adjacent twiddle factors become indistinguishable.

I.e. precision deterioration will skew the FFT algorithm - the base 
functions may lose orthogonality/norm etc.

Some critical acoustic applications need DSP algorithms using double (and not single) precision even though the filters involved are nominally
stable.

Regards,
  Sergei.




      


More information about the Bug-octave mailing list