glibc/sysdeps
Carlos O'Donell aba5e333d4 libm-test.inc: Fix tests where cos(PI/2) != 0.
The value of PI is never exactly PI in any floating point representation,
and the value of PI/2 is never PI/2. It is wrong to expect cos(M_PI_2l)
to return 0, instead it will return an answer that is  non-zero because
M_PI_2l doesn't round to exactly PI/2 in the type used.

That is to say that the correct answer is to do the following:
* Take PI or PI/2.
* Round to the floating point representation.
* Take the rounded value and compute an infinite precision cos or sin.
* Use the rounded result of the infinite precision cos or sin as the
  answer to the test.

I used printf to do the type rounding, and Wolfram's Alpha to do the
infinite precision cos calculations.

The following changes bring x86-64 and x86 to 1/2 ulp for two tests.
It shows that the x86 cos implementation is quite good, and that
our test are flawed.

Unfortunately given that the rounding errors are type dependent we
need to fix this for each type. No regressions on x86-64 or x86.

---

2013-04-11  Carlos O'Donell  <carlos@redhat.com>

	* math/libm-test.inc (cos_test): Fix PI/2 test.
	(sincos_test): Likewise.
	* sysdeps/x86_64/fpu/libm-test-ulps: Regenerate.
	* sysdeps/i386/fpu/libm-test-ulps: Regenerate.
2013-04-11 08:52:18 -04:00
..
generic
gnu
i386 libm-test.inc: Fix tests where cos(PI/2) != 0. 2013-04-11 08:52:18 -04:00
ieee754 [BZ #14686, #15336] Fix standard compliance. Don't use hard-coded qNaN values. 2013-04-05 22:34:52 +02:00
init_array
mach BZ#14280: Fix Hurd ioctl macro to avoid warning. 2013-04-08 14:31:38 -07:00
posix Fix stack overflow in getaddrinfo with many results 2013-04-03 17:39:15 +02:00
powerpc Refer to two GCC PRs. 2013-04-03 14:13:44 +02:00
pthread
s390 s390/s390x: Undef PSEUDO before redef. 2013-04-06 10:53:54 -04:00
sh
sparc
unix Preserve errno across _PC_CHOWN_RESTRICTED call on XFS 2013-04-03 10:56:45 +05:30
wordsize-32
wordsize-64
x86
x86_64 libm-test.inc: Fix tests where cos(PI/2) != 0. 2013-04-11 08:52:18 -04:00