function y = pval(tab,t)
%
% PVAL returns the value(s) of the polynomial 
% tab(1,2)+tab(1,3)(t-x(1))+....+tab(1,n)*(t-x(1))*...*(t-x(n-1))
%
x = tab(:,1);
F = tab(1,2:end);
n = length(x);

% Using nested multiplication: see p. 311. 
y = F(n);
for i=n-1:-1:1
    y = y.*(t-x(i))+F(i);
end