Post Reply 
HP-41: Formula Evaluation ROM
06-12-2017, 07:13 AM (This post was last modified: 06-12-2017 08:40 AM by Ángel Martin.)
Post: #18
RE: HP-41: Formula Evaluation ROM
(06-11-2017 03:47 PM)Gene Wrote:  Step 4: "|-(T-1))/T"

The first character is an append sign. This makes sense as step 4 would overwrite step 3 otherwise.

Thanks to Angel for the confirmation and help.

And the same for line #35 - and in general for every formula that spans two program steps.

Here's another example to calculate the Lambert function W(x)

This one requires calling EVAL$ twice because Newton's formula exceeds 24 chars, so we break it in two sections. Despite that it only takes 15 steps.

Type: x, XEQ "WL$" => successive approximations shown until final result.
Note that in some cases there may be some oscillations around the last decimal digit due to the Newton method. You can modify the program to cover for this contingency (the root cause is the X#Y? instruction at step #13, thus you can add X<>Y, RND, X<>Y RND right before the test is made - with the calculator in FIX 9).

Code:
1    LBL "WL$
2    STO Z
3    LN1+X
4    STO L
5    LBL 00
6    STO Y
7    "X*E(X)"
8    EVAL$
9    "L-((X-Z)/(X+E(L"
10    "|- )))"  - append and 3 paren
11    EVAL$
12    VIEW X
13    X#Y?
14    GTO 00
15    END

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP-41: Formula Evaluation ROM - Namir - 06-06-2017, 05:38 PM
RE: HP-41: Formula Evaluation ROM - pier4r - 06-06-2017, 10:05 PM
RE: HP-41: Formula Evaluation ROM - Gene - 06-06-2017, 06:12 PM
RE: HP-41: Formula Evaluation ROM - Gene - 06-07-2017, 02:33 AM
RE: HP-41: Formula Evaluation ROM - Gene - 06-11-2017, 03:47 PM
RE: HP-41: Formula Evaluation ROM - Ángel Martin - 06-12-2017 07:13 AM



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