summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Weigt <juw@posteo.de>2026-01-20 12:37:08 +0100
committerJulian Weigt <juw@posteo.de>2026-02-04 15:56:59 +0100
commitfbc4dc293cd09d795f62db3203af80cf1eb44531 (patch)
tree99c909cd8b1bc6b183622781cb71b9c5a7ff3423
parent8026d05da941092a1f7522c9eb07d44cd17c7b61 (diff)
Add code to print also derivatives.
-rw-r--r--charf.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/charf.c b/charf.c
index ad2da3b..4ffbb54 100644
--- a/charf.c
+++ b/charf.c
@@ -220,15 +220,40 @@ void format_result(char* s, int index, int k, EXPTYPE p, VALUETYPE r, int format
root_to_string(rts,r,p);
l += sprintf(s+l,"|f^(%2d)|_%s: %s",k,e,rts);
/*Compute and print also Mf.*/
+ /*Compute and print also df and dMf.*/
/*
VALUETYPE Mf[N];
compute_maximalfunction(f, Mf, d);
- l += sprintf(s+l,"\nMf: ");
+ l += sprintf(s+l,"\nM: ");
for(int i=0; i<d; i++){
char v[8];
valuetype_to_string(v,Mf[i]);
l += sprintf(s+l,"%s ",v);
}
+ VALUETYPE df[2][N];
+ VALUETYPE dMf[2][N];
+ for(int i=0; i<=1; i++){
+ for(int n=0; n<d; n++){
+ df[i][n] = f[n];
+ dMf[i][n] = Mf[n];
+ }
+ }
+ 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);
+ l += sprintf(s+l,"\nf%d: ",m+1);
+ for(int i=0; i<d; i++){
+ char v[8];
+ valuetype_to_string(v,df[(m+1)%2][i]);
+ l += sprintf(s+l,"%s ",v);
+ }
+ l += sprintf(s+l,"\nM%d: ",m+1);
+ for(int i=0; i<d; i++){
+ char v[8];
+ valuetype_to_string(v,dMf[(m+1)%2][i]);
+ l += sprintf(s+l,"%s ",v);
+ }
+ }
*/
}
else if(format == FORMAT_LATEX){