Tester of parabolic
approximation (in C)




This is the main program converted into C. The conversion was done by the OMtoC function (written in Maple). Except for wrapping around a long line, the result shown is the exact output of the converter.

#define m 5
#define n 10
main( int argc, char *argv[] )
{
    int i; float x[n]; float a0[n]; float a1[n];
        float a2[n];
    for( i=1; i <= n; i += 1 )
        x[i-1] = 3+2*i+i*i;
    MovingParabApprox(n,m,x,a0,a1,a2);
    for( i=1; i <= n; i += 1 )
        printf( "%2d %10.3f %10.3f %10.3f %10.3f\n",
	    i,x[i-1],a0[i-1],a1[i-1],a2[i-1]);
    exit(0);
}