	function pinterp(x,y,n,t)
	dimension x(n),y(n)

	s=0
	do i=1,n
		pn=1
		pd=1
		do k=1,n
			if(k.ne.i) then
				pn=pn*(t-x(k))
				pd=pd*(x(i)-x(k))
			end if
		end do
		s=s+y(i)*pn/pd
	end do
	pinterp=s
	return
	end
