A somewhat different Newton solver (HP35s)
|
09-27-2018, 01:07 PM
(This post was last modified: 09-27-2018 01:08 PM by Dieter.)
Post: #11
|
|||
|
|||
RE: A somewhat different Newton solver (HP35s)
(09-27-2018 12:38 PM)Albert Chan Wrote: Does the project reach its goal ? A complex multiply is just four real multiplications, and two additions/subtractions. Thats "nothing". While I can't say much about this method in high level languages with complex number support by the compiler, I bet that on almost any calculator this method will be faster than the classic (approximative) approach with f(x) and f(x+h): First, there is just one single function call per iteration step. The complex result holds both f(x) and f'(x). The classic method requires two calls per iteration. This alone speeds up the calculation, even if the complex functions should be somewhat slower. More important, I don't know any programmable pocket calculator where complex functions are returned significantly slower to the user than their real counterparts. Sure, the internal calculations are more elaborate, but all this is "low level" code. The execution time for such functions is completely negligible compared to the running speed of the calculator program, which does merely a dozen or maybe a few hundred user instructions per second. The CPU that handles the complex math "under the hood" may do thousands of low level instructions per second to calculate a function that is returned almost immediately. So all in all the complex evaluation is not significantly slower than real math, and at the same time only half of the function calls is required. Yes, that's faster. ;-) Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)