summaryrefslogtreecommitdiff
path: root/fma.c
diff options
context:
space:
mode:
authordaney <daney@280ebfd0-de03-0410-8827-d642c229c3f4>2001-10-25 14:04:09 +0000
committerdaney <daney@280ebfd0-de03-0410-8827-d642c229c3f4>2001-10-25 14:04:09 +0000
commit676ce55c834adf0a2977eee5c10221f3f31008ca (patch)
tree1f5e51595c3638033ff3d79f5bc2b97ae95ebc81 /fma.c
parent5541d17d6e6dcf290ce428027716abbd3eaf06a2 (diff)
downloadmpfr-676ce55c834adf0a2977eee5c10221f3f31008ca.tar.gz
new version
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1365 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'fma.c')
-rw-r--r--fma.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/fma.c b/fma.c
index 9e81b8258..a2710d2d5 100644
--- a/fma.c
+++ b/fma.c
@@ -107,6 +107,9 @@ mpfr_fma (s,x,y,z, rnd_mode)
mpfr_t t, u;
int d;
+ /* Flag calcul exacte */
+ int not_exact=0;
+
/* Declaration of the size variable */
mp_prec_t Nx = MPFR_PREC(x); /* Precision of input variable */
mp_prec_t Ny = MPFR_PREC(y); /* Precision of input variable */
@@ -127,16 +130,20 @@ mpfr_fma (s,x,y,z, rnd_mode)
/* initialise the intermediary variables */
mpfr_init(u);
mpfr_init(t);
-
+ printf("New \n********\n\n");
/* First computation of fma */
do {
+
+ printf("Nt = %i\n",Nt);
/* reactualisation of the precision */
mpfr_set_prec(u,Nt);
mpfr_set_prec(t,Nt);
/* computations */
- mpfr_mul(u,x,y,GMP_RNDN);
- mpfr_add(t,z,u,GMP_RNDN);
+ if(mpfr_mul(u,x,y,GMP_RNDN))
+ not_exact=1;
+ if(mpfr_add(t,z,u,GMP_RNDN))
+ not_exact=1;
/*Nt=Nt+(d+1)+_mpfr_ceil_log2(Nt); */
d = MPFR_EXP(u)-MPFR_EXP(t);
@@ -149,7 +156,7 @@ mpfr_fma (s,x,y,z, rnd_mode)
first_pass=1;
- } while (!mpfr_can_round(t,err,GMP_RNDN,rnd_mode,Ns));
+ } while (!mpfr_can_round(t,err,GMP_RNDN,rnd_mode,Ns)&& not_exact);
inexact = mpfr_set (s, t, rnd_mode);
mpfr_clear(t);