glibc/sysdeps/ieee754
Joseph Myers 4b84e2471b Fix ldbl-128 / ldbl-128ibm lgamma overflow handling (bug 16347, bug 19046).
The ldbl-128 / ldbl-128ibm implementation of lgamma has problems with
its handling of large arguments.  It has an overflow threshold that is
correct only for ldbl-128, despite being used for both types - with
diagnostic control macros as a temporary measure to disable warnings
about that constant overflowing for ldbl-128ibm - and it has a
calculation that's roughly x * log(x) - x, resulting in overflows for
arguments that are roughly at most a factor 1/log(threshold) below the
overflow threshold.

This patch fixes both issues, using an overflow threshold appropriate
for the type in question and adding another case for large arguments
that avoids the possible intermediate overflow.

Tested for x86_64, x86, mips64 and powerpc.

	[BZ #16347]
	[BZ #19046]
	* sysdeps/ieee754/ldbl-128/e_lgammal_r.c: Do not include
	<libc-internal.h>.
	(MAXLGM): Do not use diagnostic control macros.
	[LDBL_MANT_DIG == 106] (MAXLGM): Change value to overflow
	threshold for ldbl-128ibm.
	(__ieee754_lgammal_r): For large arguments, multiply by log - 1
	instead of multiplying by log then subtracting.
	* math/auto-libm-test-in: Add more tests of lgamma.
	* math/auto-libm-test-out: Regenerated.
2015-10-01 17:15:54 +00:00
..
bits Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
dbl-64 Fix clog, clog10 inaccuracy (bug 19016). 2015-09-28 22:11:22 +00:00
flt-32 Fix powf inaccuracy (bug 18956). 2015-09-26 00:27:06 +00:00
ldbl-64-128 Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
ldbl-96 Fix clog, clog10 inaccuracy (bug 19016). 2015-09-28 22:11:22 +00:00
ldbl-128 Fix ldbl-128 / ldbl-128ibm lgamma overflow handling (bug 16347, bug 19046). 2015-10-01 17:15:54 +00:00
ldbl-128ibm Fix ldbl-128ibm exp10l spurious overflows (bug 16620). 2015-09-30 23:34:59 +00:00
ldbl-opt Use math_narrow_eval more consistently. 2015-09-23 18:14:57 +00:00
ieee754.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
k_standard.c Add comment to CSTR macro in k_standard.c. 2015-02-27 01:12:19 +00:00
k_standardf.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
k_standardl.c Fix spurious "inexact" exceptions from __kernel_standard_l (bug 18245, bug 18583). 2015-06-23 17:26:46 +00:00
Makefile Avoid -Wno-write-strings for k_standard.c. 2015-02-26 22:50:54 +00:00
s_lib_version.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_matherr.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_signgam.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00