Secant method in MATLAB - Stack Overflow
https://stackoverflow.com/questions/32683123There is nothing wrong with your algorithm. The secant method is not a bracketed method, meaning that it is not going to remain between the initial points you specify. The point you report, which is approximately zero, is a valid root for your equation x-tan (x)=0. I strongly suggest you google "convergence criteria for root finding" to learn more.