This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
asinh() returns incorrect value with optimization turned on (fwd)
- To: bug-gcc at gnu dot org
- Subject: asinh() returns incorrect value with optimization turned on (fwd)
- From: Denes Molnar <molnard at phys dot columbia dot edu>
- Date: Mon, 8 May 2000 10:59:00 -0400 (EDT)
Hi,
1;
The function asinh() returns incorrect values for negative numbers when
optimization is turned on (level 1 or higher).
2;
Seen: on linux 2.2.12, i686 (Pentium III), gcc-2.95.2 compiling with
g++ -o tst-asinh -O3 -Wall tst-asinh.C
The error persists if -O3 is changed to -O2 or -O1. Only -O0 works.
3;
The code:
#include <iostream>
#include <math.h>
int main() {
while(1) {
double x;
cin >> x;
register const double e = asinh(x);
cout << e << "; " << sinh(e) << '\n';
}
}
4;
See the preprocessor outputs attached. The one with extension .E0 is for
the -O0 flag. The other one, .E1, is for -O1. I had to compress these
because you reject mail that is over 100000 bytes.
The best luck,
Denes Molnar
tst-asinh.E0.gz
tst-asinh.E1.gz