	PROGRAM D11R7
C	Driver for routine HQR
	PARAMETER(NP=5)
	DIMENSION A(NP,NP),WR(NP),WI(NP)
	DATA A/1.0,-2.0,3.0,-4.0,-5.0,2.0,3.0,4.0,5.0,6.0,
     *		0.0,0.0,50.0,-60.0,-70.0,0.0,0.0,0.0,7.0,8.0,
     *		0.0,0.0,0.0,0.0,-9.0/
	WRITE(*,'(/1X,A)') 'Matrix:'
	DO 11 I=1,NP
		WRITE(*,'(1X,5F12.2)') (A(I,J),J=1,NP)
11	CONTINUE
	CALL BALANC(A,NP,NP)
	CALL ELMHES(A,NP,NP)
	CALL HQR(A,NP,NP,WR,WI)
	WRITE(*,'(/1X,A)') 'Eigenvalues:'
	WRITE(*,'(/1X,T9,A,T24,A/)') 'Real','Imag.'
	DO 12 I=1,NP
		WRITE(*,'(1X,2E15.6)') WR(I),WI(I)
12	CONTINUE			
	END
	PROGRAM D3R6
C	Driver for routine HUNT
	PARAMETER(N=100)
	DIMENSION XX(N)
C	Create array to be searched
	DO 11 I=1,N
		XX(I)=EXP(I/20.0)-74.0
11	CONTINUE
	WRITE(*,*) 'Result of:    j=0 indicates x too small'
	WRITE(*,*) '            j=100 indicates x too large'
	WRITE(*,'(T7,A7,T17,A5,T25,A1,T32,A5,T42,A7)') 'locate:',
     *  'guess','j','xx(j)','xx(j+1)'
C	Do test
 	DO 12 I=1,19
		X=-100.0+200.0*I/20.0
C	Trial parameter
		JI=5*I
		J=JI
C	Begin search
		CALL HUNT(XX,N,X,J)
		IF (J.EQ.0) THEN
			WRITE(*,'(1X,F12.6,2I6,A12,F12.6)') X,JI,J,
     *				'lower lim',XX(J+1)
		ELSE IF (J.EQ.N) THEN
			WRITE(*,'(1X,F12.6,2I6,F12.6,A12)') X,JI,J,
     *				XX(J),'upper lim'
		ELSE
			WRITE(*,'(1X,F12.6,2I6,2F12.6)') X,JI,J,XX(J),XX(J+1)
		ENDIF
12	CONTINUE
	END
