From c6e74e0b980f567f93cb46786e344f410ca83555 Mon Sep 17 00:00:00 2001 From: Julian Weigt Date: Wed, 7 Jan 2026 21:13:50 +0000 Subject: Loop over all derivatives up to whatever limit and print depending on order of derivative. --- charf.c | 114 ++++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 76 insertions(+), 38 deletions(-) (limited to 'charf.c') diff --git a/charf.c b/charf.c index 3dd9d5e..c6a32c3 100644 --- a/charf.c +++ b/charf.c @@ -29,7 +29,7 @@ #endif /*maximum length of the support of f*/ -static const int N=16; +static const int N=24; /*given function df[0] on domain [0,M-1], compute derivatives f' until f^{(K)} and store f^{(K)} in df*/ void differentiate(VALUETYPE* f, VALUETYPE* df, int D, int K){ @@ -114,52 +114,91 @@ void compute_maximalfunction(VALUETYPE* f, VALUETYPE* Mf, int D){ } } -void compute(int K, EXPTYPE p, int D, VALUETYPE* f){ +void compute(EXPTYPE p, int D, VALUETYPE* f){ VALUETYPE Mf[N]; + /*This is the only O(D^2) operation in here so makes a lot of sense to only compute once and avoid repeating it.*/ compute_maximalfunction(f,Mf,D); /*Allocate memory for derivatives.*/ - VALUETYPE df[N]; - VALUETYPE dMf[N]; + VALUETYPE df[2][N]; + VALUETYPE dMf[2][N]; - /*Compute Kth derivative of f and Mf*/ - differentiate(f,df,D,K); - differentiate(Mf,dMf,D,K); - - /*Print derivatives*/ - /* - for(int k=0; k<=K; k++){ - printf("f %d: ",k); - for(int i=0; i.4997) - //if(to_double(r)>=.58) - if(to_double(r)>.53) - { - printf("f: "); - for(int i=0; i.9) + //|| + //(k==2 && t>=.5) + //|| + (k==3 && t>.53) + //|| + //(k==4 && t>=.5) + || + (k==5 && t>=.58) + || + (k==6 && t>=.58) + || + (k==7 && t>=.69) + || + (k==8 && t>=.83) + || + (k==9 && t>=.8699) + || + (k==10 && t>=.919) + || + (k==11 && t>=.97) + || + (k==12 && t>=.97) + || + (k==13 && t>=.98) + || + (k==14 && t>=.98) + || + (k==15 && t>=.9817) + || + (k==16 && t>=.9817) + ){ + printf("f: "); + for(int i=0; i= 0){ - compute(K,p,d,f); + compute(p,d,f); i += NUM_THREADS; d = generate_function(f,i); } -- cgit v1.2.3