From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16947 invoked by alias); 4 Nov 2011 12:51:24 -0000 Received: (qmail 16934 invoked by uid 22791); 4 Nov 2011 12:51:22 -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, 04 Nov 2011 12:50:57 +0000 From: "gastineau at imcce dot fr" To: glibc-bugs@sources.redhat.com Subject: [Bug math/13381] New: rounding problem wih sincosl Date: Fri, 04 Nov 2011 12:51: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: gastineau at imcce dot fr 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" Content-Transfer-Encoding: quoted-printable 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: 2011-11/txt/msg00002.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=3D13381 Bug #: 13381 Summary: rounding problem wih sincosl Product: glibc Version: 2.14 Status: NEW Severity: normal Priority: P2 Component: math AssignedTo: aj@suse.de ReportedBy: gastineau@imcce.fr Classification: Unclassified With some input values, the sincosl function and sinl returns a different v= alue for the sin part.=20 This problem occurs with glibc 2.14. The code source is at the end of the message. The output with these compilers is : gcc -m64 bugsincos.c -O0 -o bugsincos -lm ./bugsincos diffC=3D0.000000e+00 C1=3D0xf.e8f0776670a18eap-4 C=3D0xf.e8f0776670a18eap-4 diffS=3D-6.776264e-21 S1=3D0xd.903ba52345a81a4p-7 S=3D0xd.903ba52345a81a5p-7 diffS must be 0 if same algorithm is used inside the math library. If I compile with "-O3", the problem doesn't occur because it doesn't use t= he math library. I give some system information below and the source code. Micka=C3=ABl xxxxx$ gcc -m64 bugsincos.c -O0 -o bugsincos -lm xxxxx$ ./bugsincos diffC=3D0.000000e+00 C1=3D0xf.e8f0776670a18eap-4 C=3D0xf.e8f0776670a18eap-4 diffS=3D-6.776264e-21 S1=3D0xd.903ba52345a81a4p-7 S=3D0xd.903ba52345a81a5p-7 xxxxx$ nm bugsincos | grep sincosl U sincosl@@GLIBC_2.2.5 xxxxx$ rpm -qa | grep glibc glibc-static-2.14-5.x86_64 glibc-headers-2.14-5.x86_64 glibc-devel-2.14-5.x86_64 glibc-2.14-5.i686 glibc-common-2.14-5.x86_64 glibc-2.14-5.x86_64 xxxxx$ gcc --version gcc (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9) Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -------------- cut here---------------- #include #include int main() { long double X=3D0xd.96c3941c1094ed5p-7L; long double C=3Dcosl(X); long double S=3Dsinl(X); long double C1, S1; sincosl(X, &S1, &C1); printf("diffC=3D%Le C1=3D%La C=3D%La\n", C1-C, C1, C); printf("diffS=3D%Le S1=3D%La S=3D%La\n", S1-S, S1, S); return 0; } -------------- cut here---------------- --=20 Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are on the CC list for the bug.