function secant_method(f,a,b,number_of_digits)
epsilon=10^(-number_of_digits);
i=0;
x1=a;
x2=b;
while i<100
    x=x2-(x2-x1)/(f(x2)-f(x1))*f(x2)
    if f(x)~=0
        i=i+1;
        x1=x2;
        x2=x;
    else
        disp(x)
        break
    end
    if ~(abs(x2-x1)>epsilon)
        fprintf('iterations %d\n\n', i);
        fprintf('result is %0.5f',round(x,number_of_digits))
        break
    end
end