Minor bugfix to avoid duplicating some operations involving equivalent expressions.
For example, if x==y, we would generate x*y but if z==y we would not generate z*y.