Mathematical expression parsing and evaluation engine