function rtn=mybisec(fx,xa,xb,n)
%bisec does n bisections to approximate
% a root of fx
x=xa; fa=feval(fx,x);
x=xb; fb=feval(fx,x);
for i=1:n;
  xc=(xa+xb)/2; x=xc; fc=feval(fx,x);
  X=[i,xa,xb,xc,fc];
  disp(X);
  if fc*fa<0
    xb=xc;
    else xa=xc;
  end
end