Moved SymPy imports into the dexpr function