      program xdhav
!
!     Exercise driver for haversine function dhav and inverse
!     haversine function dahav.
!
!     B. Knapp, 1996-01-29, 2001-01-03
!
C
C     RCS DATA
C     
C     $Header$
C     
C     $Log$
C
C
      implicit none
      real*8 d2r
      parameter (d2r=3.14159265358979324d0/180.0d0)
      real*8 theta, theta2, h, dhav, dahav
      external dhav, dahav
!
    1 write(*,'(/A$)') ' Theta (degrees)? '
      read(*,*) theta
      h = dhav(theta*d2r)
      theta2 = dahav(h)/d2r
      write(*,'(2e24.16/e24.16)') theta,h,theta2
      goto 1
      end
