From b376a11a19aa7b64107081e4eed2327c25a131be Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 24 Mar 2014 12:18:45 +0000 Subject: Fix dbl-64 exp overflow/underflow in non-default rounding modes (bug 16284). The dbl-64 version of exp needs round-to-nearest mode for its internal computations, but that has the consequence of inappropriate overflowing and underflowing results in other rounding modes. This patch fixes this by recomputing the relevant results in cases where the round-to-nearest result overflows to infinity or underflows to zero (most of the diffs are actually just consequent reindentation). Tests are enabled in all rounding modes for complex functions using exp - but not for cexp because it turns out there are bugs causing spurious underflows for cexp for some tests, which will need to be fixed separately (I suspect ccos ccosh csin csinh ctan ctanh have similar bugs, just not shown by the present set of test inputs). Tested x86_64 and x86 and ulps updated accordingly. [BZ #16284] * sysdeps/ieee754/dbl-64/e_exp.c (__ieee754_exp): Use original rounding mode to recompute results that overflow to infinity or underflow to zero. * math/auto-libm-test-in: Don't mark tests as expected to fail for bug 16284. * math/auto-libm-test-out: Regenerated. * math/libm-test.inc (ccos_test): Use ALL_RM_TEST. (ccosh_test): Likewise. (csin_test_data): Use plus_oflow. (csin_test): Use ALL_RM_TEST. (csinh_test_data): Use plus_oflow. (csinh_test): Use ALL_RM_TEST. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise. --- sysdeps/x86_64/fpu/libm-test-ulps | 192 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+) (limited to 'sysdeps/x86_64/fpu') diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps index 301eaa6..670f2da 100644 --- a/sysdeps/x86_64/fpu/libm-test-ulps +++ b/sysdeps/x86_64/fpu/libm-test-ulps @@ -468,6 +468,54 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: Real part of "ccos_downward": +double: 1 +float: 1 +idouble: 1 +ifloat: 1 +ildouble: 3 +ldouble: 3 + +Function: Imaginary part of "ccos_downward": +double: 2 +float: 3 +idouble: 2 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Real part of "ccos_towardzero": +double: 1 +float: 2 +idouble: 1 +ifloat: 2 +ildouble: 3 +ldouble: 3 + +Function: Imaginary part of "ccos_towardzero": +double: 2 +float: 3 +idouble: 2 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Real part of "ccos_upward": +double: 1 +float: 2 +idouble: 1 +ifloat: 2 +ildouble: 2 +ldouble: 2 + +Function: Imaginary part of "ccos_upward": +double: 2 +float: 2 +idouble: 2 +ifloat: 2 +ildouble: 2 +ldouble: 2 + Function: Real part of "ccosh": double: 1 float: 1 @@ -482,6 +530,54 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: Real part of "ccosh_downward": +double: 1 +float: 2 +idouble: 1 +ifloat: 2 +ildouble: 3 +ldouble: 3 + +Function: Imaginary part of "ccosh_downward": +double: 2 +float: 3 +idouble: 2 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Real part of "ccosh_towardzero": +double: 1 +float: 3 +idouble: 1 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Imaginary part of "ccosh_towardzero": +double: 2 +float: 3 +idouble: 2 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Real part of "ccosh_upward": +double: 1 +float: 2 +idouble: 1 +ifloat: 2 +ildouble: 2 +ldouble: 2 + +Function: Imaginary part of "ccosh_upward": +double: 2 +float: 2 +idouble: 2 +ifloat: 2 +ildouble: 2 +ldouble: 2 + Function: Real part of "cexp": double: 2 float: 1 @@ -616,6 +712,54 @@ ifloat: 1 ildouble: 1 ldouble: 1 +Function: Real part of "csin_downward": +double: 2 +float: 3 +idouble: 2 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Imaginary part of "csin_downward": +double: 1 +float: 2 +idouble: 1 +ifloat: 2 +ildouble: 3 +ldouble: 3 + +Function: Real part of "csin_towardzero": +double: 2 +float: 3 +idouble: 2 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Imaginary part of "csin_towardzero": +double: 2 +float: 2 +idouble: 2 +ifloat: 2 +ildouble: 3 +ldouble: 3 + +Function: Real part of "csin_upward": +double: 1 +float: 3 +idouble: 1 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Imaginary part of "csin_upward": +double: 1 +float: 3 +idouble: 1 +ifloat: 3 +ildouble: 3 +ldouble: 3 + Function: Real part of "csinh": float: 1 ifloat: 1 @@ -628,6 +772,54 @@ float: 1 idouble: 1 ifloat: 1 +Function: Real part of "csinh_downward": +double: 1 +float: 2 +idouble: 1 +ifloat: 2 +ildouble: 3 +ldouble: 3 + +Function: Imaginary part of "csinh_downward": +double: 2 +float: 3 +idouble: 2 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Real part of "csinh_towardzero": +double: 2 +float: 2 +idouble: 2 +ifloat: 2 +ildouble: 3 +ldouble: 3 + +Function: Imaginary part of "csinh_towardzero": +double: 2 +float: 3 +idouble: 2 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Real part of "csinh_upward": +double: 1 +float: 3 +idouble: 1 +ifloat: 3 +ildouble: 3 +ldouble: 3 + +Function: Imaginary part of "csinh_upward": +double: 2 +float: 3 +idouble: 2 +ifloat: 3 +ildouble: 3 +ldouble: 3 + Function: Real part of "csqrt": double: 1 float: 1 -- cgit v1.1