public static Op<Double> toMathOp(final String string) {
		requireNonNull(string);

		final Op<Double> result;
		final Optional<Const<Double>> cop = toConst(string);
		if (cop.isPresent()) {
			result = cop.orElseThrow(AssertionError::new);
		} else {
			final Optional<Op<Double>> mop = toOp(string);
			result = mop.isPresent()
				? mop.orElseThrow(AssertionError::new)
				: Var.parse(string);
		}

		return result;
	}
Converts the string representation of an operation to the operation
object. It is used for converting the string representation of a tree to
an operation tree. <b>If you use it that way, you should not forget to
re-index the tree variables.</b>

{@snippet lang="java":
final TreeNode<Op<Double>> tree = TreeNode.parse(
    "add(mul(x,y),sub(y,x))",
    MathOp::toMathOp
);

assert Program.eval(tree, 10.0, 5.0) == 100.0;
Var.reindex(tree);
assert Program.eval(tree, 10.0, 5.0) == 45.0;
}

@since 5.0

@see Var#reindex(TreeNode)
@see Program#eval(Tree, Object[])

@param string the string representation of an operation which should be
       converted
@return the operation, converted from the given string
@throws IllegalArgumentException if the given {@code value} doesn't
        represent a mathematical expression
@throws NullPointerException if the given string {@code value} is
        {@code null}
jenetics.prog/src/main/java/io/jenetics/prog/op/MathOp.java