Bug in spline routine?


milank
01-12-2004, 03:35 PM
I am wondering if there is a bug in the spline routine. Specifically,
when using the ypn input parameter to specify the second derivative for the last point in the table when ypn is, say, 2 ( like for f(x) = x^2), the value y2[n-1] is not equal to ypn. On the other hand, y2[0] is very close to yp1 (e.g., for yp1=2). As I understand, y2[0] to y2[n-1] should be the second derivatives
for the points in the table, so I would expect that y2[0]=yp1 and
y2[n-1] = ypn unless I am doing a natural cubic spline (i.e., second
derivatives are zero's at the boundaries).

Milan

milank
01-12-2004, 03:48 PM
Please disregard my previous post. I just realized that yp1 and
ypn represent the first derivatives, not the second derivatives so
the function works fine.