From: Volker v. N. <vol...@gm...> - 2014-09-21 21:02:32
|
I used the quadratic Heron variant because it allows to compute what I want without any division. Here is how it works: The task is to compute the numerator and denominator of sqrt(10005). For merging the result into the Chudnovsky formula the quotient i.e. the sqrt is not needed. It took me some time to realize that. I start with a numerator n[0] and a denominator d[0], which are both (perfectly tailored) integer start values with a certain number p of bits so that after k iterations 2^k*p = fpprec + delta with delta very small. The quadratic Heron allows to compute n[i+1] and d[i+1] seperately by 4 multiplications, 1 addition and 1 shift: n[i+1] = n[i]^2+a*d[i]^2 d[i+1] = 2*n[i]*d[i] This is simple and fast. Am 21.09.2014 20:21, schrieb Richard Fateman: > I don't know what MPFR does for integer sqrt, but I think there may be > better for sqrt than Heron. > There are papers on cubic convergence. I found > > http://www.sciencedirect.com/science/article/pii/S0377042704004315 > > for example. > > But that may be essentially the taylor-series you already tried. > > It may actually be possible to just send email to bailey or borwein or > even plouffe, > and get an answer. I don't know plouffe, but I know the other two, and > bailey > is very near me in Berkeley. > > Have fun > > RJF > > On 9/21/2014 10:28 AM, Volker van Nek wrote: >> Am 21.09.2014 18:10, schrieb Richard Fateman: >>> I do not know if the splitting formula is the very fastest... I found >>> this reference >>> http://www.craig-wood.com/nick/articles/pi-chudnovsky/ >>> >>> which is not the most erudite discussion, but he claims his new code is >>> faster than "BPP". >>> However most of the time is spent in computing the sqrt of an integer. >>> >> Short remark: >> >> That was the page where I found the link to the paper of Haible and >> Papanikolaou. >> >> Yes, the sqrt part of the Chudnovsky formula is very time comsuming. For >> this problem I found an optimization. >> (I spent a lot of time with this problem and experimented with some >> alternatives. A binary splitted Taylor-series for the sqrt showed very >> good results but I ended I with an optimized Heron.) > |