real(8) function polval(n, coef, z)
real (8) coef(0:n)
real(8) z

polval =coef(n)

do  k =n-1,0,-1
polval =coef(k) +z*polval
enddo

end
