fit_poly (ul_physlib)

	status.i4.v = fit_poly(x.r4a.r, y.r4a.r, ndata.i4.v, sig.r4.r, mwt.i4.v,
			       ord.i4.v, a.r4a.r, chi2.r4.r)

	Perform a polynomial fit to set of data.  Returns fitted equation
	parameteres and statistics of the fit.  This algorithm uses 'lfit()'
	from Numerical Recipes in C;  Cambridge University Press (1988);
	Flannery...etc.; ISBN 0-521-35465-x Book,
	ISBN 0-521-35466-8 C diskette.  See page 532.

	x, y		data to fit
	ndata		number of x,y pairs
	sig		standard deviations of points
	mwt		if mwt == 0, then assume no 'sig' values
	ord		order of polynomial to fit
	a		returned coeffecients of the fit: Y = a[i]X**i
	chi2		returned ch-squared

	This function returns status values as follows:

	OK			success
	CBS_MEMFAIL		memory allocation failed
   	else			nonzero error code.

	This function requires the following include files:

	ul_physlib_h:physlib_h, acnet_errors_h

	Related functions:

	fit_poly_double, fit_linear

	C usage:

	int	status;
	int	ndata = NUM_VALUES;
	int	mwt = FALSE;
	int	ord = FIT_ORDER;
	float	x[NUM_VALUES];
	float	y[NUM_VALUES];
	float	sig;
	float	a[FIT_ORDER+1];
	float	chi;

	status = fit_poly(x,y,ndata,&sig,mwt,ord,a,&chi2);