aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Weigt <juw@posteo.de>2026-02-23 16:46:13 +0000
committerJulian Weigt <juw@posteo.de>2026-02-23 16:46:13 +0000
commite1dc1ede438c49a56f649026e95be807c95a1c54 (patch)
tree13d63065b1384ae8e26d8ce10c35010965e96032
parenta85b22476d2b7147667caa440aa593d1309cbc55 (diff)
Add case of generating the function 11100100 which seems to be the smallest for which ||Mf^(k)||/||f^(k)|| goes to infinity with k.HEADmain
-rw-r--r--charf.c22
-rw-r--r--double.c1
2 files changed, 20 insertions, 3 deletions
diff --git a/charf.c b/charf.c
index 0028dc5..e48bf9f 100644
--- a/charf.c
+++ b/charf.c
@@ -266,6 +266,21 @@ int generate_each_charf(VALUETYPE* f, index_t i){
else return 0;
}
+int generate_infinity_example(VALUETYPE* f, index_t i){
+ if(i==0){
+ f[0] = int_to_valuetype(1);
+ f[1] = int_to_valuetype(1);
+ f[2] = int_to_valuetype(1);
+ f[3] = int_to_valuetype(0);
+ f[4] = int_to_valuetype(0);
+ f[5] = int_to_valuetype(1);
+ f[6] = int_to_valuetype(0);
+ f[7] = int_to_valuetype(0);
+ return 8;
+ }
+ else return -1;
+}
+
int generate_triangle(VALUETYPE* f, index_t i){
int j = i+1;
if(j <= N/2){
@@ -287,6 +302,7 @@ int generate_random(VALUETYPE* f, index_t i){
/*Writes into f the values of the function indexed by i. Returns the size of the support of f, or -1 if there is no function with that index.*/
int generate_function(VALUETYPE* f, index_t i){
return generate_each_charf(f,i);
+ //return generate_infinity_example(f,i);
//return generate_random(f,i);
//return generate_triangle(f,i);
}
@@ -331,8 +347,8 @@ void format_result(char* s, index_t index, int k, EXPTYPE p, VALUETYPE r, int fo
}
}
for(int m=0; m+1<=k; m++){
- differentiate(df[(m+1)%2],df[m%2],d,1);
- differentiate(dMf[(m+1)%2],dMf[m%2],d,1);
+ differentiate(df[m%2],df[(m+1)%2],d,1);
+ differentiate(dMf[m%2],dMf[(m+1)%2],d,1);
l += sprintf(s+l,"\nf%d: ",m+1);
for(int i=0; i<d; i++){
char v[8];
@@ -421,7 +437,7 @@ int compute(index_t index, EXPTYPE exponents[P], VALUETYPE (*records_ratio)[K+1]
/*extra check for printing only because in error mode for some reason floats randomly seem to increase by tiny amounts*/
if(is_greater_certainly(r,(*records_ratio)[k][p])){
(*records_index)[k][p] = index;
- char s[1024];
+ char s[STRING_SIZE];
format_result(s, index, k, exponents[p], r, FORMAT_TEXT);
printf("%s\n",s);
}
diff --git a/double.c b/double.c
index 5ab6178..89ebd87 100644
--- a/double.c
+++ b/double.c
@@ -44,6 +44,7 @@ double valuetype_to_double(vtype d){ return (double)d; }
int valuetype_to_string(char* s, vtype d){
if( d == 0.0 || d == 1.0 || d == 2.0 || d == 4.0 || d == 8.0 || d == 16.0 ) sprintf(s,"%d", (int)d);
//else sprintf(s,"%4.3f",d);
+ //else sprintf(s,"%+4.3Le",d);
else sprintf(s,"%4.3Lf",d);
return 0;
}