The expressions a (b + c) + b c and a b + (a + b) c are equivalent and equally complex as measured by SimplifyCount:
Reduce[a (b + c) + b c == a b + (a + b) c]
(* True *)
SimplifyCount[a (b + c) + b c] == SimplifyCount[a b + (a + b) c] == 9
(* True *)
And unlike the example that I used in How does `Simplify` resolve `LeafCount` ties?, the two expressions are not automatically simplified to the same expression before Simplify evaluates them:
a (b + c) + b c
(* b c + a (b + c) *)
a b + (a + b) c
(* a b + (a + b) c *)
a (b + c) + b c === a b + (a + b) c
(* False *)
Nevertheless, Simplify converts the latter expression into the former:
Simplify[a (b + c) + b c]
(* b c + a (b + c) *)
% === a (b + c) + b c
(* True *)
Simplify[a b + (a + b) c]
(* b c + a (b + c) *)
% === a b + (a + b) c
(* False *)
How does Simplify decide which expression is simpler, if they have the same SimplifyCount?
My guess is that it always breaks ties by going with whichever expression comes last in canonical order:
Sort[{a (b + c) + b c, a b + (a + b) c}]
(* {a b + (a + b) c, b c + a (b + c)} *)
Is this always the case? If so, then Simplify actually uses a total order on expressions, rather than the total preorder given by SimplifyCount.
Simplify- the "tie" was completely trivial becauseSimplifywas evaluating the same expression in both instances. Since there was no actual nontrivialSimplifyCounttie, the premise of my question was invalid. This question really does concern a nontrivialSimplifyCounttie, so its answer will be unrelated to the answer to my previous question. – tparker Aug 07 '17 at 17:48Simplifywas redundant in that example so it really has nothing to do withSimplify, and if it were corrected it would become equivalent to this one I believe. You might instead ask "why does-(a + b)evaluate to-a - bbut that is yet again a different question and not the one you asked, as I read it. I don't mean to discourage you; I find this an interesting question and you have my vote on it. – Mr.Wizard Aug 07 '17 at 23:15