]> 1D Chebyshev economization, the function

1D Chebyshev economization, the function


If Cut/Copy and Paste fails, then click here for download.


double approxf (int n, double *c, double x)
{
  double y, x2, t0, t1, t2;
  int i;
  y = 0.0; x2 = 2.0 * x;
  t0 = x; t1 = x2 * x - 1.0;
  for (i = 0; i < n; i++) {
    t2 = t1; t1 = t0; t0 = t1 * x2 - t2; y += c[i] * t0;
    }
  return (y);
  }

Thu, 07 Aug 2014 00:56:57 +0200

Stephan K.H. Seidl