diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-03-03 16:51:07 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-03-03 16:51:07 +0000 |
commit | f5f7883fc7cf47d38ed493a882fd7109bdd589bb (patch) | |
tree | 1058cf0d07593fa2cec9f32b4988ac40611b4bff /tests/tlgamma.c | |
parent | cbd40e1cb659b579e608afbe7a05da5b15a860be (diff) | |
download | mpfr-f5f7883fc7cf47d38ed493a882fd7109bdd589bb.tar.gz |
GMP_RNDX -> MPFR_RNDX
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6053 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tlgamma.c')
-rw-r--r-- | tests/tlgamma.c | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/tests/tlgamma.c b/tests/tlgamma.c index af4d089cb..b7829f8a0 100644 --- a/tests/tlgamma.c +++ b/tests/tlgamma.c @@ -34,15 +34,15 @@ mpfr_lgamma_nosign (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd) if (!MPFR_IS_SINGULAR (y)) { MPFR_ASSERTN (sign == 1 || sign == -1); - if (sign == -1 && (rnd == GMP_RNDN || rnd == GMP_RNDZ)) + if (sign == -1 && (rnd == MPFR_RNDN || rnd == MPFR_RNDZ)) { - mpfr_neg (y, y, GMP_RNDN); + mpfr_neg (y, y, MPFR_RNDN); inex = -inex; /* This is a way to check with the generic tests, that the value returned in the sign variable is consistent, but warning! The tested function depends on the rounding mode: it is - * lgamma(x) = log(|Gamma(x)|) in GMP_RNDD and GMP_RNDU; - * lgamma(x) * sign(Gamma(x)) in GMP_RNDN and GMP_RNDZ. */ + * lgamma(x) = log(|Gamma(x)|) in MPFR_RNDD and MPFR_RNDU; + * lgamma(x) * sign(Gamma(x)) in MPFR_RNDN and MPFR_RNDZ. */ } } @@ -64,7 +64,7 @@ special (void) mpfr_init (y); mpfr_set_nan (x); - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); if (!mpfr_nan_p (y)) { printf ("Error for lgamma(NaN)\n"); @@ -72,7 +72,7 @@ special (void) } mpfr_set_inf (x, -1); - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0) { printf ("Error for lgamma(-Inf)\n"); @@ -81,52 +81,52 @@ special (void) mpfr_set_inf (x, 1); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 || sign != 1) { printf ("Error for lgamma(+Inf)\n"); exit (1); } - mpfr_set_ui (x, 0, GMP_RNDN); + mpfr_set_ui (x, 0, MPFR_RNDN); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 || sign != 1) { printf ("Error for lgamma(+0)\n"); exit (1); } - mpfr_set_ui (x, 0, GMP_RNDN); - mpfr_neg (x, x, GMP_RNDN); + mpfr_set_ui (x, 0, MPFR_RNDN); + mpfr_neg (x, x, MPFR_RNDN); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 || sign != -1) { printf ("Error for lgamma(-0)\n"); exit (1); } - mpfr_set_ui (x, 1, GMP_RNDN); + mpfr_set_ui (x, 1, MPFR_RNDN); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); if (MPFR_IS_NAN (y) || mpfr_cmp_ui (y, 0) || MPFR_IS_NEG (y) || sign != 1) { printf ("Error for lgamma(1)\n"); exit (1); } - mpfr_set_si (x, -1, GMP_RNDN); - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_set_si (x, -1, MPFR_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0) { printf ("Error for lgamma(-1)\n"); exit (1); } - mpfr_set_ui (x, 2, GMP_RNDN); + mpfr_set_ui (x, 2, MPFR_RNDN); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); if (MPFR_IS_NAN (y) || mpfr_cmp_ui (y, 0) || MPFR_IS_NEG (y) || sign != 1) { printf ("Error for lgamma(2)\n"); @@ -139,10 +139,10 @@ special (void) #define CHECK_X1 "1.0762904832837976166" #define CHECK_Y1 "-0.039418362817587634939" - mpfr_set_str (x, CHECK_X1, 10, GMP_RNDN); + mpfr_set_str (x, CHECK_X1, 10, MPFR_RNDN); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDN); - mpfr_set_str (x, CHECK_Y1, 10, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); + mpfr_set_str (x, CHECK_Y1, 10, MPFR_RNDN); if (mpfr_equal_p (y, x) == 0 || sign != 1) { printf ("mpfr_lgamma("CHECK_X1") is wrong:\n" @@ -155,10 +155,10 @@ special (void) #define CHECK_X2 "9.23709516716202383435e-01" #define CHECK_Y2 "0.049010669407893718563" - mpfr_set_str (x, CHECK_X2, 10, GMP_RNDN); + mpfr_set_str (x, CHECK_X2, 10, MPFR_RNDN); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDN); - mpfr_set_str (x, CHECK_Y2, 10, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); + mpfr_set_str (x, CHECK_Y2, 10, MPFR_RNDN); if (mpfr_equal_p (y, x) == 0 || sign != 1) { printf ("mpfr_lgamma("CHECK_X2") is wrong:\n" @@ -171,9 +171,9 @@ special (void) mpfr_set_prec (x, 8); mpfr_set_prec (y, 175); - mpfr_set_ui (x, 33, GMP_RNDN); + mpfr_set_ui (x, 33, MPFR_RNDN); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDU); + mpfr_lgamma (y, &sign, x, MPFR_RNDU); mpfr_set_prec (x, 175); mpfr_set_str_binary (x, "0.1010001100011101101011001101110010100001000001000001110011000001101100001111001001000101011011100100010101011110100111110101010100010011010010000101010111001100011000101111E7"); if (mpfr_equal_p (x, y) == 0 || sign != 1) @@ -184,9 +184,9 @@ special (void) mpfr_set_prec (x, 21); mpfr_set_prec (y, 8); - mpfr_set_ui (y, 120, GMP_RNDN); + mpfr_set_ui (y, 120, MPFR_RNDN); sign = -17; - mpfr_lgamma (x, &sign, y, GMP_RNDZ); + mpfr_lgamma (x, &sign, y, MPFR_RNDZ); mpfr_set_prec (y, 21); mpfr_set_str_binary (y, "0.111000101000001100101E9"); if (mpfr_equal_p (x, y) == 0 || sign != 1) @@ -201,7 +201,7 @@ special (void) mpfr_set_prec (y, 206); mpfr_set_str_binary (x, "0.110e10"); sign = -17; - inex = mpfr_lgamma (y, &sign, x, GMP_RNDN); + inex = mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_prec (x, 206); mpfr_set_str_binary (x, "0.10000111011000000011100010101001100110001110000111100011000100100110110010001011011110101001111011110110000001010100111011010000000011100110110101100111000111010011110010000100010111101010001101000110101001E13"); if (mpfr_equal_p (x, y) == 0 || sign != 1) @@ -219,7 +219,7 @@ special (void) mpfr_set_prec (y, 4); mpfr_set_str_binary (x, "0.1100E-66"); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_str_binary (x, "0.1100E6"); if (mpfr_equal_p (x, y) == 0 || sign != 1) { @@ -233,11 +233,11 @@ special (void) mpfr_set_prec (x, 256); mpfr_set_prec (y, 32); - mpfr_set_si_2exp (x, -1, 200, GMP_RNDN); - mpfr_add_ui (x, x, 1, GMP_RNDN); - mpfr_div_2ui (x, x, 1, GMP_RNDN); + mpfr_set_si_2exp (x, -1, 200, MPFR_RNDN); + mpfr_add_ui (x, x, 1, MPFR_RNDN); + mpfr_div_2ui (x, x, 1, MPFR_RNDN); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_prec (x, 32); mpfr_set_str_binary (x, "-0.10001000111011111011000010100010E207"); if (mpfr_equal_p (x, y) == 0 || sign != 1) @@ -252,11 +252,11 @@ special (void) mpfr_set_prec (x, 256); mpfr_set_prec (y, 32); - mpfr_set_si_2exp (x, -1, 200, GMP_RNDN); - mpfr_sub_ui (x, x, 1, GMP_RNDN); - mpfr_div_2ui (x, x, 1, GMP_RNDN); + mpfr_set_si_2exp (x, -1, 200, MPFR_RNDN); + mpfr_sub_ui (x, x, 1, MPFR_RNDN); + mpfr_div_2ui (x, x, 1, MPFR_RNDN); sign = -17; - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_prec (x, 32); mpfr_set_str_binary (x, "-0.10001000111011111011000010100010E207"); if (mpfr_equal_p (x, y) == 0 || sign != -1) @@ -273,7 +273,7 @@ special (void) mpfr_set_prec (x, 10); mpfr_set_prec (y, 10); mpfr_set_str_binary (x, "-0.1101111000E-3"); - inex = mpfr_lgamma (y, &sign, x, GMP_RNDN); + inex = mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_str_binary (x, "10.01001011"); if (mpfr_equal_p (x, y) == 0 || sign != -1 || inex >= 0) { @@ -289,7 +289,7 @@ special (void) mpfr_set_prec (x, 18); mpfr_set_prec (y, 28); mpfr_set_str_binary (x, "-1.10001101010001101e-196"); - inex = mpfr_lgamma (y, &sign, x, GMP_RNDN); + inex = mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_prec (x, 28); mpfr_set_str_binary (x, "0.100001110110101011011010011E8"); MPFR_ASSERTN (mpfr_equal_p (x, y) && inex < 0); @@ -313,38 +313,38 @@ special (void) mpfr_set_prec (y, 53); mpfr_set_str_binary (x, VAL1); - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_str_binary (x, OUT1); MPFR_ASSERTN(sign == -1 && mpfr_equal_p(x, y)); mpfr_set_str_binary (x, VAL2); - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_str_binary (x, OUT2); MPFR_ASSERTN(sign == -1 && mpfr_equal_p (x, y)); mpfr_set_str_binary (x, VAL3); - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_str_binary (x, OUT3); MPFR_ASSERTN(sign == -1 && mpfr_equal_p (x, y)); mpfr_set_str_binary (x, VAL4); - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_str_binary (x, OUT4); MPFR_ASSERTN(sign == -1 && mpfr_equal_p (x, y)); mpfr_set_str_binary (x, VAL5); - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_str_binary (x, OUT5); MPFR_ASSERTN(sign == -1 && mpfr_equal_p (x, y)); mpfr_set_str_binary (x, VAL6); - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_str_binary (x, OUT6); MPFR_ASSERTN(sign == -1 && mpfr_equal_p (x, y)); /* further test from Kaveh Ghazi */ mpfr_set_str_binary (x, "-0.10011010101001010010001110010111010111011101010111001E-53"); - mpfr_lgamma (y, &sign, x, GMP_RNDN); + mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_str_binary (x, "100101.00111101101010000000101010111010001111001101111"); MPFR_ASSERTN(sign == -1 && mpfr_equal_p (x, y)); @@ -353,8 +353,8 @@ special (void) emax = mpfr_get_emax (); mpfr_set_emin (-1000000000); mpfr_set_emax (1000000000); - mpfr_set_ui (x, 1, GMP_RNDN); - mpfr_lgamma (x, &sign, x, GMP_RNDN); + mpfr_set_ui (x, 1, MPFR_RNDN); + mpfr_lgamma (x, &sign, x, MPFR_RNDN); MPFR_ASSERTN(mpfr_get_emin () == -1000000000); MPFR_ASSERTN(mpfr_get_emax () == 1000000000); mpfr_set_emin (emin); @@ -364,16 +364,16 @@ special (void) mpfr_set_prec (x, 128); mpfr_set_prec (y, 128); mpfr_set_str_binary (x, "0.11000110011110111111110010100110000000000000000000000000000000000000000000000000000000000000000001000011000110100100110111101010E-765689"); - inex = mpfr_lgamma (y, &sign, x, GMP_RNDN); + inex = mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_str_binary (x, "10000001100100101111011011010000111010001001110000111010011000101001011111011111110011011010110100101111110111001001010100011101E-108"); MPFR_ASSERTN(inex < 0 && mpfr_cmp (y, x) == 0 && sign > 0); mpfr_set_prec (x, 128); mpfr_set_prec (y, 256); mpfr_set_str_binary (x, "0.1011111111111111100000111011111E-31871"); - inex = mpfr_lgamma (y, &sign, x, GMP_RNDN); + inex = mpfr_lgamma (y, &sign, x, MPFR_RNDN); mpfr_set_prec (x, 256); - mpfr_set_str (x, "AC9729B83707E6797612D0D76DAF42B1240A677FF1B6E3783FD4E53037143B1P-237", 16, GMP_RNDN); + mpfr_set_str (x, "AC9729B83707E6797612D0D76DAF42B1240A677FF1B6E3783FD4E53037143B1P-237", 16, MPFR_RNDN); MPFR_ASSERTN(inex < 0 && mpfr_cmp (y, x) == 0 && sign > 0); mpfr_clear (x); |