%N squares %F $MIR/src/subs/polyfit.for
%D Compute sums-of-squares for lsqfill
%: polynomials, calibration, least-squares
%P pjt
%B
        SUBROUTINE squares( count, x, y, pmax )

        INTEGER count, pmax
        REAL    x(*), y(*)

  Inputs:
       count -- the number of data points
       x     -- independent variable
       y     -- dependent variable
       pmax  -- polynomial order of fit
