diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-10-13 22:27:03 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2010-10-13 22:27:03 -0400 |
commit | 5e908464b9603e9cd95047d2edd00de5f78fedaf (patch) | |
tree | 1f526248f31bee031ce4c92d9b1b2e857d6b671b /math | |
parent | f90681487d90a6eea8f1c60021bc8dd83313c59b (diff) | |
download | glibc-5e908464b9603e9cd95047d2edd00de5f78fedaf.zip glibc-5e908464b9603e9cd95047d2edd00de5f78fedaf.tar.gz glibc-5e908464b9603e9cd95047d2edd00de5f78fedaf.tar.bz2 |
Implement accurate fma.
Diffstat (limited to 'math')
-rw-r--r-- | math/libm-test.inc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index 2d48f71..34c4fa9 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -2789,9 +2789,25 @@ fma_test (void) TEST_fff_f (fma, minus_infty, minus_infty, minus_infty, nan_value, INVALID_EXCEPTION); TEST_fff_f (fma, 1.25L, 0.75L, 0.0625L, 1.0L); -#ifdef TEST_FLOAT +#if defined (TEST_FLOAT) && FLT_MANT_DIG == 24 TEST_fff_f (fma, 0x1.7ff8p+13, 0x1.000002p+0, 0x1.ffffp-24, 0x1.7ff802p+13); TEST_fff_f (fma, 0x1.fffp+0, 0x1.00001p+0, -0x1.fffp+0, 0x1.fffp-20); + TEST_fff_f (fma, 0x1.9abcdep+127, 0x0.9abcdep-126, -0x1.f08948p+0, 0x1.bb421p-25); + TEST_fff_f (fma, 0x1.9abcdep+100, 0x0.9abcdep-126, -0x1.f08948p-27, 0x1.bb421p-52); + TEST_fff_f (fma, 0x1.fffffep+127, 0x1.001p+0, -0x1.fffffep+127, 0x1.fffffep+115); + TEST_fff_f (fma, -0x1.fffffep+127, 0x1.fffffep+0, 0x1.fffffep+127, -0x1.fffffap+127); + TEST_fff_f (fma, 0x1.fffffep+127, 2.0, -0x1.fffffep+127, 0x1.fffffep+127); +#endif +#if defined (TEST_DOUBLE) && DBL_MANT_DIG == 53 + TEST_fff_f (fma, 0x1.7fp+13, 0x1.0000000000001p+0, 0x1.ffep-48, 0x1.7f00000000001p+13); + TEST_fff_f (fma, 0x1.fffp+0, 0x1.0000000000001p+0, -0x1.fffp+0, 0x1.fffp-52); + TEST_fff_f (fma, 0x1.0000002p+0, 0x1.ffffffcp-1, 0x1p-300, 1.0); + TEST_fff_f (fma, 0x1.0000002p+0, 0x1.ffffffcp-1, -0x1p-300, 0x1.fffffffffffffp-1); + TEST_fff_f (fma, 0x1.deadbeef2feedp+1023, 0x0.deadbeef2feedp-1022, -0x1.a05f8c01a4bfbp+1, 0x1.0989687bc9da4p-53); + TEST_fff_f (fma, 0x1.deadbeef2feedp+900, 0x0.deadbeef2feedp-1022, -0x1.a05f8c01a4bfbp-122, 0x1.0989687bc9da4p-176); + TEST_fff_f (fma, 0x1.fffffffffffffp+1023, 0x1.001p+0, -0x1.fffffffffffffp+1023, 0x1.fffffffffffffp+1011); + TEST_fff_f (fma, -0x1.fffffffffffffp+1023, 0x1.fffffffffffffp+0, 0x1.fffffffffffffp+1023, -0x1.ffffffffffffdp+1023); + TEST_fff_f (fma, 0x1.fffffffffffffp+1023, 2.0, -0x1.fffffffffffffp+1023, 0x1.fffffffffffffp+1023); #endif END (fma); |