in mid.c, possible inexact division by 2
Imported issue: Initially reported by Vincent Lefèvre in https://gforge.inria.fr/tracker/?group_id=157&aid=14641
In src/mid.c r570 (latest revision):
/* In case of overflow: first division by 2 and then addition */
if (MPFR_IS_INF(m))
{
mpfr_init2(tmp_l, mpfi_get_prec(y));
mpfr_div_2ui(tmp_l, &(y->left), 1, GMP_RNDN); /* should be exact*/
mpfr_init2(tmp_r, mpfi_get_prec(y));
mpfr_div_2ui(tmp_r, &(y->right), 1, GMP_RNDN); /* should be exact*/
inexact_add = mpfr_add (m, tmp_l, tmp_r, GMP_RNDN);
mpfr_clear (tmp_l);
mpfr_clear (tmp_r);
}
but if the smallest bound (in absolute value) has the minimum exponent, its division by 2 is not exact. This can be possible if the precision is large enough w.r.t. the exponent range (so that the addition gives an overflow).