about summary refs log tree commit diff
path: root/math
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 /math
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.
Diffstat (limited to 'math')
-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
5 files changed, 394 insertions, 0 deletions
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);
 	}