1 | initial version |
Some primitive comparison GSL/maxima:
#Sage spline
p=[[7,2],[8,2],[3,2],[6,7]]
f=spline(p)
[f(k) for k in[3..8]] # k have to be in [3,7]
[2.0, 6.39068100358423, 8.738351254480287, 7.0, 2.0, 1.9999999999999996]
/*maxima cspline*/
load(interpol);
p:[[7,2],[8,2],[3,2],[6,7]];
c:cspline(p);
makelist(ev(subst(k,x,c),numer),k,3,8); /* k can be outside of [3,7]*/
[1.999999999999998,6.39068100358423,8.738351254480285,6.999999999999545,2.000000000000341,2.000000000000455]
2 | No.2 Revision |
Some primitive comparison GSL/maxima:
#Sage spline
p=[[7,2],[8,2],[3,2],[6,7]]
f=spline(p)
[f(k) for k in[3..8]] # k have to be in [3,7]
[2.0, 6.39068100358423, 8.738351254480287, 7.0, 2.0, 1.9999999999999996]
[f(k+0.5) for k in[3..7]]
[4.323028673835125, 7.947580645161291, 8.507616487455198, 4.318548387096774, 1.4354838709677418]
/*maxima cspline*/
load(interpol);
p:[[7,2],[8,2],[3,2],[6,7]];
c:cspline(p);
makelist(ev(subst(k,x,c),numer),k,3,8); /* k can be outside of [3,7]*/
[1.999999999999998,6.39068100358423,8.738351254480285,6.999999999999545,2.000000000000341,2.000000000000455]
makelist(ev(subst(k+0.5,x,c),numer),k,3,7);
[4.323028673835125,7.947580645161292,8.507616487455195,4.318548387096712,1.435483870968369]
3 | No.3 Revision |
Some primitive comparison GSL/maxima:
#Sage spline
p=[[7,2],[8,2],[3,2],[6,7]]
f=spline(p)
[f(k) for k in[3..8]] # k have to be in [3,7]
[3,8]
[2.0, 6.39068100358423, 8.738351254480287, 7.0, 2.0, 1.9999999999999996]
[f(k+0.5) for k in[3..7]]
[4.323028673835125, 7.947580645161291, 8.507616487455198, 4.318548387096774, 1.4354838709677418]
/*maxima cspline*/
load(interpol);
p:[[7,2],[8,2],[3,2],[6,7]];
c:cspline(p);
makelist(ev(subst(k,x,c),numer),k,3,8); /* k can be outside of [3,7]*/ [3,8]*/
[1.999999999999998,6.39068100358423,8.738351254480285,6.999999999999545,2.000000000000341,2.000000000000455]
makelist(ev(subst(k+0.5,x,c),numer),k,3,7);
[4.323028673835125,7.947580645161292,8.507616487455195,4.318548387096712,1.435483870968369]