diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2014-01-24 02:37:59 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2014-01-24 02:37:59 +0000 |
commit | a6926f545609cae068a525467045898be2dbb477 (patch) | |
tree | 292b3086bef15ce67300e3a32bd6e63e5b36012d /src/exp_2.c | |
parent | bba23fa95ac3cc865e156e8bd428738f1f55b021 (diff) | |
download | mpfr-a6926f545609cae068a525467045898be2dbb477.tar.gz |
[src/exp_2.c] Optimization: Increase the initial estimate of the number
of iterations (patch by Patrick PĂ©lissier).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8888 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/exp_2.c')
-rw-r--r-- | src/exp_2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/exp_2.c b/src/exp_2.c index cc7715662..375fe2e68 100644 --- a/src/exp_2.c +++ b/src/exp_2.c @@ -126,7 +126,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) /* for the O(n^(1/2)*M(n)) method, the Taylor series computation of n/K terms costs about n/(2K) multiplications when computed in fixed point */ - K = (precy < MPFR_EXP_2_THRESHOLD) ? __gmpfr_isqrt ((precy + 1) / 2) + K = (precy < MPFR_EXP_2_THRESHOLD) ? __gmpfr_isqrt ((precy + 1) / 2) + 5 : __gmpfr_cuberoot (4*precy); l = (precy - 1) / K + 1; err = K + MPFR_INT_CEIL_LOG2 (2 * l + 18); |