Other possible boundary conditions are here.
Cubic Spline Interpolation - Wikiversity
BTW how does your code work on
. (Cubic Spline Overshoots)
Consider the test data x = {1,2,3,3.1,5.1,6,7,8} and y = {1.8, 1.9, 1.7,1.1, 1.1, 1.7,1.4,1.9}. Apply cubic spline interpolation to this data set with the two end/boundary conditions that we discussed in this chapter. Determine those subintervals in [1,8] where negative values are produced. This is obviously an undesirable situation. In particular, what is the interpolated value when x = 4?
Carry out the same experiment with the data:
std::vector<double> x{ 0,10,30.50,70,90,100 };
std::vector<double> y{ 30,130,150,150,170,220,320};