The Secant Method is a root-finding algorithm, that uses a succession of roots of secant lines to better approximate a root of a function f. The secant method can be thought of as a finite-difference approximation of Newton’s method.
This method requires the evaluation of the derivative of the function. Sometimes derivatives may be difficult or inconvenient to evaluate. For these cases The derivative f ‘(x) can be approximated by a backward finite divided difference, this yields the following equation:
The example we used in this code is: