Post Reply 
A somewhat different Newton solver (HP35s)
09-23-2018, 05:28 PM (This post was last modified: 09-24-2018 01:59 AM by Thomas Klemm.)
Post: #2
RE: A somewhat different Newton solver (HP35s)
(08-07-2016 08:47 PM)Dieter Wrote:  What about limitations of this method? As far as I get it both f(x) as well as f'(x) are only approximate. I wonder how accurate especially f(x) is evaluated using this method. Maybe the math experts here can say more about this. ;-)

Using the Taylor series we can separate the real and imaginary part of \(f(x+ih)\):

\(\begin{align*}
\Re[f(x+ih)]&=f(x)-\frac{f''(x)}{2!}h^2+O(h^4)\\
\Im[f(x+ih)]&=h(f'(x)-\frac{f'''(x)}{3!}h^2+O(h^4))
\end{align*}\)

Thus by choosing a small \(h\) we can make the difference as small as we want.
You can verify this by using \(h=10^{-50}\) and the \(\sin\) function:

sin(2 + 1e-50 i) = 9.09297426826e-1 - 4.16146836547e-51 i

sin(2) = 9.09297426826e-1
cos(2) = -4.16146836547e-1

Both values are exact. But for a calculator with 12 significant digits something smaller like \(10^{-10}\) might be enough. It really depends on the value of the 2nd and 3rd derivative at the root.

We could go further and try to use \(h=10^{-99}\). But then we may end up with 0.
Thus we have to choose \(h\) small enough to avoid errors but not too small.

Kind regards
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: A somewhat different Newton solver (HP35s) - Thomas Klemm - 09-23-2018 05:28 PM



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