D. JacKaL's Newton's Method
This program uses Newton's Method to approximate a root. This Newton's Method
program is better than the one in the instruction manual because it displays the graph and
allows you to enter the function from within the program. When you run the program, you will
first be prompted to enter the function. You must enter it in quotation marks ("").
The program will then display the graph of the function. By looking at the graph, you should
be able to guess where a root might be. Now press ENTER. You will be prompted to enter
your guess for the root. From there the calc takes over and uses Newton's Method to
find the root to 10 decimal places. That's all there is to it.
/START80/
/NAME=NEWTON
:LBL 1
:CLRHOME
:FNOFF
:DISP "ENTER FUNCTION","IN QUOTES"
:INPUT "Y1=",Y1
:DISPGRAPH
:PAUSE
:INPUT "INITIAL X=",X
:LBL N
:X-Y1/NDERIV(Y1,X,X)->R
:DISP R
:IF ABS (X-R)>ABS (X/1\EE\10) (this is the EE symbol)
:THEN
:R->X
:GOTO N
:END
:CLRHOME
:DISP "ROOT AT X=",X
:PAUSE
:LBL Q
:CLRHOME
:DISP "ANOTHER?","1:YES","2:NO"
:INPUT Q
:IF Q=1
:GOTO 1
:IF Q-2
:GOTO Q
:CLRHOME
/STOP80/