about summary refs log tree commit diff
path: root/math/auto-libm-test-in
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-08-17 23:02:54 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-08-17 23:02:54 +0000
commit3fb4cfaf1f1e8d58312720c70d224e2050d469fc (patch)
tree8293c35bf217fba00a445ecb077a546aa8992413 /math/auto-libm-test-in
parent1e15a853ed43e9f71cbec6d36e016d31b0d238a1 (diff)
downloadglibc-3fb4cfaf1f1e8d58312720c70d224e2050d469fc.tar.gz
glibc-3fb4cfaf1f1e8d58312720c70d224e2050d469fc.tar.xz
glibc-3fb4cfaf1f1e8d58312720c70d224e2050d469fc.zip
Fix csqrt spurious underflows (bug 18823).
The csqrt functions scale up small arguments to avoid underflows when
calling hypot functions.  However, even when hypot does not underflow,
a subsequent calculation of 0.5 * hypot can underflow.  This patch
duly increases the threshold and scale factor to avoid such underflows
as well.

Tested for x86_64, x86 and mips64.

	[BZ #18823]
	* math/s_csqrt.c (__csqrt): Increase threshold and scale factor
	for scaling up small arguments.
	* 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.
Diffstat (limited to 'math/auto-libm-test-in')
-rw-r--r--math/auto-libm-test-in9
1 files changed, 9 insertions, 0 deletions
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in
index 44803714c9..015041aeb0 100644
--- a/math/auto-libm-test-in
+++ b/math/auto-libm-test-in
@@ -1162,6 +1162,15 @@ csqrt -0x0.ffp1024 0x1.1p-509
 csqrt 0x0.ffp16384 0x1.1p-8189
 csqrt -0x0.ffp16384 0x1.1p-8189
 
+csqrt 0x1p-149 0x1.000002p-126
+csqrt 0x1p-149 0x1.000004p-126
+csqrt 0x1p-1074 0x1.0000000000001p-1022
+csqrt 0x1p-1074 0x1.0000000000002p-1022
+csqrt 0x1p-16445 0x1.0000000000000002p-16382
+csqrt 0x1p-16445 0x1.0000000000000004p-16382
+csqrt 0x1p-16494 0x1.0000000000000000000000000001p-16382
+csqrt 0x1p-16494 0x1.0000000000000000000000000002p-16382
+
 ctan 0 0
 ctan 0 -0
 ctan -0 0