	PROGRAM CMP
C
C*  This program computes scores, analytic derivative and finite difference
C*  derivatives.
C
	REAL	P(3), B(3)
	REAL    scorcp(3), scorcb(3)
	db = .02
	dp = .02

	WRITE (6,*) ' Enter F, H, O, N'
	READ (5,*) frcs, hits, obs, nn
C*
	alpha = obs / FLOAT (nn)
	bias = frcs / obs
        pod = hits / obs
        rn = FLOAT (nn)
C
	WRITE (6,*) ' B, P, alpha = ', bias, pod, alpha
C
C*  Extreme Dependency score.
C
	P(1) = pod - dp
	P(2) = pod
	P(3) = pod + dp
	B(1) = bias - db
	B(2) = bias
	B(3) = bias + db
	DO i = 1, 3
	    ddcb = alog(alpha*P(i))
	    ddcp = alog(alpha*P(2))
	    scorcb(i) = (2.*alog(alpha) / ddcb) - 1.
	    scorcp(i) = (2.*alog(alpha) / ddcp) - 1.
	    If ( i .eq. 2 ) THEN
	        dd = alog(alpha*P(i))
	        scor = (2.*alog(alpha) / dd) - 1.
		dsdb = 0.0
		dsdp = (alog(alpha*P(i))) ** 2
		dsdp = -2.*alog(alpha) / (P(i)*dsdp)
		acpr = 0.0
	    END IF
	END DO
	fdsdb = (scorcp(3) - scorcp(1)) / (2.*db)
	fdsdp = (scorcb(3) - scorcb(1)) / (2.*dp)
	cprb1 = 0.0
C*
	WRITE (6,*) ' Extreme Dependency Score = ', scor
	WRITE (6,*) ' Analytic dsdb = ', dsdb
	WRITE (6,*) ' Finite diff dsdb = ', fdsdb
	WRITE (6,*) ' Analytic dsdp = ', dsdp
	WRITE (6,*) ' Finite diff dsdp = ', fdsdp
	WRITE (6,*) ' CPR = ', -dsdb/dsdp
	WRITE (6,*) ' Analytic CPR = ', acpr
	WRITE (6,*) ' CPR (B=1) = ', cprb1
C*
	STOP
	END
