From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3399 invoked by alias); 11 Mar 2006 19:13:05 -0000 Received: (qmail 3384 invoked by uid 48); 11 Mar 2006 19:13:02 -0000 Date: Sat, 11 Mar 2006 19:13:00 -0000 From: "john at johnmaddock dot co dot uk" To: glibc-bugs@sources.redhat.com Message-ID: <20060311191302.2445.john@johnmaddock.co.uk> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/2445] New: Bug in powl or expl? X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00056.txt.bz2 List-Id: I have a strange problem with powl that's very specific to AMD64 SMP machines (Suse Linux 9 on HP 2x Opteron, the actual machine is one of the HP testdrive machines: td190.testdrive.hp.com, so you can even try it on the same machine if you need to). Basically I have an expression that should underflow to zero, but which yields a non-zero result *only* on the second or subsequent execution of the expression. The gcc version info is: maddock@td190:~/libs/math/test> g++ -v Reading specs from /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/specs Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local- prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --enable-lan guages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib64 --enable-l ibgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib64 --with-syste m-zlib --enable-shared --enable-__cxa_atexit x86_64-suse-linux Thread model: posix gcc version 3.3.3 (SuSE Linux) glibc version is 20040214, not the latest by any means, but unfortunately I'm unable to test a newer version on this machine. The code to reproduce the issue is: #include #include template T regularised_gamma_prefix(T a, T z, const L&) { using namespace std; T agh = a + 4.6875L - 0.5L; //T prefix; //T d = ((z - a) - 4.6875L + 0.5L) / agh; return powl((z * expl((a-z)/a)) / agh, a); } template void test(T) { T a = 1858.277099609375; T z = 185827.703125; T r; for(int i = 0; i < 2; ++i) { r = regularised_gamma_prefix( a, z, int()); std::cout << r << " " << i << std::endl; } } int main() { test((long double)(0)); return 0; } which when run yields: 0 0 4.00731e-560 1 and on every other platform I've tried yields as expected: 0 0 0 1 My apologies if this has been fixed or reported already, but I haven't been able to find anything similar reported. Thanks in advance for any insights you may have, Regards, John Maddock. -- Summary: Bug in powl or expl? Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: libc AssignedTo: drepper at redhat dot com ReportedBy: john at johnmaddock dot co dot uk CC: glibc-bugs at sources dot redhat dot com GCC build triplet: Linux 2.6.5-7.252-smp x86_64 GCC host triplet: Linux 2.6.5-7.252-smp x86_64 GCC target triplet: Linux 2.6.5-7.252-smp x86_64 http://sourceware.org/bugzilla/show_bug.cgi?id=2445 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.