function f=lang(x,y,x0)
syms p;
n=length(x);
f=0;
for k=1:n
l=y(k);
for j=1:k-1
l=l*(p-x(j))/(x(k)-x(j));
end
for j=k+1:n
l=l*(p-x(j))/(x(k)-x(j));
end
f=f+l;
simplify(f);
end
if(nargin==2)
f=subs(f,'p','x');
f=collect(f);
f=vpa(f,4);
else
m=length(x0);
for i=1:m
temp(i)=subs(f,'p',x0(i));
end
f=temp;
end