From: Joseph Myers Date: Tue, 3 Sep 2013 15:32:54 +0000 (+0000) Subject: Fix lgammaf spurious underflow (bug 15427). X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b502a3756d6979439130f1e46c2c27b62f493acd;p=thirdparty%2Fglibc.git Fix lgammaf spurious underflow (bug 15427). --- diff --git a/ChangeLog b/ChangeLog index a2e0a9f7173..ff223e76421 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +<<<<<<< HEAD +======= +2013-09-03 Joseph Myers + + [BZ #15427] + * sysdeps/ieee754/flt-32/e_lgammaf_r.c (__ieee754_lgammaf_r): Use + 2**-30 instead of 2**-70 as threshold for returning -log(|x|). + * math/libm-test.inc (lgamma_test_data): Add more tests. + * sysdeps/i386/fpu/libm-test-ulps: Update. + * sysdeps/x86_64/fpu/libm-test-ulps: Likewise. + +2013-09-03 Ondřej Bílka + + * sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: New file. + * sysdeps/x86_64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): + Add ifunc. + * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): + Add strcmp-sse2-unaligned + * sysdeps/x86_64/multiarch/strcmp.S (strcmp): Add ifunc. + +2013-09-02 Mike Frysinger + + * Versions.def (libc): Add GLIBC_2.19. + +2013-09-02 Mike Frysinger + + * sysdeps/unix/sysv/linux/tst-fanotify.c: New test. + * sysdeps/unix/sysv/linux/Makefile (tests): Add tst-fanotify. + +>>>>>>> ffa3cd7... Fix lgammaf spurious underflow (bug 15427). 2013-09-02 Joseph Myers [BZ #14155] diff --git a/NEWS b/NEWS index 751b9aa9a2e..6a62ddf6fde 100644 --- a/NEWS +++ b/NEWS @@ -4,21 +4,6 @@ See the end for copying conditions. Please send GNU C library bug reports via using `glibc' in the "product" field. -<<<<<<< HEAD -======= - -Version 2.19 - -* The following bugs are resolved with this release: - -<<<<<<< HEAD - 14699, 15522, 15531, 15532, 15736, 15749, 15797, 15867, 15890, 15897, - 15905. ->>>>>>> 0007fc9... [BZ #15522] strtod ("nan(N)") returning a sNaN in some cases -======= - 14155, 14699, 15522, 15531, 15532, 15736, 15749, 15797, 15867, 15890, - 15897, 15905, 15909. ->>>>>>> b7835e3... Fix spurious jnf underflows (bug 14155). Version 2.18 @@ -34,10 +19,10 @@ Version 2.18 15234, 15283, 15285, 15287, 15304, 15305, 15307, 15309, 15327, 15330, 15331, 15335, 15336, 15337, 15339, 15342, 15346, 15359, 15361, 15366, 15380, 15381, 15394, 15395, 15405, 15406, 15409, 15416, 15418, 15419, - 15423, 15424, 15426, 15429, 15431, 15432, 15441, 15442, 15448, 15465, - 15480, 15485, 15488, 15490, 15492, 15493, 15497, 15506, 15522, 15529, - 15532, 15536, 15553, 15577, 15583, 15618, 15627, 15631, 15654, 15655, - 15666, 15667, 15674, 15711, 15755, 15759, 15797. + 15423, 15424, 15426, 15427, 15429, 15431, 15432, 15441, 15442, 15448, + 15465, 15480, 15485, 15488, 15490, 15492, 15493, 15497, 15506, 15522, + 15529, 15532, 15536, 15553, 15577, 15583, 15618, 15627, 15631, 15654, + 15655, 15666, 15667, 15674, 15711, 15755, 15759, 15797. * CVE-2013-2207 Incorrectly granting access to another user's pseudo-terminal has been fixed by disabling the use of pt_chown (Bugzilla #15755). diff --git a/math/libm-test.inc b/math/libm-test.inc index 9d4925533d2..7a11c90640b 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -9973,6 +9973,61 @@ static const struct test_f_f1_data lgamma_test_data[] = TEST_f_f1 (lgamma, -0.5, M_LOG_2_SQRT_PIl, -1), TEST_f_f1 (lgamma, 0.7L, 0.260867246531666514385732417016759578L, 1), TEST_f_f1 (lgamma, 1.2L, -0.853740900033158497197028392998854470e-1L, 1), + + TEST_f_f1 (lgamma, 0x1p-5L, 3.4484891277979584796832693452686366085801e+00L, 1), + TEST_f_f1 (lgamma, -0x1p-5L, 3.4845895751341394376217526729956836492792e+00L, -1), + TEST_f_f1 (lgamma, 0x1p-10L, 6.9309089024194618895406190646600805357273e+00L, 1), + TEST_f_f1 (lgamma, -0x1p-10L, 6.9320362775113082175565786721095494761582e+00L, -1), + TEST_f_f1 (lgamma, 0x1p-15L, 1.0397190093941001762077888432721419773538e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-15L, 1.0397225324389321751118257981741350715545e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-20L, 1.3862943060723899573457963336920089012399e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-20L, 1.3862944161675408862049886226750366625112e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-25L, 1.7328679496796266133304874243201700664713e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-25L, 1.7328679531201000798551671833865469674673e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-30L, 2.0794415416260785304085859198055798098863e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-30L, 2.0794415417335933262374820960532606449975e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-40L, 2.7725887222397287402100277256545578941303e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-40L, 2.7725887222398337351278293820766115529596e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-50L, 3.4657359027997264958191108994508978906983e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-50L, 3.4657359027997265983532103151309975524744e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-60L, 4.1588830833596718564533272505187468598519e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-60L, 4.1588830833596718565534582069793719571779e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-64L, 4.4361419555836499802671564849429355013920e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-64L, 4.4361419555836499802734146697217245699749e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-70L, 4.8520302639196171659205759581386516869302e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-70L, 4.8520302639196171659206737422758202661268e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-100L, 6.9314718055994530941723212145817201464678e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-100L, 6.9314718055994530941723212145818112150422e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-126L, 8.7336544750553108986571247303730247577506e+01L, 1), + TEST_f_f1 (lgamma, -0x1p-126L, 8.7336544750553108986571247303730247577520e+01L, -1), + TEST_f_f1 (lgamma, 0x1p-149L, 1.0327892990343185110316758609726830864325e+02L, 1), + TEST_f_f1 (lgamma, -0x1p-149L, 1.0327892990343185110316758609726830864325e+02L, -1), +#ifndef TEST_FLOAT + TEST_f_f1 (lgamma, 0x1p-200L, 1.3862943611198906188344642429163531361510e+02L, 1), + TEST_f_f1 (lgamma, -0x1p-200L, 1.3862943611198906188344642429163531361510e+02L, -1), + TEST_f_f1 (lgamma, 0x1p-500L, 3.4657359027997265470861606072908828403775e+02L, 1), + TEST_f_f1 (lgamma, -0x1p-500L, 3.4657359027997265470861606072908828403775e+02L, -1), + TEST_f_f1 (lgamma, 0x1p-1000L, 6.9314718055994530941723212145817656807550e+02L, 1), + TEST_f_f1 (lgamma, -0x1p-1000L, 6.9314718055994530941723212145817656807550e+02L, -1), + TEST_f_f1 (lgamma, 0x1p-1022L, 7.0839641853226410622441122813025645257316e+02L, 1), + TEST_f_f1 (lgamma, -0x1p-1022L, 7.0839641853226410622441122813025645257316e+02L, -1), + TEST_f_f1 (lgamma, 0x1p-1074L, 7.4444007192138126231410729844608163411309e+02L, 1), + TEST_f_f1 (lgamma, -0x1p-1074L, 7.4444007192138126231410729844608163411309e+02L, -1), +#endif +#if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381 + TEST_f_f1 (lgamma, 0x1p-5000L, 3.4657359027997265470861606072908828403775e+03L, 1), + TEST_f_f1 (lgamma, -0x1p-5000L, 3.4657359027997265470861606072908828403775e+03L, -1), + TEST_f_f1 (lgamma, 0x1p-10000L, 6.9314718055994530941723212145817656807550e+03L, 1), + TEST_f_f1 (lgamma, -0x1p-10000L, 6.9314718055994530941723212145817656807550e+03L, -1), + TEST_f_f1 (lgamma, 0x1p-16382L, 1.1355137111933024058873096613727848538213e+04L, 1), + TEST_f_f1 (lgamma, -0x1p-16382L, 1.1355137111933024058873096613727848538213e+04L, -1), + TEST_f_f1 (lgamma, 0x1p-16445L, 1.1398805384308300613366382237379713662002e+04L, 1), + TEST_f_f1 (lgamma, -0x1p-16445L, 1.1398805384308300613366382237379713662002e+04L, -1), +# if LDBL_MANT_DIG >= 113 + TEST_f_f1 (lgamma, 0x1p-16494L, 1.1432769596155737933527826611331164313837e+04L, 1), + TEST_f_f1 (lgamma, -0x1p-16494L, 1.1432769596155737933527826611331164313837e+04L, -1), +# endif +#endif }; static void diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps index 8244863ef67..4759aa9f7f6 100644 --- a/sysdeps/i386/fpu/libm-test-ulps +++ b/sysdeps/i386/fpu/libm-test-ulps @@ -5470,9 +5470,35 @@ double: 1 idouble: 1 ildouble: 1 ldouble: 1 +Test "gamma (-0x1p-10)": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "gamma (-0x1p-15)": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "gamma (-0x1p-20)": +double: 1 +idouble: 1 +Test "gamma (-0x1p-30)": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "gamma (-0x1p-5)": +double: 1 +idouble: 1 Test "gamma (0.7)": float: 1 ifloat: 1 +Test "gamma (0x1p-40)": +ildouble: 1 +ldouble: 1 Test "gamma (1.2)": double: 1 float: 2 @@ -5723,9 +5749,35 @@ double: 1 idouble: 1 ildouble: 1 ldouble: 1 +Test "lgamma (-0x1p-10)": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 1 +ldouble: 1 +Test "lgamma (-0x1p-15)": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "lgamma (-0x1p-20)": +double: 1 +idouble: 1 +Test "lgamma (-0x1p-30)": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "lgamma (-0x1p-5)": +double: 1 +idouble: 1 Test "lgamma (0.7)": float: 1 ifloat: 1 +Test "lgamma (0x1p-40)": +ildouble: 1 +ldouble: 1 Test "lgamma (1.2)": double: 1 float: 2 diff --git a/sysdeps/ieee754/flt-32/e_lgammaf_r.c b/sysdeps/ieee754/flt-32/e_lgammaf_r.c index 2e922690852..0dba9af8d79 100644 --- a/sysdeps/ieee754/flt-32/e_lgammaf_r.c +++ b/sysdeps/ieee754/flt-32/e_lgammaf_r.c @@ -150,8 +150,8 @@ __ieee754_lgammaf_r(float x, int *signgamp) *signgamp = -1; return one/fabsf(x); } - if(__builtin_expect(ix<0x1c800000, 0)) { - /* |x|<2**-70, return -log(|x|) */ + if(__builtin_expect(ix<0x30800000, 0)) { + /* |x|<2**-30, return -log(|x|) */ if(hx<0) { *signgamp = -1; return -__ieee754_logf(-x); diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps index 477eedc311a..6fbfa64ae1e 100644 --- a/sysdeps/x86_64/fpu/libm-test-ulps +++ b/sysdeps/x86_64/fpu/libm-test-ulps @@ -6222,11 +6222,39 @@ idouble: 1 Test "gamma (-0.5)": ildouble: 1 ldouble: 1 +Test "gamma (-0x1p-10)": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "gamma (-0x1p-15)": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "gamma (-0x1p-20)": +double: 1 +idouble: 1 +Test "gamma (-0x1p-30)": +ildouble: 1 +ldouble: 1 +Test "gamma (-0x1p-5)": +double: 1 +idouble: 1 Test "gamma (0.7)": double: 1 float: 1 idouble: 1 ifloat: 1 +Test "gamma (0x1p-10)": +float: 1 +ifloat: 1 +Test "gamma (0x1p-30)": +double: 1 +idouble: 1 +Test "gamma (0x1p-40)": +ildouble: 1 +ldouble: 1 Test "gamma (1.2)": double: 1 float: 2 @@ -6491,11 +6519,39 @@ ldouble: 2 Test "lgamma (-0.5)": ildouble: 1 ldouble: 1 +Test "lgamma (-0x1p-10)": +double: 1 +idouble: 1 +ildouble: 1 +ldouble: 1 +Test "lgamma (-0x1p-15)": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +Test "lgamma (-0x1p-20)": +double: 1 +idouble: 1 +Test "lgamma (-0x1p-30)": +ildouble: 1 +ldouble: 1 +Test "lgamma (-0x1p-5)": +double: 1 +idouble: 1 Test "lgamma (0.7)": double: 1 float: 1 idouble: 1 ifloat: 1 +Test "lgamma (0x1p-10)": +float: 1 +ifloat: 1 +Test "lgamma (0x1p-30)": +double: 1 +idouble: 1 +Test "lgamma (0x1p-40)": +ildouble: 1 +ldouble: 1 Test "lgamma (1.2)": double: 1 float: 2