* @param expression
* @return
* @throws SyntaxError
*/
public double evaluate(String expression) {
Parser p = new Parser();
fNode = p.parse(expression);
if (fNode instanceof FunctionNode) {
fNode = optimizeFunction((FunctionNode) fNode);
}
return evaluateNode(fNode);
}