HP50g simplifing a root
|
10-10-2020, 03:58 PM
Post: #22
|
|||
|
|||
RE: HP50g simplifing a root
(10-09-2020 05:21 PM)Albert Chan Wrote: \(\sqrt[3]{A ± \sqrt{R}} = a ± \sqrt{r} \quad ⇒ \quad a = \large\frac{\sqrt[3]{A+\sqrt{R}} Slightly off topics. I was curious how to calculate a accurately (assumed R > 0) Since cube root is odd function, we pull out the sign. a = sign(A)/2 * (³√(|A|+√R) + ³√(|A|-√R)) Last term can be rewritten as ³√(A²-R) / ³√(|A|+√R) Let c = ³√(A²-R), d = ³√(|A|+√R)², we have: a = sign(A)/2 * (d + c) / √d Since both c, d are cube roots, we try identity c³ + d³ = (c + d) (c² - c d + d²) c³ + d³ = (A² - R) + (A² + R + 2|A|√R) = |2A| * (|A|+√R) = |2A| * d√d Substitute back in, many terms get cancelled, a = A / (c²/d - c + d) If ³√(A ± √R) can be simplified, c turns to integer (we had shown this earlier). In fact, the whole denominator turns to integer = a² + 3r = 4a² - 3c Code: function calc_a(A,R) lua> function test_a(A,R) : local q = sqrt(R) : return calc_a(A,R), (cbrt(A+q) + cbrt(A-q))/2 : end lua> lua> test_a(26, 15^2 * 3) 2 1.9999999999999982 lua> test_a(9416, 4256^2 * 5) 11 11.000000000000005 lua> test_a(300940299,103940300^2 * 101) 99 99.00000000000006 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)