Post Reply 
Recommend root-finder for HP 67
11-30-2019, 04:44 AM (This post was last modified: 11-30-2019 05:25 AM by Trond.)
Post: #3
RE: Recommend root-finder for HP 67
(11-30-2019 03:08 AM)Namir Wrote:  Here is the code for Newton's method for the HP-67:

Code:
Memory Map
============

R0 = Torelance
R1 = x
R2 = h
R3 = fx(x)

Listing
=======

LBL A
STO 1    # Store x
RDN
STO 0    # Store tolerance
LBL 0    # start iteration loop
RCL 1
PAUSE     # View curent guess for root
ABS
1
+
EEX
2
CHS
*
STO 2     # Store h
RCL 1
GSB E     # calculate fx(x)
STO 3
RCL 1
RCL 2
+
GSB E     # calculate fx(x+h)
RCL 3
-
1/X
RCL 3
*
RCL 2
*         # Calculate difference
STO- 1    # X = X - difference
ABS
RCL 0
X<=Y?     # |difference| >= tolerance?
GTO 0     # resume iteration
RCL 1     # display x
RTN
LBL E     # define f(x)
EXP
LASTX
X^2
3
*
-
RTN

Load the above program. Edit the code in LBL E to implement the function you want to find the root for. Then:

1) Enter the tolerance value.
2) Press Enter.
3) Enter the guess for the root.
4) Press the A key.
5) The program will display the intermediate guesses for the solution using a PAUSE statement. Then the program displays the refined guess for the root, based on the tolerance value supplied.

You can calculate fx(x) values by entering a value for x and then pressing the E key.

Thanks! I am looking in vain for "RDN", do you mean "RND"?
EDIT: ah, I guess it's "roll down"

EDIT2: and "EXP" would be yX right?

EDIT3: What needs to remain in "E"? Should it always start with LASTX, and then put my function behind that?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Recommend root-finder for HP 67 - Trond - 11-29-2019, 06:19 PM
RE: Recommend root-finder for HP 67 - Trond - 11-30-2019 04:44 AM



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