diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2006-11-19 18:22:51 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2006-11-19 18:22:51 +0000 |
commit | 689e8e9280941fcaa299b7e40d2eefae6cf3a762 (patch) | |
tree | 4a4be779aa673c5220673a2f9d6c89e84e60e585 /tests | |
parent | 84f51524fc54e345d5813f679b6cc9a309e4ae01 (diff) | |
download | mpfr-689e8e9280941fcaa299b7e40d2eefae6cf3a762.tar.gz |
added more tests
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4239 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/terf.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/terf.c b/tests/terf.c index 25dcc1bbf..4ffbe50d2 100644 --- a/tests/terf.c +++ b/tests/terf.c @@ -326,6 +326,34 @@ special_erf (void) exit (1); } + /* worst cases */ + mpfr_set_prec (x, 53); + mpfr_set_prec (y, 53); + mpfr_set_str_binary (x, "1.0000000000000000000000000000000000000110000000101101"); + mpfr_erf (y, x, GMP_RNDN); + mpfr_set_str_binary (x, "0.110101111011101100111101001110100000101011000011001"); + if (mpfr_cmp (x, y)) + { + printf ("Error: erf for worst case (1)\n"); + exit (1); + } + + mpfr_set_str_binary (x, "1.0000000000000000000000000000011000111010101101011010"); + mpfr_erf (y, x, GMP_RNDU); + mpfr_set_str_binary (x, "0.11010111101110110011110100111100100111100011111000110"); + if (mpfr_cmp (x, y)) + { + printf ("Error: erf for worst case (2a)\n"); + exit (1); + } + mpfr_set_str_binary (x, "1.0000000000000000000000000000011000111010101101011010"); + mpfr_erf (y, x, GMP_RNDD); + mpfr_set_str_binary (x, "0.11010111101110110011110100111100100111100011111000101"); + if (mpfr_cmp (x, y)) + { + printf ("Error: erf for worst case (2b)\n"); + exit (1); + } mpfr_clear (x); mpfr_clear (y); @@ -419,6 +447,16 @@ large_arg (void) exit (1); } + mpfr_set_prec (x, 75); + mpfr_set_prec (y, 85); + mpfr_set_str_binary (x, "0.111110111111010011101011001100001010011110101010011111010010111101010001011E15"); + mpfr_erfc (y, x, GMP_RNDN); + if (mpfr_cmp_ui (y, 0) || mpfr_sgn (y) < 0) + { + printf ("mpfr_erfc failed for large x (3b)\n"); + exit (1); + } + mpfr_set_prec (x, 2); mpfr_set_prec (y, 21); mpfr_set_str_binary (x, "-1.0e3"); |