function E = werr2e(sig,F,t,N,sig0,sigmax,bmax,tolb);

%   The function E = errorb(sig,F,t,N,sig0,sigmax,cc,tolb) computes
%   the error bound E = truncation plus conditioning error
%   on the optimal curve b = b(sig).

b  = fmin('werr2t',0,bmax,[0 tolb],F,N,sig);  % Estimate optimal b=bopt(sig)

M  = 2*N;
a  = wcoef(F,M,sig,b);
a1 = a(2*N+1:3*N); sa1 = sum(abs(a1));
a2 = a(3*N+1:4*N); sa2 = sum(abs(a2));
E  = exp(sig*t)*(sa2+eps*sa1);
E  = log(E);









