[PATCH] Evaluate pow(x,n) at compile-time

Joseph S. Myers jsm28@cam.ac.uk
Thu Apr 10 20:52:00 GMT 2003


On Thu, 10 Apr 2003, Roger Sayle wrote:

> You should probably take a look at Gaston Gonnet's WWW site on "Error
> Analysis of System Mathematical Functions" at ETH, Zurich:
> http://www.inf.ethz.ch/personal/gonnet/FPAccuracy/Analysis.html
> 
> Not only does he show 0.56164 ulps error in glibc's pow implementation
> on i686-pc-linux-gnu, but also a 0.50024 ulp error in sqrt.  On exactly
> the same benchark cases, GCC's real_sqrt gets a perfect 0.5 ulp score!
> 
> http://gcc.gnu.org/ml/gcc-patches/2002-12/msg00471.html

Any news on getting such testcases for last-bit-accurate values in the
testsuite (for everything nontrivial we fold, for at least IEEE floating
point formats and preferably for all floating point format GCC supports),
as I requested in a follow-up to that message?

(I would prefer a correctly-rounded last-bit-accurate pow() implementation
that could then be used without -ffast-math - perhaps some GNU software
already has arbitrary-precision accurate implementations of all the C99
<math.h> and <complex.h> functions that would be suitable for using in GCC
rather than duplicating implementations (and probably bugs) of them all?
Folding for constant values makes a lot more sense if it can simply be
done for all the functions, using existing working code, rather than
piecemeal and duplicating a lot of work on implementing the functions.)

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc-patches mailing list