Post Reply 
(42S) Short Quadratic Solver
05-28-2014, 10:17 PM (This post was last modified: 05-28-2014 11:12 PM by Jeff_Kearns.)
Post: #7
RE: Short Quadratic Solver (HP-42S)
(05-28-2014 04:18 AM)Gerson W. Barbosa Wrote:  If the roots are complex, the flag 1 annunciator will be lit and the real and complex parts will be in registers Y and X, respectively.

Cheers,

Gerson

Gerson -

The code (without INPUT prompts) works OK for real roots but not for complex roots (IMHO)...

I prefer to see the results (if complex) displayed as x + iy, as per the 39 step routine based on Eddie Shore's program to which I added a couple of x<>y statements to display 'correctly'. There are two issues with this particular routine that I can't quite figure out:

1) even when I insert a x<>y before the final RTN, I still get the imaginary part in x, i.e. ix + y. With or without a x<>y before the final RTN, the displayed result is the same.

2) Only one complex root is solved correctly. As an example, if you try solving 5x² + 2x + 1 = 0, you get the following: Flag 1 is set with the imaginary part 0.4 in x, and the real part -0.2 in y. Upon R/S the second root (x = -0.2 - 0.4i) is not shown. Granted, all complex roots are of the form x = D ± Ei, so one can deduce the second root and it doesn't really matter I guess BUT...

Can you suggest a better solution?

Regards,

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


Messages In This Thread
RE: Short Quadratic Solver (HP-42S) - Jeff_Kearns - 05-28-2014 10:17 PM



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