#define NP 1000
#define INF 1.e37

struct proj { int lbf,ubf; float a,b,lb,ub,quant,mult,val[NP]; } x,y;
float *diag, *r;
float dx 1.;
float ni 100.;
int n;
int auta 0;
int periodic 0;
float konst 0.0;
float zero 0.;

/* Spline fit technique
let x,y be vectors of abscissas and ordinates
    h   be vector of differences h9i8=x9i8-x9i-1988
    y"  be vector of 2nd derivs of approx function
If the points are numbered 0,1,2,...,n+1 then y" satisfies
(R W Hamming, Numerical Methods for Engineers and Scientists,
2nd Ed, p349ff)
	h9i8y"9i-1988+2(h9i8+h9i+18)y"9i8+h9i+18y"9i+18
	
	= 6[(y9i+18-y9i8)/h9i+18-(y9i8-y9i-18)/h9i8]   i=1,2,...,n

where y"908 = y"9n+18 = 0
This is a symmetric tridiagonal system of the form

	| a918 h928               |  |y"918|      |b918|
	| h928 a928 h938            |  |y"928|      |b928|
	|    h938 a938 h948         |  |y"938|  =   |b938|
	|         .           |  | .|      | .|
	|            .        |  | .|      | .|
It can be triangularized into
	| d918 h928               |  |y"918|      |r918|
	|    d928 h938            |  |y"928|      |r928|
	|       d938 h948         |  |y"938|  =   |r938|
	|          .          |  | .|      | .|
	|             .       |  | .|      | .|
where
	d918 = a918

	r908 = 0

	d9i8 = a9i8 - h9i8829/d9i-18	1<i<_n

	r9i8 = b9i8 - h9i8r9i-18/d9i-1i8	1<_i<_n

the back solution is
	y"9n8 = r9n8/d9n8

	y"9i8 = (r9i8-h9i+18y"9i+18)/d9i8	1<_i<n

superficially, d9i8 and r9i8 don't have to