summaryrefslogtreecommitdiff
path: root/tests/texp.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2006-11-19 14:35:02 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2006-11-19 14:35:02 +0000
commitfff961b5d793f18797fe8544c53338053d8302a4 (patch)
tree4b4e7a56bf01ee44779716135da54de3f09e29f2 /tests/texp.c
parented0604f71bd2874486dbddb9f1da29a8fd5ed313 (diff)
downloadmpfr-fff961b5d793f18797fe8544c53338053d8302a4.tar.gz
fixed bug in pow (isodd -> assertion failed)
fixed problem in erfc for large input reduced tests that took too much time git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4237 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/texp.c')
-rw-r--r--tests/texp.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/tests/texp.c b/tests/texp.c
index 1ec152910..99d61e87b 100644
--- a/tests/texp.c
+++ b/tests/texp.c
@@ -154,14 +154,16 @@ check_worst_cases (void)
}
static void
-compare_exp2_exp3 (int n)
+compare_exp2_exp3 (mp_prec_t p0, mp_prec_t p1)
{
- mpfr_t x, y, z; int prec; mp_rnd_t rnd;
+ mpfr_t x, y, z;
+ mp_prec_t prec;
+ mp_rnd_t rnd;
mpfr_init (x);
mpfr_init (y);
mpfr_init (z);
- for (prec = 20; prec <= n; prec++)
+ for (prec = p0; prec <= p1; prec ++)
{
mpfr_set_prec (x, prec);
mpfr_set_prec (y, prec);
@@ -186,17 +188,26 @@ compare_exp2_exp3 (int n)
}
}
+ mpfr_clear (x);
+ mpfr_clear (y);
+ mpfr_clear (z);
+}
+
+static void
+check_large (void)
+{
+ mpfr_t x, z;
+ mp_prec_t prec;
+
/* bug found by Patrick Pe'lissier on 7 Jun 2004 */
prec = 203780;
- mpfr_set_prec (x, prec);
- mpfr_set_prec (z, prec);
+ mpfr_init2 (x, prec);
+ mpfr_init2 (z, prec);
mpfr_set_ui (x, 3, GMP_RNDN);
mpfr_sqrt (x, x, GMP_RNDN);
mpfr_sub_ui (x, x, 1, GMP_RNDN);
mpfr_exp_3 (z, x, GMP_RNDN);
-
mpfr_clear (x);
- mpfr_clear (y);
mpfr_clear (z);
}
@@ -497,12 +508,15 @@ main (int argc, char *argv[])
{
tests_start_mpfr ();
+ if (argc > 1)
+ check_large ();
+
check_inexact ();
check_special ();
test_generic (2, 100, 100);
- compare_exp2_exp3(500);
+ compare_exp2_exp3 (20, 1000);
check_worst_cases();
check3("0.0", GMP_RNDU, "1.0");
check3("-1e-170", GMP_RNDU, "1.0");