        subroutine poly(n,k,A,X,P)
	implicit none
	double precision A(0:100)
        DOUBLE PRECISION P(0:1)
        double precision x
	INTEGER n,k,i,j
        DO J = 0,K
          P(J) = A(0)
        END DO
        DO I = 1,N-k
            P(0) = A(i) + x*P(0)
            P(1) = P(0) + x*P(1)
        END DO
        DO I = N-k+1,N
            P(0) = A(N) + x*P(0)
        END DO
        write(*,*) 'values of poly and ',k,' derivatives at ',x 
        write(*,*),(P(i), i=0,k)
        stop
        end
