CALL WORTHO(X,Y,W,NPTS,COEFF,N,ERROR,WORK) -- This subroutine provides a means of producing a least-squares fit to a set of data. FCTR: WO X - Independent variable array. Y - Dependent variable array. W - Weight array. NPTS - In absolute value, the number of points. If negative, the values returned in ERROR will be percentages. COEFF - Coefficient array, dimensioned at least N+1. Y(X) = COEFF(1) + COEFF(2)*X + ... + COEFF(N+1)*X**N. N - Order of fitted polynomial, N < 6. ERROR - Array of differences between data and fitted polynomial. ERROR( IABS(NPTS)+1 ) contains maximum error, ERROR( IABS(NPTS) +2 ) contains sigma error. Must be dimensioned at least IABS(NPTS)+2. WORK - Working array, dimensioned at least 2*IABS(NPTS). NOTE: A nonweighted least-squares fit can be obtained by using SUBROUTINE ORTHO.