- Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathExample0.java
More file actions
Latest commit
19 lines (16 loc) · 611 Bytes
/
Copy pathExample0.java
File metadata and controls
19 lines (16 loc) · 611 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
packagesymjava.examples;
importsymjava.symbolic.*;
importstaticsymjava.symbolic.Symbol.*;
importsymjava.symbolic.utils.JIT;
importsymjava.bytecode.BytecodeFunc;
publicclassExample0 {
publicstaticvoidmain(String[] args) {
ExprR = 0.127-(x*0.194/(y+0.194));
ExprRdy = R.diff(y);
System.out.println(Rdy);
//Just-In-Time compile the symbolic expression to native code
BytecodeFuncfunc = JIT.compile(newExpr[]{x,y}, Rdy);
System.out.println(func.apply(0.362, 0.556)); //Scala function call operator
System.out.println(func.call(0.362, 0.556)); //Groovy function call operator
}
}