about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-08-19 22:42:01 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-08-19 22:42:01 +0000
commit948e12a238715b2931cc42486db9e502ff943e54 (patch)
treec0790fb5b46d6a49e015f15cbec9c45464dd1dc2
parentb75d1cfce647df871700a9027cde35484127d727 (diff)
downloadglibc-948e12a238715b2931cc42486db9e502ff943e54.tar.gz
glibc-948e12a238715b2931cc42486db9e502ff943e54.tar.xz
glibc-948e12a238715b2931cc42486db9e502ff943e54.zip
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.
-rw-r--r--ChangeLog11
-rw-r--r--NEWS4
-rw-r--r--math/auto-libm-test-in5
-rw-r--r--math/auto-libm-test-out356
-rw-r--r--math/s_csqrt.c11
-rw-r--r--math/s_csqrtf.c11
-rw-r--r--math/s_csqrtl.c11
-rw-r--r--sysdeps/i386/fpu/libm-test-ulps4
8 files changed, 411 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d2c13e02cf..b3c9892466 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-08-19  Joseph Myers  <joseph@codesourcery.com>
+
+	[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.
+
 2015-08-19  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/sys/platform/ppc.h (__ppc_set_ppr_med_high,
diff --git a/NEWS b/NEWS
index d8665806fe..a40d526e4c 100644
--- a/NEWS
+++ b/NEWS
@@ -10,8 +10,8 @@ Version 2.23
 * The following bugs are resolved with this release:
 
   14341, 16517, 16519, 16520, 16734, 16973, 17905, 18084, 18086, 18265,
-  18421, 18480, 18525, 18618, 18647, 18661, 18681, 18674, 18778, 18781,
-  18787, 18789, 18790, 18795, 18796, 18820, 18823, 18824.
+  18370, 18421, 18480, 18525, 18618, 18647, 18661, 18681, 18674, 18778,
+  18781, 18787, 18789, 18790, 18795, 18796, 18820, 18823, 18824.
 
 * The obsolete header <regexp.h> has been removed.  Programs that require
   this header must be updated to use <regex.h> instead.
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in
index 015041aeb0..49f1c55c03 100644
--- a/math/auto-libm-test-in
+++ b/math/auto-libm-test-in
@@ -1171,6 +1171,11 @@ csqrt 0x1p-16445 0x1.0000000000000004p-16382
 csqrt 0x1p-16494 0x1.0000000000000000000000000001p-16382
 csqrt 0x1p-16494 0x1.0000000000000000000000000002p-16382
 
+csqrt 1 min
+csqrt 1 -min
+csqrt -1 min
+csqrt -1 -min
+
 ctan 0 0
 ctan 0 -0
 ctan -0 0
diff --git a/math/auto-libm-test-out b/math/auto-libm-test-out
index f091ccb512..fca557b9a2 100644
--- a/math/auto-libm-test-out
+++ b/math/auto-libm-test-out
@@ -105924,6 +105924,362 @@ csqrt 0x1p-16494 0x1.0000000000000000000000000002p-16382
 = csqrt tonearest ldbl-128 0x4p-16496L 0x4.0000000000000000000000000008p-16384L : 0x1.6a09e667f3bcc908b2fb1366ea98p-8192L 0x1.6a09e667f3bcc908b2fb1366ea96p-8192L : inexact-ok
 = csqrt towardzero ldbl-128 0x4p-16496L 0x4.0000000000000000000000000008p-16384L : 0x1.6a09e667f3bcc908b2fb1366ea97p-8192L 0x1.6a09e667f3bcc908b2fb1366ea96p-8192L : inexact-ok
 = csqrt upward ldbl-128 0x4p-16496L 0x4.0000000000000000000000000008p-16384L : 0x1.6a09e667f3bcc908b2fb1366ea98p-8192L 0x1.6a09e667f3bcc908b2fb1366ea97p-8192L : inexact-ok
+csqrt 1 min
+= csqrt downward flt-32 0x1p+0f 0x4p-128f : 0x1p+0f 0x1.fffff8p-128f : inexact-ok underflow errno-erange-ok
+= csqrt tonearest flt-32 0x1p+0f 0x4p-128f : 0x1p+0f 0x2p-128f : inexact-ok underflow errno-erange-ok
+= csqrt towardzero flt-32 0x1p+0f 0x4p-128f : 0x1p+0f 0x1.fffff8p-128f : inexact-ok underflow errno-erange-ok
+= csqrt upward flt-32 0x1p+0f 0x4p-128f : 0x1.000002p+0f 0x2p-128f : inexact-ok underflow errno-erange-ok
+= csqrt downward dbl-64 0x1p+0 0x4p-128 : 0x1p+0 0x1.fffffffffffffp-128 : inexact-ok
+= csqrt tonearest dbl-64 0x1p+0 0x4p-128 : 0x1p+0 0x2p-128 : inexact-ok
+= csqrt towardzero dbl-64 0x1p+0 0x4p-128 : 0x1p+0 0x1.fffffffffffffp-128 : inexact-ok
+= csqrt upward dbl-64 0x1p+0 0x4p-128 : 0x1.0000000000001p+0 0x2p-128 : inexact-ok
+= csqrt downward ldbl-96-intel 0x1p+0L 0x4p-128L : 0x1p+0L 0x1.fffffffffffffffep-128L : inexact-ok
+= csqrt tonearest ldbl-96-intel 0x1p+0L 0x4p-128L : 0x1p+0L 0x2p-128L : inexact-ok
+= csqrt towardzero ldbl-96-intel 0x1p+0L 0x4p-128L : 0x1p+0L 0x1.fffffffffffffffep-128L : inexact-ok
+= csqrt upward ldbl-96-intel 0x1p+0L 0x4p-128L : 0x1.0000000000000002p+0L 0x2p-128L : inexact-ok
+= csqrt downward ldbl-96-m68k 0x1p+0L 0x4p-128L : 0x1p+0L 0x1.fffffffffffffffep-128L : inexact-ok
+= csqrt tonearest ldbl-96-m68k 0x1p+0L 0x4p-128L : 0x1p+0L 0x2p-128L : inexact-ok
+= csqrt towardzero ldbl-96-m68k 0x1p+0L 0x4p-128L : 0x1p+0L 0x1.fffffffffffffffep-128L : inexact-ok
+= csqrt upward ldbl-96-m68k 0x1p+0L 0x4p-128L : 0x1.0000000000000002p+0L 0x2p-128L : inexact-ok
+= csqrt downward ldbl-128 0x1p+0L 0x4p-128L : 0x1p+0L 0x1.ffffffffffffffffffffffffffffp-128L : inexact-ok
+= csqrt tonearest ldbl-128 0x1p+0L 0x4p-128L : 0x1p+0L 0x2p-128L : inexact-ok
+= csqrt towardzero ldbl-128 0x1p+0L 0x4p-128L : 0x1p+0L 0x1.ffffffffffffffffffffffffffffp-128L : inexact-ok
+= csqrt upward ldbl-128 0x1p+0L 0x4p-128L : 0x1.0000000000000000000000000001p+0L 0x2p-128L : inexact-ok
+= csqrt downward ldbl-128ibm 0x1p+0L 0x4p-128L : 0x1p+0L 0x1.ffffffffffffffffffffffffff8p-128L : inexact-ok
+= csqrt tonearest ldbl-128ibm 0x1p+0L 0x4p-128L : 0x1p+0L 0x2p-128L : inexact-ok
+= csqrt towardzero ldbl-128ibm 0x1p+0L 0x4p-128L : 0x1p+0L 0x1.ffffffffffffffffffffffffff8p-128L : inexact-ok
+= csqrt upward ldbl-128ibm 0x1p+0L 0x4p-128L : 0x1.000000000000000000000000008p+0L 0x2p-128L : inexact-ok
+= csqrt downward dbl-64 0x1p+0 0x4p-1024 : 0x1p+0 0x1.ffffffffffffcp-1024 : inexact-ok underflow errno-erange-ok
+= csqrt tonearest dbl-64 0x1p+0 0x4p-1024 : 0x1p+0 0x2p-1024 : inexact-ok underflow errno-erange-ok
+= csqrt towardzero dbl-64 0x1p+0 0x4p-1024 : 0x1p+0 0x1.ffffffffffffcp-1024 : inexact-ok underflow errno-erange-ok
+= csqrt upward dbl-64 0x1p+0 0x4p-1024 : 0x1.0000000000001p+0 0x2p-1024 : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel 0x1p+0L 0x4p-1024L : 0x1p+0L 0x1.fffffffffffffffep-1024L : inexact-ok
+= csqrt tonearest ldbl-96-intel 0x1p+0L 0x4p-1024L : 0x1p+0L 0x2p-1024L : inexact-ok
+= csqrt towardzero ldbl-96-intel 0x1p+0L 0x4p-1024L : 0x1p+0L 0x1.fffffffffffffffep-1024L : inexact-ok
+= csqrt upward ldbl-96-intel 0x1p+0L 0x4p-1024L : 0x1.0000000000000002p+0L 0x2p-1024L : inexact-ok
+= csqrt downward ldbl-96-m68k 0x1p+0L 0x4p-1024L : 0x1p+0L 0x1.fffffffffffffffep-1024L : inexact-ok
+= csqrt tonearest ldbl-96-m68k 0x1p+0L 0x4p-1024L : 0x1p+0L 0x2p-1024L : inexact-ok
+= csqrt towardzero ldbl-96-m68k 0x1p+0L 0x4p-1024L : 0x1p+0L 0x1.fffffffffffffffep-1024L : inexact-ok
+= csqrt upward ldbl-96-m68k 0x1p+0L 0x4p-1024L : 0x1.0000000000000002p+0L 0x2p-1024L : inexact-ok
+= csqrt downward ldbl-128 0x1p+0L 0x4p-1024L : 0x1p+0L 0x1.ffffffffffffffffffffffffffffp-1024L : inexact-ok
+= csqrt tonearest ldbl-128 0x1p+0L 0x4p-1024L : 0x1p+0L 0x2p-1024L : inexact-ok
+= csqrt towardzero ldbl-128 0x1p+0L 0x4p-1024L : 0x1p+0L 0x1.ffffffffffffffffffffffffffffp-1024L : inexact-ok
+= csqrt upward ldbl-128 0x1p+0L 0x4p-1024L : 0x1.0000000000000000000000000001p+0L 0x2p-1024L : inexact-ok
+= csqrt downward ldbl-128ibm 0x1p+0L 0x4p-1024L : 0x1p+0L 0x1.ffffffffffffcp-1024L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128ibm 0x1p+0L 0x4p-1024L : 0x1p+0L 0x2p-1024L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128ibm 0x1p+0L 0x4p-1024L : 0x1p+0L 0x1.ffffffffffffcp-1024L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128ibm 0x1p+0L 0x4p-1024L : 0x1.000000000000000000000000008p+0L 0x2p-1024L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel 0x1p+0L 0x4p-16384L : 0x1p+0L 0x1.fffffffffffffff8p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-intel 0x1p+0L 0x4p-16384L : 0x1p+0L 0x2p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-intel 0x1p+0L 0x4p-16384L : 0x1p+0L 0x1.fffffffffffffff8p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-intel 0x1p+0L 0x4p-16384L : 0x1.0000000000000002p+0L 0x2p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-m68k 0x1p+0L 0x4p-16384L : 0x1p+0L 0x1.fffffffffffffffcp-16384L : inexact-ok underflow-ok errno-erange-ok
+= csqrt tonearest ldbl-96-m68k 0x1p+0L 0x4p-16384L : 0x1p+0L 0x2p-16384L : inexact-ok underflow-ok errno-erange-ok
+= csqrt towardzero ldbl-96-m68k 0x1p+0L 0x4p-16384L : 0x1p+0L 0x1.fffffffffffffffcp-16384L : inexact-ok underflow-ok errno-erange-ok
+= csqrt upward ldbl-96-m68k 0x1p+0L 0x4p-16384L : 0x1.0000000000000002p+0L 0x2p-16384L : inexact-ok underflow-ok errno-erange-ok
+= csqrt downward ldbl-128 0x1p+0L 0x4p-16384L : 0x1p+0L 0x1.fffffffffffffffffffffffffffcp-16384L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128 0x1p+0L 0x4p-16384L : 0x1p+0L 0x2p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128 0x1p+0L 0x4p-16384L : 0x1p+0L 0x1.fffffffffffffffffffffffffffcp-16384L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128 0x1p+0L 0x4p-16384L : 0x1.0000000000000000000000000001p+0L 0x2p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel 0x1p+0L 0x2p-16384L : 0x1p+0L 0xf.ffffffffffffff8p-16388L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-intel 0x1p+0L 0x2p-16384L : 0x1p+0L 0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-intel 0x1p+0L 0x2p-16384L : 0x1p+0L 0xf.ffffffffffffff8p-16388L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-intel 0x1p+0L 0x2p-16384L : 0x1.0000000000000002p+0L 0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-m68k 0x1p+0L 0x2p-16384L : 0x1p+0L 0xf.ffffffffffffffcp-16388L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-m68k 0x1p+0L 0x2p-16384L : 0x1p+0L 0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-m68k 0x1p+0L 0x2p-16384L : 0x1p+0L 0xf.ffffffffffffffcp-16388L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-m68k 0x1p+0L 0x2p-16384L : 0x1.0000000000000002p+0L 0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-128 0x1p+0L 0x2p-16384L : 0x1p+0L 0xf.ffffffffffffffffffffffffffcp-16388L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128 0x1p+0L 0x2p-16384L : 0x1p+0L 0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128 0x1p+0L 0x2p-16384L : 0x1p+0L 0xf.ffffffffffffffffffffffffffcp-16388L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128 0x1p+0L 0x2p-16384L : 0x1.0000000000000000000000000001p+0L 0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt downward dbl-64 0x1p+0 0x8p-972 : 0x1p+0 0x3.ffffffffffffep-972 : inexact-ok
+= csqrt tonearest dbl-64 0x1p+0 0x8p-972 : 0x1p+0 0x4p-972 : inexact-ok
+= csqrt towardzero dbl-64 0x1p+0 0x8p-972 : 0x1p+0 0x3.ffffffffffffep-972 : inexact-ok
+= csqrt upward dbl-64 0x1p+0 0x8p-972 : 0x1.0000000000001p+0 0x4p-972 : inexact-ok
+= csqrt downward ldbl-96-intel 0x1p+0L 0x8p-972L : 0x1p+0L 0x3.fffffffffffffffcp-972L : inexact-ok
+= csqrt tonearest ldbl-96-intel 0x1p+0L 0x8p-972L : 0x1p+0L 0x4p-972L : inexact-ok
+= csqrt towardzero ldbl-96-intel 0x1p+0L 0x8p-972L : 0x1p+0L 0x3.fffffffffffffffcp-972L : inexact-ok
+= csqrt upward ldbl-96-intel 0x1p+0L 0x8p-972L : 0x1.0000000000000002p+0L 0x4p-972L : inexact-ok
+= csqrt downward ldbl-96-m68k 0x1p+0L 0x8p-972L : 0x1p+0L 0x3.fffffffffffffffcp-972L : inexact-ok
+= csqrt tonearest ldbl-96-m68k 0x1p+0L 0x8p-972L : 0x1p+0L 0x4p-972L : inexact-ok
+= csqrt towardzero ldbl-96-m68k 0x1p+0L 0x8p-972L : 0x1p+0L 0x3.fffffffffffffffcp-972L : inexact-ok
+= csqrt upward ldbl-96-m68k 0x1p+0L 0x8p-972L : 0x1.0000000000000002p+0L 0x4p-972L : inexact-ok
+= csqrt downward ldbl-128 0x1p+0L 0x8p-972L : 0x1p+0L 0x3.fffffffffffffffffffffffffffep-972L : inexact-ok
+= csqrt tonearest ldbl-128 0x1p+0L 0x8p-972L : 0x1p+0L 0x4p-972L : inexact-ok
+= csqrt towardzero ldbl-128 0x1p+0L 0x8p-972L : 0x1p+0L 0x3.fffffffffffffffffffffffffffep-972L : inexact-ok
+= csqrt upward ldbl-128 0x1p+0L 0x8p-972L : 0x1.0000000000000000000000000001p+0L 0x4p-972L : inexact-ok
+= csqrt downward ldbl-128ibm 0x1p+0L 0x8p-972L : 0x1p+0L 0x3.fffffffffffffffffffffffffcp-972L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128ibm 0x1p+0L 0x8p-972L : 0x1p+0L 0x4p-972L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128ibm 0x1p+0L 0x8p-972L : 0x1p+0L 0x3.fffffffffffffffffffffffffcp-972L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128ibm 0x1p+0L 0x8p-972L : 0x1.000000000000000000000000008p+0L 0x4p-972L : inexact-ok underflow errno-erange-ok
+csqrt 1 -min
+= csqrt downward flt-32 0x1p+0f -0x4p-128f : 0x1p+0f -0x2p-128f : inexact-ok underflow errno-erange-ok
+= csqrt tonearest flt-32 0x1p+0f -0x4p-128f : 0x1p+0f -0x2p-128f : inexact-ok underflow errno-erange-ok
+= csqrt towardzero flt-32 0x1p+0f -0x4p-128f : 0x1p+0f -0x1.fffff8p-128f : inexact-ok underflow errno-erange-ok
+= csqrt upward flt-32 0x1p+0f -0x4p-128f : 0x1.000002p+0f -0x1.fffff8p-128f : inexact-ok underflow errno-erange-ok
+= csqrt downward dbl-64 0x1p+0 -0x4p-128 : 0x1p+0 -0x2p-128 : inexact-ok
+= csqrt tonearest dbl-64 0x1p+0 -0x4p-128 : 0x1p+0 -0x2p-128 : inexact-ok
+= csqrt towardzero dbl-64 0x1p+0 -0x4p-128 : 0x1p+0 -0x1.fffffffffffffp-128 : inexact-ok
+= csqrt upward dbl-64 0x1p+0 -0x4p-128 : 0x1.0000000000001p+0 -0x1.fffffffffffffp-128 : inexact-ok
+= csqrt downward ldbl-96-intel 0x1p+0L -0x4p-128L : 0x1p+0L -0x2p-128L : inexact-ok
+= csqrt tonearest ldbl-96-intel 0x1p+0L -0x4p-128L : 0x1p+0L -0x2p-128L : inexact-ok
+= csqrt towardzero ldbl-96-intel 0x1p+0L -0x4p-128L : 0x1p+0L -0x1.fffffffffffffffep-128L : inexact-ok
+= csqrt upward ldbl-96-intel 0x1p+0L -0x4p-128L : 0x1.0000000000000002p+0L -0x1.fffffffffffffffep-128L : inexact-ok
+= csqrt downward ldbl-96-m68k 0x1p+0L -0x4p-128L : 0x1p+0L -0x2p-128L : inexact-ok
+= csqrt tonearest ldbl-96-m68k 0x1p+0L -0x4p-128L : 0x1p+0L -0x2p-128L : inexact-ok
+= csqrt towardzero ldbl-96-m68k 0x1p+0L -0x4p-128L : 0x1p+0L -0x1.fffffffffffffffep-128L : inexact-ok
+= csqrt upward ldbl-96-m68k 0x1p+0L -0x4p-128L : 0x1.0000000000000002p+0L -0x1.fffffffffffffffep-128L : inexact-ok
+= csqrt downward ldbl-128 0x1p+0L -0x4p-128L : 0x1p+0L -0x2p-128L : inexact-ok
+= csqrt tonearest ldbl-128 0x1p+0L -0x4p-128L : 0x1p+0L -0x2p-128L : inexact-ok
+= csqrt towardzero ldbl-128 0x1p+0L -0x4p-128L : 0x1p+0L -0x1.ffffffffffffffffffffffffffffp-128L : inexact-ok
+= csqrt upward ldbl-128 0x1p+0L -0x4p-128L : 0x1.0000000000000000000000000001p+0L -0x1.ffffffffffffffffffffffffffffp-128L : inexact-ok
+= csqrt downward ldbl-128ibm 0x1p+0L -0x4p-128L : 0x1p+0L -0x2p-128L : inexact-ok
+= csqrt tonearest ldbl-128ibm 0x1p+0L -0x4p-128L : 0x1p+0L -0x2p-128L : inexact-ok
+= csqrt towardzero ldbl-128ibm 0x1p+0L -0x4p-128L : 0x1p+0L -0x1.ffffffffffffffffffffffffff8p-128L : inexact-ok
+= csqrt upward ldbl-128ibm 0x1p+0L -0x4p-128L : 0x1.000000000000000000000000008p+0L -0x1.ffffffffffffffffffffffffff8p-128L : inexact-ok
+= csqrt downward dbl-64 0x1p+0 -0x4p-1024 : 0x1p+0 -0x2p-1024 : inexact-ok underflow errno-erange-ok
+= csqrt tonearest dbl-64 0x1p+0 -0x4p-1024 : 0x1p+0 -0x2p-1024 : inexact-ok underflow errno-erange-ok
+= csqrt towardzero dbl-64 0x1p+0 -0x4p-1024 : 0x1p+0 -0x1.ffffffffffffcp-1024 : inexact-ok underflow errno-erange-ok
+= csqrt upward dbl-64 0x1p+0 -0x4p-1024 : 0x1.0000000000001p+0 -0x1.ffffffffffffcp-1024 : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel 0x1p+0L -0x4p-1024L : 0x1p+0L -0x2p-1024L : inexact-ok
+= csqrt tonearest ldbl-96-intel 0x1p+0L -0x4p-1024L : 0x1p+0L -0x2p-1024L : inexact-ok
+= csqrt towardzero ldbl-96-intel 0x1p+0L -0x4p-1024L : 0x1p+0L -0x1.fffffffffffffffep-1024L : inexact-ok
+= csqrt upward ldbl-96-intel 0x1p+0L -0x4p-1024L : 0x1.0000000000000002p+0L -0x1.fffffffffffffffep-1024L : inexact-ok
+= csqrt downward ldbl-96-m68k 0x1p+0L -0x4p-1024L : 0x1p+0L -0x2p-1024L : inexact-ok
+= csqrt tonearest ldbl-96-m68k 0x1p+0L -0x4p-1024L : 0x1p+0L -0x2p-1024L : inexact-ok
+= csqrt towardzero ldbl-96-m68k 0x1p+0L -0x4p-1024L : 0x1p+0L -0x1.fffffffffffffffep-1024L : inexact-ok
+= csqrt upward ldbl-96-m68k 0x1p+0L -0x4p-1024L : 0x1.0000000000000002p+0L -0x1.fffffffffffffffep-1024L : inexact-ok
+= csqrt downward ldbl-128 0x1p+0L -0x4p-1024L : 0x1p+0L -0x2p-1024L : inexact-ok
+= csqrt tonearest ldbl-128 0x1p+0L -0x4p-1024L : 0x1p+0L -0x2p-1024L : inexact-ok
+= csqrt towardzero ldbl-128 0x1p+0L -0x4p-1024L : 0x1p+0L -0x1.ffffffffffffffffffffffffffffp-1024L : inexact-ok
+= csqrt upward ldbl-128 0x1p+0L -0x4p-1024L : 0x1.0000000000000000000000000001p+0L -0x1.ffffffffffffffffffffffffffffp-1024L : inexact-ok
+= csqrt downward ldbl-128ibm 0x1p+0L -0x4p-1024L : 0x1p+0L -0x2p-1024L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128ibm 0x1p+0L -0x4p-1024L : 0x1p+0L -0x2p-1024L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128ibm 0x1p+0L -0x4p-1024L : 0x1p+0L -0x1.ffffffffffffcp-1024L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128ibm 0x1p+0L -0x4p-1024L : 0x1.000000000000000000000000008p+0L -0x1.ffffffffffffcp-1024L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel 0x1p+0L -0x4p-16384L : 0x1p+0L -0x2p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-intel 0x1p+0L -0x4p-16384L : 0x1p+0L -0x2p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-intel 0x1p+0L -0x4p-16384L : 0x1p+0L -0x1.fffffffffffffff8p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-intel 0x1p+0L -0x4p-16384L : 0x1.0000000000000002p+0L -0x1.fffffffffffffff8p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-m68k 0x1p+0L -0x4p-16384L : 0x1p+0L -0x2p-16384L : inexact-ok underflow-ok errno-erange-ok
+= csqrt tonearest ldbl-96-m68k 0x1p+0L -0x4p-16384L : 0x1p+0L -0x2p-16384L : inexact-ok underflow-ok errno-erange-ok
+= csqrt towardzero ldbl-96-m68k 0x1p+0L -0x4p-16384L : 0x1p+0L -0x1.fffffffffffffffcp-16384L : inexact-ok underflow-ok errno-erange-ok
+= csqrt upward ldbl-96-m68k 0x1p+0L -0x4p-16384L : 0x1.0000000000000002p+0L -0x1.fffffffffffffffcp-16384L : inexact-ok underflow-ok errno-erange-ok
+= csqrt downward ldbl-128 0x1p+0L -0x4p-16384L : 0x1p+0L -0x2p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128 0x1p+0L -0x4p-16384L : 0x1p+0L -0x2p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128 0x1p+0L -0x4p-16384L : 0x1p+0L -0x1.fffffffffffffffffffffffffffcp-16384L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128 0x1p+0L -0x4p-16384L : 0x1.0000000000000000000000000001p+0L -0x1.fffffffffffffffffffffffffffcp-16384L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel 0x1p+0L -0x2p-16384L : 0x1p+0L -0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-intel 0x1p+0L -0x2p-16384L : 0x1p+0L -0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-intel 0x1p+0L -0x2p-16384L : 0x1p+0L -0xf.ffffffffffffff8p-16388L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-intel 0x1p+0L -0x2p-16384L : 0x1.0000000000000002p+0L -0xf.ffffffffffffff8p-16388L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-m68k 0x1p+0L -0x2p-16384L : 0x1p+0L -0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-m68k 0x1p+0L -0x2p-16384L : 0x1p+0L -0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-m68k 0x1p+0L -0x2p-16384L : 0x1p+0L -0xf.ffffffffffffffcp-16388L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-m68k 0x1p+0L -0x2p-16384L : 0x1.0000000000000002p+0L -0xf.ffffffffffffffcp-16388L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-128 0x1p+0L -0x2p-16384L : 0x1p+0L -0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128 0x1p+0L -0x2p-16384L : 0x1p+0L -0x1p-16384L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128 0x1p+0L -0x2p-16384L : 0x1p+0L -0xf.ffffffffffffffffffffffffffcp-16388L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128 0x1p+0L -0x2p-16384L : 0x1.0000000000000000000000000001p+0L -0xf.ffffffffffffffffffffffffffcp-16388L : inexact-ok underflow errno-erange-ok
+= csqrt downward dbl-64 0x1p+0 -0x8p-972 : 0x1p+0 -0x4p-972 : inexact-ok
+= csqrt tonearest dbl-64 0x1p+0 -0x8p-972 : 0x1p+0 -0x4p-972 : inexact-ok
+= csqrt towardzero dbl-64 0x1p+0 -0x8p-972 : 0x1p+0 -0x3.ffffffffffffep-972 : inexact-ok
+= csqrt upward dbl-64 0x1p+0 -0x8p-972 : 0x1.0000000000001p+0 -0x3.ffffffffffffep-972 : inexact-ok
+= csqrt downward ldbl-96-intel 0x1p+0L -0x8p-972L : 0x1p+0L -0x4p-972L : inexact-ok
+= csqrt tonearest ldbl-96-intel 0x1p+0L -0x8p-972L : 0x1p+0L -0x4p-972L : inexact-ok
+= csqrt towardzero ldbl-96-intel 0x1p+0L -0x8p-972L : 0x1p+0L -0x3.fffffffffffffffcp-972L : inexact-ok
+= csqrt upward ldbl-96-intel 0x1p+0L -0x8p-972L : 0x1.0000000000000002p+0L -0x3.fffffffffffffffcp-972L : inexact-ok
+= csqrt downward ldbl-96-m68k 0x1p+0L -0x8p-972L : 0x1p+0L -0x4p-972L : inexact-ok
+= csqrt tonearest ldbl-96-m68k 0x1p+0L -0x8p-972L : 0x1p+0L -0x4p-972L : inexact-ok
+= csqrt towardzero ldbl-96-m68k 0x1p+0L -0x8p-972L : 0x1p+0L -0x3.fffffffffffffffcp-972L : inexact-ok
+= csqrt upward ldbl-96-m68k 0x1p+0L -0x8p-972L : 0x1.0000000000000002p+0L -0x3.fffffffffffffffcp-972L : inexact-ok
+= csqrt downward ldbl-128 0x1p+0L -0x8p-972L : 0x1p+0L -0x4p-972L : inexact-ok
+= csqrt tonearest ldbl-128 0x1p+0L -0x8p-972L : 0x1p+0L -0x4p-972L : inexact-ok
+= csqrt towardzero ldbl-128 0x1p+0L -0x8p-972L : 0x1p+0L -0x3.fffffffffffffffffffffffffffep-972L : inexact-ok
+= csqrt upward ldbl-128 0x1p+0L -0x8p-972L : 0x1.0000000000000000000000000001p+0L -0x3.fffffffffffffffffffffffffffep-972L : inexact-ok
+= csqrt downward ldbl-128ibm 0x1p+0L -0x8p-972L : 0x1p+0L -0x4p-972L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128ibm 0x1p+0L -0x8p-972L : 0x1p+0L -0x4p-972L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128ibm 0x1p+0L -0x8p-972L : 0x1p+0L -0x3.fffffffffffffffffffffffffcp-972L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128ibm 0x1p+0L -0x8p-972L : 0x1.000000000000000000000000008p+0L -0x3.fffffffffffffffffffffffffcp-972L : inexact-ok underflow errno-erange-ok
+csqrt -1 min
+= csqrt downward flt-32 -0x1p+0f 0x4p-128f : 0x1.fffff8p-128f 0x1p+0f : inexact-ok underflow errno-erange-ok
+= csqrt tonearest flt-32 -0x1p+0f 0x4p-128f : 0x2p-128f 0x1p+0f : inexact-ok underflow errno-erange-ok
+= csqrt towardzero flt-32 -0x1p+0f 0x4p-128f : 0x1.fffff8p-128f 0x1p+0f : inexact-ok underflow errno-erange-ok
+= csqrt upward flt-32 -0x1p+0f 0x4p-128f : 0x2p-128f 0x1.000002p+0f : inexact-ok underflow errno-erange-ok
+= csqrt downward dbl-64 -0x1p+0 0x4p-128 : 0x1.fffffffffffffp-128 0x1p+0 : inexact-ok
+= csqrt tonearest dbl-64 -0x1p+0 0x4p-128 : 0x2p-128 0x1p+0 : inexact-ok
+= csqrt towardzero dbl-64 -0x1p+0 0x4p-128 : 0x1.fffffffffffffp-128 0x1p+0 : inexact-ok
+= csqrt upward dbl-64 -0x1p+0 0x4p-128 : 0x2p-128 0x1.0000000000001p+0 : inexact-ok
+= csqrt downward ldbl-96-intel -0x1p+0L 0x4p-128L : 0x1.fffffffffffffffep-128L 0x1p+0L : inexact-ok
+= csqrt tonearest ldbl-96-intel -0x1p+0L 0x4p-128L : 0x2p-128L 0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-intel -0x1p+0L 0x4p-128L : 0x1.fffffffffffffffep-128L 0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-intel -0x1p+0L 0x4p-128L : 0x2p-128L 0x1.0000000000000002p+0L : inexact-ok
+= csqrt downward ldbl-96-m68k -0x1p+0L 0x4p-128L : 0x1.fffffffffffffffep-128L 0x1p+0L : inexact-ok
+= csqrt tonearest ldbl-96-m68k -0x1p+0L 0x4p-128L : 0x2p-128L 0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-m68k -0x1p+0L 0x4p-128L : 0x1.fffffffffffffffep-128L 0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-m68k -0x1p+0L 0x4p-128L : 0x2p-128L 0x1.0000000000000002p+0L : inexact-ok
+= csqrt downward ldbl-128 -0x1p+0L 0x4p-128L : 0x1.ffffffffffffffffffffffffffffp-128L 0x1p+0L : inexact-ok
+= csqrt tonearest ldbl-128 -0x1p+0L 0x4p-128L : 0x2p-128L 0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-128 -0x1p+0L 0x4p-128L : 0x1.ffffffffffffffffffffffffffffp-128L 0x1p+0L : inexact-ok
+= csqrt upward ldbl-128 -0x1p+0L 0x4p-128L : 0x2p-128L 0x1.0000000000000000000000000001p+0L : inexact-ok
+= csqrt downward ldbl-128ibm -0x1p+0L 0x4p-128L : 0x1.ffffffffffffffffffffffffff8p-128L 0x1p+0L : inexact-ok
+= csqrt tonearest ldbl-128ibm -0x1p+0L 0x4p-128L : 0x2p-128L 0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-128ibm -0x1p+0L 0x4p-128L : 0x1.ffffffffffffffffffffffffff8p-128L 0x1p+0L : inexact-ok
+= csqrt upward ldbl-128ibm -0x1p+0L 0x4p-128L : 0x2p-128L 0x1.000000000000000000000000008p+0L : inexact-ok
+= csqrt downward dbl-64 -0x1p+0 0x4p-1024 : 0x1.ffffffffffffcp-1024 0x1p+0 : inexact-ok underflow errno-erange-ok
+= csqrt tonearest dbl-64 -0x1p+0 0x4p-1024 : 0x2p-1024 0x1p+0 : inexact-ok underflow errno-erange-ok
+= csqrt towardzero dbl-64 -0x1p+0 0x4p-1024 : 0x1.ffffffffffffcp-1024 0x1p+0 : inexact-ok underflow errno-erange-ok
+= csqrt upward dbl-64 -0x1p+0 0x4p-1024 : 0x2p-1024 0x1.0000000000001p+0 : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel -0x1p+0L 0x4p-1024L : 0x1.fffffffffffffffep-1024L 0x1p+0L : inexact-ok
+= csqrt tonearest ldbl-96-intel -0x1p+0L 0x4p-1024L : 0x2p-1024L 0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-intel -0x1p+0L 0x4p-1024L : 0x1.fffffffffffffffep-1024L 0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-intel -0x1p+0L 0x4p-1024L : 0x2p-1024L 0x1.0000000000000002p+0L : inexact-ok
+= csqrt downward ldbl-96-m68k -0x1p+0L 0x4p-1024L : 0x1.fffffffffffffffep-1024L 0x1p+0L : inexact-ok
+= csqrt tonearest ldbl-96-m68k -0x1p+0L 0x4p-1024L : 0x2p-1024L 0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-m68k -0x1p+0L 0x4p-1024L : 0x1.fffffffffffffffep-1024L 0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-m68k -0x1p+0L 0x4p-1024L : 0x2p-1024L 0x1.0000000000000002p+0L : inexact-ok
+= csqrt downward ldbl-128 -0x1p+0L 0x4p-1024L : 0x1.ffffffffffffffffffffffffffffp-1024L 0x1p+0L : inexact-ok
+= csqrt tonearest ldbl-128 -0x1p+0L 0x4p-1024L : 0x2p-1024L 0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-128 -0x1p+0L 0x4p-1024L : 0x1.ffffffffffffffffffffffffffffp-1024L 0x1p+0L : inexact-ok
+= csqrt upward ldbl-128 -0x1p+0L 0x4p-1024L : 0x2p-1024L 0x1.0000000000000000000000000001p+0L : inexact-ok
+= csqrt downward ldbl-128ibm -0x1p+0L 0x4p-1024L : 0x1.ffffffffffffcp-1024L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128ibm -0x1p+0L 0x4p-1024L : 0x2p-1024L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128ibm -0x1p+0L 0x4p-1024L : 0x1.ffffffffffffcp-1024L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128ibm -0x1p+0L 0x4p-1024L : 0x2p-1024L 0x1.000000000000000000000000008p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel -0x1p+0L 0x4p-16384L : 0x1.fffffffffffffff8p-16384L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-intel -0x1p+0L 0x4p-16384L : 0x2p-16384L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-intel -0x1p+0L 0x4p-16384L : 0x1.fffffffffffffff8p-16384L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-intel -0x1p+0L 0x4p-16384L : 0x2p-16384L 0x1.0000000000000002p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-m68k -0x1p+0L 0x4p-16384L : 0x1.fffffffffffffffcp-16384L 0x1p+0L : inexact-ok underflow-ok errno-erange-ok
+= csqrt tonearest ldbl-96-m68k -0x1p+0L 0x4p-16384L : 0x2p-16384L 0x1p+0L : inexact-ok underflow-ok errno-erange-ok
+= csqrt towardzero ldbl-96-m68k -0x1p+0L 0x4p-16384L : 0x1.fffffffffffffffcp-16384L 0x1p+0L : inexact-ok underflow-ok errno-erange-ok
+= csqrt upward ldbl-96-m68k -0x1p+0L 0x4p-16384L : 0x2p-16384L 0x1.0000000000000002p+0L : inexact-ok underflow-ok errno-erange-ok
+= csqrt downward ldbl-128 -0x1p+0L 0x4p-16384L : 0x1.fffffffffffffffffffffffffffcp-16384L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128 -0x1p+0L 0x4p-16384L : 0x2p-16384L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128 -0x1p+0L 0x4p-16384L : 0x1.fffffffffffffffffffffffffffcp-16384L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128 -0x1p+0L 0x4p-16384L : 0x2p-16384L 0x1.0000000000000000000000000001p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel -0x1p+0L 0x2p-16384L : 0xf.ffffffffffffff8p-16388L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-intel -0x1p+0L 0x2p-16384L : 0x1p-16384L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-intel -0x1p+0L 0x2p-16384L : 0xf.ffffffffffffff8p-16388L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-intel -0x1p+0L 0x2p-16384L : 0x1p-16384L 0x1.0000000000000002p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-m68k -0x1p+0L 0x2p-16384L : 0xf.ffffffffffffffcp-16388L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-m68k -0x1p+0L 0x2p-16384L : 0x1p-16384L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-m68k -0x1p+0L 0x2p-16384L : 0xf.ffffffffffffffcp-16388L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-m68k -0x1p+0L 0x2p-16384L : 0x1p-16384L 0x1.0000000000000002p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-128 -0x1p+0L 0x2p-16384L : 0xf.ffffffffffffffffffffffffffcp-16388L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128 -0x1p+0L 0x2p-16384L : 0x1p-16384L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128 -0x1p+0L 0x2p-16384L : 0xf.ffffffffffffffffffffffffffcp-16388L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128 -0x1p+0L 0x2p-16384L : 0x1p-16384L 0x1.0000000000000000000000000001p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward dbl-64 -0x1p+0 0x8p-972 : 0x3.ffffffffffffep-972 0x1p+0 : inexact-ok
+= csqrt tonearest dbl-64 -0x1p+0 0x8p-972 : 0x4p-972 0x1p+0 : inexact-ok
+= csqrt towardzero dbl-64 -0x1p+0 0x8p-972 : 0x3.ffffffffffffep-972 0x1p+0 : inexact-ok
+= csqrt upward dbl-64 -0x1p+0 0x8p-972 : 0x4p-972 0x1.0000000000001p+0 : inexact-ok
+= csqrt downward ldbl-96-intel -0x1p+0L 0x8p-972L : 0x3.fffffffffffffffcp-972L 0x1p+0L : inexact-ok
+= csqrt tonearest ldbl-96-intel -0x1p+0L 0x8p-972L : 0x4p-972L 0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-intel -0x1p+0L 0x8p-972L : 0x3.fffffffffffffffcp-972L 0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-intel -0x1p+0L 0x8p-972L : 0x4p-972L 0x1.0000000000000002p+0L : inexact-ok
+= csqrt downward ldbl-96-m68k -0x1p+0L 0x8p-972L : 0x3.fffffffffffffffcp-972L 0x1p+0L : inexact-ok
+= csqrt tonearest ldbl-96-m68k -0x1p+0L 0x8p-972L : 0x4p-972L 0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-m68k -0x1p+0L 0x8p-972L : 0x3.fffffffffffffffcp-972L 0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-m68k -0x1p+0L 0x8p-972L : 0x4p-972L 0x1.0000000000000002p+0L : inexact-ok
+= csqrt downward ldbl-128 -0x1p+0L 0x8p-972L : 0x3.fffffffffffffffffffffffffffep-972L 0x1p+0L : inexact-ok
+= csqrt tonearest ldbl-128 -0x1p+0L 0x8p-972L : 0x4p-972L 0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-128 -0x1p+0L 0x8p-972L : 0x3.fffffffffffffffffffffffffffep-972L 0x1p+0L : inexact-ok
+= csqrt upward ldbl-128 -0x1p+0L 0x8p-972L : 0x4p-972L 0x1.0000000000000000000000000001p+0L : inexact-ok
+= csqrt downward ldbl-128ibm -0x1p+0L 0x8p-972L : 0x3.fffffffffffffffffffffffffcp-972L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128ibm -0x1p+0L 0x8p-972L : 0x4p-972L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128ibm -0x1p+0L 0x8p-972L : 0x3.fffffffffffffffffffffffffcp-972L 0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128ibm -0x1p+0L 0x8p-972L : 0x4p-972L 0x1.000000000000000000000000008p+0L : inexact-ok underflow errno-erange-ok
+csqrt -1 -min
+= csqrt downward flt-32 -0x1p+0f -0x4p-128f : 0x1.fffff8p-128f -0x1.000002p+0f : inexact-ok underflow errno-erange-ok
+= csqrt tonearest flt-32 -0x1p+0f -0x4p-128f : 0x2p-128f -0x1p+0f : inexact-ok underflow errno-erange-ok
+= csqrt towardzero flt-32 -0x1p+0f -0x4p-128f : 0x1.fffff8p-128f -0x1p+0f : inexact-ok underflow errno-erange-ok
+= csqrt upward flt-32 -0x1p+0f -0x4p-128f : 0x2p-128f -0x1p+0f : inexact-ok underflow errno-erange-ok
+= csqrt downward dbl-64 -0x1p+0 -0x4p-128 : 0x1.fffffffffffffp-128 -0x1.0000000000001p+0 : inexact-ok
+= csqrt tonearest dbl-64 -0x1p+0 -0x4p-128 : 0x2p-128 -0x1p+0 : inexact-ok
+= csqrt towardzero dbl-64 -0x1p+0 -0x4p-128 : 0x1.fffffffffffffp-128 -0x1p+0 : inexact-ok
+= csqrt upward dbl-64 -0x1p+0 -0x4p-128 : 0x2p-128 -0x1p+0 : inexact-ok
+= csqrt downward ldbl-96-intel -0x1p+0L -0x4p-128L : 0x1.fffffffffffffffep-128L -0x1.0000000000000002p+0L : inexact-ok
+= csqrt tonearest ldbl-96-intel -0x1p+0L -0x4p-128L : 0x2p-128L -0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-intel -0x1p+0L -0x4p-128L : 0x1.fffffffffffffffep-128L -0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-intel -0x1p+0L -0x4p-128L : 0x2p-128L -0x1p+0L : inexact-ok
+= csqrt downward ldbl-96-m68k -0x1p+0L -0x4p-128L : 0x1.fffffffffffffffep-128L -0x1.0000000000000002p+0L : inexact-ok
+= csqrt tonearest ldbl-96-m68k -0x1p+0L -0x4p-128L : 0x2p-128L -0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-m68k -0x1p+0L -0x4p-128L : 0x1.fffffffffffffffep-128L -0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-m68k -0x1p+0L -0x4p-128L : 0x2p-128L -0x1p+0L : inexact-ok
+= csqrt downward ldbl-128 -0x1p+0L -0x4p-128L : 0x1.ffffffffffffffffffffffffffffp-128L -0x1.0000000000000000000000000001p+0L : inexact-ok
+= csqrt tonearest ldbl-128 -0x1p+0L -0x4p-128L : 0x2p-128L -0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-128 -0x1p+0L -0x4p-128L : 0x1.ffffffffffffffffffffffffffffp-128L -0x1p+0L : inexact-ok
+= csqrt upward ldbl-128 -0x1p+0L -0x4p-128L : 0x2p-128L -0x1p+0L : inexact-ok
+= csqrt downward ldbl-128ibm -0x1p+0L -0x4p-128L : 0x1.ffffffffffffffffffffffffff8p-128L -0x1.000000000000000000000000008p+0L : inexact-ok
+= csqrt tonearest ldbl-128ibm -0x1p+0L -0x4p-128L : 0x2p-128L -0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-128ibm -0x1p+0L -0x4p-128L : 0x1.ffffffffffffffffffffffffff8p-128L -0x1p+0L : inexact-ok
+= csqrt upward ldbl-128ibm -0x1p+0L -0x4p-128L : 0x2p-128L -0x1p+0L : inexact-ok
+= csqrt downward dbl-64 -0x1p+0 -0x4p-1024 : 0x1.ffffffffffffcp-1024 -0x1.0000000000001p+0 : inexact-ok underflow errno-erange-ok
+= csqrt tonearest dbl-64 -0x1p+0 -0x4p-1024 : 0x2p-1024 -0x1p+0 : inexact-ok underflow errno-erange-ok
+= csqrt towardzero dbl-64 -0x1p+0 -0x4p-1024 : 0x1.ffffffffffffcp-1024 -0x1p+0 : inexact-ok underflow errno-erange-ok
+= csqrt upward dbl-64 -0x1p+0 -0x4p-1024 : 0x2p-1024 -0x1p+0 : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel -0x1p+0L -0x4p-1024L : 0x1.fffffffffffffffep-1024L -0x1.0000000000000002p+0L : inexact-ok
+= csqrt tonearest ldbl-96-intel -0x1p+0L -0x4p-1024L : 0x2p-1024L -0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-intel -0x1p+0L -0x4p-1024L : 0x1.fffffffffffffffep-1024L -0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-intel -0x1p+0L -0x4p-1024L : 0x2p-1024L -0x1p+0L : inexact-ok
+= csqrt downward ldbl-96-m68k -0x1p+0L -0x4p-1024L : 0x1.fffffffffffffffep-1024L -0x1.0000000000000002p+0L : inexact-ok
+= csqrt tonearest ldbl-96-m68k -0x1p+0L -0x4p-1024L : 0x2p-1024L -0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-m68k -0x1p+0L -0x4p-1024L : 0x1.fffffffffffffffep-1024L -0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-m68k -0x1p+0L -0x4p-1024L : 0x2p-1024L -0x1p+0L : inexact-ok
+= csqrt downward ldbl-128 -0x1p+0L -0x4p-1024L : 0x1.ffffffffffffffffffffffffffffp-1024L -0x1.0000000000000000000000000001p+0L : inexact-ok
+= csqrt tonearest ldbl-128 -0x1p+0L -0x4p-1024L : 0x2p-1024L -0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-128 -0x1p+0L -0x4p-1024L : 0x1.ffffffffffffffffffffffffffffp-1024L -0x1p+0L : inexact-ok
+= csqrt upward ldbl-128 -0x1p+0L -0x4p-1024L : 0x2p-1024L -0x1p+0L : inexact-ok
+= csqrt downward ldbl-128ibm -0x1p+0L -0x4p-1024L : 0x1.ffffffffffffcp-1024L -0x1.000000000000000000000000008p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128ibm -0x1p+0L -0x4p-1024L : 0x2p-1024L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128ibm -0x1p+0L -0x4p-1024L : 0x1.ffffffffffffcp-1024L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128ibm -0x1p+0L -0x4p-1024L : 0x2p-1024L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel -0x1p+0L -0x4p-16384L : 0x1.fffffffffffffff8p-16384L -0x1.0000000000000002p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-intel -0x1p+0L -0x4p-16384L : 0x2p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-intel -0x1p+0L -0x4p-16384L : 0x1.fffffffffffffff8p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-intel -0x1p+0L -0x4p-16384L : 0x2p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-m68k -0x1p+0L -0x4p-16384L : 0x1.fffffffffffffffcp-16384L -0x1.0000000000000002p+0L : inexact-ok underflow-ok errno-erange-ok
+= csqrt tonearest ldbl-96-m68k -0x1p+0L -0x4p-16384L : 0x2p-16384L -0x1p+0L : inexact-ok underflow-ok errno-erange-ok
+= csqrt towardzero ldbl-96-m68k -0x1p+0L -0x4p-16384L : 0x1.fffffffffffffffcp-16384L -0x1p+0L : inexact-ok underflow-ok errno-erange-ok
+= csqrt upward ldbl-96-m68k -0x1p+0L -0x4p-16384L : 0x2p-16384L -0x1p+0L : inexact-ok underflow-ok errno-erange-ok
+= csqrt downward ldbl-128 -0x1p+0L -0x4p-16384L : 0x1.fffffffffffffffffffffffffffcp-16384L -0x1.0000000000000000000000000001p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128 -0x1p+0L -0x4p-16384L : 0x2p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128 -0x1p+0L -0x4p-16384L : 0x1.fffffffffffffffffffffffffffcp-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128 -0x1p+0L -0x4p-16384L : 0x2p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-intel -0x1p+0L -0x2p-16384L : 0xf.ffffffffffffff8p-16388L -0x1.0000000000000002p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-intel -0x1p+0L -0x2p-16384L : 0x1p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-intel -0x1p+0L -0x2p-16384L : 0xf.ffffffffffffff8p-16388L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-intel -0x1p+0L -0x2p-16384L : 0x1p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-96-m68k -0x1p+0L -0x2p-16384L : 0xf.ffffffffffffffcp-16388L -0x1.0000000000000002p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-96-m68k -0x1p+0L -0x2p-16384L : 0x1p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-96-m68k -0x1p+0L -0x2p-16384L : 0xf.ffffffffffffffcp-16388L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-96-m68k -0x1p+0L -0x2p-16384L : 0x1p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward ldbl-128 -0x1p+0L -0x2p-16384L : 0xf.ffffffffffffffffffffffffffcp-16388L -0x1.0000000000000000000000000001p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128 -0x1p+0L -0x2p-16384L : 0x1p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128 -0x1p+0L -0x2p-16384L : 0xf.ffffffffffffffffffffffffffcp-16388L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128 -0x1p+0L -0x2p-16384L : 0x1p-16384L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt downward dbl-64 -0x1p+0 -0x8p-972 : 0x3.ffffffffffffep-972 -0x1.0000000000001p+0 : inexact-ok
+= csqrt tonearest dbl-64 -0x1p+0 -0x8p-972 : 0x4p-972 -0x1p+0 : inexact-ok
+= csqrt towardzero dbl-64 -0x1p+0 -0x8p-972 : 0x3.ffffffffffffep-972 -0x1p+0 : inexact-ok
+= csqrt upward dbl-64 -0x1p+0 -0x8p-972 : 0x4p-972 -0x1p+0 : inexact-ok
+= csqrt downward ldbl-96-intel -0x1p+0L -0x8p-972L : 0x3.fffffffffffffffcp-972L -0x1.0000000000000002p+0L : inexact-ok
+= csqrt tonearest ldbl-96-intel -0x1p+0L -0x8p-972L : 0x4p-972L -0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-intel -0x1p+0L -0x8p-972L : 0x3.fffffffffffffffcp-972L -0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-intel -0x1p+0L -0x8p-972L : 0x4p-972L -0x1p+0L : inexact-ok
+= csqrt downward ldbl-96-m68k -0x1p+0L -0x8p-972L : 0x3.fffffffffffffffcp-972L -0x1.0000000000000002p+0L : inexact-ok
+= csqrt tonearest ldbl-96-m68k -0x1p+0L -0x8p-972L : 0x4p-972L -0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-96-m68k -0x1p+0L -0x8p-972L : 0x3.fffffffffffffffcp-972L -0x1p+0L : inexact-ok
+= csqrt upward ldbl-96-m68k -0x1p+0L -0x8p-972L : 0x4p-972L -0x1p+0L : inexact-ok
+= csqrt downward ldbl-128 -0x1p+0L -0x8p-972L : 0x3.fffffffffffffffffffffffffffep-972L -0x1.0000000000000000000000000001p+0L : inexact-ok
+= csqrt tonearest ldbl-128 -0x1p+0L -0x8p-972L : 0x4p-972L -0x1p+0L : inexact-ok
+= csqrt towardzero ldbl-128 -0x1p+0L -0x8p-972L : 0x3.fffffffffffffffffffffffffffep-972L -0x1p+0L : inexact-ok
+= csqrt upward ldbl-128 -0x1p+0L -0x8p-972L : 0x4p-972L -0x1p+0L : inexact-ok
+= csqrt downward ldbl-128ibm -0x1p+0L -0x8p-972L : 0x3.fffffffffffffffffffffffffcp-972L -0x1.000000000000000000000000008p+0L : inexact-ok underflow errno-erange-ok
+= csqrt tonearest ldbl-128ibm -0x1p+0L -0x8p-972L : 0x4p-972L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt towardzero ldbl-128ibm -0x1p+0L -0x8p-972L : 0x3.fffffffffffffffffffffffffcp-972L -0x1p+0L : inexact-ok underflow errno-erange-ok
+= csqrt upward ldbl-128ibm -0x1p+0L -0x8p-972L : 0x4p-972L -0x1p+0L : inexact-ok underflow errno-erange-ok
 ctan 0 0
 = ctan downward flt-32 0x0p+0f 0x0p+0f : 0x0p+0f 0x0p+0f : inexact-ok
 = ctan tonearest flt-32 0x0p+0f 0x0p+0f : 0x0p+0f 0x0p+0f : inexact-ok
diff --git a/math/s_csqrt.c b/math/s_csqrt.c
index 068534cd09..b86f53322e 100644
--- a/math/s_csqrt.c
+++ b/math/s_csqrt.c
@@ -148,6 +148,17 @@ __csqrt (__complex__ double x)
 	      s = __scalbn (s, scale);
 	    }
 
+	  if (fabs (r) < DBL_MIN)
+	    {
+	      double force_underflow = r * r;
+	      math_force_eval (force_underflow);
+	    }
+	  if (fabs (s) < DBL_MIN)
+	    {
+	      double force_underflow = s * s;
+	      math_force_eval (force_underflow);
+	    }
+
 	  __real__ res = r;
 	  __imag__ res = __copysign (s, __imag__ x);
 	}
diff --git a/math/s_csqrtf.c b/math/s_csqrtf.c
index f7dc3b1cd1..e433f476c2 100644
--- a/math/s_csqrtf.c
+++ b/math/s_csqrtf.c
@@ -148,6 +148,17 @@ __csqrtf (__complex__ float x)
 	      s = __scalbnf (s, scale);
 	    }
 
+	  if (fabsf (r) < FLT_MIN)
+	    {
+	      float force_underflow = r * r;
+	      math_force_eval (force_underflow);
+	    }
+	  if (fabsf (s) < FLT_MIN)
+	    {
+	      float force_underflow = s * s;
+	      math_force_eval (force_underflow);
+	    }
+
 	  __real__ res = r;
 	  __imag__ res = __copysignf (s, __imag__ x);
 	}
diff --git a/math/s_csqrtl.c b/math/s_csqrtl.c
index a0252e644a..003d614f60 100644
--- a/math/s_csqrtl.c
+++ b/math/s_csqrtl.c
@@ -148,6 +148,17 @@ __csqrtl (__complex__ long double x)
 	      s = __scalbnl (s, scale);
 	    }
 
+	  if (fabsl (r) < LDBL_MIN)
+	    {
+	      long double force_underflow = r * r;
+	      math_force_eval (force_underflow);
+	    }
+	  if (fabsl (s) < LDBL_MIN)
+	    {
+	      long double force_underflow = s * s;
+	      math_force_eval (force_underflow);
+	    }
+
 	  __real__ res = r;
 	  __imag__ res = __copysignl (s, __imag__ x);
 	}
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