Yet another π formula
|
01-05-2021, 10:50 PM
Post: #4
|
|||
|
|||
RE: Yet another π formula
(01-04-2021 08:41 PM)Gerson W. Barbosa Wrote: The alternate sum of the factors of the Wallis product tends to \(\pi\)/4 - 1/2 as \(n\) tends to infinity: Where does this limit comes from ? CAS can get pi/4 - 1/2, but the "proof" felt cheating. Cas> expand(sum(1/((4*k-3)*(4*k-1))-1/((4*k-1)*(4*k+1)),k = (1 .. ∞))) → 1/4*π-1/2 --- I find this remarkable formula for approximating the sum of alternating series. Example: above pi formula, for 1000 terms To reduce errors, do the sum in pairs, and backwards. lua> s = 0 lua> for k=500,1,-1 do c=4*k-1; s=s+4/(c*(c*c-4)) end lua> (s + 0.5) * 4 3.141592154089668 Add correction, from next 3 terms: lua> function term(k) return (-1)^(k-1)/(4*k*k-1) end lua> f1, f2, f3 = term(1001), term(1002), term(1003) lua> s = s + (7*f1 - f2 - 2*f3)/12 -- alternate series correction lua> (s + 0.5) * 4 3.141592653588056 lua> pi 3.141592653589793 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)