View Raw SPL
/* cubic spline interpolation */
ITERATE csinterp(y, rate)
{
        if (argc < 2)
        {
                if (argc < 1) error(sprintf("%s - input series required", __FUNC__));

                rate = rate(y);
        }

        if (isxy(y))
        {
                y = csinterpxy(xvals(y), yvals(y), rate);
        }
        else
        {
                y = spinterp(y, 1 / rate);
        }

        return(y);
}