#include #include #include /*given function f on domain [0,D-1], compute derivatives f^{(0)} until f^{(K)} and store them in df*/ void differentiate(double* f, double** df, int D, int K){ df[0] = f; int i; for(int k=1; k<=K; k++){ /*compute kth derivative of f from (k-1)th*/ /*only compute derivatives at arguments i < D-k, because for larger i we would need data from outside the domain of f*/ for(i=0; i Mf[i]) Mf[i] = Af[i][j]; } } /*Print computed functions and averages*/ //printf("Mf "); //for(int i=0;i> i) & 1; //if(i%3==0) f[2*N+i+K/2] = 1; } /*Compute ||Mf^{(k)}||_p/||f^{(k)}||_p.*/ r = compute_derivatives(f, Sf, Af, Mf, df, dMf, p, intdf, intdMf, D, K); //printf("%.3d: %.3f \n",t,r); /*Print f and ||Mf^{(k)}||_p/||f^{(k)}||_p if the latter is close to 1/2.*/ if(r>.4997){ printf("f: "); for(int i=0;i