Post Reply 
Solve w/ HP-41 Formula Eval Module
07-22-2017, 09:37 PM
Post: #5
RE: Solve w/ HP-41 Formula Eval Module
(07-18-2017 02:21 PM)Gene Wrote:  Ah, sorry, now I see it. Question might help someone else who does not.

EVALT will evaluate the formula in ALPHA "X+Y" or "X+T/Y" or whatever, using the values in the indicated stack registers and overwrite the value computed into the T register. Same with EVALZ etc. but in this case, the object is to find the root of X with guesses in X and Y.

Therefore, EVALZ will take X and compute the function value, followed by X<>Y EVALT which will compute the function value using the second guess originally in Y.

My confusion was thinking EVALZ would take the value of Z as the "X" for the evaluation and store the result in Z. That's not correct of course.

What Ángel and I tried to do with the EVALx series of functions was to insure that only the intended stack register (and LastX) was modified with the results of the formula in Alpha. Hence, EVAL$ touches X and L only, EVALY touches Y and L only, EVALZ touches Z and L only, EVALT touches T and L only, and EVALL touches only L (with EVALL having no LastX capability, of course).

We get away with that because all the partial calculations are pushed/popped from a special buffer (#6) as well as other important formula info. So this yields a lot of power to the user, allowing them to use the stack the way they want to. This action only occurs at the very end of the formula evaluation phase, and that means you have 5 "variables" to use in the stack (X, Y, Z, T, and L) and 5 "constants" to use in buffer 7 (a, b, c, d, and e) before the stack is modified by the final phase of the desired EVALx function.

About the only negative to all this is execution time (this is due to formula interpretation), but with positive tradeoffs of not having to create a FOCAL program to evaluate a formula, and controlled use of the stack. Now for REALLY complicated formulas, FOCAL is there ready to execute the EVALx statements, as shown with the SV$ example at the beginning of this thread.

Greg
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Solve w/ HP-41 Formula Eval Module - gjmcclure - 07-22-2017 09:37 PM



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