Can you calculate Pi using a Solver?
|
12-10-2019, 09:35 PM
(This post was last modified: 04-15-2023 02:21 PM by Albert Chan.)
Post: #11
|
|||
|
|||
RE: Can you calculate Pi using a Solver?
Pi via AGM, Emu71 HP-71B basic
Code: 10 A=1 @ B=SQRT(.5) @ S=1 @ P=1 >RUN 3.14040401902 3.1415926456 3.1415926536 3.14159265359 Comment: Apr 14, 2023 Above code started with S=1, and lowered it bit by bit. It may be more accurate to avoid this cancellation errors. Just click the green arrow for Free42 AGM code. (06-20-2020 04:23 PM)Albert Chan Wrote: To improve agm2 accuracy, I redefined agm2 returns: With above setup, x, y = agm2(1, sqrt(0.5)) --> S = 1+2*y --> pi = 2*x^2 / (y+1/2) .5 SQRT 1 XEQ "AGM" X = 8.472130847939790866064991234821916e-1 Y = -4.305341895553637462503337745231669e-2 X^2 2 * SWAP .5 + / 3.141592653589793238462643383279503 Or, less keystrokes, x, y = agm2(1, sqrt(2)) --> pi = 2*x^2 / (y+1) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)