Go to file
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
argp BZ#14812: Add missing translation marker on some argp option argument names in utilities. 2013-03-18 14:59:47 -07:00
assert
benchtests Add benchmark inputs for atan 2013-04-03 15:50:15 +05:30
bits
catgets
conf
conform
crypt
csu Use __ehdr_start, if available, as fallback for AT_PHDR. 2013-03-28 16:15:48 -07:00
ctype
debug
dirent
dlfcn
elf Fix invalid free of memory allocated during rtld init 2013-04-11 09:22:05 +02:00
gmon
gnulib
grp
gshadow
hesiod Don't add input group during initgroups_dyn in hesiod 2013-03-28 11:45:47 +05:30
hurd
iconv BZ#14812: Add missing translation marker on some argp option argument names in utilities. 2013-03-18 14:59:47 -07:00
iconvdata
include New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
inet
intl
io T_REMOVEDIR and AT_EACCESS have the same value. 2013-03-06 13:39:16 -05:00
libidn
libio
locale BZ#14812: Add missing N_ markers in localedef. 2013-03-20 14:26:58 -07:00
localedata fi_FI: Define yesstr, nostr 2013-04-06 16:33:26 -04:00
login
mach
malloc BZ#14812: Add missing translation marker on some argp option argument names in utilities. 2013-03-18 14:59:47 -07:00
manual New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
math libm-test.inc: Fix tests where cos(PI/2) != 0. 2013-04-11 08:52:18 -04:00
misc Fix copy'n'pastos. 2013-03-15 19:00:23 +01:00
nis
nptl Extend i486 pthread_cond_timedwait to use futex syscall with absolute timeout 2013-04-11 10:40:39 +02:00
nptl_db
nscd
nss BZ#14812: Add missing translation marker on some argp option argument names in utilities. 2013-03-18 14:59:47 -07:00
po Update German translations. 2013-03-30 17:01:53 -04:00
ports New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
posix Set LC_ALL=C before sed. 2013-03-08 20:31:23 -08:00
pwd
resolv
resource
rt
scripts Add support for rtld directory different from slib directory 2013-03-19 12:07:26 +01:00
setjmp
shadow
signal
socket
soft-fp
stdio-common Don't accept exp char without preceding digits in scanf float parsing 2013-04-11 10:24:37 +02:00
stdlib More tests for external charater sequences representing NaNs. 2013-04-05 22:41:20 +02:00
streams
string
sunrpc
sysdeps libm-test.inc: Fix tests where cos(PI/2) != 0. 2013-04-11 08:52:18 -04:00
sysvipc
termios
time Accept leading and trailing spaces in getdate input string 2013-04-10 11:31:46 +05:30
timezone Update zic from tzcode 2013b. 2013-03-13 01:54:00 +00:00
wcsmbs
wctype
.gitattributes
.gitignore
abi-tags
aclocal.m4 i386: Fail at configure time for i386 builds. 2013-04-06 12:00:35 -04:00
BUGS
CANCEL-FCT-WAIVE
CANCEL-FILE-WAIVE
ChangeLog libm-test.inc: Fix tests where cos(PI/2) != 0. 2013-04-11 08:52:18 -04:00
ChangeLog.1
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8
ChangeLog.9
ChangeLog.10
ChangeLog.11
ChangeLog.12
ChangeLog.13
ChangeLog.14
ChangeLog.15
ChangeLog.16
ChangeLog.17
config.h.in
config.make.in Move system-specific settings out of toplevel configure.in and config.make.in. 2013-03-20 22:37:06 +00:00
configure i386: Fail at configure time for i386 builds. 2013-04-06 12:00:35 -04:00
configure.in i386: Fail at configure time for i386 builds. 2013-04-06 12:00:35 -04:00
CONFORMANCE
COPYING
COPYING.LIB
cppflags-iterator.mk
extra-lib.mk Don't build .os objects of static-only-routines for extra libs 2013-03-13 12:12:45 +01:00
extra-modules.mk
INSTALL Remove mention of i386-pc-linux-gnu. 2013-03-12 21:33:38 -04:00
libc-abis
LICENSES
Makeconfig Don't use run-via-rtld-prefix for anything other than tests 2013-04-11 09:37:50 +05:30
Makefile
Makefile.in New Makefile target `regen-ulps'. 2013-04-06 16:22:47 -04:00
Makerules Correct missed use of $(rtlddir). 2013-03-20 14:23:47 +00:00
NAMESPACE
NEWS Don't accept exp char without preceding digits in scanf float parsing 2013-04-11 10:24:37 +02:00
o-iterator.mk
PROJECTS
README i386: Fail at configure time for i386 builds. 2013-04-06 12:00:35 -04:00
Rules Don't use run-via-rtld-prefix for anything other than tests 2013-04-11 09:37:50 +05:30
shlib-versions
test-skeleton.c
version.h
Versions.def New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
WUR-REPORT

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu.  The current
GNU/Hurd support requires out-of-tree patches that will eventually be
incorporated into an official GNU C Library release.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 2.6.16 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	powerpc-*-linux-gnu	Hardware floating point required
	powerpc64-*-linux-gnu
	s390-*-linux-gnu
	s390x-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu

The code for other CPU configurations supported by volunteers outside of
the core glibc maintenance effort is contained in the `ports' add-on,
located in the `ports' subdirectory of the source tree.

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	am33*-*-linux-gnu	Not currently functional
	arm-*-linux-gnueabi
	hppa-*-linux-gnu	Not currently functional without patches.
	ia64-*-linux-gnu
	m68k-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	powerpc-*-linux-gnu	Software floating point (--without-fp)
	tilegx-*-linux-gnu
	tilepro-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see http://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at http://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see http://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 2000-2013, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.