--- agm.c.orig Mon Aug 25 11:49:31 2003 +++ agm.c Mon Aug 25 11:52:31 2003 @@ -117,14 +117,18 @@ while (go_on) { int err, can_round; mp_prec_t eq; + double erraux; - err=1 + (int) ((3.0/2.0*(double)_mpfr_ceil_log2((double)p)+1.0)*_mpfr_ceil_exp2(-(double)p) - +3.0*_mpfr_ceil_exp2(-2.0*(double)p*uo/(vo-uo))); + erraux = (vo == uo) ? 0.0 : _mpfr_ceil_exp2 (-2.0 * (double) p * uo + / (vo - uo)); + err = 1 + (int) ((3.0 / 2.0 * (double) _mpfr_ceil_log2 ((double) p) + + 1.0) * _mpfr_ceil_exp2 (- (double) p) + + 3.0 * erraux); if(p-err-3<=q) { p=q+err+4; err= 1 + (int) ((3.0/2.0*_mpfr_ceil_log2((double)p)+1.0)*_mpfr_ceil_exp2(-(double)p) - +3.0*_mpfr_ceil_exp2(-2.0*(double)p*uo/(vo-uo))); + +3.0 * erraux); } /* Calculus of un and vn */