subroutine tab(f,x1,x2,n,a) implicit none integer n double precision f, x1, x2, a(*) integer i real dx dx = (x2-x1)/dble(n-1) do i=1, n a(i) = f(x1+dble(i-1)*dx) end do end