summaryrefslogtreecommitdiff
path: root/src/invsqrt_limb.h
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2017-01-24 10:34:36 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2017-01-24 10:34:36 +0000
commit57f4a88c504d9b8f82ffddd34f8c8b2484d55710 (patch)
tree03e7b5ed9b3785b528c96af22d7f2de73432485e /src/invsqrt_limb.h
parent86fa25560949294c84130ac07a883378f36a1aae (diff)
downloadmpfr-57f4a88c504d9b8f82ffddd34f8c8b2484d55710.tar.gz
[src/invsqrt_limb.h] changed slightly definition of d10 and d37 (does not
change final error analysis) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11224 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/invsqrt_limb.h')
-rw-r--r--src/invsqrt_limb.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/invsqrt_limb.h b/src/invsqrt_limb.h
index dffda944e..b830172f0 100644
--- a/src/invsqrt_limb.h
+++ b/src/invsqrt_limb.h
@@ -26,11 +26,11 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
/* for now, we only provide __gmpfr_invert_limb for 64-bit limb */
#if GMP_NUMB_BITS == 64
-/* For 256 <= d10 <= 1024, T[d10-256] = min(2^11-1,floor(sqrt(2^30/d10))).
+/* For 257 <= d10 <= 1024, T[d10-257] = floor(sqrt(2^30/d10)).
Sage code:
- T = [min(2^11-1,floor(sqrt(2^30/d10))) for d10 in [256..1024]] */
-static const mp_limb_t T[] =
- { 2047, 2044, 2040, 2036, 2032, 2028, 2024, 2020, 2016, 2012, 2009, 2005,
+ T = [floor(sqrt(2^30/d10)) for d10 in [257..1024]] */
+static const mp_limb_t T[768] =
+ { 2044, 2040, 2036, 2032, 2028, 2024, 2020, 2016, 2012, 2009, 2005,
2001, 1997, 1994, 1990, 1986, 1983, 1979, 1975, 1972, 1968, 1965, 1961,
1958, 1954, 1951, 1947, 1944, 1941, 1937, 1934, 1930, 1927, 1924, 1920,
1917, 1914, 1911, 1907, 1904, 1901, 1898, 1895, 1891, 1888, 1885, 1882,
@@ -97,8 +97,8 @@ static const mp_limb_t T[] =
1024 };
/* table of v0^3 */
-static const mp_limb_t T3[] =
- { 8577357823, 8539701184, 8489664000, 8439822656, 8390176768, 8340725952,
+static const mp_limb_t T3[768] =
+ { 8539701184, 8489664000, 8439822656, 8390176768, 8340725952,
8291469824, 8242408000, 8193540096, 8144865728, 8108486729, 8060150125,
8012006001, 7964053973, 7928215784, 7880599000, 7833173256, 7797729087,
7750636739, 7703734375, 7668682048, 7622111232, 7587307125, 7541066681,
@@ -246,10 +246,10 @@ static const mp_limb_t T3[] =
do { \
mp_limb_t _d, _i, _v0, _e0, _d37, _v1, _e1, _h, _v2, _e2; \
_d = (d); \
- _i = ((_d - 1) >> 54) - 255; \
+ _i = (_d >> 54) - 256; \
/* i = d10 - 256 */ \
_v0 = T[_i]; \
- _d37 = 1 + ((_d - 1) >> 27); \
+ _d37 = 1 + (_d >> 27); \
_e0 = T3[_i] * _d37; \
/* the value (_v0 << 57) - _e0 is less than 2^61 */ \
_v1 = (_v0 << 11) + (((_v0 << 57) - _e0) >> 47); \