Short quadratic solver (HP15C) Message #1 Posted by Gerson W. Barbosa on 22 May 2007, 7:44 p.m.
Two and a half months ago Allen presented an RPL program and a quadratic formula quite suitable for short programs:
http://www.hpmuseum.org/cgisys/cgiwrap/hpmuseum/archv017.cgi?read=109539#109539
(scroll past the middle of the thread)
This is a 22step program based on that formula. It was written then and no further attempt has been made to sizeoptmize it, so it's still possible someone come up with an even shorter program.
001 LBL E
002 ENTER
003 R^
004 /
005 LSTx
006 R^
007 x<>y
008 2
009 *
010 /
011 CHS
012 ENTER
013 ENTER
014 x^2
015 R^
016 
017 SQRT
018 +
019 x<>y
020 LSTx
021 
022 RTN
Usage:
a ENTER b ENTER c GSB E => x1
x<>y => x2
If flag 8 is set the program will also handle complex roots.
The record for the HP41 appears to be a 16step program available in the Software Library. What might be the record for the HP15C?
Gerson.
P.S.: Of course, on the 33S I prefer to use Mr. Hanson's program available in the link. On my everyday 15C, however, every step counts...
