Introduction
This program computes left and right hand approximations for
. It also includes the average of the two approximations.
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
'LR SUMS' | {' is in ALPHA} {This is the name of the program} |
Lbl 1 | {Lbl is in PRGM under JMP} |
"A"?A | {" is in ALPHA} {? is in PRGM} { is on the , button} |
"B"?B | |
"N"?N | |
(B-A) N H | |
AX | |
0L | {The 0 is a zero} |
Lbl 2 | |
L+f1H L | {f1 is in Fmem. Choose fn, then type a 1} |
X+H X | |
Dsz N | {Dsz is in PRGM under JMP} |
Goto 2 | {Goto is in PRGM under JMP} |
BX | |
L+f1H R | |
AX | |
R-f1H R | |
(L+R) 2T | |
"L R AVG" | |
L | { is in PRGM} |
R | |
T | |
Goto 1 |
Running the Program
You will need to enter a function f(x) into
f1 before running
the program. Store your function by hitting Fmem.
Store your equation in position 1.
The program will ask for values of A, B, and N (number of
subdivisions).
To test the program try the following:
f(x) = x2+ 3,
A=1, B=4, N=20.
Your answer will be
L R AVG
28.88625
31.13625
30.01125
To get each estimate hit EXE.