function [root,val] = secant(F,x0,x1,tol,nimax)
% Finds a zero of a real function y=F(x) of a
% single real variable x using the secant method.
%     
% Input arguments:
%    F   - name of the function (a string);
%    x0,x1 - initial points;
%    tol - tolerance; 
%    nimax - maximal number of iterations.
% Output arguments:
%    root - the approximate zero found;  val=F(root).
% Stopping criterion:
%    abs(F(X(n))) < tol