Skip to main content
4 of 9
deleted 2 characters in body
Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375

There is no documented built-in way to convert the InterpolatingFunction object into explicit Piecewise form (thanks to @MichaelE2 for the link!). So the only possibility to get an explicit interpolating function is to re-implement the built-int Interpolation in the high-level Mathematica language. I have already done this for the built-in "Spline" method with InterpolationOrder -> 2 (quadric spline interpolation with splicing points in the middle of adjacent interpolation points). Spline interpolation in general gives much better results than the default "Hermite" method.

You can use my implementation of quadric spline interpolation in Mathemetica to produce an explicit Piecewise function interpolating your data (as opposed to the built-in, it supports arbitrary precision!):

data = Transpose[{Range[Length[#]], #}] &@{2, 5, 9, 15, 22, 33, 50, 70, 100, 145};
spline[\[FormalX]_] = makeSpline[toSplineData[data], \[FormalX]]

screenshot

Alexey Popkov
  • 62.3k
  • 7
  • 154
  • 375