This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33698] FAIL: gfortran.dg/gamma_5.f90
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Oct 2007 22:06:46 -0000
- Subject: [Bug fortran/33698] FAIL: gfortran.dg/gamma_5.f90
- References: <bug-33698-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from burnus at gcc dot gnu dot org 2007-10-09 22:06 -------
> We'll probably need to roll our own tgamma function: To
> cover cases like this, where the system doesn't provide
> one, and to get numerically better answers.
g95 uses a C version of W. J. Cody and L. Stoltz' Fortran procedure available
from http://www.netlib.org/specfun/gamma
If I read GLIBC correctly, it implements gamma as exp(lgamma(x)), which
explains why the results are not optimal, cf.
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/math/w_tgamma.c?cvsroot=glibc
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/ieee754/dbl-64/e_gamma_r.c?cvsroot=glibc
Initially, I had claimed that it is better to use the C99/POSIX-2001 tgamma
function of the system C library (if available), but now I am not so sure
anymore.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33698