Newton and Halley's methods with enhanced derivatives estimation
|
10-06-2017, 09:55 AM
Post: #2
|
|||
|
|||
RE: Newton and Halley's methods with enhanced derivatives estimation
(09-30-2017 08:39 PM)Namir Wrote: I present versions of Newton's method and Halley's method that use enhanced estimations for the first and second derivatives What? Still no answers after six days ?-) Then let me add a first comment. First of all, thank you very much for your suggestion of enhanced methods with more accurate derivatives. I tried the Newton method in Excel VBA, and here is what I got: Indeed the derivative is much more accurate than the classic method based on two points at x and x+h. The approximation sequence actually matches very nicely the one based on the exact derivative. This way often one iteration less is required, there may be even cases where two or more are saved. But... the number of function calls is much higher than with the classic two-point approach. Here is an example with your f(x) = exp(x) – 3 · x², based on a tolerance of 1 E–10. Code: Newton method with x0 = -2 and The 2-point derivative was based on an IMHO more suitable definition of h = x/10000 (or 0,00001 for x=0). You can see that the first two columns agree very nicely, i.e. the 5-point derivative essentially delivers the same results as the exact derivative. So yes, the number of iterations can be slightly improved with a more accurate derivative, but (and this is a big BUT) the number of function calls and thus the required execution time will significantly increase! Since the function has to be called 2,5x more often compared to a classic 2-point derivative (and the calculation of the derivative itself also requires a bit more effort) the gain of one or two less iterations does not outweigh the much longer time it takes for each approximation step. In the above example the simple 2-point method is more than twice as fast. So... where's the benefit of a more exact derivative? Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)