/cubicspline

constructing the natural cubic spline for the function 1/(x^2 + 1)

Primary LanguageC++

Cubic Spline

Program that constructs the natural cubic spline for the function 1/(x^2 + 1)

using the points x = -6, -4, -2, 0, 2, 4, 6

input

none

output

data points

tri-diagonal system before forward elim

tri-diagonal system after forward elim

solution for z_i

coefficients Ai, Bi, Ci, Di

Natural Cubic Spline

Table containing x, f(x), S(x), and |f(x) - S(x)| for x = -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6