	PROGRAM D9R2
C	Driver for routine ZBRAC
	LOGICAL SUCCES
	EXTERNAL BESSJ0
	WRITE(*,'(/1X,T4,A,T29,A/))') 'Bracketing values:',
     *		'Function values:'
	WRITE(*,'(1X,T6,A,T16,A,T29,A,T41,A/))') 'X1','X2',
     *		'BESSJ0(X1)','BESSJ0(X2)'
	DO 11 I=1,10
		X1=I
		X2=X1+1.0
		CALL ZBRAC(BESSJ0,X1,X2,SUCCES)
		IF (SUCCES) THEN
			WRITE(*,'(1X,F7.2,F10.2,7X,2F12.6))') X1,X2,
     *				BESSJ0(X1),BESSJ0(X2)
		ENDIF
11	CONTINUE
	END
	PROGRAM D9R3
C	Driver for routine ZBRAK
	EXTERNAL BESSJ0
	PARAMETER(N=100,NBMAX=20,X1=1.0,X2=50.0)
	DIMENSION XB1(NBMAX),XB2(NBMAX)
	NB=NBMAX
	CALL ZBRAK(BESSJ0,X1,X2,N,XB1,XB2,NB)
	WRITE(*,'(/1X,A/)') 'Brackets for roots of BESSJ0:'
	WRITE(*,'(/1X,T17,A,T27,A,T40,A,T50,A/)') 'lower','upper',
     *			'F(lower)','F(upper)'
	DO 11 I=1,NB
		WRITE(*,'(1X,A,I2,2(4X,2F10.4))') 'Root ',I,XB1(I),XB2(I),
     *			BESSJ0(XB1(I)),BESSJ0(XB2(I))
11	CONTINUE
	END
	PROGRAM D9R7
C	Driver for routine ZBRENT
	EXTERNAL BESSJ0
	PARAMETER(N=100,NBMAX=20,X1=1.0,X2=50.0)
	DIMENSION XB1(NBMAX),XB2(NBMAX)
	NB=NBMAX
	CALL ZBRAK(BESSJ0,X1,X2,N,XB1,XB2,NB)
	WRITE(*,'(/1X,A)') 'Roots of BESSJ0:'
	WRITE(*,'(/1X,T19,A,T31,A/)') 'x','F(x)'
	DO 11 I=1,NB
		TOL=(1.0E-6)*(XB1(I)+XB2(I))/2.0
		ROOT=ZBRENT(BESSJ0,XB1(I),XB2(I),TOL)
		WRITE(*,'(1X,A,I2,2X,F12.6,E16.4)') 'Root ',I,ROOT,BESSJ0(ROOT)
11	CONTINUE
	END
	PROGRAM D9R11
C	Driver for routine ZROOTS
	PARAMETER(M=4,M1=M+1)
	COMPLEX A(M1),X,ROOTS(M)
	LOGICAL POLISH
	DATA A/(0.0,2.0),(0.0,0.0),(-1.0,-2.0),(0.0,0.0),(1.0,0.0)/
	WRITE(*,'(/1X,A)') 'Roots of the polynomial x^4-(1+2i)*x^2+2i'
	POLISH=.FALSE.
	CALL ZROOTS(A,M,ROOTS,POLISH)
	WRITE(*,'(/1X,A)') 'Unpolished roots:'
	WRITE(*,'(1X,T10,A,T25,A,T37,A)') 'Root #','Real','Imag.'
	DO 11 I=1,M
		WRITE(*,'(1X,I11,5X,2F12.6)') I,ROOTS(I)
11	CONTINUE
	WRITE(*,'(/1X,A)') 'Corrupted roots:'
	DO 12 I=1,M
		ROOTS(I)=ROOTS(I)*(1.0+0.01*I)
12	CONTINUE
	WRITE(*,'(1X,T10,A,T25,A,T37,A)') 'Root #','Real','Imag.'
	DO 13 I=1,M
		WRITE(*,'(1X,I11,5X,2F12.6)') I,ROOTS(I)
13	CONTINUE
	POLISH=.TRUE.
	CALL ZROOTS(A,M,ROOTS,POLISH)
	WRITE(*,'(/1X,A)') 'Polished roots:'
	WRITE(*,'(1X,T10,A,T25,A,T37,A)') 'Root #','Real','Imag.'
	DO 14 I=1,M
		WRITE(*,'(1X,I11,5X,2F12.6)') I,ROOTS(I)
14	CONTINUE
	END
