Package com.nr.fi

Examples of com.nr.fi.DErule


      a=0.0;
      b=eta;
      aa=eta;
      bb=eta+60.0;
      hmax=4.3;
      DErule s = new DErule(this,a,b,hmax);
      DErule ss = new DErule(this,aa,bb,hmax);
      for (int i=1;i<=NMAX;i++) {
        sum=s.next()+ss.next();
        if (i > 3)
          if (abs(sum-olds) <= EPS*abs(olds))
            return sum;
        olds=sum;
      }
View Full Code Here


    System.out.println("Testing DErule");

    a=0.0;
    b=1.0;
    func_DErule func_DErule = new func_DErule();
    DErule derule = new DErule(func_DErule,a,b);
    expect=2.0-PI*PI/6.0;

    sold=derule.next();
    sbeps=1.e-15;
    for (i=0;i<M;i++) {
      s=derule.next();
      if (abs(s-sold) < sbeps) break;
      else sold=s;
    }

    System.out.printf("DErule,case 1: Maximum discrepancy = %f\n", abs(s-expect));
    localflag = abs(s-expect) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** DErule,case 2: Failure to achieve expected accuracy in improper integral");
     
    }

    a=0.0;
    b=1.0;
   
    func_DErule2 func_DErule2 = new func_DErule2();
    DErule derule2 = new DErule(func_DErule2,a,b,4.5);
    expect=PI;

    sold=derule2.next();
    sbeps=1.e-15;
    for (i=0;i<M;i++) {
      s=derule2.next();
      if (abs(s-sold) < sbeps) break;
      else sold=s;
    }

    System.out.printf("DErule,case 2: Maximum discrepancy = %f\n", abs(s-expect));
View Full Code Here

TOP

Related Classes of com.nr.fi.DErule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.