import java.io.*;


class Y_LA extends f_x
{
 double func (double LA)
 {
   double L=1000;
   return 0.4818e-7*LA*LA*LA*LA-0.9089e-4*LA*LA*LA+0.06842*LA*LA
          -0.2107e2*LA+9860-0.9592e-7*(L-LA)*(L-LA)*(L-LA)*(L-LA)
          +0.7811e-4*(L-LA)*(L-LA)*(L-LA)-0.2625e-1*(L-LA)*(L-LA)
          +2.189*(L-LA)-9003;
 }
}

public class Matrix2
{
    public static void main(String args[]) throws IOException
    {
	//finding rotts of equations    
    Y_LA ff=new Y_LA();
    double LA=500;
    LA=Numeric.newton(LA,ff);
    System.out.println("Newton\nLA = "+LA);
    double xl=10;
    double xu=800;
    LA=Numeric.bisectionsearch(xl,xu,ff);
    System.out.println("Bisection search\nLA = "+LA);
    LA=Numeric.bisection(xl,xu,ff);
    System.out.println("Bisection\nLA = "+LA);
    LA=Numeric.ridder(xl,xu,ff);
    System.out.println("Ridder\nLA = "+LA);
    LA=Numeric.newton_2nd_derivative(LA,ff);
    System.out.println("Newton 2nd derivative\nLA = "+LA);
    LA=Numeric.secant_2nd_derivative(LA,ff);
    System.out.println("Secand 2nd derivative\nLA = "+LA);
    LA=Numeric.brent(xl,xu,ff,1.0e-4);
    System.out.println("brent\nLA = "+LA);
    }
}
