A somewhat different Newton solver (HP35s)
|
09-26-2018, 09:05 AM
(This post was last modified: 09-26-2018 11:21 AM by Ángel Martin.)
Post: #5
|
|||
|
|||
RE: A somewhat different Newton solver (HP35s)
(09-26-2018 07:56 AM)Thomas Klemm Wrote: You don't have to execute the function twice since both, value and derivative are returned: Brilliant Thomas, many thanks for snapping me out of my stupor to see what was before my nose! And so glad to see there's at least one more 41Z-literate person in the world ;-) BTW nice move choosing R02 for the function name instead of R00 - this allows using the 41Z functions on ZR00, which uses "0" as default parameter so it's not required in the program. Really impressive - although you must be using an older revision of the module, because with the latest one (the 'Deluxe" edition) the real part is stored in the lower register of the pair, i.e. ZSTO 00 stores Re(z) in R00 and Im(z) in R01 So re-writing the code for the 41Z-Deluxe conventions (transposing R00 and R01), and starting with h in Y, x guess in X: Code: 01 LBL "ZNWT" ; x h 17 steps, nothing can beat that ;-) Thanks much again. Best, ÁM PS. As it turns out removing RND is not a good idea because some times the oscillation in the 10th. decimal place causes the test X#0? never to occur. This is a well-known behavior of the Newton method, so nothing new here... "To live or die by your own sword one must first learn to wield it aptly." |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)