Package com.nr.interp

Examples of com.nr.interp.Rational_interp


    for (i=0;i<N;i++) {
      x[i]=(double)(i)/(N-1);
      y[i]=(1.0-x[i]*(0.5-0.1*x[i]))/(1.0+(x[i]-2.0)*(x[i]-2.0));
    }
    Ran myran = new Ran(17);
    Rational_interp z = new Rational_interp(x,y,3);
    for (i=0;i<N;i++) {
      xx[i]=myran.doub();
      yy[i]=z.interp(xx[i]);      // interpolated values
      dyy[i]=z.dy;          // Estimated error
      zz[i]=(1.0-xx[i]*(0.5-0.1*xx[i]))/(1.0+(xx[i]-2.0)*(xx[i]-2.0)); // Actual values
    }
    System.out.printf("     Rat_interp: Max. estimated error: %f\n", maxel(dyy));
    System.out.printf("     Rat_interp: Max. actual error:    %f\n", maxel(vecsub(zz,yy)));
View Full Code Here

TOP

Related Classes of com.nr.interp.Rational_interp

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.