Post Reply 
Cadillac Quadratic Solver behaving like an Edsel - Problem solved!!
09-17-2014, 01:23 AM
Post: #22
RE: Cadillac Quadratic Solver behaving like an Edsel - Problem solved!!
You don't really need the SIGN function. You can exchange the SQRT with register F and use register arithmetic (lines B12 - B17). But then you don't push F onto the stack. That's why we need to recall F later in line E07.

Code:
B01 LBL B
B02 FIX 9
B03 RCL H
B04 x^2
B05 STO(i)
B06 RCL D
B07 RCL I
B08 SUM -
B09 SUM xy
B10 x<0?
B11 GTO E
B12 SQRT
B13 x<> F
B14 x<0?
B15 RCL- F
B16 x>=0?
B17 RCL+ F
B18 STO J
B19 x<>y
B20 /
B21 RCL J
B22 x#0?
B23 GTO F
B24 CLx
B25 STOP
F01 LBL F
F02 RCL G
F03 x<>y
F04 /
F05 STOP
E01 LBL E
E02 SF 0
E03 +/-
E04 SQRT
E05 RCL D
E06 /
E07 RCL F
E08 R UP
E09 /
E10 STOP

Currently I have troubles with my HP-32II and therefore can't test these changes. But as an inspiration you can have a look at the original code for the HP-15C (lines 057-061 of program B).

HTH
Thomas

PS: Sorry for being late to the party.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Cadillac Quadratic Solver behaving like an Edsel - Problem solved!! - Thomas Klemm - 09-17-2014 01:23 AM



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