      SUBROUTINE BTRTST (ER, FP, TM)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
C   BTRIX TEST PROGRAM
C
      PARAMETER (JD=30, KD=30, LD=30, MD=30, F7=78125., T30=1073741824.)
      COMMON /ARRAYS/ S(JD,KD,LD,5), A(5,5,MD,MD), B(5,5,MD,MD),
     $     C(5,5,MD,MD), SX(JD,KD,LD,5), BX(5,5,MD,MD)
      DATA JS/2/, JE/29/, LS/2/, LE/29/, IT/20/, ANS/-0.286282658663962/
C
C   INITIALIZATION
C
      NB = 25 * MD * MD
      NS = JD * KD * LD * 5
      T = F7 / T30
      DO 100 L = 1, MD
        DO 100 K = 1, MD
          DO 100 J = 1, 5
            DO 100 I = 1, 5
              T = MOD (F7 * T, 1.0D0)
              A(I,J,K,L) = T
              T = MOD (F7 * T, 1.0D0)
              BX(I,J,K,L) = T
              T = MOD (F7 * T, 1.0D0)
              C(I,J,K,L) = T
100   CONTINUE
      DO 110 L = 1, 5
        DO 110 K = 1, LD
          DO 110 J = 1, KD
            DO 110 I = 1, JD
              T = MOD (F7 * T, 1.0D0)
              SX(I,J,K,L) = T
110   CONTINUE
      TM = CPTIME ()
C
C   TIMING TEST
C
      DO 120 II = 1, IT
        CALL COPY (NS, SX, S)
        DO 120 K = 1, KD
          CALL COPY (NB, BX, B)
          CALL BTRIX (JS, JE, LS, LE, K)
120   CONTINUE
C
      TM = CPTIME ()
      ER = ABS ((S(19,19,19,1) - ANS) / ANS)
      FP = IT * MD * (LE - 1) * 19165.
C
      RETURN
      END
