Denesting roots

20 views
Skip to first unread message

Waldek Hebisch

unread,
Aug 14, 2023, 2:53:00 PM8/14/23
to fricas...@googlegroups.com
I have now a prototype denesting code. It is somewhat long for
an email, so I put it at:

http://fricas.math.uni.wroc.pl/~hebisch/rsimp2.input

So try it first do

)read rsimp2.input

ATM there is one user oriented function called 'rsimp'. Argument
to 'rsimp' should be a single root, it tries to produce
denested version of the root, like:

rsimp(sqrt(12 + 2*sqrt(6) + 2*sqrt(14) + sqrt(6)*sqrt(14)))

+-+ +--+ +-+
(\|6 + 3)\|14 + 7 \|6
(275) ------------------------
+--+
\|42

or

rsimp(sqrt(x + sqrt(x^2 - 1)))

+-------+ +------+ +-------+
| 1 | 2 | 1
(276) |------- \|x - 1 + (x + 1) |-------
\|2 x + 2 \|2 x + 2

or

rsimp(sqrt(13^(1/3)+(108)^(1/3)))

3+--+2 3+-+3+--+ 3+-+2
2 \|13 + 2 \|4 \|13 - \|4
(277) ------------------------------
6


Due to interpreter limitation argument must be of type Expression(Integer).
In principle the code should be able to denest roots of degree up
to 12 when nested roots are all square roots, and roots of degree up
to 4 when nested roots involve cube roots. But there are shortcuts
in implementation which may lead to loss of some denstings. ATM
code does not handle dependent roots, nested roots must be
independent. And computational complexity is quite high, so
complicated examples may take very long time or run out of
memory. Still, I think that even in its current state this is
quite powerful denester.

--
Waldek Hebisch

Ralf Hemmecke

unread,
Aug 22, 2023, 8:04:52 AM8/22/23
to fricas...@googlegroups.com
On 14.08.23 20:52, Waldek Hebisch wrote:
> I have now a prototype denesting code. It is somewhat long for
> an email, so I put it at:
>
> http://fricas.math.uni.wroc.pl/~hebisch/rsimp2.input

The file is missing.

Ralf

Waldek Hebisch

unread,
Aug 22, 2023, 4:38:03 PM8/22/23
to fricas...@googlegroups.com
Unfortunantly, our systems in Wrocław ATM are misconfigured.
And today this is different machine, I have now put the
file there.

I will write to other folks when I have mail running correctly.

--
Waldek Hebisch

Waldek Hebisch

unread,
Sep 9, 2023, 8:31:11 AM9/9/23
to fricas...@googlegroups.com
Some remarks to what I wrote earlier: the simplification code
changes only nested root(s) and preserves the other. So
in

rsimp(sqrt(12 + 2*sqrt(6) + 2*sqrt(14) + sqrt(6)*sqrt(14)))

example the answer is in terms of original roots, that is
sqrt(6) and sqrt(14) and one new root that is sqrt(42).
Martin in sci.math.symbolic showed result from Derive,
namely sqrt(2) + sqrt(3) + sqrt(7). This result is
simpler but I am affraid misses the point. Namely,
roots are multivalued and minimizing changes to roots
is helps in preserving intended value of the expression.
Second, while in example above factoring numbers under
root leads to simplification, the method used by rsimp
does not depend on factoring numbers, it still works
even when there are troubles with factorization.

It is worthwile to implement simplifications based on
factorization, but they not always work and may be
undesirable in some situations. So 'rsimp' perform
denestiong with minimal changes to roots. And I am
working on separate routine which is going to
perform simplifications based on factoring. The idea
is that 'rsimp' could be used alone or combined with
planned second routine, depending on the needs.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages