cacosh and other math errors

Carlos O'Donell
Fri Mar 13 11:29:00 GMT 2009

On Wed, Mar 11, 2009 at 9:44 AM, JohnT <> wrote:
> Using tarballs from 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.

The quality of glibc depends on the quality of the toolchain used during
the build. What were the test results like for your gcc 4.2.4 and binutils

> 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: needs work.
> cat math/test-double.out displays the following:

Regardless of optimization level, test-idouble test tests inline math
functions, and test-double tests calling the math library functions.

It is expected that -O3 adds to the size. The -O3 optimization level
adds several compiler passes which increase code size in an
attempt to increase speed.

> 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.

These are valid failures, you should try to debug these.

> 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."

I always run 'make -k check', it's better to see *all* of the errors and get
an idea for the state of the entire testsuite before fixing one test.

If a tests fails it is up to the developer to examine the test "out" file,
which contains the details of the failure.

Carlos O'Donell.

More information about the Libc-help mailing list