Project 2


Compute the piecewise Hermite Cubic Interpolant to the Runge function at equidistant nodes in [-1,1]. Plot the function and interpolants, and determine an estimate for the interpolation error.
This program computes the Hermite cubic interpolant for a user-specified number of nodes. It then creates the files "output" and "output2". "Output" contains data to graph the Runge function, and "output2" contains data to graph the interpolant of the specified order.
This program computes the Hermite cubic interpolants for up to 100 nodes, and creates the file "output3". "Output3" contains data to graph the log of the maximum error for a given interpolant against the log of the mesh width. Below is the Runge function:

The interpolant with two nodes:

The interpolant with three nodes:

And a plot of the error vs mesh width.