Very good! Is there another similar function that does similar things when variables (rather than just numbers) are involved?
For example, there is the function
denestSqrt[e_, domain_, x_] := Replace[y /. Solve[Simplify[Reduce[Reduce[y == e && domain, x], y,
Reals], domain], y], {{r_} :> r, _ -> e}]
written by @CarlWoll (denestSqrt).
Here is an example:
denestSqrt[Sqrt[(1 - 2 x) (1 - x - 2 x^2) (2 - x + 2 Sqrt[1 - x - 2 x^2])], 1/3 < x <= 1/8 (2 + Sqrt[2]), x]
(* 1 - x - 2 x^2 + Sqrt[-(1 + x) (-1 + 2 x)^3] *)
– you have earned Featured Contributor Badge ![]()
Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!
Looks fantastic, this is just what I need for recent work. However, the current algorithm is unable to find some denesting result even when one truly exists, e.g. ones related to non-algebraic numbers and transcendental functions, like this below:
From my test today, the function posted is unable to find the denesting result of the compound radicals above, but there truly exists one:
So I hope you can improve your function, making it able to solve compound radicals related to non-algebraic numbers and transcendental functions.
Despite its imperfection, I am still very impressive about Corey Ziegler and Bill Gosper, Daniel Lichtblau, Swastik Banerjee and their team’s excellent work. This is no doubt a good start. Please keep going, making this function more and more powerful!
Thanks for this function. I use it to convert expressions with roots into a canonical form in order to detect equal expressions. It works more reliable than the kernel functions FullSimplify, ToRadical, etc.
It would be nice, if the function didn’t give a warning, when an expression without radicals is given.
In[366]:= ResourceFunction["RadicalDenest"][1]
During evaluation of In[366]:= LCM::argm: LCM called with 0 arguments; 1 or more arguments are expected.
Out[366]= 1