Post Reply 
Can you calculate Pi using a Solver (on the prime)?
12-17-2019, 08:08 AM (This post was last modified: 12-17-2019 09:25 AM by Stevetuc.)
Post: #1
Can you calculate Pi using a Solver (on the prime)?
In this thread post #26
https://www.hpmuseum.org/forum/thread-14...#pid125210

Valentin gives a recursive method to solve for Pi using fnroot solver.
Valentin Albillo ' Wrote:  [...]For instance, if your Solver admits nesting and can use the Gamma function, then this will do:Code for the HP-71B, where FNROOT (Find Root) is the "official" HP-71B's "Solver":

     1   DEF FNF(X) = FNROOT(1, 1, GAMMA(FVAR) - X)
     2   DISP FNROOT(3, 4, FNF(SQR(FVAR)) - 1/2)

>RUN

          3.14159265359

This produces as a root the theoretically exact (not an approximation) value of Pi.

V.


Tried this on the prime but it appears that the solver doesnt support recursion
Code:
EXPORT FVAR:=0;
EXPORT FNF(X)
BEGIN
FNROOT(Gamma(FVAR)-X,FVAR,1,1);
END;

And then at Home screen:

Code:
FNROOT(FNF(√(FVAR))-(1/2),FVAR,3,4)

produces the error Error: Bad Guess(es)

I also tried defining FNF as a user function using Define key, changing and omitting initial guesses, but same error. ROOT instead of FNROOT gives Error:No solution found.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Can you calculate Pi using a Solver (on the prime)? - Stevetuc - 12-17-2019 08:08 AM



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