program poly2 implicit none integer,parameter :: n=5 double precision a(0:n),x,fx data a / 0.10204d0, 1.203d0, 0.2335d0, 1.786d0, 2.334d0, 3.4478d0 / x = acos( -1.0d0 ) call poly(a, n, x, fx) write(*,'(2e15.6)') x,fx end program poly2 subroutine poly(a, n, x, fx) implicit none integer i,n double precision a(0:n),x,fx fx = a(n) do i=n-1,0,-1 fx = fx * x + a(i) end do end subroutine