Post Reply 
(11C) Roots of f(x)=0 in an Interval
12-20-2018, 07:38 AM (This post was last modified: 12-20-2018 07:39 AM by Gamo.)
Post: #1
(11C) Roots of f(x)=0 in an Interval
Found this Solver Program from
HP-19C Solutions Book (Mathematics 1977) on Page 13

According to this solutions book this solver find Roots in an Interval.
This program uses a "half-interval" search to find the real roots of an equation
f(x)=0 in a closed interval [a,b]

Specify Accuracy Tolerance and search increment.

The program then begins at the left of the interval and compares the functional
values a the ends of the interval.

I have test these roots searching speed between the Newton's Method program from the
HP-11C User's Handbook with this HP-19C Solution Book and found that
the Half-Interval Method is faster than the Newton's Method.

--------------------------------------------------------

Procedure:

[A] Tolerance and Search Increment values
[B] Interval [x1,x2]
[C] Search for Roots [R/S] for more Roots

**Available Register**
R0 and R9 up to any available space.

---------------------------------------------------------
Example from 19C Solutions Book

X^3 - 8X^2 + 5X + 14 = 0

Set Tolerance 10^-6 and increment by 1
Interval between -10 to 10

Enter your equation at LBL E

STO 0
3
Y^X
RCL 0
X^2
8
x
-
5
RCL 0
x
+
1
4
+
RTN

Tolerance and Search Increment: [EEX] [CHS] 6 [ENTER] 1 [A]
Interval: 10 [CHS] [ENTER] 10 [B]
Search for Roots: [C] display -1 [R/S] 2 [R/S] 7

Answer:
x1 = -1
x2 = 2
x3 = 7

------------------------------------------------------
Program:
Code:

LBL A
STO 6
Rv
STO 5
RTN
-------------------------
LBL B
STO 7
Rv
STO 1
RTN
-------------------------
LBL C
RCL 1
GSB E
STO 3
X=0
GSB 9
RCL 1
RCL 6
+
STO 2
STO 8
GSB E
RCL 3
x
X<0
GTO 8
RCL 2
STO 1
RCL 6
+
STO 2
RCL 7
X<>Y
X>Y
R/S
GTO C
------------------------
LBL 6
RCL 4
STO 2
GTO 8
-----------------------
LBL 7
RCL 4
R/S
RCL 8
STO 1
GTO C
----------------------
LBL 9
RCL 1
R/S
RTN
----------------------
LBL 8
RCL 1
RCL 2
+
2
รท
STO 4
GSB E
ABS
RCL 5
X>Y
GTO 7
RCL 1
GSB E
STO 3
RCL 4
GSB E
RCL 3
x
X<0
GTO 6
RCL 4
STO 1
GTO 8
---------------------
LBL E
Start f(x)
.
.
.
.
RTN

Gamo
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(11C) Roots of f(x)=0 in an Interval - Gamo - 12-20-2018 07:38 AM



User(s) browsing this thread: 1 Guest(s)