summaryrefslogtreecommitdiff
path: root/agm.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-06-20 13:22:49 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2007-06-20 13:22:49 +0000
commit6ace8c2b5075f9aa849469ec73435e6e78713f26 (patch)
tree8d6d8aca017a947b461ac5bb5937a6f85edb6e82 /agm.c
parentd5913d021b41388498583ad4cd87eb00a586b37c (diff)
downloadmpfr-6ace8c2b5075f9aa849469ec73435e6e78713f26.tar.gz
Untabified and removed trailing spaces.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4553 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'agm.c')
-rw-r--r--agm.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/agm.c b/agm.c
index d43327557..9f4537a31 100644
--- a/agm.c
+++ b/agm.c
@@ -126,34 +126,34 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mp_rnd_t rnd_mode)
while (mpfr_cmp2 (u, v, &eq) != 0 && eq <= p - 2)
{
mpfr_add (tmp, u, v, GMP_RNDN);
- mpfr_div_2ui (tmp, tmp, 1, GMP_RNDN);
+ mpfr_div_2ui (tmp, tmp, 1, GMP_RNDN);
/* See proof in algorithms.tex */
if (4*eq > p)
{
- mpfr_t w;
- /* tmp = U(k) */
- mpfr_init2 (w, (p + 1) / 2);
+ mpfr_t w;
+ /* tmp = U(k) */
+ mpfr_init2 (w, (p + 1) / 2);
mpfr_sub (w, v, u, GMP_RNDN); /* e = V(k-1)-U(k-1) */
mpfr_sqr (w, w, GMP_RNDN); /* e = e^2 */
mpfr_div_2ui (w, w, 4, GMP_RNDN); /* e*= (1/2)^2*1/4 */
mpfr_div (w, w, tmp, GMP_RNDN); /* 1/4*e^2/U(k) */
mpfr_sub (v, tmp, w, GMP_RNDN);
- err = MPFR_GET_EXP (tmp) - MPFR_GET_EXP (v); /* 0 or 1 */
- mpfr_clear (w);
+ err = MPFR_GET_EXP (tmp) - MPFR_GET_EXP (v); /* 0 or 1 */
+ mpfr_clear (w);
break;
}
mpfr_mul (u, u, v, GMP_RNDN);
mpfr_sqrt (u, u, GMP_RNDN);
mpfr_swap (v, tmp);
- n ++;
+ n ++;
}
/* the error on v is bounded by (18n+51) ulps, or twice if there
- was an exponent loss in the final subtraction */
+ was an exponent loss in the final subtraction */
err += MPFR_INT_CEIL_LOG2(18 * n + 51); /* 18n+51 should not overflow
- since n is about log(p) */
+ since n is about log(p) */
/* we should have n+2 <= 2^(p/4) [see algorithms.tex] */
if (MPFR_LIKELY (MPFR_INT_CEIL_LOG2(n + 2) <= p / 4 &&
- MPFR_CAN_ROUND (v, p - err, q, rnd_mode)))
+ MPFR_CAN_ROUND (v, p - err, q, rnd_mode)))
break; /* Stop the loop */
/* Next iteration */