On 2009-Dec-31 17:50:05 -0200, Gonzalo Tornaria <torna...@math.utexas.edu> wrote: >gcc is actually inlining exp(1.0) to its correct value. The exp() from >the sun library is incorrect. Try this program instead:
FreeBSD libm is derived from Sun's libm and also gets exp(1) 1ULP high on amd64 (on i386, exp() is written using i387 assembler) so I tend to agree that the bug is in Sun's libm. >#include <math.h> >#include <stdio.h> >#include <stdlib.h> > >int main(int argc, char **argv) { > double x = 1.0; > if (argc>1) > x = atof(argv[1]); > printf("%.16lf\n",exp(x)); ^^ this needs to be at least 18 to see the problem. >} -- Peter Jeremy
pgpjbXnFSiZY1.pgp
Description: PGP signature