This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/33683] calculating lgamma instead of gamma
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Oct 2007 10:22:12 -0000
- Subject: [Bug libfortran/33683] calculating lgamma instead of gamma
- References: <bug-33683-10391@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from tkoenig at gcc dot gnu dot org 2007-10-07 10:22 -------
(In reply to comment #2)
> I checked and the simplification routines work correctly, which means there is
> no real testsuite coverage for these functions. We should always include
> testcases comparing values calculated at runtime with constants coming from our
> simplification routines.
I concur. PR 22307 strikes again...
The cause of the problem is outlined in the gamma(3) man page
of my Linux distro:
DESCRIPTION
For the definition of the Gamma function, see tgamma(3).
*BSD version
4.4BSD and FreeBSD libm have a gamma() function that computes the Gamma
function, as one would expect.
glibc version
Glibc has a gamma() function that is equivalent to lgamma() and com-
putes the natural logarithm of the Gamma function. (This is for com-
patibility reasons only. Don't use this function.)
CONFORMING TO
4.2BSD. Compatible with previous mistakes.
I think we need to use tgamma() where available. If it isn't, we
need a test to check whether gamma() is equivalent to tgamma() or
to lgamma().
Yuck.
--
tkoenig at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-10-07 10:22:12
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33683