Results 1 to 2 of 2

Thread: Recursive Definiton of PI

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Posts
    84

    Recursive Definiton of PI

    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:

    Code:
     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

  2. #2
    appi101
    Guest
    Hi

    How do we use this to find the value of Pi

    Appi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width