From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: shimpei+usenet+.mil+.gov@BOFH.submm.caltech.edu (Shimpei Yamashita) Cc: egcs@egcs.cygnus.com Subject: Re: asinh() gives NaN on Linux/x86/glibc with optimization on Date: Tue, 22 Dec 1998 16:05:00 -0000 Message-id: References: <75pbnk$lj9@gap.cco.caltech.edu> X-SW-Source: 1998-12/msg00870.html > > H.J. Lu writes: > > > >> > >> On RedHat Linux 5.2 (using glibc 2.0.7) for x86, asinh() returns NaN > >> for negative arguments if optimizations are on. The error does not > >> occur if optimizations are turned off. I'm not sure where the problem > >> is--egcs or glibc. Using libc5 seems to solve the problem, but so does > >> dropping back to gcc 2.7.2. > > > >Do you have a testcase? > > Sure. > > #include > #include > > main() { > > double ha; > > printf("Input argument for asinh: "); > scanf("%lf", &ha); > printf("asinh(%f)=%f\n", ha, asinh(ha)); > exit(0); > } > > The program works correctly for positive arguments. Negative results > (I tried -100, -50, -10, -5) all return NaN. > # gcc -v Reading specs from /usr/lib/gcc-lib/i586-pc-linux/egcs-2.91.60/specs gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release) # gcc -O6 x.c # a.out Input argument for asinh: -100 asinh(-100.000000)=-5.298342 # ldd a.out libc.so.6 => /lib/libc.so.6 (0x40007000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000) # ls -l /lib/libc.so.6 lrwxrwxrwx 1 root root 26 Dec 11 08:16 /lib/libc.so.6 -> glibc-2.0-981211/libc.so.6 I am running glibc 2.0.7 981211. -- H.J. Lu (hjl@gnu.org)