This is the mail archive of the
mailing list for the GCC project.
[Bug middle-end/29335] transcendental functions with constant arguments should be resolved at compile-time
- From: "vincent at vinc17 dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Oct 2006 09:07:21 -0000
- Subject: [Bug middle-end/29335] transcendental functions with constant arguments should be resolved at compile-time
- References: <email@example.com/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #18 from vincent at vinc17 dot org 2006-10-28 09:07 -------
(In reply to comment #17)
> Yes, I can reproduce the NaN. In fact, any negative value
> gives a NaN.
Not any negative value, but in lngamma.c:
/* if x < 0 and -2k-1 <= x <= -2k, then lngamma(x) = NaN */
probably because the gamma value is negative. This is because MPFR defines
lngamma as log(gamma(x)) while the C standard defines it as log|gamma(x)|. I
wonder if this should be regarded as a bug or if a new function (say,
mpfr_lgamma) should be defined in MPFR (in which case, not before 2.3.0). Do
other standards (other languages) define such a function, either as
log(gamma(x)) or as log|gamma(x)|?
Also, warning! The mpfr_erfc is incomplete for x >= 4096: There is an infinite
loop in the 2.2 branch. This problem is now detected in the trunk, and until
this is completely fixed, a NaN is returned with the MPFR erange flag set. This
should be in the 2.2 branch in a few days (and a preversion of MPFR 2.2.1 will
come several days after that).