HP50g simplifing a root
|
10-09-2020, 05:21 PM
(This post was last modified: 10-11-2020 11:32 AM by Albert Chan.)
Post: #21
|
|||
|
|||
RE: HP50g simplifing a root
I was being stupid. Why solve cubic equation for a
This is the way to get cube roots simplified: \(\sqrt[3]{A ± \sqrt{R}} = a ± \sqrt{r} \quad ⇒ \quad a = \large\frac{\sqrt[3]{A+\sqrt{R}} \;+\; \sqrt[3]{A-\sqrt{R}}}{2} \) Round a to closest halves, get r, and double check if it round-trip back to (A, R) Code: function simp_cbrt4(A,B,k) -- simplify cbrt(A + B * sqrt(k)) lua> simp_cbrt4(1859814842094, -59687820010, 415) 11589 -145 415 lua> simp_cbrt4(300940299,103940300,101) 99 100 101 lua> simp_cbrt(180, 23, 157) -- (a,b) can be halves 1.5 0.5 157 lua> simp_cbrt4(-36, 20, -7) -- work with complex roots too. 3 1 -7 lua> simp_cbrt4(81,30,-3) -- this is simplest, see comment from previous post. 4.5 0.5 -3 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)