Improved subexpressions, no need for numerical evaluation

There is non need to evaluate sympy functions numerically. An error in subexpression handling caused this problem.