@Test public void specialEval3() { final String expr = "5 + 6*x + sin(x)^34 + (1 + sin(x*5)/4)/6"; Assert.assertEquals( MathExpr.eval(expr, 4.32), 31.170600453465315 ); Assert.assertEquals( MathExpr.eval(expr, 4.32), 5.0 + 6*4.32 + pow(sin(4.32), 34) + (1 + sin(4.32*5)/4.0)/6.0 ); }
public double eval(final double... args) { final double val = apply(box(args)); return val == -0.0 ? 0.0 : val; }
MathExpr implements
		Function<Double[], Double>,
		Serializable { public double eval(final double... args) { final double val = apply(box(args)); return val == -0.0 ? 0.0 : val; } }
MathExpr implements
		Function<Double[], Double>,
		Serializable { public double eval(final double... args) { final double val = apply(box(args)); return val == -0.0 ? 0.0 : val; } private  MathExpr(final Tree<? extends Op<Double>, ?> tree, boolean primary);  MathExpr(final Tree<? extends Op<Double>, ?> tree); }
MathExpr implements
		Function<Double[], Double>,
		Serializable { public double eval(final double... args) { final double val = apply(box(args)); return val == -0.0 ? 0.0 : val; } private  MathExpr(final Tree<? extends Op<Double>, ?> tree, boolean primary);  MathExpr(final Tree<? extends Op<Double>, ?> tree); ISeq<Var<Double>> vars(); TreeNode<Op<Double>> toTree(); @Override Double apply(final Double[] args); double eval(final double... args); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); MathExpr simplify(
		final TreeRewriter<Op<Double>> rewriter,
		final int limit
	); MathExpr simplify(final TreeRewriter<Op<Double>> rewriter); MathExpr simplify(); static String format(final Tree<? extends Op<Double>, ?> tree); static MathExpr parse(final String expression); static TreeNode<Op<Double>> parseTree(final String expression); static double eval(final String expression, final double... args); static double eval(
		final Tree<? extends Op<Double>, ?> expression,
		final double... args
	); static int rewrite(final TreeNode<Op<Double>> tree, final int limit); static int rewrite(final TreeNode<Op<Double>> tree); }
MathExpr implements
		Function<Double[], Double>,
		Serializable { public double eval(final double... args) { final double val = apply(box(args)); return val == -0.0 ? 0.0 : val; } private  MathExpr(final Tree<? extends Op<Double>, ?> tree, boolean primary);  MathExpr(final Tree<? extends Op<Double>, ?> tree); ISeq<Var<Double>> vars(); TreeNode<Op<Double>> toTree(); @Override Double apply(final Double[] args); double eval(final double... args); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); MathExpr simplify(
		final TreeRewriter<Op<Double>> rewriter,
		final int limit
	); MathExpr simplify(final TreeRewriter<Op<Double>> rewriter); MathExpr simplify(); static String format(final Tree<? extends Op<Double>, ?> tree); static MathExpr parse(final String expression); static TreeNode<Op<Double>> parseTree(final String expression); static double eval(final String expression, final double... args); static double eval(
		final Tree<? extends Op<Double>, ?> expression,
		final double... args
	); static int rewrite(final TreeNode<Op<Double>> tree, final int limit); static int rewrite(final TreeNode<Op<Double>> tree); static final TreeRewriter<Op<Double>> CONST_REWRITER; static final TreeRewriter<Op<Double>> ARITHMETIC_REWRITER; static final TreeRewriter<Op<Double>> REWRITER; }