Post Reply 
Mathematician Finds Easier Way to Solve Quadratic Equations
05-04-2024, 07:37 PM
Post: #32
RE: Mathematician Finds Easier Way to Solve Quadratic Equations
(05-03-2024 02:02 PM)Gerson W. Barbosa Wrote:  The following is longer, but preserves the previous stack register X for later use. Some optimization is still possible, I think.

Code:

00 { 31-Byte Prgm }
01▸LBL "T"
02 X<> ST Z
03 STO÷ ST Z
04 +/-
05 STO+ ST X
06 ÷
07 X<>Y
08 SQRT
09 STO ST Z
10 X<>Y
11 ÷
12 ASIN
13 2
14 ÷
15 TAN
16 RCL× ST Y
17 X<>Y
18 RCL÷ ST L
19 END

On the real HP-42S, in DEG mode:

E 13 +/- ENTER 2 +/- ENTER 1 XEQ T ->

Y: 4.99999999999E-1
Y: 2.00000000000E13

This saves four bytes and four steps:

Code:

00 { 27-Byte Prgm }
01▸LBL "T"
02 X<> ST Z
03 STO÷ ST Z
04 STO+ ST X
05 +/-
06 ÷
07 RCL ST Y
08 SQRT
09 RCL÷ ST Y
10 ASIN
11 COS
12 RCL× ST Y
13 +
14 STO÷ ST Y
15 END

On the real HP-42S, in DEG mode:

E 13 +/- ENTER 2 +/- ENTER 1 XEQ T ->

Y: 0.5
Y: 2.E13

On Free42, in DEG mode:

E 13 +/- ENTER 2 +/- ENTER 1 XEQ T ->

Y: 0.500000000000012500000000000625
X: 19,999,999,999,999.4999999999999875 


\(x_{1}=\left({\cos\left({\arcsin{\frac{\sqrt{q}}{-\frac{p}{2}}}}\right)+1}\right)\times-\frac{p}{2}\)

That is equivalent to Albert Chan’s formula.

\(x_{2}=\frac{q}{x_{1}}\)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Mathematician Finds Easier Way to Solve Quadratic Equations - Gerson W. Barbosa - 05-04-2024 07:37 PM



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