[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

RE: [FWP] algorithm to calculate pi



Andy Bach [mailto:root@wiwb.uscourts.gov] said on Monday, June 26
> On Sun, 25 Jun 2000, Michael Assels wrote:
> > I can't promise 280 digits, but here's something shorter:
> > 
> > #!/usr/bin/perl -l
> > 
> for(0..9999){$i=$_*8;$p+=(16**-$_)*(4/($i+1)-2/($i+4)-1/($i+5)
> -1/($i+6))}print$p
> 
> and, briefly, can one of the math whizes say why?

Mathworld is a great place to find answers to this kind of question.

Travelling from 
    http://mathworld.wolfram.com/Pi.html
to
    http://mathworld.wolfram.com/PiFormulas.html
led me to
    http://mathworld.wolfram.com/Bailey-Borwein-PlouffeAlgorithm.html
and finally to
    http://www.cecm.sfu.ca/~pborwein/PAPERS/P123.ps
and
     http://www.mathsoft.com/asolve/plouffe/plouffe.html
which lists more notes and variants.

Page 3 of the postscript paper shows a proof (or at least parts
of it) as to why that expression works out to pi.
-- 
Mike
 

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe