Mathematician Finds Easier Way to Solve Quadratic Equations
|
05-02-2024, 02:00 PM
(This post was last modified: 05-05-2024 09:21 PM by Albert Chan.)
Post: #27
|
|||
|
|||
RE: Mathematician Finds Easier Way to Solve Quadratic Equations
(05-01-2024 11:08 PM)Gerson W. Barbosa Wrote: \(x_{1,2}=\sqrt{q}\times e^{±\cosh^{-1}{(-\frac{p}{2\sqrt{q}}})}\) exp/cosh quadratic formula avoided subtraction canellation, but introduced another. Exponential function slope is also an exponential function! e^(x*(1-ε)) ≈ e^x - (x*e^x)*ε RelErr(x) = ε ⇒ RelErr(e^x) = (exact - approx) / exact ≈ (x*e^x)*ε / e^x = x*ε Fortunately, acosh is similar to log, keeping size of x in check. Still, Trig (tan/asin) quadratic version is perhaps more accurate. Code: 00 { 24-Byte Prgm } 1E-13 Enter -2 Enter 1 XEQ "Q" Y : 19,999,999,999,999.49999999999998749992 // error = 8 ULP X : 5.000000000000125000000000006250021e-1 // error = -21 ULP 1E-13 Enter -2 Enter 1 XEQ "T" Y: 5.000000000000125000000000006250001e-1 // error = -1 ULP X: 19,999,999,999,999.4999999999999875 // error = 0 ULP There is another issue. acosh(x) has real domain x≥1 Trig quadratic version does not have this problem. (tan/asin both odd functions) 1E-13 Enter 2 Enter 1 XEQ "Q" Y: -19,999,999,999,999.49999999999998749992-2.31605661201243998216520079425921e-21i X: -0.500000000000012500000000000625002+5.790141530031389462489503558740034e-35i 1E-13 Enter 2 Enter 1 XEQ "T" Y: -5.000000000000125000000000006250001e-1 X: -19,999,999,999,999.4999999999999875 Update: here is e^asinh version. Determinant Δ = (p/2)² - q It has the same RelErr(e^x) issue ... not recommended. \( x_{1,2}= \sqrt{q}× e^{±\sinh^{-1} \sqrt{\frac{Δ}{q}} } \) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)