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

trobey@taos.arc.unm.edu (Thomas H. Robey)
Wed, 23 Nov 1994 22:23:54 GMT

          From comp.compilers

Related articles
[4 earlier articles]
Re: Why is using single-precision slower than using double-precision joelw@convex.convex.com (1994-11-23)
Re: Why is using single-precision slower than using double-precision koppel@omega.ee.lsu.edu (1994-11-23)
Re: Why is using single-precision slower than using double-precision bevan@cs.man.ac.uk (1994-11-23)
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)
[2 later articles]
| List of all articles for this month |
Newsgroups: comp.parallel,comp.arch,comp.compilers
From: trobey@taos.arc.unm.edu (Thomas H. Robey)
Status: RO
Originator: rmuise@dragon.acadiau.ca
Organization: Spectra Research Institute
X-Newsreader: News Xpress Version 1.0 Beta #0
References: <3aqv5k$e27@monalisa.usc.edu>
Date: Wed, 23 Nov 1994 22:23:54 GMT

zxu@monalisa.usc.edu (Zhiwei Xu) wrote:
>Can any one explain why a C program using single precision (float) is slower
>that the same code using double precision (double)? Please try the following
>code for computing pi. I have tried it on IBM RS6000/250, IBM SP2, Sun4, and
>Sun SS20, and got the same strange timing.
>


C often performs the computations in double precision by default. Thus, when you request single precision, the
compiler probably does the computation in double precision and then truncates or rounds-off to get the single
precision result. Thus, single precision usually is slower than double precision. This behavior is also dependent on the
platform being used and whether a floating point coprocessor is used.


Thomas H. Robey
trobey@arc.unm.edu







Post a followup to this message

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