about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-05-19 23:05:22 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-05-19 23:05:22 +0000
commit526af54142db14c1edcd2d80dc1b56d33ff4e8ce (patch)
tree04991e58f9d8c05a94a492eda37747bdcc8a4740
parent88ed594f5d431d855256edbe7e886c8cf4b575dc (diff)
downloadglibc-526af54142db14c1edcd2d80dc1b56d33ff4e8ce.tar.gz
glibc-526af54142db14c1edcd2d80dc1b56d33ff4e8ce.tar.xz
glibc-526af54142db14c1edcd2d80dc1b56d33ff4e8ce.zip
Fix i386 atanhl spurious underflows (bug 18049).
The i386 implementation of atanhl, for small arguments, does a
calculation that involves computing twice the square of the argument,
resulting in spurious underflows for some arguments.  This patch fixes
this by just returning the argument when its exponent is below -32,
with underflow being forced as needed for subnormal arguments.

Tested for x86 and x86_64.

	[BZ #18049]
	* sysdeps/i386/fpu/e_atanhl.S (__ieee754_atanhl): For exponents
	below -32, return the argument, with underflow if subnormal.
	* math/auto-libm-test-in: Add more tests of atanh.
	* math/auto-libm-test-out: Regenerated.
-rw-r--r--ChangeLog8
-rw-r--r--NEWS8
-rw-r--r--math/auto-libm-test-in5
-rw-r--r--math/auto-libm-test-out325
-rw-r--r--sysdeps/i386/fpu/e_atanhl.S10
5 files changed, 352 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ea3db5a2c..0a5ef3b4a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-05-19  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #18049]
+	* sysdeps/i386/fpu/e_atanhl.S (__ieee754_atanhl): For exponents
+	below -32, return the argument, with underflow if subnormal.
+	* math/auto-libm-test-in: Add more tests of atanh.
+	* math/auto-libm-test-out: Regenerated.
+
 2015-05-19  Roland McGrath  <roland@hack.frob.com>
 
 	[BZ #18434]
diff --git a/NEWS b/NEWS
index 7d74b8e7b8..c112b94ba3 100644
--- a/NEWS
+++ b/NEWS
@@ -15,10 +15,10 @@ Version 2.22
   17631, 17692, 17711, 17715, 17776, 17779, 17792, 17836, 17912, 17916,
   17930, 17932, 17944, 17949, 17964, 17965, 17967, 17969, 17978, 17987,
   17991, 17996, 17998, 17999, 18007, 18019, 18020, 18029, 18030, 18032,
-  18036, 18038, 18039, 18042, 18043, 18046, 18047, 18068, 18080, 18093,
-  18100, 18104, 18110, 18111, 18125, 18128, 18138, 18185, 18196, 18197,
-  18206, 18210, 18211, 18217, 18220, 18221, 18247, 18287, 18319, 18333,
-  18346, 18397, 18409, 18418.
+  18036, 18038, 18039, 18042, 18043, 18046, 18047, 18049, 18068, 18080,
+  18093, 18100, 18104, 18110, 18111, 18125, 18128, 18138, 18185, 18196,
+  18197, 18206, 18210, 18211, 18217, 18220, 18221, 18247, 18287, 18319,
+  18333, 18346, 18397, 18409, 18418.
 
 * Cache information can be queried via sysconf() function on s390 e.g. with
   _SC_LEVEL1_ICACHE_SIZE as argument.
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in
index 6fe0ed7d75..9e55d913ae 100644
--- a/math/auto-libm-test-in
+++ b/math/auto-libm-test-in
@@ -368,6 +368,11 @@ atanh 0x1p-57
 atanh 0x1p-58
 atanh 0x1p-59
 atanh 0x1p-100
+atanh -0x1p-100
+atanh 0x1p-600
+atanh -0x1p-600
+atanh 0x1p-10000
+atanh -0x1p-10000
 atanh -0x6.e6c77p-20
 atanh 0x3.2ca824p-4
 atanh -0x1.cc1d66p-4
diff --git a/math/auto-libm-test-out b/math/auto-libm-test-out
index 8119f275d0..90ec0e585a 100644
--- a/math/auto-libm-test-out
+++ b/math/auto-libm-test-out
@@ -19883,6 +19883,331 @@ atanh 0x1p-100
 = atanh tonearest ldbl-128ibm 0x1p-100L : 0x1p-100L : inexact-ok
 = atanh towardzero ldbl-128ibm 0x1p-100L : 0x1p-100L : inexact-ok
 = atanh upward ldbl-128ibm 0x1p-100L : 0x1.000000000000000000000000008p-100L : inexact-ok
+atanh -0x1p-100
+= atanh downward flt-32 -0x1p-100f : -0x1.000002p-100f : inexact-ok
+= atanh tonearest flt-32 -0x1p-100f : -0x1p-100f : inexact-ok
+= atanh towardzero flt-32 -0x1p-100f : -0x1p-100f : inexact-ok
+= atanh upward flt-32 -0x1p-100f : -0x1p-100f : inexact-ok
+= atanh downward dbl-64 -0x1p-100 : -0x1.0000000000001p-100 : inexact-ok
+= atanh tonearest dbl-64 -0x1p-100 : -0x1p-100 : inexact-ok
+= atanh towardzero dbl-64 -0x1p-100 : -0x1p-100 : inexact-ok
+= atanh upward dbl-64 -0x1p-100 : -0x1p-100 : inexact-ok
+= atanh downward ldbl-96-intel -0x1p-100L : -0x1.0000000000000002p-100L : inexact-ok
+= atanh tonearest ldbl-96-intel -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh towardzero ldbl-96-intel -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh upward ldbl-96-intel -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh downward ldbl-96-m68k -0x1p-100L : -0x1.0000000000000002p-100L : inexact-ok
+= atanh tonearest ldbl-96-m68k -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh towardzero ldbl-96-m68k -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh upward ldbl-96-m68k -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh downward ldbl-128 -0x1p-100L : -0x1.0000000000000000000000000001p-100L : inexact-ok
+= atanh tonearest ldbl-128 -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh towardzero ldbl-128 -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh upward ldbl-128 -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh downward ldbl-128ibm -0x1p-100L : -0x1.000000000000000000000000008p-100L : inexact-ok
+= atanh tonearest ldbl-128ibm -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh towardzero ldbl-128ibm -0x1p-100L : -0x1p-100L : inexact-ok
+= atanh upward ldbl-128ibm -0x1p-100L : -0x1p-100L : inexact-ok
+atanh 0x1p-600
+= atanh downward flt-32 0x8p-152f : 0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh tonearest flt-32 0x8p-152f : 0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh towardzero flt-32 0x8p-152f : 0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh upward flt-32 0x8p-152f : 0x1p-148f : inexact-ok underflow errno-erange-ok
+= atanh downward dbl-64 0x8p-152 : 0x8p-152 : inexact-ok
+= atanh tonearest dbl-64 0x8p-152 : 0x8p-152 : inexact-ok
+= atanh towardzero dbl-64 0x8p-152 : 0x8p-152 : inexact-ok
+= atanh upward dbl-64 0x8p-152 : 0x8.0000000000008p-152 : inexact-ok
+= atanh downward ldbl-96-intel 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh tonearest ldbl-96-intel 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh towardzero ldbl-96-intel 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh upward ldbl-96-intel 0x8p-152L : 0x8.000000000000001p-152L : inexact-ok
+= atanh downward ldbl-96-m68k 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh tonearest ldbl-96-m68k 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh towardzero ldbl-96-m68k 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh upward ldbl-96-m68k 0x8p-152L : 0x8.000000000000001p-152L : inexact-ok
+= atanh downward ldbl-128 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh tonearest ldbl-128 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh towardzero ldbl-128 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh upward ldbl-128 0x8p-152L : 0x8.0000000000000000000000000008p-152L : inexact-ok
+= atanh downward ldbl-128ibm 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh tonearest ldbl-128ibm 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh towardzero ldbl-128ibm 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh upward ldbl-128ibm 0x8p-152L : 0x8.00000000000000000000000004p-152L : inexact-ok
+= atanh downward flt-32 0x0p+0f : 0x0p+0f : inexact-ok
+= atanh tonearest flt-32 0x0p+0f : 0x0p+0f : inexact-ok
+= atanh towardzero flt-32 0x0p+0f : 0x0p+0f : inexact-ok
+= atanh upward flt-32 0x0p+0f : 0x0p+0f : inexact-ok
+= atanh downward dbl-64 0x0p+0 : 0x0p+0 : inexact-ok
+= atanh tonearest dbl-64 0x0p+0 : 0x0p+0 : inexact-ok
+= atanh towardzero dbl-64 0x0p+0 : 0x0p+0 : inexact-ok
+= atanh upward dbl-64 0x0p+0 : 0x0p+0 : inexact-ok
+= atanh downward ldbl-96-intel 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh tonearest ldbl-96-intel 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh towardzero ldbl-96-intel 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh upward ldbl-96-intel 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh downward ldbl-96-m68k 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh tonearest ldbl-96-m68k 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh towardzero ldbl-96-m68k 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh upward ldbl-96-m68k 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh downward ldbl-128 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh tonearest ldbl-128 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh towardzero ldbl-128 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh upward ldbl-128 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh downward ldbl-128ibm 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh tonearest ldbl-128ibm 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh towardzero ldbl-128ibm 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh upward ldbl-128ibm 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh downward dbl-64 0x1p-600 : 0x1p-600 : inexact-ok
+= atanh tonearest dbl-64 0x1p-600 : 0x1p-600 : inexact-ok
+= atanh towardzero dbl-64 0x1p-600 : 0x1p-600 : inexact-ok
+= atanh upward dbl-64 0x1p-600 : 0x1.0000000000001p-600 : inexact-ok
+= atanh downward ldbl-96-intel 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh tonearest ldbl-96-intel 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh towardzero ldbl-96-intel 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh upward ldbl-96-intel 0x1p-600L : 0x1.0000000000000002p-600L : inexact-ok
+= atanh downward ldbl-96-m68k 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh tonearest ldbl-96-m68k 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh towardzero ldbl-96-m68k 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh upward ldbl-96-m68k 0x1p-600L : 0x1.0000000000000002p-600L : inexact-ok
+= atanh downward ldbl-128 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh tonearest ldbl-128 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh towardzero ldbl-128 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh upward ldbl-128 0x1p-600L : 0x1.0000000000000000000000000001p-600L : inexact-ok
+= atanh downward ldbl-128ibm 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh tonearest ldbl-128ibm 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh towardzero ldbl-128ibm 0x1p-600L : 0x1p-600L : inexact-ok
+= atanh upward ldbl-128ibm 0x1p-600L : 0x1.000000000000000000000000008p-600L : inexact-ok
+atanh -0x1p-600
+= atanh downward flt-32 -0x0p+0f : -0x0p+0f : inexact-ok
+= atanh tonearest flt-32 -0x0p+0f : -0x0p+0f : inexact-ok
+= atanh towardzero flt-32 -0x0p+0f : -0x0p+0f : inexact-ok
+= atanh upward flt-32 -0x0p+0f : -0x0p+0f : inexact-ok
+= atanh downward dbl-64 -0x0p+0 : -0x0p+0 : inexact-ok
+= atanh tonearest dbl-64 -0x0p+0 : -0x0p+0 : inexact-ok
+= atanh towardzero dbl-64 -0x0p+0 : -0x0p+0 : inexact-ok
+= atanh upward dbl-64 -0x0p+0 : -0x0p+0 : inexact-ok
+= atanh downward ldbl-96-intel -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh tonearest ldbl-96-intel -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh towardzero ldbl-96-intel -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh upward ldbl-96-intel -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh downward ldbl-96-m68k -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh tonearest ldbl-96-m68k -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh towardzero ldbl-96-m68k -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh upward ldbl-96-m68k -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh downward ldbl-128 -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh tonearest ldbl-128 -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh towardzero ldbl-128 -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh upward ldbl-128 -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh downward ldbl-128ibm -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh tonearest ldbl-128ibm -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh towardzero ldbl-128ibm -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh upward ldbl-128ibm -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh downward flt-32 -0x8p-152f : -0x1p-148f : inexact-ok underflow errno-erange-ok
+= atanh tonearest flt-32 -0x8p-152f : -0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh towardzero flt-32 -0x8p-152f : -0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh upward flt-32 -0x8p-152f : -0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh downward dbl-64 -0x8p-152 : -0x8.0000000000008p-152 : inexact-ok
+= atanh tonearest dbl-64 -0x8p-152 : -0x8p-152 : inexact-ok
+= atanh towardzero dbl-64 -0x8p-152 : -0x8p-152 : inexact-ok
+= atanh upward dbl-64 -0x8p-152 : -0x8p-152 : inexact-ok
+= atanh downward ldbl-96-intel -0x8p-152L : -0x8.000000000000001p-152L : inexact-ok
+= atanh tonearest ldbl-96-intel -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh towardzero ldbl-96-intel -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh upward ldbl-96-intel -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh downward ldbl-96-m68k -0x8p-152L : -0x8.000000000000001p-152L : inexact-ok
+= atanh tonearest ldbl-96-m68k -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh towardzero ldbl-96-m68k -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh upward ldbl-96-m68k -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh downward ldbl-128 -0x8p-152L : -0x8.0000000000000000000000000008p-152L : inexact-ok
+= atanh tonearest ldbl-128 -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh towardzero ldbl-128 -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh upward ldbl-128 -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh downward ldbl-128ibm -0x8p-152L : -0x8.00000000000000000000000004p-152L : inexact-ok
+= atanh tonearest ldbl-128ibm -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh towardzero ldbl-128ibm -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh upward ldbl-128ibm -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh downward dbl-64 -0x1p-600 : -0x1.0000000000001p-600 : inexact-ok
+= atanh tonearest dbl-64 -0x1p-600 : -0x1p-600 : inexact-ok
+= atanh towardzero dbl-64 -0x1p-600 : -0x1p-600 : inexact-ok
+= atanh upward dbl-64 -0x1p-600 : -0x1p-600 : inexact-ok
+= atanh downward ldbl-96-intel -0x1p-600L : -0x1.0000000000000002p-600L : inexact-ok
+= atanh tonearest ldbl-96-intel -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh towardzero ldbl-96-intel -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh upward ldbl-96-intel -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh downward ldbl-96-m68k -0x1p-600L : -0x1.0000000000000002p-600L : inexact-ok
+= atanh tonearest ldbl-96-m68k -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh towardzero ldbl-96-m68k -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh upward ldbl-96-m68k -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh downward ldbl-128 -0x1p-600L : -0x1.0000000000000000000000000001p-600L : inexact-ok
+= atanh tonearest ldbl-128 -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh towardzero ldbl-128 -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh upward ldbl-128 -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh downward ldbl-128ibm -0x1p-600L : -0x1.000000000000000000000000008p-600L : inexact-ok
+= atanh tonearest ldbl-128ibm -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh towardzero ldbl-128ibm -0x1p-600L : -0x1p-600L : inexact-ok
+= atanh upward ldbl-128ibm -0x1p-600L : -0x1p-600L : inexact-ok
+atanh 0x1p-10000
+= atanh downward flt-32 0x8p-152f : 0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh tonearest flt-32 0x8p-152f : 0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh towardzero flt-32 0x8p-152f : 0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh upward flt-32 0x8p-152f : 0x1p-148f : inexact-ok underflow errno-erange-ok
+= atanh downward dbl-64 0x8p-152 : 0x8p-152 : inexact-ok
+= atanh tonearest dbl-64 0x8p-152 : 0x8p-152 : inexact-ok
+= atanh towardzero dbl-64 0x8p-152 : 0x8p-152 : inexact-ok
+= atanh upward dbl-64 0x8p-152 : 0x8.0000000000008p-152 : inexact-ok
+= atanh downward ldbl-96-intel 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh tonearest ldbl-96-intel 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh towardzero ldbl-96-intel 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh upward ldbl-96-intel 0x8p-152L : 0x8.000000000000001p-152L : inexact-ok
+= atanh downward ldbl-96-m68k 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh tonearest ldbl-96-m68k 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh towardzero ldbl-96-m68k 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh upward ldbl-96-m68k 0x8p-152L : 0x8.000000000000001p-152L : inexact-ok
+= atanh downward ldbl-128 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh tonearest ldbl-128 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh towardzero ldbl-128 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh upward ldbl-128 0x8p-152L : 0x8.0000000000000000000000000008p-152L : inexact-ok
+= atanh downward ldbl-128ibm 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh tonearest ldbl-128ibm 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh towardzero ldbl-128ibm 0x8p-152L : 0x8p-152L : inexact-ok
+= atanh upward ldbl-128ibm 0x8p-152L : 0x8.00000000000000000000000004p-152L : inexact-ok
+= atanh downward flt-32 0x0p+0f : 0x0p+0f : inexact-ok
+= atanh tonearest flt-32 0x0p+0f : 0x0p+0f : inexact-ok
+= atanh towardzero flt-32 0x0p+0f : 0x0p+0f : inexact-ok
+= atanh upward flt-32 0x0p+0f : 0x0p+0f : inexact-ok
+= atanh downward dbl-64 0x0p+0 : 0x0p+0 : inexact-ok
+= atanh tonearest dbl-64 0x0p+0 : 0x0p+0 : inexact-ok
+= atanh towardzero dbl-64 0x0p+0 : 0x0p+0 : inexact-ok
+= atanh upward dbl-64 0x0p+0 : 0x0p+0 : inexact-ok
+= atanh downward ldbl-96-intel 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh tonearest ldbl-96-intel 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh towardzero ldbl-96-intel 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh upward ldbl-96-intel 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh downward ldbl-96-m68k 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh tonearest ldbl-96-m68k 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh towardzero ldbl-96-m68k 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh upward ldbl-96-m68k 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh downward ldbl-128 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh tonearest ldbl-128 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh towardzero ldbl-128 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh upward ldbl-128 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh downward ldbl-128ibm 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh tonearest ldbl-128ibm 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh towardzero ldbl-128ibm 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh upward ldbl-128ibm 0x0p+0L : 0x0p+0L : inexact-ok
+= atanh downward dbl-64 0x4p-1076 : 0x4p-1076 : inexact-ok underflow errno-erange-ok
+= atanh tonearest dbl-64 0x4p-1076 : 0x4p-1076 : inexact-ok underflow errno-erange-ok
+= atanh towardzero dbl-64 0x4p-1076 : 0x4p-1076 : inexact-ok underflow errno-erange-ok
+= atanh upward dbl-64 0x4p-1076 : 0x8p-1076 : inexact-ok underflow errno-erange-ok
+= atanh downward ldbl-96-intel 0x4p-1076L : 0x4p-1076L : inexact-ok
+= atanh tonearest ldbl-96-intel 0x4p-1076L : 0x4p-1076L : inexact-ok
+= atanh towardzero ldbl-96-intel 0x4p-1076L : 0x4p-1076L : inexact-ok
+= atanh upward ldbl-96-intel 0x4p-1076L : 0x4.0000000000000008p-1076L : inexact-ok
+= atanh downward ldbl-96-m68k 0x4p-1076L : 0x4p-1076L : inexact-ok
+= atanh tonearest ldbl-96-m68k 0x4p-1076L : 0x4p-1076L : inexact-ok
+= atanh towardzero ldbl-96-m68k 0x4p-1076L : 0x4p-1076L : inexact-ok
+= atanh upward ldbl-96-m68k 0x4p-1076L : 0x4.0000000000000008p-1076L : inexact-ok
+= atanh downward ldbl-128 0x4p-1076L : 0x4p-1076L : inexact-ok
+= atanh tonearest ldbl-128 0x4p-1076L : 0x4p-1076L : inexact-ok
+= atanh towardzero ldbl-128 0x4p-1076L : 0x4p-1076L : inexact-ok
+= atanh upward ldbl-128 0x4p-1076L : 0x4.0000000000000000000000000004p-1076L : inexact-ok
+= atanh downward ldbl-128ibm 0x4p-1076L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
+= atanh tonearest ldbl-128ibm 0x4p-1076L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
+= atanh towardzero ldbl-128ibm 0x4p-1076L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
+= atanh upward ldbl-128ibm 0x4p-1076L : 0x8p-1076L : inexact-ok underflow errno-erange-ok
+= atanh downward ldbl-96-intel 0x1p-10000L : 0x1p-10000L : inexact-ok
+= atanh tonearest ldbl-96-intel 0x1p-10000L : 0x1p-10000L : inexact-ok
+= atanh towardzero ldbl-96-intel 0x1p-10000L : 0x1p-10000L : inexact-ok
+= atanh upward ldbl-96-intel 0x1p-10000L : 0x1.0000000000000002p-10000L : inexact-ok
+= atanh downward ldbl-96-m68k 0x1p-10000L : 0x1p-10000L : inexact-ok
+= atanh tonearest ldbl-96-m68k 0x1p-10000L : 0x1p-10000L : inexact-ok
+= atanh towardzero ldbl-96-m68k 0x1p-10000L : 0x1p-10000L : inexact-ok
+= atanh upward ldbl-96-m68k 0x1p-10000L : 0x1.0000000000000002p-10000L : inexact-ok
+= atanh downward ldbl-128 0x1p-10000L : 0x1p-10000L : inexact-ok
+= atanh tonearest ldbl-128 0x1p-10000L : 0x1p-10000L : inexact-ok
+= atanh towardzero ldbl-128 0x1p-10000L : 0x1p-10000L : inexact-ok
+= atanh upward ldbl-128 0x1p-10000L : 0x1.0000000000000000000000000001p-10000L : inexact-ok
+atanh -0x1p-10000
+= atanh downward flt-32 -0x0p+0f : -0x0p+0f : inexact-ok
+= atanh tonearest flt-32 -0x0p+0f : -0x0p+0f : inexact-ok
+= atanh towardzero flt-32 -0x0p+0f : -0x0p+0f : inexact-ok
+= atanh upward flt-32 -0x0p+0f : -0x0p+0f : inexact-ok
+= atanh downward dbl-64 -0x0p+0 : -0x0p+0 : inexact-ok
+= atanh tonearest dbl-64 -0x0p+0 : -0x0p+0 : inexact-ok
+= atanh towardzero dbl-64 -0x0p+0 : -0x0p+0 : inexact-ok
+= atanh upward dbl-64 -0x0p+0 : -0x0p+0 : inexact-ok
+= atanh downward ldbl-96-intel -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh tonearest ldbl-96-intel -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh towardzero ldbl-96-intel -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh upward ldbl-96-intel -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh downward ldbl-96-m68k -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh tonearest ldbl-96-m68k -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh towardzero ldbl-96-m68k -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh upward ldbl-96-m68k -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh downward ldbl-128 -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh tonearest ldbl-128 -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh towardzero ldbl-128 -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh upward ldbl-128 -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh downward ldbl-128ibm -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh tonearest ldbl-128ibm -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh towardzero ldbl-128ibm -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh upward ldbl-128ibm -0x0p+0L : -0x0p+0L : inexact-ok
+= atanh downward flt-32 -0x8p-152f : -0x1p-148f : inexact-ok underflow errno-erange-ok
+= atanh tonearest flt-32 -0x8p-152f : -0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh towardzero flt-32 -0x8p-152f : -0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh upward flt-32 -0x8p-152f : -0x8p-152f : inexact-ok underflow errno-erange-ok
+= atanh downward dbl-64 -0x8p-152 : -0x8.0000000000008p-152 : inexact-ok
+= atanh tonearest dbl-64 -0x8p-152 : -0x8p-152 : inexact-ok
+= atanh towardzero dbl-64 -0x8p-152 : -0x8p-152 : inexact-ok
+= atanh upward dbl-64 -0x8p-152 : -0x8p-152 : inexact-ok
+= atanh downward ldbl-96-intel -0x8p-152L : -0x8.000000000000001p-152L : inexact-ok
+= atanh tonearest ldbl-96-intel -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh towardzero ldbl-96-intel -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh upward ldbl-96-intel -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh downward ldbl-96-m68k -0x8p-152L : -0x8.000000000000001p-152L : inexact-ok
+= atanh tonearest ldbl-96-m68k -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh towardzero ldbl-96-m68k -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh upward ldbl-96-m68k -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh downward ldbl-128 -0x8p-152L : -0x8.0000000000000000000000000008p-152L : inexact-ok
+= atanh tonearest ldbl-128 -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh towardzero ldbl-128 -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh upward ldbl-128 -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh downward ldbl-128ibm -0x8p-152L : -0x8.00000000000000000000000004p-152L : inexact-ok
+= atanh tonearest ldbl-128ibm -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh towardzero ldbl-128ibm -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh upward ldbl-128ibm -0x8p-152L : -0x8p-152L : inexact-ok
+= atanh downward dbl-64 -0x4p-1076 : -0x8p-1076 : inexact-ok underflow errno-erange-ok
+= atanh tonearest dbl-64 -0x4p-1076 : -0x4p-1076 : inexact-ok underflow errno-erange-ok
+= atanh towardzero dbl-64 -0x4p-1076 : -0x4p-1076 : inexact-ok underflow errno-erange-ok
+= atanh upward dbl-64 -0x4p-1076 : -0x4p-1076 : inexact-ok underflow errno-erange-ok
+= atanh downward ldbl-96-intel -0x4p-1076L : -0x4.0000000000000008p-1076L : inexact-ok
+= atanh tonearest ldbl-96-intel -0x4p-1076L : -0x4p-1076L : inexact-ok
+= atanh towardzero ldbl-96-intel -0x4p-1076L : -0x4p-1076L : inexact-ok
+= atanh upward ldbl-96-intel -0x4p-1076L : -0x4p-1076L : inexact-ok
+= atanh downward ldbl-96-m68k -0x4p-1076L : -0x4.0000000000000008p-1076L : inexact-ok
+= atanh tonearest ldbl-96-m68k -0x4p-1076L : -0x4p-1076L : inexact-ok
+= atanh towardzero ldbl-96-m68k -0x4p-1076L : -0x4p-1076L : inexact-ok
+= atanh upward ldbl-96-m68k -0x4p-1076L : -0x4p-1076L : inexact-ok
+= atanh downward ldbl-128 -0x4p-1076L : -0x4.0000000000000000000000000004p-1076L : inexact-ok
+= atanh tonearest ldbl-128 -0x4p-1076L : -0x4p-1076L : inexact-ok
+= atanh towardzero ldbl-128 -0x4p-1076L : -0x4p-1076L : inexact-ok
+= atanh upward ldbl-128 -0x4p-1076L : -0x4p-1076L : inexact-ok
+= atanh downward ldbl-128ibm -0x4p-1076L : -0x8p-1076L : inexact-ok underflow errno-erange-ok
+= atanh tonearest ldbl-128ibm -0x4p-1076L : -0x4p-1076L : inexact-ok underflow errno-erange-ok
+= atanh towardzero ldbl-128ibm -0x4p-1076L : -0x4p-1076L : inexact-ok underflow errno-erange-ok
+= atanh upward ldbl-128ibm -0x4p-1076L : -0x4p-1076L : inexact-ok underflow errno-erange-ok
+= atanh downward ldbl-96-intel -0x1p-10000L : -0x1.0000000000000002p-10000L : inexact-ok
+= atanh tonearest ldbl-96-intel -0x1p-10000L : -0x1p-10000L : inexact-ok
+= atanh towardzero ldbl-96-intel -0x1p-10000L : -0x1p-10000L : inexact-ok
+= atanh upward ldbl-96-intel -0x1p-10000L : -0x1p-10000L : inexact-ok
+= atanh downward ldbl-96-m68k -0x1p-10000L : -0x1.0000000000000002p-10000L : inexact-ok
+= atanh tonearest ldbl-96-m68k -0x1p-10000L : -0x1p-10000L : inexact-ok
+= atanh towardzero ldbl-96-m68k -0x1p-10000L : -0x1p-10000L : inexact-ok
+= atanh upward ldbl-96-m68k -0x1p-10000L : -0x1p-10000L : inexact-ok
+= atanh downward ldbl-128 -0x1p-10000L : -0x1.0000000000000000000000000001p-10000L : inexact-ok
+= atanh tonearest ldbl-128 -0x1p-10000L : -0x1p-10000L : inexact-ok
+= atanh towardzero ldbl-128 -0x1p-10000L : -0x1p-10000L : inexact-ok
+= atanh upward ldbl-128 -0x1p-10000L : -0x1p-10000L : inexact-ok
 atanh -0x6.e6c77p-20
 = atanh downward flt-32 -0x6.e6c77p-20f : -0x6.e6c778p-20f : inexact-ok
 = atanh tonearest flt-32 -0x6.e6c77p-20f : -0x6.e6c77p-20f : inexact-ok
diff --git a/sysdeps/i386/fpu/e_atanhl.S b/sysdeps/i386/fpu/e_atanhl.S
index 88a970378d..1ad6851058 100644
--- a/sysdeps/i386/fpu/e_atanhl.S
+++ b/sysdeps/i386/fpu/e_atanhl.S
@@ -56,6 +56,16 @@ ENTRY(__ieee754_atanhl)
 	andl	$0x7fff, %eax
 	cmpl	$0x7fff, %eax
 	je	5f
+	cmpl	$0x3fdf, %eax
+	jge	7f
+	// Exponent below -32; return x, with underflow if subnormal.
+	fldt	4(%esp)
+	cmpl	$0, %eax
+	jne	8f
+	fld	%st(0)
+	fmul	%st(0)
+	fstp	%st(0)
+8:	ret
 7:
 
 #ifdef PIC