I am sure this issue has been discussed here, but it has never been asked whether this behavior is a bug. Therefore my direct question to the community: do you think this behavior is a bug?
poly = a1 b1 e1 + a2 b1 e1 + a3 b1 e1 + a1 b2 e1 + a2 b2 e1 + a3 b2 e1 + b1 c1 x + c1 d1 x + c1 x z;
FullSimplify[poly]
Out[1]= a3 b1 e1 + a3 b2 e1 + a1 (b1 + b2) e1 + a2 (b1 + b2) e1 + b1 c1 x + c1 d1 x + c1 x z
FullSimplify[poly /. x -> a]
Out[2]= (a1 + a2 + a3) (b1 + b2) e1 + a c1 (b1 + d1 + z)
The LeafCount is 33 and 17, respectively. How one can achieve a consistent simplification independent on the names of variables?
x->t or x->s or x -> F, but does simplify if you choosex -> ω, x -> ℵ, x -> C[1], for example. – flinty Jul 28 '20 at 13:38LeafCount. – yarchik Jul 28 '20 at 14:31LeafCountI would even claim that we are talking about simplification vs. no simplification at all depending on the variables' name. Lack of consistency is a bug, isn't it? – yarchik Jul 28 '20 at 14:37LeafCountor more generally theComplexityFunctionis the criterion by which the optimal ordering of the variables is determined. More clearly, the actual variables are substituted with a set of ordered replacements which effectively reorders the original variables. Each set of substitutions is used to measure theComplexityFunctionof the corresponding result. The substitution (ordering of the original variables) that produces the optimum result is used. That result then has the reverse substitution applied to express the result in the original variables. – Bob Hanlon Jul 28 '20 at 14:53ComplexityFunctionof final result before and after the return to the original variables will not change. – Bob Hanlon Jul 28 '20 at 15:12OrderedFullSimplifythat replaces all symbols with s[1],s[2],s[3],...,s[n], performs theFullSimplify, then puts back the original symbols. – flinty Jul 28 '20 at 16:21