1
$\begingroup$

I was comparing results of spline interpolation in Mathematica and C++/gsl-library

Results of interpolation are different if I use Method -> "Spline", InterpolationOrder -> 3 in Mathematica and cubic spline in C++.

I believe this is due to difference in methods used by Mathematica and C++.

While the method spline interpolation is generated in C++ is known I have no idea what Mathematica calls a cubic spline (probably BSpline , but I am not sure as C++ doesn't seem to have implementation of BSpline, so I can't compare)

I thought of implementing C++ spline method in Mathematica to make one to one comparison to C++. Other option would be to learn what algorithm does Mathematica use for spline interpolation, but I believe it is not open source, or is it?

$\endgroup$
3
  • 2
    $\begingroup$ No, it is most certainly not open-source. Ping support, however: they seem pretty responsive to such internals questions. $\endgroup$
    – ciao
    Mar 26, 2014 at 20:44
  • 3
    $\begingroup$ You can try plotting the function together with its first and second derivatives to figure out what's going on. It should show clearly how the function is pieces together. $\endgroup$
    – Szabolcs
    Mar 26, 2014 at 21:36
  • $\begingroup$ The method underlying the "Spline" option is more or less elaborated in the accepted answer to the duplicate question. $\endgroup$ Jul 5, 2015 at 16:44

0