n=100;                    % GRADO.
x=(-5:10/n:5)';       % NODI INTERP. (EQUISPAZ.).
y=runge(x);        % FUNZIONE NEI NODI EQUISP.
s=(-5:10/(10*n):5)';  % NODI TEST.   
data_eqs=[x y];
t=barylag(data_eqs,s);

xcheb=(cheb(-5,5,n))';   % NODI CHEB.
ycheb=runge(xcheb);   % FUNZIONE NEI NODI CHEB.
data_cheb=[xcheb ycheb];
tcheb=barylag(data_cheb,s);  
                      % INTP. CHEB.
plot(s,runge(s),s,t,s,tcheb);   % PLOT INTP. VS RUNGE.
err_eqs=norm(runge(s)-t,inf);     % ABS. ERR. EQUISPAZ.
err_cheb=norm(runge(s)-tcheb,inf); % ABS. ERR. CHEB.
fprintf('\n \t [ABS.ERR.][EQS]: %2.2e [CHEB]: %2.2e',err_eqs,err_cheb);
