function f=polfun(coeff);
global xp
global fp;
% routine for polynomial approximation with fminimax
pv=polyval(coeff,xp);
f=[fp-pv; -fp+pv];