I would expect simplify
with :flat
to evaluate 3 * x * y * z
to (* 3 x y z)
. Instead, the result is (* 3 (* x y z))
. Why?
Example
w = Int('w')
x = Int('x')
y = Int('y')
z = Int('z')
print simplify(w * x * y * z, flat=True).num_args() # 4, which we expected
print simplify(3 * x * y * z, flat=True).num_args() # 2, why not 4?