(71B) Newton and Halley's methods with enhanced derivatives estimation - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (71B) Newton and Halley's methods with enhanced derivatives estimation (/thread-9203.html) |
(71B) Newton and Halley's methods with enhanced derivatives estimation - Namir - 09-30-2017 08:43 PM I present versions of Newton's method and Halley's method that use enhanced estimations for the first and second derivatives, using five point central difference schemes. Each listing will prompt you for the initial guess for the root and its tolerance value. Line 20 in each listing defines the function whose root you seek. Here is the enhanced Newton's method Code: 10 REM NEWTON'S METHOD WITH ENHANCED DERIVATIVE Here is the enhanced Halley's method Code: 10 REM HALLEY'S METHOD WITH ENHANCED DERIVATIVE You are welcome to add iteration counters to also view the number of iterations needed. Moreover, these counters can also help prevent indefinite iterations in case the guess for the function you are using fails to converge. Enjoy! |