      real*8 function dahav( x )
!
!     Inverse haversine function
!
!     B. Knapp, 96.01.29
!
C
C     RCS DATA
C     
C     $Header$
C     
C     $Log$
C
C
      implicit none
!
      real*8 x
!
!     Use numerically stable identity:
      dahav = 2.d0*asin(sqrt(x))
      return
      end
