ratint

double ratint(double* xa, double* ya, int n, double x, double* dy);

For a function f whose values at the points [xa, xa + n) are [ya, ya + n), this routine approximates f with a rational funtion and returns the interpolated value at the point x. On return, dy contains an error estimate.

Parameters:
xaX values of the function.
yaY values of the function.
nNumber of values.
xValue to interpolate function at.
dyError estimate.

Returns:
R(x), where R a rational function defined on the points (xa, ya), (xa + 1, ya + 1), ... (xa + n - 1, ya + n - 1).

Usage:
double x[] = {1, 2, 3, 4}
double y[] = {-1, 1, 2, -2}
double dy;
double yy = ratint(x, y, 4, 2.5, &dy);

Header:
#include "interpol.h"