Pi Approximation Day
|
07-22-2020, 11:22 PM
Post: #1
|
|||
|
|||
Pi Approximation Day
Today is Pi Approximation Day.
To celebrate it, here is an HP 50g program based on a variation of the Wallis Product. Here we use (2/1*4/3*6/5*8/7*...) plus a correction factor in continued fraction form. The number of digits per iteration is slightly less than 21/10, which is being used by the program, so this has to be adjusted. The argument of the RPL program is the desired number of decimal places. For n = 100, the program returns 98 correct decimal digits; for n = 200, the program gets all of them right. This takes about one minute on the emulator because of the slowness of EXPAND to process long algebraic expressions. Code:
253 bytes, CKS = # 537h 3,14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745 028410270193852110555964462294895493038196 HP-75C program: Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)