which pi formula is given in the decimal module documentation?

Albert van der Horst albert at spenarnc.xs4all.nl
Mon Dec 21 10:33:33 EST 2009


In article <a266b155-02df-4294-8b91-41be4a1e4f81 at a32g2000yqm.googlegroups.com>,
Mark Dickinson  <dickinsm at gmail.com> wrote:
>On Dec 11, 10:30=A0am, Mark Dickinson <dicki... at gmail.com> wrote:
>> > It looks like an infinite series with term `t`, where`n` =3D (2k-1)^2
>> > and `d` =3D d =3D 4k(4k+2) for k =3D 1... Does it have a name?
>>
>> Interesting. =A0So the general term here is
>> 3 * (2k choose k) / (16**k * (2*k+1)), =A0k >=3D 0.
>>
>> I've no idea what its name is or where it comes from, though. =A0I
>> expect Raymond Hettinger would know.
>
>After a cup of coffee, it's much clearer:  this just comes from the
>Taylor series for arcsin(x), applied to x =3D 1/2 to get asin(1/2) =3D pi/
>6.

Curious. It seems better to calculate the zero of sin(pi/6)-1/2.
Not that we can forego the need of a Taylor series, but sin
converges much faster than arcsin.
The derivative is known analytically, and we have a 5th order process
before we know it.
It would be a big win for large precisions.
(Especially if we remember a previous value of pi to start up.)
The trick with temporarily increasing precision could be superfluous.

(I implemented this once in FORTRAN and was much disappointed that
double precision wasn't enough to show off the 5th order convergence. )

>--
>Mark

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert at spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst




More information about the Python-list mailing list