#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef __cplusplus
}
#endif

# undef LOCAL

double expint_local(double x, double ym, double x0, double y0, double xp, double yp);
double expint_end(double low, double x, double ym, double x0, double y0,
			double xp, double yp);

struct parab_t	{
	double xctr, yctr, coef;
	double slope, value;
	};

struct parab_t expint_parab(double xm, double ym, double x0, double y0, double xp, double yp);


MODULE = expint		PACKAGE = expint		PREFIX=expint_
PROTOTYPES: ENABLE


double
expint_localint(xm, ym, x0, y0, xp, yp)
	INPUT:
	double xm;
	double ym;
	double x0;
	double y0;
	double xp;
	double yp;
	CODE:
	RETVAL = expint_local(xm, ym, x0, y0, xp, yp);
	OUTPUT:
	RETVAL


double
expint_endint(low, xm, ym, x0, y0, xp, yp)
	INPUT:
	double low;
	double xm;
	double ym;
	double x0;
	double y0;
	double xp;
	double yp;
	CODE:
	RETVAL = expint_end(low, xm, ym, x0, y0, xp, yp);
	OUTPUT:
	RETVAL


double
expint_parabx(xm, ym, x0, y0, xp, yp)
	INPUT:
	double xm;
	double ym;
	double x0;
	double y0;
	double xp;
	double yp;
	PREINIT:
	struct parab_t tmp;
	CODE:
	tmp = expint_parab(xm, ym, x0, y0, xp, yp);
	RETVAL = tmp.xctr;
	OUTPUT:
	RETVAL

double
expint_paraby(xm, ym, x0, y0, xp, yp)
	INPUT:
	double xm;
	double ym;
	double x0;
	double y0;
	double xp;
	double yp;
	PREINIT:
	struct parab_t tmp;
	CODE:
	tmp = expint_parab(xm, ym, x0, y0, xp, yp);
	RETVAL = tmp.yctr;
	OUTPUT:
	RETVAL
