import cam.symfun.*;
public class SFtest3
{
//
//######################################################################
//
// Create and then evaluates a SymbolicFunction that
// implements function of two variables 2*x*y + sin(x)
//
//######################################################################
//
public static void main(String[] args)
{
SymbolicFunction Sym = new SymbolicFunction();
String[] V = new String[2];
V[0] = new String("x"); // x = ind. variable
V[1] = new String("y"); // y = ind. variable
String E = "2*x*y + sin(x)";
try
{
Sym.initialize(V,E);
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
double val = Sym.evaluate(3.14,1.0);
System.out.println(" SymbolicFunction F = " + Sym.getConstructorString());
System.out.println(" Evaluated at (x,y) = (3.14,1.0) is : " + val);
//
// Pause command window
//
System.out.println(" ");
System.out.println(" Program End : Hit Return to Continue ");
java.io.BufferedReader d = new java.io.BufferedReader
(new java.io.InputStreamReader(System.in));
try{d.readLine();}catch(Exception e){};
}
}