Post Reply 
Mathematician Finds Easier Way to Solve Quadratic Equations
05-07-2024, 03:05 PM
Post: #56
RE: Mathematician Finds Easier Way to Solve Quadratic Equations
KISS quad solver
Code:
function quad(a,b,c)
    b = -.5*b
    local y = I.sqrt(b*b-a*c)
    y = I.abs(b+y) < I.abs(b-y) and b-y or b+y
    return y/a, c/y
end

lua> quad(1e-13,-2,1)
(19999999999999.496+0*I)      (0.5000000000000125+0*I)
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 - Albert Chan - 05-07-2024 03:05 PM



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