Post Reply 
(35S) - Quadratic root finder -- high performance
05-30-2014, 05:29 PM (This post was last modified: 05-30-2014 05:30 PM by Jeff_Kearns.)
Post: #4
RE: HP 35s -- Quadratic root finder -- and the HP-15C
(05-30-2014 04:15 AM)Douglas De Boer Wrote:  Thanks for your comments!
--DDB

DDB,

The Quadratic Solution is also an (amateur) interest of mine, especially as it pertains to the complex plane. I highly recommend the following math videos called Calculus Revisited where this impressive lecturer Herbert Gross explains complex numbers in a very interesting manner.

A great thread on this forum related to which quadratic solution should be used can be found here. There are also some neat (and short) Quadratic Equation solvers for the 42s, 32sii and 33s on this site if you do a search. There is also a short HP-15C routine by Gerson Barbosa and Thomas Klemm:

001- LBL B
002- ENTER
003- R^
004- /
005- R^
006- LSTx
007- /
008- 2
009- CHS
010- /
011- ENTER
012- ENTER
013- x^2
014- R^
015- -
016- SQRT
017- -
018- x<>y
019- LSTx
020- +
021- RTN

Usage: To solve for 'x' in Ax^2+Bx+C=0

Set Flag 8

1) Enter coefficients: A [ENTER] B [ENTER] C
2) GSB B
3) Roots appear in X and Y registers
4) If there are complex roots (and Flag 8 is not set), result is Error 0
5) Set Flag 8 and rerun
6) First root is in X register. Real part and imaginary parts can be seen by toggling Re<>Im. To see second root, press X<>Y and toggle Re<>Im

From the HP-15C Advanced Functions Handbook, page 208:

"Programs do exist which, while carrying only 10 significant digits during arithmetic, will calculate the roots of any quadratic correctly to at least nine significant digits regardless of how nearly coincident those roots may be. All such programs calculate
d = b2 - ac by some trick tantamount to carrying 20 significant digits whenever b2 and ac nearly cancel, so those programs are a lot longer and slower than the simple subroutine provided above."

The manual includes an 82 line program that accomplishes just that, likened to "Grandmother's expensive chinaware, reserved for special occasions, leaving subroutine "A" for everyday use."

Long live the HP-15C!

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


Messages In This Thread
RE: HP 35s -- Quadratic root finder -- and the HP-15C - Jeff_Kearns - 05-30-2014 05:29 PM



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