You should really be using something like `S(1)/2` (or `Rational(1, 2)`), not 1/2 or 0.5, because 1/2 = 0.5 are floating point numbers, by definition inexact. You want to be able to compare things exactly. By definition, you cannot compare `0.5==0.5`, because floating point numbers must be compared as `abs(0.5-0.5) < eps` where you choose something like `eps=1e-12`. But you can compare `S(1)/2 == S(1/2)` exactly, that's the point of using symbolic mathematics and SymPy.