function [ x, secant_num ] = secant ( ftol, a, b, secant_max, f )
  secant_num = 0; 
  while ( secant_num < secant_max )
    secant_num = secant_num + 1;
    x = a - f(a) * ( b - a ) / ( f(b) - f(a) );
    if ( abs ( f(x) ) <= ftol )
      return
    end
    b = a;
    a = x;
  end
  return
end
