function [x1,err,k,y]=dixot(f,x0,x1,epsilon,max1);
for k=1:max1
    deltax=(x1-x0)/2;
    x2=x1;
    x1=x0+deltax;
    y=feval(f,x1);
    if y<0, x0=x1; x1=x2; 
    end;
     err=abs(x1-x0); 
    if  err<epsilon, break, end;
    end;
    
