From 554edb23ffc7a953ca86309cc5f02dbd1a63abe0 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 22 Jun 2015 21:06:19 +0000 Subject: Fix expm1 missing underflows (bug 16353). Similar to various other bugs in this area, some expm1 implementations do not raise the underflow exception for subnormal arguments, when the result is tiny and inexact. This patch forces the exception in a similar way to previous fixes. (The issue does not apply to the ldbl-* implementations or to those for x86 / x86_64 long double. The change to sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c is one I missed when previously fixing bug 16354; the bug in that implementation was previously latent, but the expm1 fixes stopped it being latent and so required it to be fixed to avoid spurious underflows from cosh.) Tested for x86_64 and x86. [BZ #16353] * sysdeps/i386/fpu/s_expm1.S (dbl_min): New object. (__expm1): Force underflow exception for arguments with small absolute value. * sysdeps/i386/fpu/s_expm1f.S (flt_min): New object. (__expm1f): Force underflow exception for arguments with small absolute value. * sysdeps/ieee754/dbl-64/s_expm1.c: Include . (__expm1): Force underflow exception for arguments with small absolute value. * sysdeps/ieee754/flt-32/s_expm1f.c: Include . (__expm1f): Force underflow exception for arguments with small absolute value. * sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c (__ieee754_cosh): Check for small arguments before calling __expm1. * math/auto-libm-test-in: Do not mark underflow exceptions as possibly missing for bug 16353. * math/auto-libm-test-out: Regenerated. --- math/auto-libm-test-in | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'math/auto-libm-test-in') diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in index 6b054597f1..9bae9d5570 100644 --- a/math/auto-libm-test-in +++ b/math/auto-libm-test-in @@ -1362,12 +1362,11 @@ expm1 0x6.289a78p-4 expm1 0x6.1b4d318238d4a2a8p-4 expm1 0x5.fb8dc64e91a74p-4 expm1 0x3.735f497c4e67535cp-4 -# Bug 16353: underflow exception may be missing -expm1 0x4.0000000000000028p-16384 missing-underflow -expm1 min missing-underflow -expm1 -min missing-underflow -expm1 min_subnorm missing-underflow -expm1 -min_subnorm missing-underflow +expm1 0x4.0000000000000028p-16384 +expm1 min +expm1 -min +expm1 min_subnorm +expm1 -min_subnorm fma 1.0 2.0 3.0 fma 1.25 0.75 0.0625 -- cgit 1.4.1