summaryrefslogtreecommitdiff
path: root/tests/tgamma.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2009-03-03 16:51:07 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2009-03-03 16:51:07 +0000
commitf5f7883fc7cf47d38ed493a882fd7109bdd589bb (patch)
tree1058cf0d07593fa2cec9f32b4988ac40611b4bff /tests/tgamma.c
parentcbd40e1cb659b579e608afbe7a05da5b15a860be (diff)
downloadmpfr-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/tgamma.c')
-rw-r--r--tests/tgamma.c120
1 files changed, 60 insertions, 60 deletions
diff --git a/tests/tgamma.c b/tests/tgamma.c
index 8ccf10c89..54ee2e675 100644
--- a/tests/tgamma.c
+++ b/tests/tgamma.c
@@ -39,7 +39,7 @@ special (void)
mpfr_init (y);
mpfr_set_nan (x);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!mpfr_nan_p (y))
{
printf ("Error for gamma(NaN)\n");
@@ -47,7 +47,7 @@ special (void)
}
mpfr_set_inf (x, -1);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!mpfr_nan_p (y))
{
printf ("Error for gamma(-Inf)\n");
@@ -55,40 +55,40 @@ special (void)
}
mpfr_set_inf (x, 1);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0)
{
printf ("Error for gamma(+Inf)\n");
exit (1);
}
- mpfr_set_ui (x, 0, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_set_ui (x, 0, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0)
{
printf ("Error for gamma(+0)\n");
exit (1);
}
- mpfr_set_ui (x, 0, GMP_RNDN);
- mpfr_neg (x, x, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_set_ui (x, 0, MPFR_RNDN);
+ mpfr_neg (x, x, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!mpfr_inf_p (y) || mpfr_sgn (y) > 0)
{
printf ("Error for gamma(-0)\n");
exit (1);
}
- mpfr_set_ui (x, 1, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_set_ui (x, 1, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (mpfr_cmp_ui (y, 1))
{
printf ("Error for gamma(1)\n");
exit (1);
}
- mpfr_set_si (x, -1, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_set_si (x, -1, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!mpfr_nan_p (y))
{
printf ("Error for gamma(-1)\n");
@@ -101,9 +101,9 @@ special (void)
#define CHECK_X1 "1.0762904832837976166"
#define CHECK_Y1 "0.96134843256452096050"
- mpfr_set_str (x, CHECK_X1, 10, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
- mpfr_set_str (x, CHECK_Y1, 10, GMP_RNDN);
+ mpfr_set_str (x, CHECK_X1, 10, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
+ mpfr_set_str (x, CHECK_Y1, 10, MPFR_RNDN);
if (mpfr_cmp (y, x))
{
printf ("mpfr_lngamma("CHECK_X1") is wrong:\n"
@@ -116,9 +116,9 @@ special (void)
#define CHECK_X2 "9.23709516716202383435e-01"
#define CHECK_Y2 "1.0502315560291053398"
- mpfr_set_str (x, CHECK_X2, 10, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
- mpfr_set_str (x, CHECK_Y2, 10, GMP_RNDN);
+ mpfr_set_str (x, CHECK_X2, 10, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
+ mpfr_set_str (x, CHECK_Y2, 10, MPFR_RNDN);
if (mpfr_cmp (y, x))
{
printf ("mpfr_lngamma("CHECK_X2") is wrong:\n"
@@ -131,8 +131,8 @@ special (void)
mpfr_set_prec (x, 8);
mpfr_set_prec (y, 175);
- mpfr_set_ui (x, 33, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDU);
+ mpfr_set_ui (x, 33, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDU);
mpfr_set_prec (x, 175);
mpfr_set_str_binary (x, "0.110010101011010101101000010101010111000110011101001000101011000001100010111001101001011E118");
if (mpfr_cmp (x, y))
@@ -143,8 +143,8 @@ special (void)
mpfr_set_prec (x, 21);
mpfr_set_prec (y, 8);
- mpfr_set_ui (y, 120, GMP_RNDN);
- mpfr_gamma (x, y, GMP_RNDZ);
+ mpfr_set_ui (y, 120, MPFR_RNDN);
+ mpfr_gamma (x, y, MPFR_RNDZ);
mpfr_set_prec (y, 21);
mpfr_set_str_binary (y, "0.101111101110100110110E654");
if (mpfr_cmp (x, y))
@@ -158,7 +158,7 @@ special (void)
mpfr_set_prec (x, 3);
mpfr_set_prec (y, 206);
mpfr_set_str_binary (x, "0.110e10");
- inex = mpfr_gamma (y, x, GMP_RNDN);
+ inex = mpfr_gamma (y, x, MPFR_RNDN);
mpfr_set_prec (x, 206);
mpfr_set_str_binary (x, "0.110111100001000001101010010001000111000100000100111000010011100011011111001100011110101000111101101100110001001100110100001001111110000101010000100100011100010011101110000001000010001100010000101001111E6250");
if (mpfr_cmp (x, y))
@@ -175,13 +175,13 @@ special (void)
/* worst case to exercise retry */
mpfr_set_prec (x, 1000);
mpfr_set_prec (y, 869);
- mpfr_const_pi (x, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_const_pi (x, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
mpfr_set_prec (x, 4);
mpfr_set_prec (y, 4);
mpfr_set_str_binary (x, "-0.1100E-66");
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
mpfr_set_str_binary (x, "-0.1011E67");
if (mpfr_cmp (x, y))
{
@@ -209,7 +209,7 @@ special_overflow (void)
mpfr_init2 (x, 24);
mpfr_init2 (y, 24);
mpfr_set_str_binary (x, "0.101100100000000000110100E7");
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!mpfr_inf_p (y))
{
printf ("Overflow error.\n");
@@ -220,8 +220,8 @@ special_overflow (void)
/* problem mentioned by Kenneth Wilder, 18 Aug 2005 */
mpfr_set_prec (x, 29);
mpfr_set_prec (y, 29);
- mpfr_set_str (x, "-200000000.5", 10, GMP_RNDN); /* exact */
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_set_str (x, "-200000000.5", 10, MPFR_RNDN); /* exact */
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!(mpfr_zero_p (y) && MPFR_SIGN (y) < 0))
{
printf ("Error for gamma(-200000000.5)\n");
@@ -233,8 +233,8 @@ special_overflow (void)
mpfr_set_prec (x, 53);
mpfr_set_prec (y, 53);
- mpfr_set_str (x, "-200000000.1", 10, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_set_str (x, "-200000000.1", 10, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!(mpfr_zero_p (y) && MPFR_SIGN (y) < 0))
{
printf ("Error for gamma(-200000000.1), prec=53\n");
@@ -247,8 +247,8 @@ special_overflow (void)
/* another problem mentioned by Kenneth Wilder, 29 Aug 2005 */
mpfr_set_prec (x, 333);
mpfr_set_prec (y, 14);
- mpfr_set_str (x, "-2.0000000000000000000000005", 10, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_set_str (x, "-2.0000000000000000000000005", 10, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
mpfr_set_prec (x, 14);
mpfr_set_str_binary (x, "-11010011110001E66");
if (mpfr_cmp (x, y))
@@ -265,7 +265,7 @@ special_overflow (void)
mpfr_set_prec (x, 38);
mpfr_set_prec (y, 54);
mpfr_set_str_binary (x, "0.11101111011100111101001001010110101001E-166");
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
mpfr_set_prec (x, 54);
mpfr_set_str_binary (x, "0.100010001101100001110110001010111111010000100101011E167");
if (mpfr_cmp (x, y))
@@ -282,7 +282,7 @@ special_overflow (void)
mpfr_set_prec (y, 71);
mpfr_set_str_binary (x, "10101011011100001111111000010111110010E-1034");
/* 184083777010*2^(-1034) */
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
mpfr_set_prec (x, 71);
mpfr_set_str_binary (x, "10111111001000011110010001000000000000110011110000000011101011111111100E926");
/* 1762885132679550982140*2^926 */
@@ -298,7 +298,7 @@ special_overflow (void)
mpfr_set_prec (y, 88);
mpfr_set_str_binary (x, "10111100111001010000100001100100100101E-104");
/* 202824096037*2^(-104) */
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
mpfr_set_prec (x, 88);
mpfr_set_str_binary (x, "1010110101111000111010111100010110101010100110111000001011000111000011101100001101110010E-21");
/* 209715199999500283894743922*2^(-21) */
@@ -313,12 +313,12 @@ special_overflow (void)
mpfr_set_prec (x, 171);
mpfr_set_prec (y, 38);
mpfr_set_str (x, "-2993155353253689176481146537402947624254601559176535", 10,
- GMP_RNDN);
- mpfr_div_2exp (x, x, 170, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ MPFR_RNDN);
+ mpfr_div_2exp (x, x, 170, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
mpfr_set_prec (x, 38);
- mpfr_set_str (x, "201948391737", 10, GMP_RNDN);
- mpfr_mul_2exp (x, x, 92, GMP_RNDN);
+ mpfr_set_str (x, "201948391737", 10, MPFR_RNDN);
+ mpfr_mul_2exp (x, x, 92, MPFR_RNDN);
if (mpfr_cmp (x, y))
{
printf ("Error for gamma (test 5)\n");
@@ -331,10 +331,10 @@ special_overflow (void)
mpfr_set_prec (x, 337);
mpfr_set_prec (y, 38);
mpfr_set_str (x, "-30000.000000000000000000000000000000000000000000001", 10,
- GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
mpfr_set_prec (x, 38);
- mpfr_set_str (x, "-3.623795987425E-121243", 10, GMP_RNDN);
+ mpfr_set_str (x, "-3.623795987425E-121243", 10, MPFR_RNDN);
if (mpfr_cmp (x, y))
{
printf ("Error for gamma (test 7)\n");
@@ -347,8 +347,8 @@ special_overflow (void)
set_emin (emin);
mpfr_set_prec (x, 71);
mpfr_set_prec (y, 71);
- mpfr_set_str (x, "-200000000.1", 10, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_set_str (x, "-200000000.1", 10, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!(mpfr_zero_p (y) && MPFR_SIGN (y) < 0))
{
printf ("Error for gamma (test 8)\n");
@@ -360,8 +360,8 @@ special_overflow (void)
set_emax (1073741823);
mpfr_set_prec (x, 29);
mpfr_set_prec (y, 29);
- mpfr_set_str (x, "423786866", 10, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
+ mpfr_set_str (x, "423786866", 10, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0)
{
printf ("Error for gamma(423786866)\n");
@@ -370,8 +370,8 @@ special_overflow (void)
/* check exact result */
mpfr_set_prec (x, 2);
- mpfr_set_ui (x, 3, GMP_RNDN);
- inex = mpfr_gamma (x, x, GMP_RNDN);
+ mpfr_set_ui (x, 3, MPFR_RNDN);
+ inex = mpfr_gamma (x, x, MPFR_RNDN);
if (inex != 0 || mpfr_cmp_ui (x, 2) != 0)
{
printf ("Error for gamma(3)\n");
@@ -382,7 +382,7 @@ special_overflow (void)
mpfr_set_prec (x, 53);
mpfr_set_prec (y, 53);
mpfr_set_str_binary (x, "101010110100110011111010000110001000111100000110101E-43");
- mpfr_gamma (x, x, GMP_RNDU);
+ mpfr_gamma (x, x, MPFR_RNDU);
mpfr_set_str_binary (y, "110000011110001000111110110101011110000100001111111E971");
if (mpfr_cmp (x, y) != 0)
{
@@ -396,8 +396,8 @@ special_overflow (void)
set_emax (emax);
/* bug found by Kevin Rauch, 26 Oct 2007 */
- mpfr_set_str (x, "1e19", 10, GMP_RNDN);
- inex = mpfr_gamma (x, x, GMP_RNDN);
+ mpfr_set_str (x, "1e19", 10, MPFR_RNDN);
+ inex = mpfr_gamma (x, x, MPFR_RNDN);
MPFR_ASSERTN(mpfr_inf_p (x) && inex > 0);
mpfr_clear (y);
@@ -419,9 +419,9 @@ gamma_integer (void)
for (i = 0; i < 100; i++)
{
mpz_fac_ui (n, i);
- mpfr_set_ui (x, i+1, GMP_RNDN);
- mpfr_gamma (y, x, GMP_RNDN);
- mpfr_set_z (x, n, GMP_RNDN);
+ mpfr_set_ui (x, i+1, MPFR_RNDN);
+ mpfr_gamma (y, x, MPFR_RNDN);
+ mpfr_set_z (x, n, MPFR_RNDN);
if (!mpfr_equal_p (x, y))
{
printf ("Error for gamma(%u)\n", i+1);
@@ -447,16 +447,16 @@ test20071231 (void)
mpfr_set_emin (-1000000);
mpfr_init2 (x, 21);
- mpfr_set_str (x, "-1000001.5", 10, GMP_RNDN);
- inex = mpfr_gamma (x, x, GMP_RNDN);
+ mpfr_set_str (x, "-1000001.5", 10, MPFR_RNDN);
+ inex = mpfr_gamma (x, x, MPFR_RNDN);
MPFR_ASSERTN(MPFR_IS_ZERO(x) && MPFR_IS_POS(x) && inex < 0);
mpfr_clear (x);
mpfr_set_emin (emin);
mpfr_init2 (x, 53);
- mpfr_set_str (x, "-1000000001.5", 10, GMP_RNDN);
- inex = mpfr_gamma (x, x, GMP_RNDN);
+ mpfr_set_str (x, "-1000000001.5", 10, MPFR_RNDN);
+ inex = mpfr_gamma (x, x, MPFR_RNDN);
MPFR_ASSERTN(MPFR_IS_ZERO(x) && MPFR_IS_POS(x) && inex < 0);
mpfr_clear (x);
}