]>
If Cut/Copy and Paste fails, then click here for download.
double approxd (int n, double *c, double x)
{
double y, x2, u0, u1, wu, u2, cu;
int i;
y = 0.0; x2 = 2.0 * x;
u0 = -1.0; u1 = -x2;
wu = -1.0;
for (i = 0; i < n; i++) {
u2 = u1; u1 = u0; u0 = u1 * x2 - u2;
cu = c[i] * u0; wu += 1.0; y += cu * wu;
}
return (y);
}