      subroutine kolm1_as(n,fxct,eps1,eps2,q1as,q2as)
c bernd berg, apr 4 2001.
c asymptotic one-sided kolmogorov tests, implementing smirnov's
c equation, see van der waerden, mathematical statistics, springer 1969.
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      dimension fxct(n)
c
      do j=1,2
        eps=zero
        if(j.eq.1) then
          do i=1,n
            femp=(one*(i-1))/n
            eps=max(eps,fxct(i)-femp)
          end do
          eps1=eps
          q1as=exp(-(two*n*eps**2))
        else
          do i=1,n
            femp=(one*i)/n
            eps=max(eps,femp-fxct(i))
          end do
          eps2=eps
          q2as=exp(-(two*n*eps**2))
        end if
      end do
c
      return
      end
