home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.programming
- Path: sparky!uunet!mcsun!ieunet!tcdcs!unix1.tcd.ie!bosullvn
- From: bosullvn@unix1.tcd.ie (Bryan O'Sullivan)
- Subject: Re: how to calculate PI
- Message-ID: <bosullvn.727615765@unix1.tcd.ie>
- Sender: usenet@cs.tcd.ie (NN required at ashe.cs.tcd.ie)
- Nntp-Posting-Host: unix1.tcd.ie
- Organization: Computer Science Department, Trinity College, Dublin, Ireland
- References: <peterd.727508100@tscc2> <LOWRY.93Jan20104500@rotor.watson.ibm.com> <c8h3xpm@rpi.edu>
- Date: Thu, 21 Jan 1993 11:29:25 GMT
- Lines: 31
-
- rogerj@aix.rpi.edu (Diversion (Jeff Rogers)) writes:
-
- >>Andy Lowry writes:
-
- >> pi/4 = 4*atan(1/5)-atan(1/239)
-
- >Why not just
- > pi/4=atan(1)?
- >If your answer is in radians, this works too, but
- >I think it requires prior knowledge of pi.
-
- Exactly. It's a bit circular, no? Seems the formula Andy Lowry
- quotes better lends itself to Taylor Series expansion.
-
- >... but I don't see why a taylor expansion would work for some values
- >and not others.
-
- Seems to work for all values, but I could well be wrong. I've got
- a (totally uncommented and rather obtuse) variant of Gregory's
- algorithm written in C which churns out values fairly quickly; it's
- not particularly optimised, but takes about 7 seconds to churn out
- 1000 digits of pi on an unloaded SPARCstation.
-
- I've not looked at any analyses, but it seems that Gregory's
- algorithm gets roughly exponentially slower with the number of
- digits of precision required. Or perhaps it's just the variant I
- have.
-
- <b
- --
- SCRG, Department of Computer Science, Trinity College
-