about summary refs log tree commit diff
path: root/math/libm-test.inc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-12-20 21:03:39 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-12-20 21:03:39 +0000
commit31e3a40588f6b215f2583c12ba29ff5cea63d2ef (patch)
tree725953dd081236e773cf669b7d74d6b79557666a /math/libm-test.inc
parent6165840feae41dba93b85d0cfad23f3d226fad30 (diff)
downloadglibc-31e3a40588f6b215f2583c12ba29ff5cea63d2ef.tar.gz
glibc-31e3a40588f6b215f2583c12ba29ff5cea63d2ef.tar.xz
glibc-31e3a40588f6b215f2583c12ba29ff5cea63d2ef.zip
Add more libm-test coverage of [a-c]* real functions.
Various libm functions have inadequate test coverage in libm-test.inc
/ auto-libm-test-in - failing to cover all the usual special cases
(infinities, NaNs, zero, large and small finite values, subnormals) as
well as a reasonable range of ordinary inputs and, where appropriate,
inputs close to the thresholds for underflow and overflow.

This patch improves test coverage for real functions [a-c]* (with the
expectation of adding more coverage for other functions later).

Tested x86_64 and x86 and ulps updated accordingly (and eight glibc
bugs and one C11 DR filed for issues found in the process).

	* math/auto-libm-test-in: Add more tests of acos, acosh, asin,
	asinh, atan, atan2, atanh, cbrt, cos and cosh.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (acosh_test_data): Add more tests.
	(atanh_test_data): Likewise.
	(ceil_test_data): Likewise.
	(copysign_test_data): Likewise.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
Diffstat (limited to 'math/libm-test.inc')
-rw-r--r--math/libm-test.inc30
1 files changed, 30 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index abe12dbe2e..523514943b 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -1727,6 +1727,13 @@ static const struct test_f_f_data acosh_test_data[] =
     TEST_f_f (acosh, qnan_value, qnan_value, NO_INEXACT_EXCEPTION),
 
     /* x < 1:  */
+    TEST_f_f (acosh, 0.75L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_f_f (acosh, min_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_f_f (acosh, min_subnorm_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_f_f (acosh, plus_zero, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_f_f (acosh, minus_zero, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_f_f (acosh, -min_subnorm_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_f_f (acosh, -min_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
     TEST_f_f (acosh, -1.125L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
     TEST_f_f (acosh, -max_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
 
@@ -1866,6 +1873,8 @@ static const struct test_f_f_data atanh_test_data[] =
     TEST_f_f (atanh, -1.125L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
     TEST_f_f (atanh, max_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
     TEST_f_f (atanh, -max_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_f_f (atanh, plus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
+    TEST_f_f (atanh, minus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
 
     AUTO_TESTS_f_f (atanh, tonearest),
   };
@@ -5915,12 +5924,18 @@ static const struct test_f_f_data ceil_test_data[] =
     /* Bug 15479: spurious "inexact" exception may occur.  */
     TEST_f_f (ceil, M_PIl, 4.0),
     TEST_f_f (ceil, -M_PIl, -3.0),
+    TEST_f_f (ceil, min_subnorm_value, 1.0),
+    TEST_f_f (ceil, min_value, 1.0),
     TEST_f_f (ceil, 0.1, 1.0),
     TEST_f_f (ceil, 0.25, 1.0),
     TEST_f_f (ceil, 0.625, 1.0),
+    TEST_f_f (ceil, max_value, max_value),
+    TEST_f_f (ceil, -min_subnorm_value, minus_zero),
+    TEST_f_f (ceil, -min_value, minus_zero),
     TEST_f_f (ceil, -0.1, minus_zero),
     TEST_f_f (ceil, -0.25, minus_zero),
     TEST_f_f (ceil, -0.625, minus_zero),
+    TEST_f_f (ceil, -max_value, -max_value),
 
 #ifdef TEST_LDOUBLE
     /* The result can only be represented in long double.  */
@@ -6403,6 +6418,21 @@ static const struct test_ff_f_data copysign_test_data[] =
     TEST_ff_f (copysign, qnan_value, minus_zero, -qnan_value, NO_INEXACT_EXCEPTION|TEST_NAN_SIGN),
     TEST_ff_f (copysign, -qnan_value, 0, qnan_value, NO_INEXACT_EXCEPTION|TEST_NAN_SIGN),
     TEST_ff_f (copysign, -qnan_value, minus_zero, -qnan_value, NO_INEXACT_EXCEPTION|TEST_NAN_SIGN),
+
+    TEST_ff_f (copysign, min_value, min_subnorm_value, min_value, NO_INEXACT_EXCEPTION),
+    TEST_ff_f (copysign, min_value, -min_subnorm_value, -min_value, NO_INEXACT_EXCEPTION),
+    TEST_ff_f (copysign, -min_value, min_subnorm_value, min_value, NO_INEXACT_EXCEPTION),
+    TEST_ff_f (copysign, -min_value, -min_subnorm_value, -min_value, NO_INEXACT_EXCEPTION),
+
+    TEST_ff_f (copysign, min_subnorm_value, max_value, min_subnorm_value, NO_INEXACT_EXCEPTION),
+    TEST_ff_f (copysign, min_subnorm_value, -max_value, -min_subnorm_value, NO_INEXACT_EXCEPTION),
+    TEST_ff_f (copysign, -min_subnorm_value, max_value, min_subnorm_value, NO_INEXACT_EXCEPTION),
+    TEST_ff_f (copysign, -min_subnorm_value, -max_value, -min_subnorm_value, NO_INEXACT_EXCEPTION),
+
+    TEST_ff_f (copysign, max_value, min_value, max_value, NO_INEXACT_EXCEPTION),
+    TEST_ff_f (copysign, max_value, -min_value, -max_value, NO_INEXACT_EXCEPTION),
+    TEST_ff_f (copysign, -max_value, min_value, max_value, NO_INEXACT_EXCEPTION),
+    TEST_ff_f (copysign, -max_value, -min_value, -max_value, NO_INEXACT_EXCEPTION),
   };
 
 static void