This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/29335] transcendental functions with constant arguments should be resolved at compile-time



------- 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).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29335


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]