summaryrefslogtreecommitdiff
path: root/src/fma.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-04-12 10:27:59 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-04-12 10:27:59 +0000
commitb93b17c5f7dc089a0532b33752b87634497762f0 (patch)
tree7edddecfd4933b8a928114f8e8d28987a02fd921 /src/fma.c
parente8624636bd5fe5f03bd8f47615ea8281c1e621d6 (diff)
downloadmpfr-b93b17c5f7dc089a0532b33752b87634497762f0.tar.gz
[src/fma.c] Correction for the FIXME from r12403 concerning r12396.
The test added in tests/tfma.c r12584 no longer fails. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12585 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/fma.c')
-rw-r--r--src/fma.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/fma.c b/src/fma.c
index a1d0d4100..9794bbf8b 100644
--- a/src/fma.c
+++ b/src/fma.c
@@ -260,14 +260,13 @@ mpfr_fma (mpfr_ptr s, mpfr_srcptr x, mpfr_srcptr y, mpfr_srcptr z,
mpfr_srcptr zz;
MPFR_BLOCK_DECL (flags);
- if (MPFR_GET_EXP (u) - MPFR_GET_EXP (z) > MPFR_PREC (s) + 1)
+ if (MPFR_GET_EXP (u) - MPFR_GET_EXP (z) >
+ MAX (MPFR_PREC (s), precx + precy) + 1)
{
- /* |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!
- FIXME[VL]: It should be |z| < ulp(u)/4 where the precision
- considered for the ulp is the maximum of the precisions of
- s and u. First, add a test... */
+ /* |z| < ulp(u)/4, where the ulp is meant with the maximum
+ of the precision of the result s and the precision of
+ the exact product x*y. Therefore one can use z instead
+ of z/4, including when u is a power of 2! */
zz = z;
}
else