diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2011-07-28 16:36:50 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2011-07-28 16:36:50 +0000 |
commit | d999e70d6bc45c0bd455e6384a3d71bfe358fbc2 (patch) | |
tree | fc480af0053126d6840061628a0c69f8f6e97010 /tune | |
parent | d8506f77bc9b2f4f78b99b0ffccb548e6e8c281e (diff) | |
download | mpfr-d999e70d6bc45c0bd455e6384a3d71bfe358fbc2.tar.gz |
[tuneup.c] fix tuning bounds of short product and division according to the
ARITH-20 paper
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7756 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tune')
-rw-r--r-- | tune/tuneup.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tune/tuneup.c b/tune/tuneup.c index 19ae6bc3d..d99cdeddf 100644 --- a/tune/tuneup.c +++ b/tune/tuneup.c @@ -768,7 +768,8 @@ tune_mul_mulders_upto (mp_size_t n) /* Check Mulders with cutoff point k */ step = 1 + n / (2 * MAX_STEPS); - for (k = n / 2 + 1 ; k < n ; k += step) + /* we need k >= (n+3)/2, which translates into k >= (n+4)/2 in C */ + for (k = (n + 4) / 2 ; k < n ; k += step) { mulhigh_ktab[n] = k; t = mpfr_speed_measure (speed_mpfr_mulhigh, &s, "mpfr_mulhigh"); @@ -813,7 +814,8 @@ tune_sqr_mulders_upto (mp_size_t n) /* Check Mulders */ step = 1 + n / (2 * MAX_STEPS); - for (k = n / 2 + 1 ; k < n ; k += step) + /* we need k >= (n+3)/2, which translates into k >= (n+4)/2 in C */ + for (k = (n + 4) / 2 ; k < n ; k += step) { sqrhigh_ktab[n] = k; t = mpfr_speed_measure (speed_mpfr_sqrhigh, &s, "mpfr_sqrhigh"); @@ -854,8 +856,9 @@ tune_div_mulders_upto (mp_size_t n) /* Check Mulders */ step = 1 + n / (2 * MAX_STEPS); - for (k = (n+1) / 2 ; k < n ; k += step) - // for (k = 1; k < n; k += step) + /* we should have (n+3)/2 <= k < n, which translates into + (n+4)/2 <= k < n in C */ + for (k = (n + 4) / 2 ; k < n ; k += step) { divhigh_ktab[n] = k; t = mpfr_speed_measure (speed_mpfr_divhigh, &s, "mpfr_divhigh"); |