home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!news.nd.edu!mentor.cc.purdue.edu!news
- From: ags@seaman.cc.purdue.edu (Dave Seaman)
- Newsgroups: comp.programming
- Subject: Re: how to calculate PI
- Message-ID: <C17vvq.Msr@mentor.cc.purdue.edu>
- Date: 21 Jan 93 18:40:37 GMT
- References: <c8h3xpm@rpi.edu>
- Sender: news@mentor.cc.purdue.edu (USENET News)
- Organization: Purdue University
- Lines: 30
-
- In article <c8h3xpm@rpi.edu> rogerj@aix.rpi.edu (Diversion (Jeff Rogers))
- writes:
- > lowry@watson.ibm.com (Andy Lowry) writes:
- > >In any case, you can use Taylor expansion to get atan(1/5) and
- > >atan(1/239). I understand there are more high-powered schemes out
- >
- > Maybe this is the answer (to my question above), but I don't see why a
- > taylor expansion would work for some values and not others.
-
- It's called "radius of convergence." The Taylor expansion in question is
-
- atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...
-
- and it turns out that the radius of convergence is 1. That means the
- series converges for |x| < 1 and diverges for |x| > 1. For x = 1 you get
-
- pi/4 = atan(1) = 1 - 1/3 + 1/5 - 1/7 + ...
-
- and the series converges, but with painful slowness. You have to add
- around a thousand terms just to get three-digit accuracy, and for each
- additional digit you need ten times as many terms. Compare this with
-
- atan(1/239) = 1/239 - 1/(3*239^3) + 1/(5*239^5) - ...
-
- which converges very rapidly, and you can see the advantage of using small
- arguments in the atan series.
-
- --
- Dave Seaman
- ags@seaman.cc.purdue.edu
-