diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-04-12 10:27:59 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-04-12 10:27:59 +0000 |
commit | b93b17c5f7dc089a0532b33752b87634497762f0 (patch) | |
tree | 7edddecfd4933b8a928114f8e8d28987a02fd921 /src/fma.c | |
parent | e8624636bd5fe5f03bd8f47615ea8281c1e621d6 (diff) | |
download | mpfr-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.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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 |