glibc/sysdeps/x86_64/fpu
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
..
multiarch New __sqr function as a faster special case of __mul 2013-02-14 10:31:09 +05:30
dla.h
e_acosl.c
e_atan2l.c
e_exp2l.S
e_exp10l.S
e_expf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_expl.S
e_fmodl.S
e_ilogbl.S
e_log2l.S
e_log10l.S
e_logl.S
e_powl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_remainderl.S
e_scalbl.S
e_sqrt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_sqrtf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_sqrtl.c
fclrexcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fedisblxcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
feenablxcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fegetenv.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fegetexcept.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fegetround.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
feholdexcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fesetenv.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fesetround.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
feupdateenv.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fgetexcptflg.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fraiseexcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fsetexcptflg.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ftestexcept.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Implies
k_rem_pio2l.c
libm-test-ulps libm-test.inc: Fix tests where cos(PI/2) != 0. 2013-04-11 08:52:18 -04:00
math_ldbl.h
math_private.h
printf_fphex.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_atanl.c
s_ceill.S
s_copysign.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_copysignf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_copysignl.S
s_cosf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_expm1l.S
s_fabs.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fabsf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fabsl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fdiml.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_finitel.S
s_floorl.S
s_fmax.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmaxf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmaxl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmin.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fminf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fminl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fpclassifyl.c
s_isinfl.c
s_isnanl.c
s_llrint.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_llrintf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_llrintl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_log1pl.S
s_logbl.c
s_lrint.S
s_lrintf.S
s_lrintl.S
s_nearbyintl.S
s_nextafterl.c
s_nexttoward.c
s_nexttowardf.c
s_rintl.c
s_scalbnl.S
s_signbit.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_signbitf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_significandl.c
s_sincosf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_sinf.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_truncl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00