Bruno Haible <br...@clisp.org> writes:

> Hi Paolo,
>
> I added trivial tests for the mathl functions, that verify that
>   1) there are no link errors,
>   2) on a randomly picked value, the function's result is correct
>      to 10 decimal digits.
>
> For the cosl() function, when compiled from the gnulib sources, this
> test fails. Seen on OpenBSD/x86, Solaris/SPARC, Cygwin. gdb shows this:
>
>   Breakpoint 1, main () at test-cosl.c:40
>   40        ASSERT (y >= 0.8253356149L && y <= 0.8253356150L);
>   (gdb) print y
>   $1 = 0.82533762773239849330764172918861732
>
> It seems that the result has an accuracy of only 6 decimal digits,
> i.e. 'float' precision, only!

I see this too on cygwin.  Does POSIX require that cosl return values
with long double precision?  I can't find anything specific on

http://www.opengroup.org/onlinepubs/9699919799/functions/cosl.html

But maybe it is specified generally?

If there is no requirement on cosl to return long double precision data,
I'm not sure testing for that is useful.

Alternatively, gnulib could provide a replacement cosl that provides
better precision...

/Simon


Reply via email to