Post Reply 
[VA] SRC #016 - Pi Day 2024 Special
03-17-2024, 05:21 PM
Post: #14
RE: [VA] SRC #016 - Pi Day 2024 Special
(03-17-2024 04:05 PM)Gerson W. Barbosa Wrote:  3rd, on the hp 50g emulator:

'5/((1+√5)/2*EXP(∑(n=1,50000,
LNP1(-(1/(100*n^2))))))' EVAL


->

3.14159202448

As a comparison, the actual 12-digit result should be 3.14159202528

P. S.: For n = 100000, per the requirement:

3.14159233344

This is a nice use of both the 50G's summation function and the log function.
A similar code on the 71b gives:
>S=0 @ FOR N=1 TO 1E5 @ S=S+LOGP1(-1/N/N/100) @ NEXT N @ DISP 5*2/(1+SQR(5))/EXP(S)
3.14159233937
The ∑ function probably accumulates the sum with extended 15-digit accuracy, thus a slightly different result.
We can improve a little bit the 71B's code by summing backward:
>S=0 @ FOR N=1E5 TO 1 STEP -1 @ S=S+LOGP1(-1/N/N/100) @ NEXT N @ DISP 5*2/(1+SQR(5))/EXP(S)
3.14159233943

and this is the value I get with Free42 (to 12 digits). But at the end this doesn't improve the approximation of pi.

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #016 - Pi Day 2024 Special - J-F Garnier - 03-17-2024 05:21 PM



User(s) browsing this thread: 1 Guest(s)