This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/6869] sin() and cos() return grossly wrong results when rounding is set to upward
- From: "anders dot lennartsson at foi dot se" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 24 Sep 2008 10:43:58 -0000
- Subject: [Bug math/6869] sin() and cos() return grossly wrong results when rounding is set to upward
- References: <20080905193441.6869.bagnara@cs.unipr.it>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From anders dot lennartsson at foi dot se 2008-09-24 10:43 -------
The problem may occur on 64-bits only. I compiled and ran the test program on
three computers, all Intel machines running Debian. Two of these use Debian 4.0
Etch, one 32 and one 64-bits, and the problem was present only on 64 bits. It is
still there on a 64-bits machine with Debian unstable.
Etch 32-bits:
theta = 5.27906
sin(theta) = -0.843695
cos(theta) = 0.536822
Repeating after setting the rounding direction to UPWARD:
theta = 5.27906
sin(theta) = -0.843695
cos(theta) = 0.536822
user@computer1:~/gcc$ g++ --v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --with-tune=i686
--enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Etch 64-bits:
theta = 5.27906
sin(theta) = -0.843695
cos(theta) = 0.536822
Repeating after setting the rounding direction to UPWARD:
theta = 5.27906
sin(theta) = -0.212522
cos(theta) = 8.2185
user@computer2:~/gcc$ g++ --v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release x86_64-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Sid 64-bits:
theta = 5.27906
sin(theta) = -0.843695
cos(theta) = 0.536822
Repeating after setting the rounding direction to UPWARD:
theta = 5.27906
sin(theta) = -0.247529
cos(theta) = 7.26962
user@computer3:/home_2/abel/gcc$ g++ --v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-mpfr --enable-cld --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1)
--
http://sourceware.org/bugzilla/show_bug.cgi?id=6869
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.