01-09-2014, 11:59 PM
LBL 0
RCL 1
GSB 1
RCL 1
GSB 2
/
CHS
RCL 1
+
STO 3
RCL 1
-
ABS
RCL 2
X>Y?
RTN
RCL 3
STO 1
GTO 0
LBL 1
f(x)=0 code
LBL 2
f'(x)=0 code
R1: old value (or initial value)
R2: Tolerance of error (0.001, 0.0001, 0.000000001 etc)
THE RESULT:
R3: new value (root)
EXAMPLE
Find the root of f(x)=x^3 - 3x^2-6x+8
rewritten as f(x)= [(x-3)x-6]x +8
f(x) code:
LBL1
ENTER
ENTER
ENTER
3
-
*
6
-
*
8
+
RTN
f'(x)= 3x(x-6)-6
f'(x) code
LBL 2
ENTER
ENTER
6
-
*
3
*
6
-
RTN
The roots are [-2, 1, 4]
give a initial value, for example: -3
-3 STO 1
give a tolerance of error, for example: 0.0001
0.0001 STO 2
BEGIN THE PROGRAM...
GSB 0
runnning...
when the error < TOL the program stop and display:
0.0001
you can find the root in the register 3
RCL 3
DISPLAY: -2.0001
try with initial value = 2
[/size][/font][/size][/size][/font][/font]
RCL 1
GSB 1
RCL 1
GSB 2
/
CHS
RCL 1
+
STO 3
RCL 1
-
ABS
RCL 2
X>Y?
RTN
RCL 3
STO 1
GTO 0
LBL 1
f(x)=0 code
LBL 2
f'(x)=0 code
R1: old value (or initial value)
R2: Tolerance of error (0.001, 0.0001, 0.000000001 etc)
THE RESULT:
R3: new value (root)
EXAMPLE
Find the root of f(x)=x^3 - 3x^2-6x+8
rewritten as f(x)= [(x-3)x-6]x +8
f(x) code:
LBL1
ENTER
ENTER
ENTER
3
-
*
6
-
*
8
+
RTN
f'(x)= 3x(x-6)-6
f'(x) code
LBL 2
ENTER
ENTER
6
-
*
3
*
6
-
RTN
The roots are [-2, 1, 4]
give a initial value, for example: -3
-3 STO 1
give a tolerance of error, for example: 0.0001
0.0001 STO 2
BEGIN THE PROGRAM...
GSB 0
runnning...
when the error < TOL the program stop and display:
0.0001
you can find the root in the register 3
RCL 3
DISPLAY: -2.0001
try with initial value = 2
[/size][/font][/size][/size][/font][/font]