Better handling of the else branch
I realized sympy.Piecewise iterates over the conditions
and returns the first which evaluates to True. So, the
else branch should have True
instead of sp.Not(cond)
for a more robust implementation.
I realized sympy.Piecewise iterates over the conditions
and returns the first which evaluates to True. So, the
else branch should have True
instead of sp.Not(cond)
for a more robust implementation.