8 #include <malloc/malloc.h>
15 void polint(
double *xa,
double *ya,
int n,
double x,
double *y,
double *dy )
30 if( (c = (
double *)malloc( n *
sizeof(
double ) )) == NULL || (d = (
double *)malloc( n *
sizeof(
double ) )) == NULL ) {
47 for( i = 0; i < n; ++i ) {
48 dift = fabs( x-xa[i] );
59 for( m = 0; m < n-1; ++
m ) {
60 for( i = 0; i < n-m-1; ++i ) {
65 if( fabs(den) < 1.e-25 ) {
66 fprintf( stderr,
"polint error: den = 0\n" );
68 fprintf( stderr,
"polint error: setting y = 0 and dy = 1e9\n" );
84 if( 2*(ns+1) < n-m-1 ) {
static const double m
mass of electron in grams
void polint(double *xa, double *ya, int n, double x, double *y, double *dy)