Post Reply 
Mathematician Finds Easier Way to Solve Quadratic Equations
05-09-2024, 02:34 PM
Post: #61
RE: Mathematician Finds Easier Way to Solve Quadratic Equations
(05-08-2024 04:22 PM)Albert Chan Wrote:  I was comparing absolute value, going for the big root.
This is *exactly* the same as your cos/asin trig formula.
(05-04-2024 07:37 PM)Gerson W. Barbosa Wrote:  \(x_{1}=\left({\cos\left({\arcsin{\frac{\sqrt{q}}{-\frac{p}{2}}}}\right)+1}\right)\times-\frac{p}{2}\)

Replace cos(asin(z)) = √(1-z²), we have KISS version, only 1 square root!

Code:
00 { 28-Byte Prgm }
01▸LBL "Q"
02 X<> ST Z         ;   a   b   c
03 STO÷ ST Z        
04 STO+ ST X
05 +/-              
06 ÷                ;   m   q
07 ENTER            
08 X↑2              ; m^2   m   q
09 RCL- ST Z        ; m^2-q m   q
10 RCL÷ ST L
11 SQRT
12 RCL× ST Y        
13 +                ; x1    q
14 STO÷ ST Y        ; x1    x2
15 END

As you said, KISS is not simple.

Q(1,0,1) stops with a “Divide by 0” message (as does my program using COS/ASIN).
Both Q42S (24 bytes) and QFree42 (28 bytes) return the proper 0 ± i answer.
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-09-2024 02:34 PM



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