public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gastineau at imcce dot fr" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sources.redhat.com Subject: [Bug math/13381] New: rounding problem wih sincosl Date: Fri, 04 Nov 2011 12:51:00 -0000 [thread overview] Message-ID: <bug-13381-131@http.sourceware.org/bugzilla/> (raw) http://sourceware.org/bugzilla/show_bug.cgi?id=13381 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 value for the sin part. 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=0.000000e+00 C1=0xf.e8f0776670a18eap-4 C=0xf.e8f0776670a18eap-4 diffS=-6.776264e-21 S1=0xd.903ba52345a81a4p-7 S=0xd.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 the math library. I give some system information below and the source code. Mickaël xxxxx$ gcc -m64 bugsincos.c -O0 -o bugsincos -lm xxxxx$ ./bugsincos diffC=0.000000e+00 C1=0xf.e8f0776670a18eap-4 C=0xf.e8f0776670a18eap-4 diffS=-6.776264e-21 S1=0xd.903ba52345a81a4p-7 S=0xd.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 <mathimf.h> #include <stdio.h> int main() { long double X=0xd.96c3941c1094ed5p-7L; long double C=cosl(X); long double S=sinl(X); long double C1, S1; sincosl(X, &S1, &C1); printf("diffC=%Le C1=%La C=%La\n", C1-C, C1, C); printf("diffS=%Le S1=%La S=%La\n", S1-S, S1, S); return 0; } -------------- cut here---------------- -- 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.
next reply other threads:[~2011-11-04 12:51 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-11-04 12:51 gastineau at imcce dot fr [this message] 2011-11-07 16:18 ` [Bug math/13381] " gastineau at imcce dot fr 2011-11-08 7:47 ` schwab@linux-m68k.org 2011-11-08 8:36 ` gastineau at imcce dot fr 2011-11-08 8:59 ` schwab@linux-m68k.org 2011-11-09 0:49 ` vincent-srcware at vinc17 dot net 2011-12-22 16:34 ` drepper.fsp at gmail dot com 2011-12-22 16:49 ` gastineau at imcce dot fr 2011-12-22 17:45 ` drepper.fsp at gmail dot com 2011-12-22 19:32 ` gastineau at imcce dot fr 2011-12-23 11:02 ` vincent-srcware at vinc17 dot net 2011-12-23 11:21 ` gastineau at imcce dot fr 2011-12-23 11:42 ` vincent-srcware at vinc17 dot net 2012-01-09 20:03 ` martyn.j.corden at intel dot com 2012-02-03 14:50 ` vincent-srcware at vinc17 dot net 2014-06-27 11:39 ` fweimer at redhat dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-13381-131@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sources.redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).