From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24420 invoked by alias); 28 Oct 2006 09:07:33 -0000 Received: (qmail 23309 invoked by uid 48); 28 Oct 2006 09:07:21 -0000 Date: Sat, 28 Oct 2006 09:07:00 -0000 Message-ID: <20061028090721.23308.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/29335] transcendental functions with constant arguments should be resolved at compile-time In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "vincent at vinc17 dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-10/txt/msg02384.txt.bz2 List-Id: ------- 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