Post Reply 
(11C) Roots of f(x)=0 in an Interval
12-20-2018, 07:21 PM
Post: #3
RE: (11C) Roots of f(x)=0 in an Interval
(12-20-2018 07:38 AM)Gamo Wrote:  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]

This is usually called bisection. A simple but ineffective method.

(12-20-2018 07:38 AM)Gamo Wrote:  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.

Bisection converges faster than Newton? Tell me about it. ;-)

Sorry, Gamo, but bisection is a simple but not very effective moethod for finding roots of a function. Newton's method usually is much faster. Of course for the particular example you give bisection works nicely: according to the input data the program checks the function at –10, –9, –8, ..., 8, 9 and 10 while the roots are at –1, 2 and 7. This means that the bisection algorithm does not even have to be applied, the three roots are directly found at the ends of an interval.

The advantage of this program is its ability to find multiple roots within an interval. But this should be combined with a method that is more effective than bisection. For instance the secant method or regula falsi. Here you can also specify an interval but the root within that interval is found much faster. I would recommend a modifed regula falsi, e.g. the Illinois method.

BTW, coding polynomials in RPN can be done much simpler and faster with Horner's method. Most important, this avoids the use of the y^x function which is very slow. You better do it this way:

Code:
LBL E
ENTER
ENTER
ENTER
8
-
x
5
+
x
1
4
+
RTN

Now, what about a program that uses the given basic structure but provides faster root finding e.g. with a regula falsi approach?

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


Messages In This Thread
RE: (11C) Roots of f(x)=0 in an Interval - Dieter - 12-20-2018 07:21 PM



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