NEWTON'S METHOD - HP 48

Introduction
This program finds successive approximations to the solutions of  f(x) = 0 using Newton's method.
 
If you have not used one of the programs posted on this website before, you should read through the information in the Intro to Programming section\ first.


The Program
Note: The main program, NEWT, will call two subprograms, XPRG and FSTO. All programs are given below.

<< PATHP
<< 1 P SIZE FOR K P K
GET EVAL 'X'
PURGE NEXT>> >>
ENTER 'XPRG' STO {This stores the program under variable name XPRG.}
<< XPRG DUP 'F'
STO 'X' 'DF' STO >>
ENTER 'FSTO' STO {This stores the program under variable name FSTO.}
<<'X' STO X X F
EVAL DF EVAL / - 'X'
PURGE>>
ENTER 'NEWT' STO {This stores the program under variable name NEWT.}


Running the Program
 
You will need to enter a function  f(x,y) into the variable named FSTO. To do this, enter your function onto the stack and then hit FSTO. Next, enter your initial guess for the solution onto the stack. Hit NEWT. Each time you hit NEWT you will get the next approximation.

To test the program try the following:
 
f(x) = x3-3x2+x-5,   initial guess = 3.
 
The approximations should be
3.2
3.18019169329
3.17998109582
3.17998107216