use of org.matheclipse.core.eval.EvalEngine in project symja_android_library by axkr.
the class ExpandTestCase method testExpandPerformance001.
public void testExpandPerformance001() {
// ExpandAll((a+b+2*c+x+y+3*z)^6)
IAST ast = Power(Plus(a, b, F.Times(C2, c), x, y, F.Times(F.C3, z)), F.ZZ(6));
IAST temp = (IAST) Algebra.expand(ast, null, false, false, false);
EvalEngine engine = EvalEngine.get();
temp = (IAST) engine.evaluate(temp);
// number of terms
assertEquals(temp.argSize(), 462);
assertEquals(temp.get(462).toString(), "729*z^6");
}
use of org.matheclipse.core.eval.EvalEngine in project symja_android_library by axkr.
the class ExprEvaluatorTest method testSmallValueEvalEnginge.
public void testSmallValueEvalEnginge() {
// github #208
ExprEvaluator exprEvaluator = new ExprEvaluator();
EvalEngine evalEngine = exprEvaluator.getEvalEngine();
evalEngine.setNumericMode(true, 100, -1);
assertEquals(evalEngine.evaluate("N( 1/(1602176620898*10^(-31)) ,100)").toString(), "6.241509125501484852088071665173164020252959820255548406024372975427711002340001391293975286331422182*10^18");
assertEquals(evalEngine.evaluate("1/(N(0.0000000000000000001602176620898, 100))").toString(), "6.241509125501484852088071665173164020252959820255548406024372975427711002340001391293975286331422182*10^18");
assertEquals(evalEngine.evaluate("N(1/(N(0.0000000000000000001602176620898, 100)), 100)").toString(), "6.241509125501484852088071665173164020252959820255548406024372975427711002340001391293975286331422182*10^18");
}
use of org.matheclipse.core.eval.EvalEngine in project symja_android_library by axkr.
the class ExprEvaluatorTest method testEvalF.
public void testEvalF() {
EvalEngine engine = new EvalEngine(true);
ExprEvaluator eval = new ExprEvaluator(engine, true, (short) 20);
String str = "Sqrt(2)*Pi";
double d = eval.evalf(str);
assertEquals("4.442882938158366", Double.toString(d));
}
use of org.matheclipse.core.eval.EvalEngine in project symja_android_library by axkr.
the class ExprParserTestCase method testIntegerMIN_VALUE.
public void testIntegerMIN_VALUE() {
// Integer.MIN_VALUE
EvalEngine engine = new EvalEngine("", 256, 256, System.out, System.err, true);
ExprParser parser = new ExprParser(engine, true);
IExpr expr = parser.parse("-2147483648");
assertEquals(expr.toMMA(), "-2147483648");
}
use of org.matheclipse.core.eval.EvalEngine in project symja_android_library by axkr.
the class ExprParserTestCase method testLongMIN_VALUE.
public void testLongMIN_VALUE() {
// Long.MIN_VALUE
EvalEngine engine = new EvalEngine("", 256, 256, System.out, System.err, true);
ExprParser parser = new ExprParser(engine, true);
IExpr expr = parser.parse("-9223372036854775808");
assertEquals(expr.toMMA(), "-9223372036854775808");
}
Aggregations