Package com.nr.sf

Examples of com.nr.sf.Erf


   

    // Test Erf
    System.out.println("Testing Erf");

    Erf e = new Erf();
    for (i=0;i<N;i++) {
      zz1[i]=e.erf(xx[i]);
      zz2[i]=e.erfc(xx[i]);
    }

    sbeps=5.e-15;
    System.out.printf("Erf, erf(): Maximum discrepancy = %f\n", maxel(vecsub(zz1,yy1)));
    localflag = maxel(vecsub(zz1,yy1)) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** Erf, erf(): Incorrect function values");
     
    }

    sbeps=5.e-15;
    System.out.printf("Erf, erfc(): Maximum discrepancy = %f\n", maxel(vecsub(zz2,yy2)));
    localflag = maxel(vecsub(zz2,yy2)) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** Erf, erfc(): Incorrect function values");
     
    }

    for (i=0;i<N;i++) {
      zz3[i]=e.inverf(zz1[i]);
      zz4[i]=e.inverfc(zz2[i]);
    }

    sbeps=1.e-9;
    System.out.printf("Erf, inverf(): Maximum discrepancy = %f\n", maxel(vecsub(zz3,xx)));
    localflag = maxel(vecsub(zz3,xx)) > sbeps;
View Full Code Here


   

    // Test erfcc
    System.out.println("Testing erfcc");

    Erf e = new Erf();
    for (i=0;i<N;i++) {
      yy[i]=Erf.erfcc(x[i]);
      zz[i]=e.erfc(x[i]);
    }
    System.out.printf("erfcc: Maximum discrepancy = %f\n", maxel(vecsub(zz,yy)));
    localflag = maxel(vecsub(zz,yy)) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
View Full Code Here

TOP

Related Classes of com.nr.sf.Erf

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.