Perhaps my example was not clear enough. I start with a fully symbolic expression. Then, I try two things : - ask a simplify on the fully symbolic expression, that works well, - replace some symbols in the initial expression and then simplify.
The first step shows that a simplified expression exists, and replacing by values may not change this fact (it can lead to an even more simplified expresssion isn'nt it ?). I do not understand why Sympy cannot simplify at all the initial expression when symbols are replaced by values, whereas we know that a simplified expresssion exists as Sympy itself found it from the fully symbolic version. Le vendredi 31 juillet 2020 16:52:23 UTC+2, Oscar a écrit : > > On Sun, 26 Jul 2020 at 21:56, Mikhael Myara > <mikhae...@umontpellier.fr <javascript:>> wrote: > > > > And I obtain what follows. I am surprized that inserting values instead > of some symbols disables sympy simplification. In some more complex cases, > the computation times required for simplification are huge and lead to non > simplified expressions. > > I think that inserting Float rather than Symbol or Rational can lead > to significant problems for some polynomial type simplifications such > as cancellation of factors. The long computation times might be the > result of converting Float to Rational somewhere which can sometimes > lead to very polynomials with high order or large coefficients. It's > hard to investigate that without self-contained code demonstrating the > problem though. > > Do you have a reason to think that expression can be simplified much? > The main thing I notice is that it has repeating subexpressions so > something like cse might be useful: > > https://docs.sympy.org/latest/modules/rewriting.html#common-subexpression-detection-and-collection > > > Oscar > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/3a18afde-93ac-4236-a094-749a4e735c97o%40googlegroups.com.