diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-02-22 10:30:25 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-02-22 10:30:25 +0000 |
commit | ef54f709b94a0bd2bd113bf78dd3a782de913d8c (patch) | |
tree | 42b8529bf39bc8aa34af01b7f307a28a18dddc6a | |
parent | 822e16eb825ff9dc45ef555884ed37e4a87424e8 (diff) | |
download | mpfr-ef54f709b94a0bd2bd113bf78dd3a782de913d8c.tar.gz |
[src/fma.c] fixed last failure
[tests/tfma.c] removed debug stuff
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12396 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/fma.c | 5 | ||||
-rw-r--r-- | tests/tfma.c | 3 |
2 files changed, 5 insertions, 3 deletions
@@ -261,9 +261,10 @@ mpfr_fma (mpfr_ptr s, mpfr_srcptr x, mpfr_srcptr y, mpfr_srcptr z, MPFR_BLOCK_DECL (flags); if (MPFR_GET_EXP (u) > MPFR_GET_EXP (z) && - MPFR_GET_EXP (u) - MPFR_GET_EXP (z) > MPFR_PREC (u) + 1) + MPFR_GET_EXP (u) - MPFR_GET_EXP (z) > MPFR_PREC (s) + 1) { - /* |z| < ulp(u)/4, therefore one can use z instead of z/4, + /* |z| < ulp(u)/4, where the ulp is meant with the precision + of the result s, therefore one can use z instead of z/4, including when u is a power of 2! */ zz = z; } diff --git a/tests/tfma.c b/tests/tfma.c index 07a2f2e65..513308b5b 100644 --- a/tests/tfma.c +++ b/tests/tfma.c @@ -216,6 +216,7 @@ test_overflow3 (void) inex = mpfr_fma (r, x, y, z, MPFR_RNDN); MPFR_ASSERTN(inex > 0); MPFR_ASSERTN(mpfr_inf_p (r) && mpfr_sgn (r) > 0); + MPFR_ASSERTN(mpfr_overflow_p ()); mpfr_clears (x, y, z, r, (mpfr_ptr) 0); } @@ -238,9 +239,9 @@ test_overflow4 (void) x*y+z = 2^emax - 2^(emax-2p-3) + 2^(emax-3p-3) should overflow, since it is closest from 2^emax than from 2^emax - 2^(emax-2p-1). */ inex = mpfr_fma (r, x, y, z, MPFR_RNDN); - mpfr_dump (r); MPFR_ASSERTN(inex > 0); MPFR_ASSERTN(mpfr_inf_p (r) && mpfr_sgn (r) > 0); + MPFR_ASSERTN(mpfr_overflow_p ()); mpfr_clears (x, y, z, r, (mpfr_ptr) 0); } |