glibc/sysdeps
Joseph Myers a84e78c8b3 Fix catan, catanh, __ieee754_logf in round-downward mode (bug 16799, bug 16800).
This patch fixes incorrect results from catan and catanh of certain
special inputs in round-downward mode (bug 16799), and incorrect
results of __ieee754_logf (+/-0) in round-downward mode (bug 16800)
that show up through catan/catanh when tested in all rounding modes,
but not directly in the testing for logf because the bug gets hidden
by the wrappers.

Both bugs involve a zero that should be +0 being -0 instead: one
computed as (1-x)*(1+x) in the catan/catanh case, and one as (x-x) in
the logf case.  The fixes ensure positive zero is used.  Testing of
catan and catanh in all rounding modes is duly enabled.

I expect there are various other bugs in special cases in __ieee754_*
functions that are normally hidden by the wrappers but would show up
for testing with -lieee (or in future with -fno-math-errno if we
replace -lieee and _LIB_VERSION with compile-time redirection to new
*_noerrno symbol names).

Tested x86_64 and x86 and ulps updated accordingly.

	[BZ #16799]
	[BZ #16800]
	* math/s_catan.c (__catan): Avoid passing -0 denominator to atan2
	with 0 numerator.
	* math/s_catanf.c (__catanf): Likewise.
	* math/s_catanh.c (__catanh): Likewise.
	* math/s_catanhf.c (__catanhf): Likewise.
	* math/s_catanhl.c (__catanhl): Likewise.
	* math/s_catanl.c (__catanl): Likewise.
	* sysdeps/ieee754/flt-32/e_logf.c (__ieee754_logf): Always divide
	by positive zero when computing -Inf result.
	* math/libm-test.inc (catan_test): Use ALL_RM_TEST.
	(catanh_test): Likewise.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2014-04-02 17:41:02 +00:00
..
aarch64 Compile with -Wundef. 2014-03-14 11:32:51 -07:00
alpha Compile with -Wundef. 2014-03-14 11:32:51 -07:00
arm Fix -Wundef warnins for __FP_FAST_FMA* 2014-03-21 17:28:43 +05:30
generic S390: Define SIZE_MAX as unsigned long (BZ #16712). 2014-03-24 16:59:01 +01:00
gnu Combine __USE_BSD and __USE_SVID into __USE_MISC. 2014-02-12 23:41:01 +00:00
i386 Fix catan, catanh, __ieee754_logf in round-downward mode (bug 16799, bug 16800). 2014-04-02 17:41:02 +00:00
ia64 Compile with -Wundef. 2014-03-14 11:32:51 -07:00
ieee754 Fix catan, catanh, __ieee754_logf in round-downward mode (bug 16799, bug 16800). 2014-04-02 17:41:02 +00:00
init_array Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
m68k Compile with -Wundef. 2014-03-14 11:32:51 -07:00
mach Compile with -Wundef. 2014-03-14 11:32:51 -07:00
microblaze Compile with -Wundef. 2014-03-14 11:32:51 -07:00
mips Fix -Wundef warnings for _ABI* on MIPS. 2014-03-21 18:21:13 +00:00
posix Fix use of half-initialized result in getaddrinfo when using nscd (bug 16743) 2014-03-24 16:51:53 +01:00
powerpc Correct prefetch hint in power7 memrchr. 2014-04-02 13:42:27 +10:30
pthread Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
s390 S390: Define SIZE_MAX as unsigned long (BZ #16712). 2014-03-24 16:59:01 +01:00
sh Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
sparc Don't include individual test ulps in libm-test-ulps. 2014-03-05 15:02:38 +00:00
tile Fix -Wundef warnins for __FP_FAST_FMA* 2014-03-21 17:28:43 +05:30
unix Correct robust mutex / PI futex kernel assumptions (bug 9894). 2014-03-31 12:55:18 +00:00
wordsize-32 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
wordsize-64 Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
x86 Fix -Wundef warnins for __FP_FAST_FMA* 2014-03-21 17:28:43 +05:30
x86_64 Fix catan, catanh, __ieee754_logf in round-downward mode (bug 16799, bug 16800). 2014-04-02 17:41:02 +00:00