code: public static String rewrite(String expression) throws InvalidExpressionException {
  
          ExpressionTree expTree = parseToTree(expression);
  
          expTree.reduce();
  
          return expTree.toString();
      }
docs: Rewrite the expression to eliminate redundant terms and simplify the expression.
  @param expression
  @return
  @throws InvalidExpressionException