On Tue, Apr 21, 2026 at 06:45:38AM +0800, Qian Yun wrote:
> (1) -> rootSimp((64*x^12)^(1/12))
>
> 6+-+
> (1) x\|8
> Type: Expression(Integer)
> (2) -> rootSimp %
>
> +-+
> (2) x\|2
> Type: Expression(Integer)
>
> In 'iroot', in the loop, nn is multiple of p, then "nn := nn rem p"
> will always be 0 and cause early exit. This is clearly a logical error.
>
> This causes expression to not be simplified at fullest.
>
> - Qian
Thanks, please commit.
> (Disclaimer: this issue is found by LLM, but the analysis and patch
> is thoroughly reviewed by me.)
>
> diff --git a/src/algebra/manip.spad b/src/algebra/manip.spad
> index 54dc6b47..69949ac1 100644
> --- a/src/algebra/manip.spad
> +++ b/src/algebra/manip.spad
> @@ -95,15 +95,15 @@
> while p <= nn repeat
> not ((nn rem p) = 0) =>
> p := nextPrime(p)$IntegerPrimesPackage(Z)
> if (ru := perfectNthRoot(x,
> qcoerce(p)@N)$IntegerRoots(Z)) case Z then
> x := ru::Z
> e := e*p
> - nn := nn rem p
> + nn := nn quo p
> else
> p := nextPrime(p)$IntegerPrimesPackage(Z)
> [(n quo e)::N, x]
>
> if R has imaginary : () -> R then
> czroot : (Z, N) -> REC
>
> --
> 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...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/58392043-7e63-40b9-a121-0f63641ee803%40gmail.com.
--
Waldek Hebisch