PDA

Click to See Complete Forum and Search --> : Recursive Definiton of PI


Illuminator
Jun 28th, 2001, 02:34 PM
From "Numerical Recipes in C: The art of Scientific Computing"
This has to be one of the best math/computer science resources around. It covers everything from linear algebra and integration to Fourier and Wavelets and it provides c code for everything.

This is one sample from the book.
A recursive definition of PI:


X(0) = 2^(1/2)
Y(0) = 2^(1/4)
PI(0) = 2+X(0)

X(i+1) = 1/2 * [X(i)^(1/2) + X(i)^(-1/2)]

Y(i+1) = [Y(i) * X(i+1)^(1/2) + X(i+1)^(-1/2)] / [Y(i) + 1]

PI(i+1) = PI(i) * [X(i+1) +1] / [Y(i) +1]


as i -> infinity PI(i) -> PI
The sample in the book approxiamated PI to 2398 decimal places

appi101
Jun 30th, 2001, 08:44 AM
Hi

How do we use this to find the value of Pi

Appi