cacosh and other math errors

JohnT jrt@worldlinc.net
Wed Mar 11 12:45:00 GMT 2009


Using tarballs from http://ftp.gnu.org/gnu/glibc/ on system: Mandriva
2006 Powerpack, i686, installed kernel 2.6.12, glibc 2.3.5, gcc 4.2.4,
gettext 0.17, binutils 2.18, gmp 4.2.4, mpfr 2.31.

After building glibc-2.9 with the following configurations, I got nearly
identical math failures involving the function cacosh, as well as
similar summary reports on math (accuracy) errors. I may follow up on
this after looking at the source code.

../glibc-2.9/./configure --prefix=/usr --enable-all-warnings
--enable-profile CFLAGS=" -march=i686 -O3"

../glibc-2.9/./configure --prefix=/usr --enable-all-warnings
--enable-profile CFLAGS=" -march=i686 -O2"

With a build not configured for check-abi, the above tests were ok, and
the check process arrived at another error.
GCONV_PATH=/home2/bild29/iconvdata LC_ALL=C  
/home2/bild29/elf/ld-linux.so.2 --library-path
/home2/bild29:/home2/bild29/math:/home2/bild29/elf:/home2/bild29/dlfcn:/home2/bild29/nss:/home2/bild29/nis:/home2/bild29/rt:/home2/bild29/resolv:/home2/bild29/crypt:/home2/bild29/nptl
/home2/bild29/math/test-double  > /home2/bild29/math/test-double.out
make[2]: *** [/home2/bild29/math/test-double.out] Error 1
make[2]: Leaving directory `/home2/glibc-2.9/math'
make[1]: *** [math/tests] Error 2
make[1]: Leaving directory `/home2/glibc-2.9'
make: *** [check] Error 2
[dilbert@localhost bild29]$ ls math/test-double.out
math/test-double.out

The test-double.out file reported double functions as being without
inline functions, which are part of O3 optimization. Building with the
flag -O2 should be tried next. O3 adds to the size of the files too.
Related bug: http://sourceware.org/bugzilla/show_bug.cgi?id=2154 needs work.
cat math/test-double.out displays the following:

testing double (without inline functions)
Failure: Real part of: cacosh (0 - 0 i) == 0.0 - pi/2 i: Exception
"Invalid operation" set
Failure: Real part of: cacosh (inf - inf i) == inf - pi/4 i: Exception
"Invalid operation" set
Failure: Real part of: cacosh (0 + inf i) == inf + pi/2 i: Exception
"Invalid operation" set

Test suite completed:
  2999 test cases plus 2620 tests for exception flags executed.
  3 errors occurred.


Trying again with the same configuration except for optimization level 2
(  -O2 ), errors again
involving cacosh (complex arc-hyperbolic-cosine) results.

GCONV_PATH=/home2/bild29/iconvdata LC_ALL=C  
/home2/bild29/elf/ld-linux.so.2 --library-path
/home2/bild29:/home2/bild29/math:/home2/bild29/elf:/home2/bild29/dlfcn:/home2/bild29/nss:/home2/bild29/nis:/home2/bild29/rt:/home2/bild29/resolv:/home2/bild29/crypt:/home2/bild29/nptl
/home2/bild29/math/test-double  > /home2/bild29/math/test-double.out
make[2]: *** [/home2/bild29/math/test-double.out] Error 1
make[2]: Leaving directory `/home/dilbert/glibc-2.9/math'
make[1]: *** [math/tests] Error 2
make[1]: Leaving directory `/home/dilbert/glibc-2.9'
make: *** [check] Error 2
[dilbert@localhost bild29]$ cat math/test-double.out
testing double (without inline functions)
Failure: Real part of: cacosh (0 - 0 i) == 0.0 - pi/2 i: Exception
"Invalid operation" set
Failure: Real part of: cacosh (-inf - inf i) == inf - 3/4 pi i:
Exception "Invalid operation" set
Failure: Real part of: cacosh (-10.0 + inf i) == inf + pi/2 i: Exception
"Invalid operation" set

Test suite completed:
  2999 test cases plus 2620 tests for exception flags executed.
  3 errors occurred.

Running make with the -k option tells make to continue in spite of
errors. After it finished, errors in math were reported, but apparently
nowhere else in the test results. Here's the summary of errors obtained
by grepping the math results for "error."

math/atest-exp2.out:0 failures; 69 errors; error rate 0.03%
math/atest-exp2.out:maximum error:   0x0.0000000000000801337fc048f922ff760
math/atest-exp2.out:error in exp(1): 0x0.0000000000000000000000cbffc1f5e90
math/atest-exp.out:0 failures; 33 errors; error rate 0.03%
math/atest-exp.out:maximum error:   000000000000010021152e7d8198a5820
math/atest-exp.out:error in exp(1): 00000000000000000000000cbffc1f5e9
math/atest-sincos.out:0 failures; 285 errors; error rate 0.03%
math/atest-sincos.out:maximum error:   0000000000000040083d369e8c6c47a11
math/atest-sincos.out:error in sin(1): 000000000000000000000012713da512a
math/atest-sincos.out:0 failures; 0 errors; error rate 0.00%
math/atest-sincos.out:maximum error:   000000000000000009024a863d7a7e166
math/atest-sincos.out:error in cos(1): 00000000000000000000001cb8e2f6306
math/test-double.out:  3 errors occurred.



More information about the Libc-help mailing list