f=inline('2-exp(x)');
a=0;
b=1;
options=struct('TOLX',1e-10,'Display','iter');
[xb,fxb,flagb,outb,xvetb]=bzero(f,[a b], options);
[xs,fxs,flags,outs,xvets]=szero(f,[a b], options);
[xbs,fxbs,flagbs,outbs,xvetbs]=bszero(f,[a b], options);
df = inline('-exp(x)');
[xn,fxn,flagn,outn,xvetn]=nzero(f,df,a, options);

semilogy(1:length(xvets),abs(xvets-log(2)),'r*',1:length(xvetbs),abs(xvetbs-log(2)),'o',1:length(xvetb),abs(xvetb-log(2)),'+',1:length(xvetn),abs(xvetn-log(2)),'d');
