Post Reply 
41C/CV root finders
05-21-2015, 12:51 PM
Post: #9
RE: 41C/CV root finders
I knocked out a simple lazy Newton's method solver (lazy in that it approximates the 1st derivative using f(1.000001x) and f(.999999x)), and it seems functional but definitely suboptimal. Here's the code for it, if you want to have a chuckle at my background obviously not being in numeric methods.

Code:

LBL "FN="
"FN="
AON
PROMPT
ASTO 20
AOFF
RTN

LBL "SOLVE"
"REG="
AOFF
PROMPT
STO 21
LBL "PSOLVE"
RCL IND 21
STO 22
LBL 00
CLA
ARCL X
AVIEW
STO IND 21
XEQ IND 20
STO 23
X=0?
GTO 04
RCL 22
1
1 E-6
-
*
STO IND 21
XEQ IND 20
STO 24
RCL 22
1
1 E-6
+
*
STO IND 21
XEQ IND 20
STO 25
RCL 24
-
X=0?
GTO 09
RCL 22
2 E-6
*
X<>Y
/
RCL 23
*
CHS
RCL 22
+
STO 22
GTO 00
LBL 04
RCL 22
RTN
LBL 09
RCL 23
RCL 22
RTN
END

LBL 09 is where it would check for extrema or discontinuities if I had implemented that part yet. I fed it numbers similar to my mortgage loan, and it obtained i%, but it wasn't exactly fast. Evaluating the function three times for every iteration really takes its toll on speed.

I'll have to study the HP-80 article more so as to have a better approximation of its algorithm. There's also a 19C/29C i% solver that uses Newton's method that's on the museum DVD (part of the general application book, I think), and I might be able to use some of that. I don't even necessarily need a general purpose solver, just one that's suited for handling the TVM equation.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
41C/CV root finders - Dave Britten - 05-20-2015, 07:07 PM
RE: 41C/CV root finders - Thomas Klemm - 05-20-2015, 07:36 PM
RE: 41C/CV root finders - Dieter - 05-20-2015, 07:44 PM
RE: 41C/CV root finders - Dave Britten - 05-20-2015, 08:08 PM
RE: 41C/CV root finders - Massimo Gnerucci - 05-20-2015, 08:40 PM
RE: 41C/CV root finders - Dave Britten - 05-20-2015, 08:49 PM
RE: 41C/CV root finders - Didier Lachieze - 05-21-2015, 11:12 AM
RE: 41C/CV root finders - Dieter - 05-21-2015, 11:40 AM
RE: 41C/CV root finders - Dave Britten - 05-21-2015 12:51 PM
RE: 41C/CV root finders - Dieter - 05-21-2015, 07:36 PM
RE: 41C/CV root finders - Dieter - 05-22-2015, 08:34 AM
RE: 41C/CV root finders - bshoring - 05-27-2015, 10:09 PM
RE: 41C/CV root finders - Dieter - 05-27-2015, 11:16 PM
RE: 41C/CV root finders - Ángel Martin - 05-28-2015, 06:19 AM
RE: 41C/CV root finders - Dieter - 05-28-2015, 08:42 AM
RE: 41C/CV root finders - bshoring - 05-28-2015, 09:37 PM
RE: 41C/CV root finders - Ángel Martin - 05-22-2015, 01:14 PM
RE: 41C/CV root finders - Dieter - 05-22-2015, 07:07 PM
RE: 41C/CV root finders - Dieter - 05-24-2015, 07:10 PM
RE: 41C/CV root finders - Ángel Martin - 05-25-2015, 05:35 AM
RE: 41C/CV root finders - Dieter - 05-25-2015, 07:19 PM
RE: 41C/CV root finders - Ángel Martin - 05-26-2015, 05:06 AM
RE: 41C/CV root finders - Dieter - 05-26-2015, 05:39 PM
RE: 41C/CV root finders - Ángel Martin - 05-26-2015, 09:26 PM
RE: 41C/CV root finders - Dieter - 05-26-2015, 10:08 PM
RE: 41C/CV root finders - rprosperi - 05-27-2015, 12:30 AM
RE: 41C/CV root finders - Dieter - 05-27-2015, 11:08 PM
RE: 41C/CV root finders - Ángel Martin - 05-28-2015, 05:44 AM
RE: 41C/CV root finders - Dieter - 05-28-2015, 09:50 PM
RE: 41C/CV root finders - Ángel Martin - 05-29-2015, 07:58 AM
RE: 41C/CV root finders - Ángel Martin - 05-27-2015, 05:17 AM
RE: 41C/CV root finders - Dieter - 05-27-2015, 01:50 PM
RE: 41C/CV root finders - Ángel Martin - 05-27-2015, 03:03 PM
RE: 41C/CV root finders - Dieter - 05-27-2015, 07:15 PM
RE: 41C/CV root finders - Dieter - 05-28-2015, 09:59 AM
RE: 41C/CV root finders - Ángel Martin - 05-28-2015, 11:27 AM
RE: 41C/CV root finders - Ángel Martin - 05-28-2015, 01:54 PM
RE: 41C/CV root finders - Dieter - 05-28-2015, 06:33 PM
RE: 41C/CV root finders - Ángel Martin - 05-29-2015, 08:04 AM
RE: 41C/CV root finders - Ángel Martin - 05-29-2015, 05:54 PM
RE: 41C/CV root finders - Dieter - 05-29-2015, 06:15 PM
RE: 41C/CV root finders - Ángel Martin - 05-29-2015, 06:44 PM
RE: 41C/CV root finders - Dieter - 05-29-2015, 07:19 PM
RE: 41C/CV root finders - Dieter - 05-30-2015, 12:37 PM
RE: 41C/CV root finders - Ángel Martin - 05-30-2015, 02:04 PM
RE: 41C/CV root finders - Dieter - 05-29-2015, 08:00 PM



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