diff options
-rw-r--r-- | acos.c | 2 | ||||
-rw-r--r-- | agm.c | 2 | ||||
-rw-r--r-- | atan.c | 8 | ||||
-rw-r--r-- | atanh.c | 6 | ||||
-rw-r--r-- | const_euler.c | 4 | ||||
-rw-r--r-- | const_log2.c | 12 | ||||
-rw-r--r-- | const_pi.c | 2 | ||||
-rw-r--r-- | cos.c | 4 | ||||
-rw-r--r-- | cosh.c | 2 | ||||
-rw-r--r-- | exp3.c | 4 | ||||
-rw-r--r-- | exp_2.c | 6 | ||||
-rw-r--r-- | gamma.c | 4 | ||||
-rw-r--r-- | generic.c | 2 | ||||
-rw-r--r-- | get_str.c | 4 | ||||
-rw-r--r-- | sin.c | 2 | ||||
-rw-r--r-- | sinh.c | 2 | ||||
-rw-r--r-- | tanh.c | 2 | ||||
-rw-r--r-- | zeta.c | 2 |
18 files changed, 35 insertions, 35 deletions
@@ -104,7 +104,7 @@ mpfr_acos (mpfr_ptr acos, mpfr_srcptr x, mp_rnd_t rnd_mode) mpfr_div (tmp, x, tmp, GMP_RNDN); mpfr_atan (arcc, tmp, GMP_RNDN); mpfr_const_pi (tmp, GMP_RNDN); - mpfr_div_2exp (tmp, tmp, 1, GMP_RNDN); + mpfr_div_2ui (tmp, tmp, 1, GMP_RNDN); mpfr_sub (arcc, tmp, arcc, GMP_RNDN); if (mpfr_can_round (arcc, realprec, GMP_RNDN, rnd_mode, MPFR_PREC(acos))) @@ -182,7 +182,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mp_rnd_t rnd_mode) mpfr_mul(tmp, u, v, GMP_RNDN); mpfr_sqrt (tmpu, tmp, GMP_RNDN); mpfr_add(tmp, u, v, GMP_RNDN); - mpfr_div_2exp(tmpv, tmp, 1, GMP_RNDN); + mpfr_div_2ui(tmpv, tmp, 1, GMP_RNDN); mpfr_set(u, tmpu, GMP_RNDN); mpfr_set(v, tmpv, GMP_RNDN); } @@ -128,7 +128,7 @@ mpfr_atan (mpfr_ptr arctangent, mpfr_srcptr x, mp_rnd_t rnd_mode) if (comparaison == 0) { mpfr_init2(Pisur2, prec_arctan); mpfr_const_pi(Pisur2, rnd_mode); - mpfr_div_2exp(arctangent, Pisur2, 2, rnd_mode); + mpfr_div_2ui(arctangent, Pisur2, 2, rnd_mode); if (signe == -1) MPFR_CHANGE_SIGN(arctangent); mpfr_clear(Pisur2); @@ -172,7 +172,7 @@ mpfr_atan (mpfr_ptr arctangent, mpfr_srcptr x, mp_rnd_t rnd_mode) { mpfr_init2(Pisur2, Prec); mpfr_const_pi(Pisur2, GMP_RNDN); - mpfr_div_2exp(Pisur2, Pisur2, 1, GMP_RNDN); + mpfr_div_2ui(Pisur2, Pisur2, 1, GMP_RNDN); mpfr_ui_div(sk, 1, xp, GMP_RNDN); } else @@ -182,7 +182,7 @@ mpfr_atan (mpfr_ptr arctangent, mpfr_srcptr x, mp_rnd_t rnd_mode) mpfr_set_ui (tmp_arctan, 0, GMP_RNDN); twopoweri = 1; for(i = 0; i <= N0; i++){ - mpfr_mul_2exp(tmp, sk, twopoweri, GMP_RNDN); + mpfr_mul_2ui(tmp, sk, twopoweri, GMP_RNDN); /* Calculation of trunc(tmp) --> mpz */ mpfr_trunc (ukf, tmp); exptol = mpz_set_fr (ukz, ukf); @@ -196,7 +196,7 @@ mpfr_atan (mpfr_ptr arctangent, mpfr_srcptr x, mp_rnd_t rnd_mode) mpz_neg(square, square); mpfr_atan_aux(t_arctan, square, 2*twopoweri, N0 - i); mpfr_set_z(Ak, ukz, GMP_RNDN); - mpfr_div_2exp(Ak, Ak, twopoweri, GMP_RNDN); + mpfr_div_2ui(Ak, Ak, twopoweri, GMP_RNDN); mpfr_mul(t_arctan, t_arctan, Ak, GMP_RNDN); /* Addition and iteration */ @@ -110,9 +110,9 @@ mpfr_atanh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode) /* compute atanh */ mpfr_ui_sub(te,1,x,GMP_RNDU); /* (1-xt)*/ mpfr_add_ui(ti,x,1,GMP_RNDD); /* (xt+1)*/ - mpfr_div(te,ti,te,GMP_RNDN); /* (1+xt)/(1-xt)*/ - mpfr_log(te,te,GMP_RNDN); /* ln((1+xt)/(1-xt))*/ - mpfr_div_2exp(t,te,1,GMP_RNDN); /* (1/2)*ln((1+xt)/(1-xt))*/ + mpfr_div(te,ti,te,GMP_RNDN); /* (1+xt)/(1-xt)*/ + mpfr_log(te,te,GMP_RNDN); /* ln((1+xt)/(1-xt))*/ + mpfr_div_2ui(t,te,1,GMP_RNDN); /* (1/2)*ln((1+xt)/(1-xt))*/ /* estimation of the error see- algorithms.ps*/ /* err=Nt-_mpfr_ceil_log2(1+5*pow(2,1-MPFR_EXP(t)));*/ diff --git a/const_euler.c b/const_euler.c index eb36fe6e6..1ae448b81 100644 --- a/const_euler.c +++ b/const_euler.c @@ -106,7 +106,7 @@ mpfr_const_euler_S (mpfr_t x, unsigned long n) thus that the error on x is at most one ulp */ mpfr_set_z (x, s, GMP_RNDD); - mpfr_div_2exp (x, x, m, GMP_RNDD); + mpfr_div_2ui (x, x, m, GMP_RNDD); mpz_clear (a); mpz_clear (s); @@ -152,7 +152,7 @@ mpfr_const_euler_R (mpfr_t x, unsigned long n) exit (1); } mpfr_set_z (x, s, GMP_RNDD); /* exact */ - mpfr_div_2exp (x, x, m, GMP_RNDD); + mpfr_div_2ui (x, x, m, GMP_RNDD); /* now x = 1/n * sum(k!/(-n)^k, k=0..n-2) <= 1/n */ /* err(x) <= (n+1)/2^m <= (n+1)*exp(n)/2^PREC(x) */ diff --git a/const_log2.c b/const_log2.c index 774eb072c..e5d368684 100644 --- a/const_log2.c +++ b/const_log2.c @@ -75,19 +75,19 @@ mpfr_const_aux_log2 (mpfr_ptr mylog, mp_rnd_t rnd_mode) mpfr_init2(tmp3, prec_x); mpz_set_ui(cst, 1); mpfr_aux_log2(tmp1, cst, 4, prec-2); - mpfr_div_2exp(tmp1, tmp1, 4,GMP_RNDD); - mpfr_mul_ui(tmp1, tmp1, 15,GMP_RNDD); + mpfr_div_2ui(tmp1, tmp1, 4, GMP_RNDD); + mpfr_mul_ui(tmp1, tmp1, 15, GMP_RNDD); mpz_set_ui(cst, 3); mpfr_aux_log2(tmp2, cst, 7, prec-2); - mpfr_div_2exp(tmp2, tmp2, 7,GMP_RNDD); - mpfr_mul_ui(tmp2, tmp2, 5*3,GMP_RNDD); + mpfr_div_2ui(tmp2, tmp2, 7, GMP_RNDD); + mpfr_mul_ui(tmp2, tmp2, 5*3, GMP_RNDD); mpfr_sub(result, tmp1, tmp2, GMP_RNDD); mpz_set_ui(cst, 13); mpfr_aux_log2(tmp3, cst, 8, prec-2); - mpfr_div_2exp(tmp3, tmp3, 8,GMP_RNDD); - mpfr_mul_ui(tmp3, tmp3, 3*13,GMP_RNDD); + mpfr_div_2ui(tmp3, tmp3, 8, GMP_RNDD); + mpfr_mul_ui(tmp3, tmp3, 3*13, GMP_RNDD); mpfr_sub(result, result, tmp3, GMP_RNDD); mpfr_clear(tmp1); diff --git a/const_pi.c b/const_pi.c index 94ea9fb3c..edca47860 100644 --- a/const_pi.c +++ b/const_pi.c @@ -97,7 +97,7 @@ mpfr_pi_machin3 (mpfr_ptr mylog, mp_rnd_t rnd_mode) mpfr_sub(result, result, tmp4, GMP_RNDD); mpfr_add(result, result, tmp5, GMP_RNDD); mpfr_add(result, result, tmp6, GMP_RNDD); - mpfr_mul_2exp(result, result, 2, GMP_RNDD); + mpfr_mul_2ui(result, result, 2, GMP_RNDD); mpfr_clear(tmp1); mpfr_clear(tmp2); mpfr_clear(tmp3); @@ -61,7 +61,7 @@ mpfr_cos (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) /* we need that |r| < 1 for mpfr_cos2_aux, i.e. up(x^2)/2^(2K) < 1 */ K = K0 + MAX(MPFR_EXP(r), 0); - mpfr_div_2exp (r, r, 2 * K, GMP_RNDN); /* r = (x/2^K)^2, err <= 1 ulp */ + mpfr_div_2ui (r, r, 2 * K, GMP_RNDN); /* r = (x/2^K)^2, err <= 1 ulp */ /* s <- 1 - r/2! + ... + (-1)^l r^l/(2l)! */ l = mpfr_cos2_aux (s, r); @@ -69,7 +69,7 @@ mpfr_cos (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) for (k = 0; k < K; k++) { mpfr_mul (s, s, s, GMP_RNDU); /* err <= 2*olderr */ - mpfr_mul_2exp (s, s, 1, GMP_RNDU); /* err <= 4*olderr */ + mpfr_mul_2ui (s, s, 1, GMP_RNDU); /* err <= 4*olderr */ mpfr_sub_ui (s, s, 1, GMP_RNDN); } @@ -99,7 +99,7 @@ mpfr_cosh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode) mpfr_exp(te,x,GMP_RNDD); /* exp(x) */ mpfr_ui_div(ti,1,te,GMP_RNDU); /* 1/exp(x) */ mpfr_add(t,te,ti,GMP_RNDN); /* exp(x) + 1/exp(x)*/ - mpfr_div_2exp(t,t,1,GMP_RNDN); /* 1/2(exp(x) + 1/exp(x))*/ + mpfr_div_2ui(t,t,1,GMP_RNDN); /* 1/2(exp(x) + 1/exp(x))*/ /* estimation of the error */ err=Nt-3; @@ -110,7 +110,7 @@ mpfr_exp_rational (mpfr_ptr y, mpz_srcptr p, int r, int m) mpfr_set_z(y,S[0], GMP_RNDD); MPFR_EXP(y) += expo; - mpfr_div_2exp(y, y, r*(i-1),GMP_RNDN); + mpfr_div_2ui(y, y, r*(i-1),GMP_RNDN); for (i=0;i<=m;i++) { mpz_clear(P[i]); mpz_clear(S[i]); mpz_clear(ptoj[i]); } TMP_FREE (marker); return 0; @@ -151,7 +151,7 @@ mpfr_exp3 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) if (ttt > 0) { shift_x = ttt; - mpfr_mul_2exp(x_copy,x,-ttt, GMP_RNDN); + mpfr_div_2ui(x_copy, x, ttt, GMP_RNDN); ttt = MPFR_EXP(x_copy); } realprec = MPFR_PREC(y)+logn; @@ -167,7 +167,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) printf(" ="); mpfr_print_binary(r); putchar('\n'); if (MPFR_SIGN(r)<0) { fprintf(stderr,"Error in mpfr_exp: r<0\n"); exit(1); } #endif - mpfr_div_2exp(r, r, K, GMP_RNDU); /* r = (x-n*log(2))/2^K */ + mpfr_div_2ui(r, r, K, GMP_RNDU); /* r = (x-n*log(2))/2^K */ TMP_MARK(marker); MY_INIT_MPZ(ss, 3 + 2*((q-1)/BITS_PER_MP_LIMB)); @@ -187,8 +187,8 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) mpfr_set_z(s, ss, GMP_RNDN); MPFR_EXP(s) += exps; TMP_FREE(marker); /* don't need ss anymore */ - if (n>0) mpfr_mul_2exp(s, s, n, GMP_RNDU); - else mpfr_div_2exp(s, s, -n, GMP_RNDU); + if (n>0) mpfr_mul_2ui(s, s, n, GMP_RNDU); + else mpfr_div_2ui(s, s, -n, GMP_RNDU); /* error is at most 2^K*(3l*(l+1)) ulp for mpfr_exp2_aux */ if (precy<SWITCH) l = 3*l*(l+1); @@ -164,12 +164,12 @@ mpfr_gamma (gamma, x, rnd_mode) #endif mpfr_const_pi(the_pi, GMP_RNDN); mpfr_const_pi(tmp, GMP_RNDN); - mpfr_mul_2exp(tmp, tmp, 1, GMP_RNDN); + mpfr_mul_2ui(tmp, tmp, 1, GMP_RNDN); mpfr_sqrt(tmp, tmp, GMP_RNDN); mpfr_add(GammaTrial, GammaTrial, tmp, GMP_RNDN); mpfr_add_ui(tmp2, xp, A, GMP_RNDN); mpfr_set_ui(tmp, 1, GMP_RNDN); - mpfr_div_2exp(tmp, tmp, 1, GMP_RNDN); + mpfr_div_2ui(tmp, tmp, 1, GMP_RNDN); mpfr_add(tmp, tmp, xp, GMP_RNDN); mpfr_pow(tmp, tmp2, tmp, GMP_RNDN); mpfr_mul(GammaTrial, GammaTrial, tmp, GMP_RNDN); @@ -188,7 +188,7 @@ GENERIC (mpfr_ptr y, mpz_srcptr p, int r, int m) mpfr_div (y, y, tmp, GMP_RNDD); mpfr_clear (tmp); #else - mpfr_div_2exp(y, y, r*(i-1), GMP_RNDN); + mpfr_div_2ui(y, y, r*(i-1), GMP_RNDN); #endif for (i=0;i<=m;i++) { @@ -227,9 +227,9 @@ mpfr_get_str (char *str, mp_exp_t *expptr, int base, size_t n, if (pow2) { if (div) - mpfr_div_2exp (b, op, pow2*p, rnd_mode); + mpfr_div_2ui (b, op, pow2*p, rnd_mode); else - mpfr_mul_2exp (b, op, pow2*p, rnd_mode); + mpfr_mul_2ui (b, op, pow2*p, rnd_mode); } else { @@ -52,7 +52,7 @@ mpfr_sin (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) /* first determine sign */ mpfr_const_pi (c, GMP_RNDN); - mpfr_mul_2exp (c, c, 1, GMP_RNDN); /* 2*Pi */ + mpfr_mul_2ui (c, c, 1, GMP_RNDN); /* 2*Pi */ mpfr_div (k, x, c, GMP_RNDN); /* x/(2*Pi) */ mpfr_floor (k, k); /* floor(x/(2*Pi)) */ mpfr_mul (c, k, c, GMP_RNDN); @@ -107,7 +107,7 @@ mpfr_sinh (mpfr_ptr y, mpfr_srcptr xt, mp_rnd_t rnd_mode) mpfr_exp(te,x,GMP_RNDD); /* exp(x) */ mpfr_ui_div(ti,1,te,GMP_RNDU); /* 1/exp(x) */ mpfr_sub(t,te,ti,GMP_RNDN); /* exp(x) - 1/exp(x)*/ - mpfr_div_2exp(t,t,1,GMP_RNDN); /* 1/2(exp(x) - 1/exp(x))*/ + mpfr_div_2ui(t,t,1,GMP_RNDN); /* 1/2(exp(x) - 1/exp(x))*/ /* calculation of the error*/ d = MPFR_EXP(te)-MPFR_EXP(t)+2; @@ -115,7 +115,7 @@ mpfr_tanh (y, xt, rnd_mode) mpfr_set_prec(tb,Nt); /* compute tanh */ - mpfr_mul_2exp(te,x,1,GMP_RNDN); /* 2x */ + mpfr_mul_2ui(te,x,1,GMP_RNDN); /* 2x */ mpfr_exp(te,te,GMP_RNDN); /* exp(2x) */ mpfr_add_ui(ta,te,1,GMP_RNDD); /* exp(2x) + 1*/ mpfr_sub_ui(tb,te,1,GMP_RNDU); /* exp(2x) - 1*/ @@ -69,7 +69,7 @@ mpfr_zeta (result, op, rnd_mode) /* mpfr_set_ui(nn,n,GMP_RNDN); */ mpfr_div_ui(z,u,n,GMP_RNDN); mpfr_mul(z2,z,z,GMP_RNDN); - mpfr_div_2exp(v,z2,1,GMP_RNDN); + mpfr_div_2ui(v,z2,1,GMP_RNDN); mpfr_set(s2,z,GMP_RNDN); mpfr_sub(s2,s2,v,GMP_RNDN); |