import javax.swing.*;
public class ez
{
public static void print(String s1,String s2)
{	
JOptionPane.showMessageDialog(null,s1,s2,JOptionPane.PLAIN_MESSAGE);
}
// ROOTS OF EQUATIONS
public static double bisection(String s,double xmin,double xmax)
{       ce1 x0=new ce1(s);
        ce2 x1=new ce2(xmin,xmax);
        return x1.r;
}
public static double false_position(String s,double xmin,double xmax)
{       ce1 x0=new ce1(s);
        ce2A x1=new ce2A(xmin,xmax);
        return x1.r;
}
public static double stefensen(String s,double xmin)
{       ce1 x0=new ce1(s);
        ce2B x1=new ce2B(xmin);
        return x1.r;
}

public static double brent(String s,double xmin,double xmax)
{       ce1 x0=new ce1(s);
        ce2F x1=new ce2F(xmin,xmax);
        return x1.r;
}

public static double ridder(String s,double xmin,double xmax)
{       ce1 x0=new ce1(s);
        ce2E x1=new ce2E(xmin,xmax);
        return x1.r;
}

public static double newton(String s,double xmin)
{       ce1 x0=new ce1(s);
        ce2C x1=new ce2C(xmin);
        return x1.r;
}

public static double secant(String s,double xmin)
{       ce1 x0=new ce1(s);
        ce2D x1=new ce2D(xmin);
        return x1.r;
}
public static double inverseinterpolation(String s,double xmin,double x2,double xmax)
{       ce1 x0=new ce1(s);
        ce2I x1=new ce2I(xmin,x2,xmax);
        return x1.r;
}
public static double muller(String s,double xmin,double x2,double xmax)
{       ce1 x0=new ce1(s);
        ce2G x1=new ce2G(xmin,x2,xmax);
        return x1.r;
}

public static double newton_bisection(String s,double xmin,double xmax)
{       ce1 x0=new ce1(s);
        ce2H x1=new ce2H(xmin,xmax);
        return x1.r;
}
//______________
public static double bisection(double xmin,double xmax)
{       ce1 x0=new ce1();
        ce2 x1=new ce2(xmin,xmax);
        return x1.r;
}
public static double false_position(double xmin,double xmax)
{       ce1 x0=new ce1();
        ce2A x1=new ce2A(xmin,xmax);
        return x1.r;
}
public static double stefensen(double xmin)
{       ce1 x0=new ce1();
        ce2B x1=new ce2B(xmin);
        return x1.r;
}

public static double brent(double xmin,double xmax)
{       ce1 x0=new ce1();
        ce2F x1=new ce2F(xmin,xmax);
        return x1.r;
}

public static double ridder(double xmin,double xmax)
{       ce1 x0=new ce1();
        ce2E x1=new ce2E(xmin,xmax);
        return x1.r;
}

public static double newton(double xmin)
{       ce1 x0=new ce1();
        ce2C x1=new ce2C(xmin);
        return x1.r;
}

public static double secant(double xmin)
{       ce1 x0=new ce1();
        ce2D x1=new ce2D(xmin);
        return x1.r;
}
public static double inverseinterpolation(double xmin,double x2,double xmax)
{       ce1 x0=new ce1();
        ce2I x1=new ce2I(xmin,x2,xmax);
        return x1.r;
}
public static double muller(double xmin,double x2,double xmax)
{       ce1 x0=new ce1();
        ce2G x1=new ce2G(xmin,x2,xmax);
        return x1.r;
}

public static double newton_bisection(double xmin,double xmax)
{       ce1 x0=new ce1();
        ce2H x1=new ce2H(xmin,xmax);
        return x1.r;
}
// OPTIMIZATION
//Golden search method
public static double golden_search(String s,double xmin,double xmax)
{       ce1 x0=new ce1(s);
        ce2J x1=new ce2J(xmin,xmax);
        return x1.r;
}
//Quadratic polynomial search
public static double quadratic_polynomial_search(String s,double xmin,double xmax)
{       ce1 x0=new ce1(s);
        ce2K x1=new ce2K(xmin,xmax);
        return x1.r;
}
//Cubic  polynomial search
public static double cubic_polynomial_search(String s,double xmin,double xmax)
{       ce1 x0=new ce1(s);
        ce2L x1=new ce2L(xmin,xmax);
        return x1.r;
}
// Newton-Raphson method
public static double newton_search(String s,double xmin)
{       ce1 x0=new ce1(s);
        ce2M x1=new ce2M(xmin);
        return x1.r;
}
// Brent method
public static double brent_search(String s,double x1,double x2,double x3)
{       ce1 x0=new ce1(s);
        ce2N xx=new ce2N(x1,x2,x3);
        return xx.r;
}
//____
//Golden search method
public static double golden_search(double xmin,double xmax)
{       ce1 x0=new ce1();
        ce2J x1=new ce2J(xmin,xmax);
        return x1.r;
}
//Quadratic polynomial search
public static double quadratic_polynomial_search(double xmin,double xmax)
{       ce1 x0=new ce1();
        ce2K x1=new ce2K(xmin,xmax);
        return x1.r;
}
//Cubic  polynomial search
public static double cubic_polynomial_search(double xmin,double xmax)
{       ce1 x0=new ce1();
        ce2L x1=new ce2L(xmin,xmax);
        return x1.r;
}
// Newton-Raphson method
public static double newton_search(double xmin)
{       ce1 x0=new ce1();
        ce2M x1=new ce2M(xmin);
        return x1.r;
}
// Brent method
public static double brent_search(double x1,double x2,double x3)
{       ce1 x0=new ce1();
        ce2N xx=new ce2N(x1,x2,x3);
        return xx.r;
}
//INTEGRAL 
//Gauss-Legendre Integral
public static double Gauss_Legendre_integral(double x1,double x2)
{       ce1 x0=new ce1();
        ce2O xx=new ce2O(x1,x2);
        return xx.r;
}
//Adaptive Gauss-Lobatto Integral
public static double Gauss_Lobatto_integral(double x1,double x2)
{       ce1 x0=new ce1();
        ce2P xx=new ce2P(x1,x2);
        return xx.r;
}
//Adaptive Simpson Integral
public static double Simpson_Integral(double x1,double x2)
{       ce1 x0=new ce1();
        ce2Q xx=new ce2Q(x1,x2);
        return xx.r;
}
//Adaptive Gauss-Kronroad Integral
public static double Gauss_Kronroad_Integral(double x1,double x2)
{       ce1 x0=new ce1();
        ce2R xx=new ce2R(x1,x2);
        return xx.r;
}
//DIFFERENTIAL GROUP
public static double derivative(double x1)
{       ce1 x0=new ce1();
        f2D ff=new f2D();
        double r=ff.dfunc(x1);
        return r;
}
//nth order derivative
public static double derivative_n(double x1,int n)
{       ce1 x0=new ce1();
         f2D ff=new f2D();
        double r=ff.dfunc(x1,n);
        return r;
}

// PLOT GROUP

public static void plot(String s,double xmin,double xmax)
{       ce1 x0=new ce1(s);
        ce3 x1=new ce3(xmin,xmax,400,x0.s);
}

public static void plot(String s,double xmin,double xmax,int N)
{       ce1 x0=new ce1(s);
        ce3 x1=new ce3(xmin,xmax,N,x0.s);
}
	  
public static void plot()
{ 
		ce1 x0=new ce1();
        double a[]=Text.readDoubleV("Enter minimum and maximum values of the function xmin xmax");
        ce3 x1=new ce3(a[0],a[1],400,x0.s);
}

public static void main(String arg[])
{ plot();}

}