OK, after some debugging, I have made a patch:

--- a/src/algebra/manip.spad
+++ b/src/algebra/manip.spad
@@ -349,7 +349,7 @@ AlgebraicManipulations(R, F) : Exports == 
Implementation where
         rootKerSimp(op, x, n) == inroot(op, x, n)
 
 -- l is a list of nth-roots, returns a list of records of the form
--- [a^(1/n1), a^(1/n2), ...], [n1, n2, ...]]
+-- [[a^(1/n1), a^(1/n2), ...], [n1, n2, ...]]
 -- such that the whole list covers l exactly
       breakup l ==
         empty? l => empty()
@@ -386,21 +386,22 @@
 -- replaces (a^(1/n))^m in p by a power of a simpler radical of a if
 -- n and m have a common factor
       radeval(p, k) ==
         a := first(arg := argument k)
         n := (retract(second arg)@Integer)::NonNegativeInteger
         ans : F := 0
         q := univariate(p, k)
         while (d := degree q) > 0 repeat
-          term :=
+          term : F :=
 --            one?(g := gcd(d, n)) => monomial(1, k, d)
-            ((g := gcd(d, n)) = 1) => monomial(1, k, d)
-            monomial(1, kernel(operator k, [a, (n quo g)::F], height k), d 
quo g)
-          ans := ans + leadingCoefficient(q)::F * term::F
+            (d = n) => a
+            ((g := gcd(d, n)) = 1) => monomial(1, k, d)::F
+            monomial(1, kernel(operator k, [a, (n quo g)::F], height k), d 
quo g)::F
+          ans := ans + leadingCoefficient(q)::F * term
           q := reductum q
         leadingCoefficient(q)::F + ans
 

First part is just a comment fix.
The second part fixs function 'radeval', bug happens when
simplify calls rootProduct calls radeval.
As we can see from the comments above, when 'm=n',
'(a^(1/n))^m' should simplify to 'a' instead of '(a^(1/1))^1'.


-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to