35s - Simple Complex Quadratic Root Finder (1st try)



#3

If I am doubling someone else’s work, I apologize. Before tinkering with this, I briefly searched the forums for a simple quadratic root finder with complex compatibility and didn’t find much; my search techniques may be seriously lacking, though. I have need for a rapid fire quad finder with complex and didn’t want to work my finder tips raw getting that massive version in. So, enough said.
Clearly this is limited to quadratics:

Q001 LBL Q

Q002 INPUT A

Q003 INPUT B

Q004 INPUT C

Q005 SQ(B)-4XAXC (AS EQN)

Q006 ROLLUP

Q007 2

Q008 X

Q009 STO D

Q010 X<>Y

Q011 X<0?

Q012 GTO Q016

Q013 SQRT

Q014 STO S

Q015 GTO Q021

Q016 +/-

Q017 SQRT

Q018 i

Q019 X

Q020 STO S

Q021 (-B+S) / D (AS EQN)

Q022 (-B-S) / D (AS EQN)

Q023 RTN

CK = E46A (for what it’s worth)
LN = 98

So… let the tomatoes fly; my skin is thick.

;)


Edited: 24 Aug 2007, 7:44 p.m.


#4

Quote:
my search techniques may be seriously lacking, though.

Using site:www.hpmuseum.org quadratic-solver as the search-key in Google returns 21 results. On the other hand, not having found them has proved useful, as you had the chance to come up with your own solution, which is good.

Program-size is not so important nowadays, as you see can see in Palmer's article (1st result). However, a shorter program is possible, based on a 15C program by Thomas Klemm (3rd result) :

Q001- LBL E
Q002- ENTER
Q003- R^
Q004- /
Q005- R^
Q006- LSTx
Q007- /
Q008- -2
Q009- /
Q010- ENTER
Q011- ENTER
Q012- x2
Q013- R^
Q014- -
Q015- 0.5i0
Q016- yx
Q017- -
Q018- x<>y
Q019- LSTx
Q020- +
Q021- RTN

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv017.cgi?read=114345


Quote:
So… let the tomatoes fly; my skin is thick.

;)


Quite the contrary. Congratulations!

Gerson.


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime: complex numbers in CAS. Alberto Candel 1 695 12-06-2013, 02:36 PM
Last Post: parisse
  [HP Prime] Plots containing complex numbers bug? Chris Pem10 7 1,370 12-05-2013, 07:40 AM
Last Post: cyrille de Brébisson
  Simple Tetris. free for you to improve on cyrille de Brébisson 3 796 11-20-2013, 05:43 PM
Last Post: Erwin Ried
  Complex Number Entry on Prime Jeff O. 19 2,386 11-16-2013, 12:34 PM
Last Post: Jeff O.
  [HP Prime] Using n-root symbol and exponent problem uklo 7 1,117 11-11-2013, 01:39 AM
Last Post: Alberto Candel
  [HP-Prime] Simple Game (Bugs) CompSystems 1 566 11-01-2013, 10:18 AM
Last Post: Han
  HP Prime complex results Javier Goizueta 0 434 10-06-2013, 12:59 PM
Last Post: Javier Goizueta
  HP Prime Solving Nonlinear System of Equations for Complex Results Helge Gabert 11 1,777 09-30-2013, 03:44 AM
Last Post: From Hong Kong
  Quadratic & Cubic Regression RPN progs Matt Agajanian 9 1,185 09-17-2013, 11:37 AM
Last Post: Jeff O.
  [HP-Prime xcas] operations with complex numbers + BUGs + Request CompSystems 9 1,441 09-08-2013, 10:40 PM
Last Post: CompSystems

Forum Jump: