C----------------------------------------------------------C
C  SUBROUTINE  BDMCA2  OBTAINS UPPER AND LOWER BOUNDS FOR  C
C                      TWO-SIDED MCA CRITICAL VALUE        C
C  INPUT VARIABLES:                                        C
C    K = NUMBER OF TREATMENTS                              C
C    CC = CONFIDENCE LEVEL                                 C
C    NU = DEGREES OF FREEDOM                               C
C  OUTPUT VARIABLES:                                       C
C    DHALL = UPPER BOUND OF CRITICAL VALUE                 C
C    DLALL = LOWER BOUND OF CRITICAL VALUE                 C
C  LAST REVISION: 11-25-87 BY JCH                          C
C----------------------------------------------------------C
      SUBROUTINE BDMCA2(K,CC,NU,DNU,DHALL,DLALL)
      IMPLICIT DOUBLEPRECISION (A-H,O-Z)
C6    IMPLICIT REAL*8 (A-H,O-Z)
      COMMON/LIST5/DINFNU
C
      IF (DNU.LE.DINFNU) GOTO 63
C       ---------------------------
C       INFINITE D.F. (NORMAL) CASE
C       ---------------------------
        CUMU=0.5D0+0.5D0*CC
        DLALL=FINVN(CUMU,IFAULT)
C       ------------------------------------------------------
C       OBTAIN UPPER BOUND BY SIDAK'S AND MIXTURE INEQUALITIES
C       ------------------------------------------------------
        CUMU=0.5D0+0.5D0*DEXP(DLOG(CC)/DBLE(FLOAT(K*(K-1)/2)))
        DHALL=FINVN(CUMU,IFAULT)
        GOTO 65
C
C     ---------------------------------
C     FINITE D.F. (T DISTRIBUTION) CASE
C     ---------------------------------
   63 TAIL=1.0D0-CC
      DLALL=FINVT(TAIL,NU)
C     ----------------------------------------
C     OBTAIN UPPER BOUND BY SIDAK'S INEQUALITY
C     ----------------------------------------
      TAIL=1.0D0-DEXP(DLOG(CC)/DBLE(FLOAT(K*(K-1)/2)))
      DHALL=FINVT(TAIL,NU)
C  
   65 CONTINUE
      RETURN
      END
C
