Parses math expressions and returns the result