#include #include #include #define EXACT false #define VALUETYPE double #define EXPTYPE double #if EXACT #define VALUETYPE ratio #define EXPTYPE int #endif /*given function df[0] on domain [0,D-1], compute derivatives f' until f^{(K)} and store them in df[1] to df[K]*/ void differentiate(VALUETYPE** df, int D, int K){ 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