From 948e12a238715b2931cc42486db9e502ff943e54 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 19 Aug 2015 22:42:01 +0000 Subject: Fix csqrt missing underflows (bug 18370). The csqrt implementations in glibc can miss underflow exceptions when the real or imaginary part of the result becomes tiny in the course of scaling down (in particular, multiplication by 0.5) and that scaling is exact although the relevant part of the mathematical result isn't. This patch forces the exception in a similar way to previous fixes. Tested for x86_64 and x86. [BZ #18370] * math/s_csqrt.c (__csqrt): Force underflow exception for results whose real or imaginary part has small absolute value. * math/s_csqrtf.c (__csqrtf): Likewise. * math/s_csqrtl.c (__csqrtl): Likewise. * math/auto-libm-test-in: Add more tests of csqrt. * math/auto-libm-test-out: Regenerated. * sysdeps/i386/fpu/libm-test-ulps: Update. --- sysdeps/i386/fpu/libm-test-ulps | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdeps/i386') diff --git a/sysdeps/i386/fpu/libm-test-ulps b/sysdeps/i386/fpu/libm-test-ulps index 8263717281..1cbf0db898 100644 --- a/sysdeps/i386/fpu/libm-test-ulps +++ b/sysdeps/i386/fpu/libm-test-ulps @@ -1213,7 +1213,9 @@ ldouble: 2 Function: Real part of "csqrt_downward": double: 1 +float: 1 idouble: 1 +ifloat: 1 ildouble: 4 ldouble: 4 @@ -1227,7 +1229,9 @@ ldouble: 4 Function: Real part of "csqrt_towardzero": double: 1 +float: 1 idouble: 1 +ifloat: 1 ildouble: 4 ldouble: 4 -- cgit 1.4.1