A somewhat different Newton solver (HP35s)
|
09-25-2018, 11:46 AM
(This post was last modified: 09-25-2018 01:54 PM by Ángel Martin.)
Post: #3
|
|||
|
|||
RE: A somewhat different Newton solver (HP35s)
Nicely done, it piqued my curiosity so I went ahead and jotted down the following 41Z version of the same concept.- About 30 steps in this proof of concept; which expects the function name in ALPHA, h in Y and the xo guess (a real value) in X.
Code: 01 LBL "ZNWT" The execution shows the successive values of the root if user flag 10 is set (a la PPC-ROM). Convergence criteria always uses 9 decimal places - irrespective of the display FIX settings. The function is to be programmed using 41Z functions (definitely a super-set of those in the 35S), as a complex equation. To use Dieter's same example: Code: 01 LBL "Z1" Results: ALPHA, "Z1", ALPHA 0.1, ENTER^, 2, XEQ "ZNWT" -> 1.451605963 0.1, ENTER^, 0, XEQ "ZNWT" -> 0.403031717 0.1, ENTER^, -2, XEQ "ZNWT"-> -0.854637680 Supposedly more accurate results would be obtained with smaller values of h... Cheers, ÁM "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)