" yes, simplification (particularly full simplification) can involve some 
algorithms with very high time and space complexities, so seeing memory 
errors is not surprising by itself."

Yes, I know this. But I had to use full_simplify() as simplify() does not 
do the job on some basic expressions. Here is an example using V 10.0

sage: var('x')
x

sage: expr=(1-x)^3+(-x^2+x)^3+(x^2-1)^3-3*(1-x)*(-x^2+x)*(x^2-1)

sage: expr.simplify()
-(x^2 - x)^3 + (x^2 - 1)^3 - 3*(x^2 - x)*(x^2 - 1)*(x - 1) - (x - 1)^3

sage: expr.full_simplify()
0

I think simplify should have been able to do it? in Mathematica Simplify 
can and no need to use its FullSimplify which also uses more resources than 
Simplify. But I understand, simplification is not an easy problem and 
different systems do things differently.

So instead of keeping trying, I was using full_simplify() instead of 
simplify() but this causes problems in some cases.

--Nasser

On Friday, June 23, 2023 at 11:36:30 AM UTC-5 Nils Bruin wrote:

> On Friday, 23 June 2023 at 17:28:03 UTC+1 Dima Pasechnik wrote:
>
> This looks suboptimal and unclear - there are e.g. several occurrences of 
>
> rootOf((625*%%E0^4*a
>   ^12+(-125)*%%E0^3*a^9+25*%%E0^2*a^6+(-5)*%%E0*a^3+1)/(625*a^12),%%E0)
>
> Apart from parsing problems inherent in not knowing  which roots are meant 
> exactly, translation of these expressions to sage's internal symbolic 
> system and maximalib (where it ends up judging from the ECL error) is 
> problematic because neiither has a native object to represent RootOf. So 
> these expressions cannot really be handled anyway and simplification is 
> unnlikely to do something useful. Better simplify in fricas.
>
> Considering memory errors from large simplification tasks: yes, 
> simplification (particularly full simplification) can involve some 
> algorithms with very high time and space complexities, so seeing memory 
> errors is not surprising by itself.
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/34196b45-e59b-4ea4-b411-ac4ee4b65001n%40googlegroups.com.

Reply via email to