summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-01-26 17:03:19 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-01-26 17:03:19 +0000
commit65f156be846e6e08a793ece5075ef66a37d38151 (patch)
tree54e3797754fdcb74d7cd523fa57b64287e5ecb75 /tests
parent17c4d1ace7e5395e65124da44a13bbce858573bc (diff)
downloadmpfr-65f156be846e6e08a793ece5075ef66a37d38151.tar.gz
[tests/tdiv.c] Completed r12128 test with new comments and an assert.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12132 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r--tests/tdiv.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/tdiv.c b/tests/tdiv.c
index 02ffbec33..da12dfda9 100644
--- a/tests/tdiv.c
+++ b/tests/tdiv.c
@@ -1521,7 +1521,12 @@ bug20171218 (void)
/* Extended test based on a bug found with flint-arb test suite with a
32-bit ABI: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888459
- A failure may occur in r12126 with pb=GMP_NUMB_BITS and MPFR_RNDN.
+ Division of the form: (1 - 2^(-pa)) / (1 - 2^(-pb)).
+ The result is compared to the one obtained by increasing the precision
+ of the denominator (without changing its value, so that both results
+ should be equal). For all of these tests, a failure may occur in r12126
+ only with pb=GMP_NUMB_BITS and MPFR_RNDN (and some particular values of
+ pa and pc).
*/
static void
bug20180126 (void)
@@ -1542,9 +1547,9 @@ bug20180126 (void)
mpfr_inits2 (pb, b2, (mpfr_ptr) 0);
mpfr_set_ui (a, 1, MPFR_RNDN);
- mpfr_nextbelow (a);
+ mpfr_nextbelow (a); /* 1 - 2^(-pa) */
mpfr_set_ui (b2, 1, MPFR_RNDN);
- mpfr_nextbelow (b2);
+ mpfr_nextbelow (b2); /* 1 - 2^(-pb) */
inex1 = mpfr_set (b1, b2, MPFR_RNDN);
MPFR_ASSERTN (inex1 == 0);
@@ -1554,6 +1559,7 @@ bug20180126 (void)
RND_LOOP_NO_RNDF (r)
{
+ MPFR_ASSERTN (mpfr_equal_p (b1, b2));
inex1 = mpfr_div (c1, a, b1, (mpfr_rnd_t) r);
inex2 = mpfr_div (c2, a, b2, (mpfr_rnd_t) r);