exp(float) much slower than exp(double)

Andreas Svrcek-Seiler svrci@tbi.univie.ac.at
Tue Mar 27 12:41:00 GMT 2007


Hi,
using some simple benchmark I just found out that
exp(float) takes about 8 times more time than exp(double).
gprofing my benchmark gives:
  44.26      5.34     5.34                             fesetenv
  19.49      7.69     2.35                             fesetround
  14.97      9.49     1.81                             feholdexcept
  13.40     11.11     1.62                             __ieee754_expf
...So most time is wasted(?) in functions never called when the benchmark 
is compiled to use doubles.
Sorry if I sent this to the wrong address,

best regards
W. A. Svrcek-Seiler

P.S.:
gcc -v says
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --enable-shared --enable-threads=posix 
--enable-checking=release --with-system-zlib --enable-__cxa_atexit 
--disable-libunwind-exceptions --enable-libgcj-multifile 
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada 
--enable-java-awt=gtk --disable-dssi --enable-plugin 
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre 
--with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)

(stock fedora core 6, that is)



More information about the Gcc-bugs mailing list