summaryrefslogtreecommitdiff
path: root/exp_2.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2010-06-06 11:21:26 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2010-06-06 11:21:26 +0000
commit3f1c858f950f81cec743021cb75e130b3aa0e8f3 (patch)
treef138f3149348ba64a5d07a28c8e8f6b860dde9a0 /exp_2.c
parent5e5a9ad690146924a8e816952a51404d547b9c33 (diff)
downloadmpfr-3f1c858f950f81cec743021cb75e130b3aa0e8f3.tar.gz
[exp_2.c] Reverted incorrect optimization patch r6922 (added a comment).
There were failures on 32-bit machines. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6933 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'exp_2.c')
-rw-r--r--exp_2.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/exp_2.c b/exp_2.c
index ca7fff77b..0b471bff4 100644
--- a/exp_2.c
+++ b/exp_2.c
@@ -85,7 +85,6 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
int inexact;
mpfr_t r, s;
mpz_t ss;
- MPFR_GROUP_DECL(group);
MPFR_ZIV_DECL (loop);
MPFR_LOG_FUNC (("x[%#R]=%R rnd=%d", x, x, rnd_mode),
@@ -127,8 +126,10 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
/* add K extra bits, i.e. failure probability <= 1/2^K = O(1/precy) */
q = precy + err + K + 5;
-
- MPFR_GROUP_INIT_2 (group, q + error_r, r, s);
+ /* Note: due to the mpfr_prec_round below, it is not possible to use
+ the MPFR_GROUP_* macros here. */
+ mpfr_init2 (r, q + error_r);
+ mpfr_init2 (s, q + error_r);
/* the algorithm consists in computing an upper bound of exp(x) using
a precision of q bits, and see if we can round to MPFR_PREC(y) taking
@@ -221,11 +222,13 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
}
MPFR_ZIV_NEXT (loop, q);
- MPFR_GROUP_REPREC_2 (group, q, r, s);
+ mpfr_set_prec (r, q);
+ mpfr_set_prec (s, q);
}
MPFR_ZIV_FREE (loop);
- MPFR_GROUP_CLEAR (group);
+ mpfr_clear (r);
+ mpfr_clear (s);
return inexact;
}