aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-05-08 11:58:18 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-05-08 11:58:18 +0000
commitd8cd06db62d92f86cc8cc3c0d6a489bd207bb834 (patch)
tree3906235135ce8e0b4ea11d5dadc076699be07738
parentbb7cf681e90d5aa2d867aeff4948ac605447de7d (diff)
downloadglibc-d8cd06db62d92f86cc8cc3c0d6a489bd207bb834.tar.xz
glibc-d8cd06db62d92f86cc8cc3c0d6a489bd207bb834.zip
Improve tgamma accuracy (bugs 2546, 2560, 5159, 15426).
-rw-r--r--ChangeLog56
-rw-r--r--NEWS16
-rw-r--r--math/Makefile3
-rw-r--r--math/libm-test.inc500
-rw-r--r--sysdeps/generic/math_private.h12
-rw-r--r--sysdeps/i386/fpu/libm-test-ulps596
-rw-r--r--sysdeps/ieee754/dbl-64/e_gamma_r.c140
-rw-r--r--sysdeps/ieee754/dbl-64/gamma_product.c75
-rw-r--r--sysdeps/ieee754/dbl-64/gamma_productf.c46
-rw-r--r--sysdeps/ieee754/flt-32/e_gammaf_r.c134
-rw-r--r--sysdeps/ieee754/k_standard.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/e_gammal_r.c145
-rw-r--r--sysdeps/ieee754/ldbl-128/gamma_productl.c75
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c144
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/gamma_productl.c42
-rw-r--r--sysdeps/ieee754/ldbl-96/e_gammal_r.c143
-rw-r--r--sysdeps/ieee754/ldbl-96/gamma_product.c46
-rw-r--r--sysdeps/ieee754/ldbl-96/gamma_productl.c75
-rw-r--r--sysdeps/x86_64/fpu/libm-test-ulps676
19 files changed, 2873 insertions, 53 deletions
diff --git a/ChangeLog b/ChangeLog
index c6812711c0..1948ed630e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,59 @@
+2013-05-08 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #2546]
+ [BZ #2560]
+ [BZ #5159]
+ [BZ #15426]
+ * sysdeps/ieee754/k_standard.c (__kernel_standard): Copy sign of
+ input to result for tgamma overflow.
+ * sysdeps/ieee754/dbl-64/e_gamma_r.c: Include <float.h>.
+ (gamma_coeff): New variable.
+ (NCOEFF): New macro.
+ (gamma_positive): New function.
+ (__ieee754_gamma_r): Handle positive infinity, NaN, overflow and
+ underflow here. Use gamma_positive instead of exp (lgamma) for
+ other arguments.
+ * sysdeps/ieee754/flt-32/e_gammaf_r.c: Include <float.h>.
+ (gamma_coeff): New variable.
+ (NCOEFF): New macro.
+ (gammaf_positive): New function.
+ (__ieee754_gammaf_r): Handle positive infinity, NaN, overflow and
+ underflow here. Use gamma_positive instead of exp (lgamma) for
+ other arguments.
+ * sysdeps/ieee754/ldbl-128/e_gammal_r.c: Include <float.h>.
+ (gamma_coeff): New variable.
+ (NCOEFF): New macro.
+ (gammal_positive): New function.
+ (__ieee754_gammal_r): Handle positive infinity, NaN, overflow and
+ underflow here. Use gamma_positive instead of exp (lgamma) for
+ other arguments.
+ * sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c: Include <float.h>.
+ (gamma_coeff): New variable.
+ (NCOEFF): New macro.
+ (gammal_positive): New function.
+ (__ieee754_gammal_r): Handle positive infinity, overflow and
+ underflow here. Handle NaN the same as positive infinity. Remove
+ check x < 0xffffffff for negative integers. Use gamma_positive
+ instead of exp (lgamma) for other arguments.
+ * sysdeps/ieee754/ldbl-96/e_gammal_r.c: Include <float.h>.
+ (gamma_coeff): New variable.
+ (NCOEFF): New macro.
+ (gammal_positive): New function.
+ * sysdeps/ieee754/dbl-64/gamma_product.c: New file.
+ * sysdeps/ieee754/dbl-64/gamma_productf.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/gamma_productl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/gamma_productl.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/gamma_product.c: Likewise.
+ * sysdeps/ieee754/ldbl-96/gamma_productl.c: Likewise.
+ * sysdeps/generic/math_private.h (__gamma_productf): New
+ prototype.
+ (__gamma_product): Likewise.
+ (__gamma_productl): Likewise.
+ * math/Makefile (libm-calls): Add gamma_product.
+ * math/libm-test.inc (tgamma_test): Add more tests.
+ * sysdeps/i386/fpu/libm-test-ulps: Update.
+ * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
2013-05-08 Ondřej Bílka <neleai@seznam.cz>
* benchtests/bench-skeleton.c (main): Preheat CPU.
diff --git a/NEWS b/NEWS
index 95a4e4f4c3..1a02e19f2b 100644
--- a/NEWS
+++ b/NEWS
@@ -9,14 +9,14 @@ Version 2.18
* The following bugs are resolved with this release:
- 10060, 10062, 10357, 11120, 11561, 12723, 13550, 13889, 13951, 13988,
- 14142, 14176, 14200, 14280, 14293, 14317, 14327, 14478, 14496, 14686,
- 14812, 14888, 14920, 14952, 14964, 14981, 14982, 14985, 14994, 14996,
- 15003, 15006, 15007, 15020, 15023, 15036, 15054, 15055, 15062, 15078,
- 15084, 15085, 15086, 15160, 15214, 15221, 15232, 15234, 15283, 15285,
- 15287, 15304, 15305, 15307, 15309, 15327, 15330, 15335, 15336, 15337,
- 15342, 15346, 15361, 15366, 15380, 15394, 15405, 15406, 15409, 15416,
- 15418, 15419, 15423.
+ 2546, 2560, 5159, 10060, 10062, 10357, 11120, 11561, 12723, 13550, 13889,
+ 13951, 13988, 14142, 14176, 14200, 14280, 14293, 14317, 14327, 14478,
+ 14496, 14686, 14812, 14888, 14920, 14952, 14964, 14981, 14982, 14985,
+ 14994, 14996, 15003, 15006, 15007, 15020, 15023, 15036, 15054, 15055,
+ 15062, 15078, 15084, 15085, 15086, 15160, 15214, 15221, 15232, 15234,
+ 15283, 15285, 15287, 15304, 15305, 15307, 15309, 15327, 15330, 15335,
+ 15336, 15337, 15342, 15346, 15361, 15366, 15380, 15394, 15405, 15406,
+ 15409, 15416, 15418, 15419, 15423, 15426.
* CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
#15078).
diff --git a/math/Makefile b/math/Makefile
index 9f0bf722b9..5bbf9d3c48 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -58,7 +58,8 @@ libm-calls = e_acos e_acosh e_asin e_atan2 e_atanh e_cosh e_exp e_fmod \
s_catan s_casin s_ccos s_csin s_ctan s_ctanh s_cacos \
s_casinh s_cacosh s_catanh s_csqrt s_cpow s_cproj s_clog10 \
s_fma s_lrint s_llrint s_lround s_llround e_exp10 w_log2 \
- s_isinf_ns s_issignaling $(calls:s_%=m_%) x2y2m1 k_casinh
+ s_isinf_ns s_issignaling $(calls:s_%=m_%) x2y2m1 k_casinh \
+ gamma_product
include ../Makeconfig
diff --git a/math/libm-test.inc b/math/libm-test.inc
index f289e99c8d..d2c5046637 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -13482,11 +13482,511 @@ tgamma_test (void)
TEST_f_f (tgamma, -0.5, -M_2_SQRT_PIl);
TEST_f_f (tgamma, 1, 1);
+ TEST_f_f (tgamma, 2, 1);
+ TEST_f_f (tgamma, 3, 2);
TEST_f_f (tgamma, 4, 6);
+ TEST_f_f (tgamma, 5, 24);
+ TEST_f_f (tgamma, 6, 120);
+ TEST_f_f (tgamma, 7, 720);
+ TEST_f_f (tgamma, 8, 5040);
+ TEST_f_f (tgamma, 9, 40320);
+ TEST_f_f (tgamma, 10, 362880);
TEST_f_f (tgamma, 0.7L, 1.29805533264755778568117117915281162L);
TEST_f_f (tgamma, 1.2L, 0.918168742399760610640951655185830401L);
+ TEST_f_f (tgamma, 1.5L, 8.8622692545275801364908374167057259139877e-01L);
+ TEST_f_f (tgamma, 2.5L, 1.3293403881791370204736256125058588870982e+00L);
+ TEST_f_f (tgamma, 3.5L, 3.3233509704478425511840640312646472177454e+00L);
+ TEST_f_f (tgamma, 4.5L, 1.1631728396567448929144224109426265262109e+01L);
+ TEST_f_f (tgamma, 5.5L, 5.2342777784553520181149008492418193679490e+01L);
+ TEST_f_f (tgamma, 6.5L, 2.8788527781504436099631954670830006523720e+02L);
+ TEST_f_f (tgamma, 7.5L, 1.8712543057977883464760770536039504240418e+03L);
+ TEST_f_f (tgamma, 8.5L, 1.4034407293483412598570577902029628180313e+04L);
+ TEST_f_f (tgamma, 9.5L, 1.1929246199460900708784991216725183953266e+05L);
+ TEST_f_f (tgamma, -1.5L, 2.3632718012073547030642233111215269103967e+00L);
+ TEST_f_f (tgamma, -2.5L, -9.4530872048294188122568932444861076415869e-01L);
+ TEST_f_f (tgamma, -3.5L, 2.7008820585226910892162552127103164690248e-01L);
+ TEST_f_f (tgamma, -4.5L, -6.0019601300504246427027893615784810422774e-02L);
+ TEST_f_f (tgamma, -5.5L, 1.0912654781909862986732344293779056440504e-02L);
+ TEST_f_f (tgamma, -6.5L, -1.6788699664476712287280529682737009908468e-03L);
+ TEST_f_f (tgamma, -7.5L, 2.2384932885968949716374039576982679877958e-04L);
+ TEST_f_f (tgamma, -8.5L, -2.6335215159963470254557693619979623385833e-05L);
+ TEST_f_f (tgamma, -9.5L, 2.7721279115751021320587045915768024616666e-06L);
+ TEST_f_f (tgamma, 0x1p-24L, 1.6777215422784394050795179874582764575261e+07L);
+ TEST_f_f (tgamma, -0x1p-24L, -1.6777216577215723853867349114260580375249e+07L);
+ TEST_f_f (tgamma, 0x1p-53L, 9.0071992547409914227843350984672492007618e+15L);
+ TEST_f_f (tgamma, -0x1p-53L, -9.0071992547409925772156649015329704137860e+15L);
+ TEST_f_f (tgamma, 0x1p-64L, 1.8446744073709551615422784335098467139447e+19L);
+ TEST_f_f (tgamma, -0x1p-64L, -1.8446744073709551616577215664901532860660e+19L);
+ TEST_f_f (tgamma, 0x1p-106L, 8.1129638414606681695789005144063422784335e+31L);
+ TEST_f_f (tgamma, -0x1p-106L, -8.1129638414606681695789005144064577215665e+31L);
+ TEST_f_f (tgamma, 0x1p-113L, 1.0384593717069655257060992658440191422784e+34L);
+ TEST_f_f (tgamma, -0x1p-113L, -1.0384593717069655257060992658440192577216e+34L);
+ TEST_f_f (tgamma, 0x1p-127L, 1.7014118346046923173168730371588410572742e+38L);
+ TEST_f_f (tgamma, -0x1p-127L, -1.7014118346046923173168730371588410572858e+38L);
+#ifdef TEST_FLOAT
+ TEST_f_f (tgamma, 0x1p-128L, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (tgamma, -0x1p-128L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (tgamma, 0x1p-149L, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (tgamma, -0x1p-149L, minus_infty, OVERFLOW_EXCEPTION);
+#else
+ TEST_f_f (tgamma, 0x1p-128L, 3.4028236692093846346337460743176821145542e+38L);
+ TEST_f_f (tgamma, -0x1p-128L, -3.4028236692093846346337460743176821145658e+38L);
+ TEST_f_f (tgamma, 0x1p-149L, 7.1362384635297994052914298472474756819137e+44L);
+ TEST_f_f (tgamma, -0x1p-149L, -7.1362384635297994052914298472474756819137e+44L);
+#endif
+#ifndef TEST_FLOAT
+ TEST_f_f (tgamma, 0x1p-1023L, 8.9884656743115795386465259539451236680899e+307L);
+ TEST_f_f (tgamma, -0x1p-1023L, -8.9884656743115795386465259539451236680899e+307L);
+# if !defined TEST_LDOUBLE || LDBL_MAX_EXP <= 1024
+ TEST_f_f (tgamma, 0x1p-1024L, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (tgamma, -0x1p-1024L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (tgamma, 0x1p-1074L, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (tgamma, -0x1p-1074L, minus_infty, OVERFLOW_EXCEPTION);
+# else
+ TEST_f_f (tgamma, 0x1p-1024L, 1.7976931348623159077293051907890247336180e+308L);
+ TEST_f_f (tgamma, -0x1p-1024L, -1.7976931348623159077293051907890247336180e+308L);
+ TEST_f_f (tgamma, 0x1p-1074L, 2.0240225330731061835249534671891730704956e+323L);
+ TEST_f_f (tgamma, -0x1p-1074L, -2.0240225330731061835249534671891730704956e+323L);
+# endif
+#endif
+#if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
+ TEST_f_f (tgamma, 0x1p-16383L, 5.9486574767861588254287966331400356538172e+4931L);
+ TEST_f_f (tgamma, -0x1p-16383L, -5.9486574767861588254287966331400356538172e+4931L);
+ TEST_f_f (tgamma, 0x1p-16384L, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (tgamma, -0x1p-16384L, minus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (tgamma, 0x1p-16445L, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (tgamma, -0x1p-16445L, minus_infty, OVERFLOW_EXCEPTION);
+# if LDBL_MANT_DIG >= 113
+ TEST_f_f (tgamma, 0x1p-16494L, plus_infty, OVERFLOW_EXCEPTION);
+ TEST_f_f (tgamma, -0x1p-16494L, minus_infty, OVERFLOW_EXCEPTION);
+# endif
+#endif
+ TEST_f_f (tgamma, 0x8.00001p0L, 5.0400096882277802019946778420223050233915e+03L);
+ TEST_f_f (tgamma, 0x7.fffff8p0L, 5.0399951558933225045148935487583089307135e+03L);
+ TEST_f_f (tgamma, 0x7.000008p0L, 7.2000064296977505705636258629805621178587e+02L);
+ TEST_f_f (tgamma, 0x6.fffff8p0L, 7.1999935703082425988147448928288557689866e+02L);
+ TEST_f_f (tgamma, 0x6.000008p0L, 1.2000009762487825358530770343720418162783e+02L);
+ TEST_f_f (tgamma, 0x5.fffff8p0L, 1.1999990237520611552119807476573441975106e+02L);
+ TEST_f_f (tgamma, 0x5.000008p0L, 2.4000017236155647574166073485628713443799e+01L);
+ TEST_f_f (tgamma, 0x4.fffff8p0L, 2.3999982763857938712639837029547357501709e+01L);
+ TEST_f_f (tgamma, 0x4.000008p0L, 6.0000035937827461765660468073471093546129e+00L);
+ TEST_f_f (tgamma, 0x3.fffffcp0L, 5.9999982031095793171233994481968816873643e+00L);
+ TEST_f_f (tgamma, 0x3.000004p0L, 2.0000004400179308360529417942462250547999e+00L);
+ TEST_f_f (tgamma, 0x2.fffffcp0L, 1.9999995599822108706107786027549565954046e+00L);
+ TEST_f_f (tgamma, 0x2.000004p0L, 1.0000001007996638509889062631687945799175e+00L);
+ TEST_f_f (tgamma, 0x1.fffffep0L, 9.9999994960018563231526611134590489120697e-01L);
+ TEST_f_f (tgamma, 0x1.000002p0L, 9.9999993119054472483596471908942669644327e-01L);
+ TEST_f_f (tgamma, 0x0.ffffffp0L, 1.0000000344047381790797322460568297132998e+00L);
+ TEST_f_f (tgamma, -0x0.ffffffp0L, -1.6777216422784419250710305882992376932423e+07L);
+ TEST_f_f (tgamma, -0x1.000002p0L, 8.3886075772158332060084424806449513922858e+06L);
+ TEST_f_f (tgamma, -0x1.fffffep0L, 4.1943044613922792026014320172298377770578e+06L);
+ TEST_f_f (tgamma, -0x2.000004p0L, -2.0971515386080557574407223895988378776747e+06L);
+ TEST_f_f (tgamma, -0x2.fffffcp0L, -6.9905087601970247876992248591045142913324e+05L);
+ TEST_f_f (tgamma, -0x3.000004p0L, 6.9905045731381300146131914617735687322025e+05L);
+ TEST_f_f (tgamma, -0x3.fffffcp0L, 1.7476272942159602684441970627092458855771e+05L);
+ TEST_f_f (tgamma, -0x4.000008p0L, -8.7381270578483499672965708923121931082305e+04L);
+ TEST_f_f (tgamma, -0x4.fffff8p0L, -1.7476280884325863043793087474680780379554e+04L);
+ TEST_f_f (tgamma, -0x5.000008p0L, 1.7476252449031389167286893378510439443844e+04L);
+ TEST_f_f (tgamma, -0x5.fffff8p0L, 2.9127137122026653716311560165769071985443e+03L);
+ TEST_f_f (tgamma, -0x6.000008p0L, -2.9127085100239567622341538102130981196910e+03L);
+ TEST_f_f (tgamma, -0x6.fffff8p0L, -4.1610198723079349791939054365613377035519e+02L);
+ TEST_f_f (tgamma, -0x7.000008p0L, 4.1610118737306415004517215226199741948733e+02L);
+ TEST_f_f (tgamma, -0x7.fffff8p0L, 5.2012751504050764429534086402871289946986e+01L);
+ TEST_f_f (tgamma, -0x8.00001p0L, -2.6006296115134418896533598545925084576702e+01L);
+ TEST_f_f (tgamma, -0x9.fffffp0L, 2.8896008370721717567612135720915723136310e-01L);
+ TEST_f_f (tgamma, -0xa.00001p0L, -2.8895878754728051776830454190076999107021e-01L);
+ TEST_f_f (tgamma, -0x13.ffffep0L, 2.1550026214525536756224040483579183652119e-13L);
+ TEST_f_f (tgamma, -0x14.00002p0L, -2.1549777908265594916405421768142757507179e-13L);
+ TEST_f_f (tgamma, -0x1d.ffffep0L, 1.9765721589464867957912772592816027583176e-27L);
+ TEST_f_f (tgamma, -0x1e.00002p0L, -1.9765463890341964384070157599286498212650e-27L);
+ TEST_f_f (tgamma, -0x27.ffffcp0L, 3.2129279441390812141195076945616975790225e-43L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_f_f (tgamma, -0x28.00004p0L, -3.2128372159115252365699015758097981155793e-43L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_f_f (tgamma, -0x28.ffffcp0L, -7.8364103489619817539676737414096652170685e-45L, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_f_f (tgamma, -0x29.00004p0L, 7.8361876024016854597745353972619195760515e-45L, UNDERFLOW_EXCEPTION_FLOAT);
+#ifdef TEST_FLOAT
+ TEST_f_f (tgamma, -0x29.ffffcp0L, plus_zero, UNDERFLOW_EXCEPTION_FLOAT);
+ TEST_f_f (tgamma, -0x2a.00004p0L, minus_zero, UNDERFLOW_EXCEPTION_FLOAT);
+#else
+ TEST_f_f (tgamma, -0x29.ffffcp0L, 1.8658121573125798145204120066590953505132e-46L);
+ TEST_f_f (tgamma, -0x2a.00004p0L, -1.8657587834931410688246126853566488626385e-46L);
+#endif
+#ifndef TEST_FLOAT
+ TEST_f_f (tgamma, 0x8.0000000000008p0L, 5.0400000000000180457125667322294144477136e+03L);
+ TEST_f_f (tgamma, 0x7.ffffffffffffcp0L, 5.0399999999999909771437166339103165198442e+03L);
+ TEST_f_f (tgamma, 0x7.0000000000004p0L, 7.2000000000000119762397445457359071259652e+02L);
+ TEST_f_f (tgamma, 0x6.ffffffffffffcp0L, 7.1999999999999880237602554542848858572672e+02L);
+ TEST_f_f (tgamma, 0x6.0000000000004p0L, 1.2000000000000018184042734842640022086408e+02L);
+ TEST_f_f (tgamma, 0x5.ffffffffffffcp0L, 1.1999999999999981815957265157389249327533e+02L);
+ TEST_f_f (tgamma, 0x5.0000000000004p0L, 2.4000000000000032104829055124673225982803e+01L);
+ TEST_f_f (tgamma, 0x4.ffffffffffffcp0L, 2.3999999999999967895170944875373910918544e+01L);
+ TEST_f_f (tgamma, 0x4.0000000000004p0L, 6.0000000000000066939396342309789716341613e+00L);
+ TEST_f_f (tgamma, 0x3.ffffffffffffep0L, 5.9999999999999966530301828845138185025345e+00L);
+ TEST_f_f (tgamma, 0x3.0000000000002p0L, 2.0000000000000008195971324717875960213536e+00L);
+ TEST_f_f (tgamma, 0x2.ffffffffffffep0L, 1.9999999999999991804028675282128956223990e+00L);
+ TEST_f_f (tgamma, 0x2.0000000000002p0L, 1.0000000000000001877539613108624482361963e+00L);
+ TEST_f_f (tgamma, 0x1.fffffffffffffp0L, 9.9999999999999990612301934456883679778984e-01L);
+ TEST_f_f (tgamma, 0x1.0000000000001p0L, 9.9999999999999987183237573039992418700531e-01L);
+ TEST_f_f (tgamma, 0x0.fffffffffffff8p0L, 1.0000000000000000640838121348000744796665e+00L);
+ TEST_f_f (tgamma, -0x0.fffffffffffff8p0L, -9.0071992547409924227843350984672961392521e+15L);
+ TEST_f_f (tgamma, -0x1.0000000000001p0L, 4.5035996273704955772156649015331740980405e+15L);
+ TEST_f_f (tgamma, -0x1.fffffffffffffp0L, 2.2517998136852484613921675492337776673289e+15L);
+ TEST_f_f (tgamma, -0x2.0000000000002p0L, -1.1258999068426235386078324507668462444260e+15L);
+ TEST_f_f (tgamma, -0x2.ffffffffffffep0L, -3.7529996894754154268627807196691509198813e+14L);
+ TEST_f_f (tgamma, -0x3.0000000000002p0L, 3.7529996894754112398038859470009084971438e+14L);
+ TEST_f_f (tgamma, -0x3.ffffffffffffep0L, 9.3824992236885396088236184658402406857503e+13L);
+ TEST_f_f (tgamma, -0x4.0000000000004p0L, -4.6912496118442603911763815341745722862351e+13L);
+ TEST_f_f (tgamma, -0x4.ffffffffffffcp0L, -9.3824992236885475509805702650262155809819e+12L);
+ TEST_f_f (tgamma, -0x5.0000000000004p0L, 9.3824992236885191156860964016850034672946e+12L);
+ TEST_f_f (tgamma, -0x5.ffffffffffffcp0L, 1.5637498706147581566449098589862357835505e+12L);
+ TEST_f_f (tgamma, -0x6.0000000000004p0L, -1.5637498706147529544662012521330708016396e+12L);
+ TEST_f_f (tgamma, -0x6.ffffffffffffcp0L, -2.2339283865925119357965832452642909859289e+11L);
+ TEST_f_f (tgamma, -0x7.0000000000004p0L, 2.2339283865925039372192897706214475877342e+11L);
+ TEST_f_f (tgamma, -0x7.ffffffffffffcp0L, 2.7924104832406402297655703264222230055898e+10L);
+ TEST_f_f (tgamma, -0x8.0000000000008p0L, -1.3962052416203121511868106259843527348026e+10L);
+ TEST_f_f (tgamma, -0x9.ffffffffffff8p0L, 1.5513391573559147700413058496716749249803e+08L);
+ TEST_f_f (tgamma, -0xa.0000000000008p0L, -1.5513391573559018084419393002828541166901e+08L);
+ TEST_f_f (tgamma, -0x13.ffffffffffffp0L, 1.1569515572952029402736625857313236848570e-04L);
+ TEST_f_f (tgamma, -0x14.000000000001p0L, -1.1569515572951781096476686854873801225397e-04L);
+ TEST_f_f (tgamma, -0x1d.ffffffffffffp0L, 1.0611571800204311628217068863959963842891e-18L);
+ TEST_f_f (tgamma, -0x1e.000000000001p0L, -1.0611571800204053929094168642022073530425e-18L);
+ TEST_f_f (tgamma, -0x27.fffffffffffep0L, 1.7249032006742266376460389310340465554361e-34L);
+ TEST_f_f (tgamma, -0x28.000000000002p0L, -1.7249032006741359094184881234822934593822e-34L);
+ TEST_f_f (tgamma, -0x28.fffffffffffep0L, -4.2070809772542120404320040128839297118648e-36L);
+ TEST_f_f (tgamma, -0x29.000000000002p0L, 4.2070809772539892938717205103652583609422e-36L);
+ TEST_f_f (tgamma, -0x29.fffffffffffep0L, 1.0016859469652887505173040814397197718981e-37L);
+ TEST_f_f (tgamma, -0x2a.000000000002p0L, -1.0016859469652353766978684241048308120274e-37L);
+ TEST_f_f (tgamma, -0x31.fffffffffffep0L, 4.6273774273632946947805289899230181990085e-51L);
+ TEST_f_f (tgamma, -0x32.000000000002p0L, -4.6273774273630367887073532197576655720178e-51L);
+ TEST_f_f (tgamma, -0x63.fffffffffffcp0L, 7.5400833348840965463348754984345825364294e-145L);
+ TEST_f_f (tgamma, -0x64.000000000004p0L, -7.5400833348831085791638490135462230991587e-145L);
+ TEST_f_f (tgamma, -0x95.fffffffffff8p0L, 6.1582369322723207086020016423767264008839e-250L);
+ TEST_f_f (tgamma, -0x96.000000000008p0L, -6.1582369322705655439003240743176243138734e-250L);
+ TEST_f_f (tgamma, -0xb4.fffffffffff8p0L, -9.6760879059917574597728750098636253931457e-319L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_f_f (tgamma, -0xb5.000000000008p0L, 9.6760879059888966544677044221698800670218e-319L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_f_f (tgamma, -0xb5.fffffffffff8p0L, 5.3165318164789884455066481673086605454904e-321L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_f_f (tgamma, -0xb6.000000000008p0L, -5.3165318164774149139661976747137185876909e-321L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_f_f (tgamma, -0xb6.fffffffffff8p0L, -2.9052086428846935908287469917922960610289e-323L, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_f_f (tgamma, -0xb7.000000000008p0L, 2.9052086428838328351126988236541632950925e-323L, UNDERFLOW_EXCEPTION_DOUBLE);
+# if !defined TEST_LDOUBLE || LDBL_MAX_EXP <= 1024
+ TEST_f_f (tgamma, -0xb7.fffffffffff8p0L, plus_zero, UNDERFLOW_EXCEPTION_DOUBLE);
+ TEST_f_f (tgamma, -0xb8.000000000008p0L, minus_zero, UNDERFLOW_EXCEPTION_DOUBLE);
+# else
+ TEST_f_f (tgamma, -0xb7.fffffffffff8p0L, 1.5789177406982032823826953250736039527543e-325L);
+ TEST_f_f (tgamma, -0xb8.000000000008p0L, -1.5789177406977349925854817486109369828857e-325L);
+# endif
+#endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106
+ TEST_f_f (tgamma, 0x8.00000000000000000000000004p0L, 5.0400000000000000000000000000020034765587e+03L);
+ TEST_f_f (tgamma, 0x7.fffffffffffffffffffffffffep0L, 5.0399999999999999999999999999989982617206e+03L);
+ TEST_f_f (tgamma, 0x7.00000000000000000000000002p0L, 7.2000000000000000000000000000013296297113e+02L);
+ TEST_f_f (tgamma, 0x6.fffffffffffffffffffffffffep0L, 7.1999999999999999999999999999986703702887e+02L);
+ TEST_f_f (tgamma, 0x6.00000000000000000000000002p0L, 1.2000000000000000000000000000002018834292e+02L);
+ TEST_f_f (tgamma, 0x5.fffffffffffffffffffffffffep0L, 1.1999999999999999999999999999997981165708e+02L);
+ TEST_f_f (tgamma, 0x5.00000000000000000000000002p0L, 2.4000000000000000000000000000003564352042e+01L);
+ TEST_f_f (tgamma, 0x4.fffffffffffffffffffffffffep0L, 2.3999999999999999999999999999996435647958e+01L);
+ TEST_f_f (tgamma, 0x4.00000000000000000000000002p0L, 6.0000000000000000000000000000007431765907e+00L);
+ TEST_f_f (tgamma, 0x3.ffffffffffffffffffffffffffp0L, 5.9999999999999999999999999999996284117046e+00L);
+ TEST_f_f (tgamma, 0x3.00000000000000000000000001p0L, 2.0000000000000000000000000000000909935607e+00L);
+ TEST_f_f (tgamma, 0x2.ffffffffffffffffffffffffffp0L, 1.9999999999999999999999999999999090064393e+00L);
+ TEST_f_f (tgamma, 0x2.00000000000000000000000001p0L, 1.0000000000000000000000000000000208448771e+00L);
+ TEST_f_f (tgamma, 0x1.ffffffffffffffffffffffffff8p0L, 9.9999999999999999999999999999998957756146e-01L);
+ TEST_f_f (tgamma, 0x1.000000000000000000000000008p0L, 9.9999999999999999999999999999998577053525e-01L);
+ TEST_f_f (tgamma, 0x0.ffffffffffffffffffffffffffcp0L, 1.0000000000000000000000000000000071147324e+00L);
+ TEST_f_f (tgamma, -0x0.ffffffffffffffffffffffffffcp0L, -8.1129638414606681695789005144064422784335e+31L);
+ TEST_f_f (tgamma, -0x1.000000000000000000000000008p0L, 4.0564819207303340847894502572031577215665e+31L);
+ TEST_f_f (tgamma, -0x1.ffffffffffffffffffffffffff8p0L, 2.0282409603651670423947251286016461392168e+31L);
+ TEST_f_f (tgamma, -0x2.00000000000000000000000001p0L, -1.0141204801825835211973625643007538607832e+31L);
+ TEST_f_f (tgamma, -0x2.ffffffffffffffffffffffffffp0L, -3.3804016006086117373245418810028760196114e+30L);
+ TEST_f_f (tgamma, -0x3.00000000000000000000000001p0L, 3.3804016006086117373245418810024573137219e+30L);
+ TEST_f_f (tgamma, -0x3.ffffffffffffffffffffffffffp0L, 8.4510040015215293433113547025072942156952e+29L);
+ TEST_f_f (tgamma, -0x4.00000000000000000000000002p0L, -4.2255020007607646716556773512527057843048e+29L);
+ TEST_f_f (tgamma, -0x4.fffffffffffffffffffffffffep0L, -8.4510040015215293433113547025080884313904e+28L);
+ TEST_f_f (tgamma, -0x5.00000000000000000000000002p0L, 8.4510040015215293433113547025052449019430e+28L);
+ TEST_f_f (tgamma, -0x5.fffffffffffffffffffffffffep0L, 1.4085006669202548905518924504180378867132e+28L);
+ TEST_f_f (tgamma, -0x6.00000000000000000000000002p0L, -1.4085006669202548905518924504175176688423e+28L);
+ TEST_f_f (tgamma, -0x6.fffffffffffffffffffffffffep0L, -2.0121438098860784150741320720257967542615e+27L);
+ TEST_f_f (tgamma, -0x7.00000000000000000000000002p0L, 2.0121438098860784150741320720249968965322e+27L);
+ TEST_f_f (tgamma, -0x7.fffffffffffffffffffffffffep0L, 2.5151797623575980188426650900322769448110e+26L);
+ TEST_f_f (tgamma, -0x8.00000000000000000000000004p0L, -1.2575898811787990094213325450153421028080e+26L);
+ TEST_f_f (tgamma, -0x9.fffffffffffffffffffffffffcp0L, 1.3973220901986655660237028277960625420495e+24L);
+ TEST_f_f (tgamma, -0xa.00000000000000000000000004p0L, -1.3973220901986655660237028277947663821128e+24L);
+ TEST_f_f (tgamma, -0x13.fffffffffffffffffffffffff8p0L, 1.0420893204640670202556853709074896123293e+12L);
+ TEST_f_f (tgamma, -0x14.00000000000000000000000008p0L, -1.0420893204640670202556853709050065497299e+12L);
+ TEST_f_f (tgamma, -0x1d.fffffffffffffffffffffffff8p0