If GSL is enabled, various spline interpolations can be selected (including linear), as well as computation of the first two derivates. Note that with ascii tables enough precision must be given to give the higher order derivatives a change to be computed accurately enough. This means %20.16f or something better should be given in all tab* programs. See example below.
% nemoinp 1:2:0.001 | tabmath - - ’%1*%1’ | tabspline - y=2 1.41421 2
or a little more serious to check the accuracy of the GSL interpolation
types, use 100 values between 1 and 2 to evaluate the accuracy of dermining
sqrt(2)
:
% nemoinp 1:2:0.01 format=%20.16f | tabmath - - ’%1*%1’ format=%20.16f |\ tabspline - y=2 format=%20.16f type=linear | tabmath - - ’%1-sqrt(2)’ 1.4142049469964664 2.0000000000000000 -8.61538e-06 % nemoinp 1:2:0.01 format=%20.16f | tabmath - - ’%1*%1’ format=%20.16f |\ tabspline - y=2 format=%20.16f type=akima | tabmath - - ’%1-sqrt(2)’ 1.4142135470218800 2.0000000000000000 -1.53512e-08 % nemoinp 1:2:0.01 format=%20.16f | tabmath - - ’%1*%1’ format=%20.16f |\ tabspline - y=2 format=%20.16f type=cspline | tabmath - - ’%1-sqrt(2)’ 1.4142135625037890 2.0000000000000000 1.30694e-10
table(5NEMO), spline(3NEMO)
src/kernel/tab/tabspline.c source code
15-Apr-98 V2.0 TOOLBOX made functional for Sally PJT 16-apr-98 split code and placed in src/kernel/tab PJT 23-jan-01 V2.1 added x=,y= arrays for Mousumi PJT 5-apr-01 V2.2: added format= PJT 9-sep-01 V3.0: GSL enabled, can use spline options PJT 22-jul-02 V3.1: documented nder PJT 31-aug-02 V3.3: allow x=all and y=all PJT