import cam.symfun.*;
public class SFtest1
{
//
//######################################################################
//
//  Create and then evaluate a SymbolicFunction that 
//  implements  the function 2*x + sin(x)
//
//######################################################################
//
public static void main(String[] args)
{
    SymbolicFunction Sym = new SymbolicFunction(); 
    
    String[] V = new String[1];                 
    V[0]       = new String("x"); // x = ind. variable
    String E   = "2*x + sin(x)";

    try
    {  
    Sym.initialize(V,E);
    }
    catch(Exception e)
    {
    System.out.println(e.getMessage());
    }
    
    double val = Sym.evaluate(2.0);
    System.out.println(" SymbolicFunction F = " + Sym.getConstructorString());
    System.out.println(" Evaluated at x     = 2.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){};
}    
}