summaryrefslogtreecommitdiff
path: root/tests/terf.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2007-07-18 15:48:57 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2007-07-18 15:48:57 +0000
commit32a7949f36cef248e2c2210ec7e4211e26669733 (patch)
tree41450658bf9a6de255991f1e8f6914259460b4c4 /tests/terf.c
parent72abdbf55209579b5f4db97a95037ef43800d08a (diff)
downloadmpfr-32a7949f36cef248e2c2210ec7e4211e26669733.tar.gz
fixed problem with erfc() near underflow region
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4647 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/terf.c')
-rw-r--r--tests/terf.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/terf.c b/tests/terf.c
index 6985350f0..98b742036 100644
--- a/tests/terf.c
+++ b/tests/terf.c
@@ -483,15 +483,13 @@ large_arg (void)
exit (1);
}
- /* Reported by Christopher Creutzig on 2007-07-10.
- I took the result from Maple. -- VL. */
+ /* Reported by Christopher Creutzig on 2007-07-10. */
mpfr_set_prec (x, 53);
mpfr_set_prec (y, 53);
mpfr_set_si_2exp (x, 54563, -1, GMP_RNDN);
mpfr_erfc (y, x, GMP_RNDZ);
- mpfr_set_str_binary (x,
- "0.11110001000000001010111000101011001010011101000111101E-1073769430");
- if (! mpfr_equal_p (x, y))
+ mpfr_set_ui (x, 0, GMP_RNDN);
+ if (! mpfr_equal_p (y, x))
{
printf ("mpfr_erfc failed for x=27281.5, prec=53 (6)\n");
printf ("expected "); mpfr_dump (x);
@@ -499,6 +497,19 @@ large_arg (void)
exit (1);
}
+ /* same test with rounding away from zero */
+ mpfr_set_si_2exp (x, 54563, -1, GMP_RNDN);
+ mpfr_erfc (y, x, GMP_RNDU);
+ mpfr_set_ui (x, 0, GMP_RNDN);
+ mpfr_nextabove (x);
+ if (! mpfr_equal_p (y, x))
+ {
+ printf ("mpfr_erfc failed for x=27281.5, prec=53 (7)\n");
+ printf ("expected "); mpfr_dump (x);
+ printf ("got "); mpfr_dump (y);
+ exit (1);
+ }
+
mpfr_clear (x);
mpfr_clear (y);
}