Re: Why is using single-precision slower than using double-precision

"David B. Chorlian" <davidc@panix.com>
Thu, 24 Nov 1994 22:49:37 GMT

          From comp.compilers

Related articles
[7 earlier articles]
Re: Why is using single-precision slower than using double-precision luigi@paris.CS.Berkeley.EDU (1994-11-23)
Re: Why is using single-precision slower than using double-precision davidm@Rational.COM (1994-11-23)
Re: Why is using single-precision slower than using double-precision dsmentek@hpfcla.fc.hp.com (1994-11-23)
Re: Why is using single-precision slower than using double-precision trobey@taos.arc.unm.edu (1994-11-23)
Re: Why is using single-precision slower than using double-precision kenneta@hubcap.clemson.edu (1994-11-23)
Re: Why is using single-precision slower than using double-precision dik@cwi.nl (1994-11-24)
Re: Why is using single-precision slower than using double-precision davidc@panix.com (David B. Chorlian) (1994-11-24)
Re: Why is using single-precision slower than using double-precision roedy@BIX.com (1994-11-30)
Re: Why is using single-precision slower than using double-precision tgl@netcom.com (1994-11-30)
Re: Why is using single-precision slower than using double-precision hebert@prism.uvsq.fr (1994-11-24)
Re: Why is using single-precision slower than using double-precision dekker@dutiag.twi.tudelft.nl (Rene Dekker) (1994-11-30)
Re: Why is using single-precision slower than using double-precision meissner@osf.org (1994-11-24)
| List of all articles for this month |
Newsgroups: comp.parallel,comp.arch,comp.compilers
From: "David B. Chorlian" <davidc@panix.com>
Status: R
Originator: rmuise@dragon.acadiau.ca
Organization: PANIX Public Access Internet and Unix, NYC
References: <3aqv5k$e27@monalisa.usc.edu> <3b015c$bt@rational.rational.com>
Date: Thu, 24 Nov 1994 22:49:37 GMT

In <3b015c$bt@rational.rational.com> davidm@Rational.COM (David Moore) writes:


[snip]
>programmer can help by using a double temporary instead of floating i:


> double di=1.0;
> for(i=1;i<=N;i=i+1) {
> local = ( (di - 0.5 ) * w ;
> pi = pi + 4.0 / ( 1.0 + local * local ) ;
> di += 1.0;
> }


The above code verges on inaccuracy by keeping an index variable as
a floating point number and incrementing it by a floating point
number. Systematic error is introduced into such an index variable if the
increment quantity does not have an exact binary representation.


--
David B. Chorlian
Neurodynamics Lab SUNY/HSCB
chorlian@sp1p.neurodyn.hscbklyn.edu
davidc@panix.com







Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.