Home My Page Projects MPFI
Summary Activity Forums Tracker Lists Tasks Docs News SCM Files

[#14641] in mid.c, possible inexact division by 2

Date:
2012-07-20 14:47
Priority:
3
State:
Open
Submitted by:
Vincent Lefèvre (vlefevre)
Assigned to:
Nobody (None)
Category:
none
Group:
none
Resolution:
none
Summary:
in mid.c, possible inexact division by 2

Detailed description
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).

No Comments Have Been Posted

No Changes Have Been Made to This Item