function r = Regula_Falsi(f, a, b)
%Regula_Falsi(f, a, b)
%   f : función a evaluar
%   a : inicio del intervalo
%   b : fin frl intervalo

iter = 1;
 while 1 %abs((b - a)/a) > 0.0001
     c = a - f(a)*(b-a)/(f(b) - f(a));
     fprintf('%02d %12.6f %12.6f %12.6f %12.6f %12.6f %12.6f\n', iter, a, c, b,  f(a), f(c), f(b));
   iter = iter+1;
   if(abs(f(c)) <= 1e-06) 
       r = c;
       return;
   end;

   if f(a)*f(c) < 0 
     b = c;
   else
     a = c;
   end;
 end;
     
 r= c;