diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2006-11-16 15:02:08 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2006-11-16 15:02:08 +0000 |
commit | db84ffff5f3fb1a396a4764a19bfc7ed86bb6c26 (patch) | |
tree | 77d312eea7c01535fedc15a3460ba1ad690aea47 /tests/terf.c | |
parent | b6553962e92665f362c098fa3db01df78367e1c3 (diff) | |
download | mpfr-db84ffff5f3fb1a396a4764a19bfc7ed86bb6c26.tar.gz |
implemented asymptotic formula for erfc (fixed both slowness for large
arguments, and call to MPFR_WARNING with return value NaN for huge arguments)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4219 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/terf.c')
-rw-r--r-- | tests/terf.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/terf.c b/tests/terf.c index 6d5ec883b..5f6b2178c 100644 --- a/tests/terf.c +++ b/tests/terf.c @@ -390,11 +390,34 @@ large_arg (void) mpfr_set_si_2exp (x, -1, 173, GMP_RNDN); mpfr_erfc (y, x, GMP_RNDN); + if (mpfr_cmp_ui (y, 2) != 0) + { + printf ("mpfr_erfc failed for large x (1)\n"); + exit (1); + } + mpfr_set_prec (x, 33); mpfr_set_prec (y, 43); mpfr_set_str_binary (x, "1.11000101010111011000111100101001e6"); mpfr_erfc (y, x, GMP_RNDD); + mpfr_set_prec (x, 43); + mpfr_set_str_binary (x, "100010011100101100001101100101011101101E-18579"); + if (mpfr_cmp (x, y) != 0) + { + printf ("mpfr_erfc failed for large x (2)\n"); + exit (1); + } + + mpfr_set_prec (y, 43); + mpfr_set_si_2exp (x, 1, 11, GMP_RNDN); + mpfr_erfc (y, x, GMP_RNDN); + mpfr_set_str_binary (x, "0.1100000100100010101111001111010010001000110E-6051113"); + if (mpfr_cmp (x, y) != 0) + { + printf ("mpfr_erfc failed for large x (3)\n"); + exit (1); + } mpfr_clear (x); mpfr_clear (y); |