From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18901 invoked by alias); 6 Apr 2012 14:54:34 -0000 Received: (qmail 18892 invoked by uid 22791); 6 Apr 2012 14:54:33 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Apr 2012 14:54:19 +0000 From: "bruno at clisp dot org" To: glibc-bugs@sources.redhat.com Subject: [Bug math/13957] New: powl very inaccurate on powerpc Date: Fri, 06 Apr 2012 14:54:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: math X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bruno at clisp dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00113.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13957 Bug #: 13957 Summary: powl very inaccurate on powerpc Product: glibc Version: 2.11 Status: NEW Severity: normal Priority: P2 Component: math AssignedTo: unassigned@sourceware.org ReportedBy: bruno@clisp.org Classification: Unclassified Created attachment 6327 --> http://sourceware.org/bugzilla/attachment.cgi?id=6327 test case While on x86, x86_64 platforms the results of powl() generally have an error of less than 100 ulps, on a PowerPC platform I'm seeing errors of more than 50000 ulps. Recall that on PowerPC, 'long double' numbers have 106 mantissa bits, i.e. ca. 32 decimal digits after the decimal point. How to reproduce: ================================ foo.c ================================ #include #include long double x = 0.9500175466493529918258722439486448724157L; long double y = 13499.12711242096089256937988377554090961L; int main () { long double p = powl (x, y); long double q = powl (p, 1.0L / y); printf ("x = %.63Lg\n", x); printf ("y = %.63Lg\n", y); printf ("x^y = %.63Lg\n", p); printf ("x^y*2^1000 = %.63Lg\n", ldexpl (p, 1000)); printf ("(x^y)^(1/y) = %.63Lg\n", q); printf ("(x^y)^(1/y)/x = %.63Lg\n", q / x); return 0; } ======================================================================= $ gcc -Wall foo.c -lm $ ./a.out Expected results (assuming no rounding errors at all): x = 0.950017546649352991825872243948644872415686653396830865564350738 y = 13499.1271124209608925693798837755409096128741713277563070427778 x^y = 2.49114074548890053222918160895394492812126078716433839487765876e-301 x^y*2^1000 = 2.66927875050377145601812886620084351250727601302586070667964568 (x^y)^(1/y) = 0.950017546649352991825872243948644872415686653396830865564350738 (x^y)^(1/y)/x = 1 Actual results: x = 0.950017546649352991825872243948644872415686653396830865564350738 y = 13499.1271124209608925693798837755409096128741713277563070427778 x^y = 2.49114074548890047185112002893359654155432307599856022554444831e-301 x^y*2^1000 = 2.66927875050377145601815149518866790434579172597295837476849556 (x^y)^(1/y) = 0.950017546649352991825872244545270235795653144477288826094787998 (x^y)^(1/y)/x = 1.0000000000000000000000000006280072362657898669644932875180931 You can see: 1) x^y*2^1000 has only 22 correct digits after the decimal point. This means that x^y has an error of more than 900000000 ulp! 2) (x^y)^(1/y)/x has only 27 correct digits after the decimal point. This means that (x^y)^(1/y)/x has an error of more than 50000 ulp! -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.