glibc/sysdeps/x86_64
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
..
64 Convert WORDSIZE[32|64]/ld entries to abi-variants 2012-05-30 08:33:26 -07:00
bits Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fpu libm-test.inc: Fix tests where cos(PI/2) != 0. 2013-04-11 08:52:18 -04:00
multiarch Faster strlen on x64. 2013-03-18 07:39:12 +01:00
x32 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
____longjmp_chk.S
__longjmp.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
_mcount.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
abort-instr.h
add_n.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
addmul_1.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
backtrace.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
bsd-_setjmp.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
bsd-setjmp.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
bzero.S
cacheinfo.c Change __x86_64 prefix in cache size to __x86 2013-01-05 16:00:38 -08:00
configure Move system-specific settings out of toplevel configure.in and config.make.in. 2013-03-20 22:37:06 +00:00
configure.in Move system-specific settings out of toplevel configure.in and config.make.in. 2013-03-20 22:37:06 +00:00
crti.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
crtn.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-irel.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-lookupcfg.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-machine.h Implement x86 SIZE32/SIZE64 relocations 2013-01-16 20:31:03 -08:00
dl-runtime.c
dl-tls.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-tlsdesc.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-tlsdesc.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-trampoline.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-trampoline.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ffs.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ffsll.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
hp-timing.c
hp-timing.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
htonl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Implies Use x86-64 bits/byteswap.h for both i386 and x86_64 2012-05-30 14:13:18 -07:00
jmpbuf-offsets.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
jmpbuf-unwind.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
l10nflist.c
ldbl2mpn.c
ldsodefs.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
link-defines.sym
locale-defines.sym
lshift.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
machine-gmon.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Makefile Also run tst-xmmymm.sh on i386 ld.so 2012-11-07 13:50:08 -08:00
memchr.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
memcmp.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
memcpy_chk.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
memcpy.S Change __x86_64 prefix in cache size to __x86 2013-01-05 16:00:38 -08:00
memmove.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
mempcpy_chk.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
mempcpy.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
memrchr.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
memset_chk.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
memset.S Remove Prefer_SSE_for_memop on x64 2013-03-11 15:39:08 +01:00
memusage.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
mp_clz_tab.c
mul_1.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
preconfigure Regenerate sysdeps/x86_64/preconfigure. 2013-03-15 01:18:32 +00:00
preconfigure.in
rawmemchr.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
rshift.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
rtld-memcmp.c
rtld-memset.c
rtld-strchr.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
rtld-strlen.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
sched_cpucount.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
setjmp.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
stackguard-macros.h Split up stackguard-macros.h into sysdeps directories. 2012-05-15 23:34:30 +00:00
stackinfo.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
start.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
stpcpy_chk.S
stpcpy.S
strcasecmp_l-nonascii.c
strcasecmp_l.S
strcasecmp.S
strcat.S Faster strlen on x64. 2013-03-18 07:39:12 +01:00
strchr.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
strchrnul.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
strcmp.S BZ#11120: fix x86_64/strcmp.S NOT_IN_libc safeguards 2013-03-22 03:16:00 +00:00
strcpy_chk.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
strcpy.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
strcspn.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
strlen.S Faster strlen on x64. 2013-03-18 07:39:12 +01:00
strncase_l-nonascii.c
strncase_l.S
strncase.S
strncmp.S
strnlen.S Faster strlen on x64. 2013-03-18 07:39:12 +01:00
strpbrk.S
strrchr.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
strspn.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
strtok_r.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
strtok.S Remove bounded-pointers handling from x86_64 assembly sources. 2013-02-17 21:57:26 +00:00
sub_n.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
submul_1.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
sysdep.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tls-macros.h Split tls-macros.h into sysdeps directories. 2012-07-17 11:30:58 +00:00
tlsdesc.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tlsdesc.sym
tst-audit.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tst-mallocalign1.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tst-quad1.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tst-quad1pie.c Handle R_X86_64_RELATIVE64 and R_X86_64_64 for x32 2012-05-10 17:05:06 -07:00
tst-quad2.c Handle R_X86_64_RELATIVE64 and R_X86_64_64 for x32 2012-05-10 17:05:06 -07:00
tst-quad2pie.c Handle R_X86_64_RELATIVE64 and R_X86_64_64 for x32 2012-05-10 17:05:06 -07:00
tst-quadmod1.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tst-quadmod1pie.S Handle R_X86_64_RELATIVE64 and R_X86_64_64 for x32 2012-05-10 17:05:06 -07:00
tst-quadmod2.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tst-quadmod2pie.S Handle R_X86_64_RELATIVE64 and R_X86_64_64 for x32 2012-05-10 17:05:06 -07:00
tst-stack-align.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Versions
wcschr.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
wcscmp.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
wcslen.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
wcsrchr.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00