]>
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);
}