From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5606 invoked by alias); 27 Jan 2012 14:12:32 -0000 Received: (qmail 5589 invoked by uid 22791); 27 Jan 2012 14:12:30 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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, 27 Jan 2012 14:12:17 +0000 From: "fxcoudert at gcc dot gnu.org" To: glibc-bugs@sources.redhat.com Subject: [Bug math/13629] New: clog() returns wrong values around z=1 Date: Fri, 27 Jan 2012 14:12: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: fxcoudert at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: aj at suse dot de 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-01/txt/msg00129.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13629 Bug #: 13629 Summary: clog() returns wrong values around z=1 Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: math AssignedTo: aj@suse.de ReportedBy: fxcoudert@gcc.gnu.org Classification: Unclassified On the example below, clog() is called on value 1+epsilon*I. The result (first output line) is pretty different from the expected result, calculated in the second output line as a second-order series expansion. I could reproduce it with glibc versions 2.5, 2.11.2, and 2.13, on both i686 and x86_64 systems (and many compilers). $ cat a.c #include #include #include int main () { complex double z, fz,gz; z = 1.0f + 0.00000001f*I; fz = clog(z); gz = (z-1) - (z-1)*(z-1)/2; printf (" %.15e + %.15ei\n", creal(fz), cimag(fz)); printf (" %.15e + %.15ei\n", creal(gz), cimag(gz)); return 0; } $ gcc a.c -lm -O0 -W -Wall -std=c99 && ./a.out 0.000000000000000e+00 + 1.000000000000000e-08i 5.000000000000001e-17 + 1.000000000000000e-08i -- 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.