Es un método abierto derivado del método de Newton. The difference is that this time we are going to evaluate in every iteration using the function's second derivate and a different formula for xn.
You will need to provide an initial value x0, a tolerance to error, the number of iterations wanted, and the f(x) function.
First it needs to have the value of df/dx=df and d2f/dx =ddf.
The code works as follows:
The x0 is evaluated into f(x0), df(x0) and dff(x0).
Then, a xn value is found using the formula x0-f(x0)*df(x0)/(df(x0)^2-f(x0)*ddf(x0))=xn.
This xn is evaluated into f(xn), df(xn) and dff(xn).
It will continue doing the same, creating and evaluating xn, checking for how close it is to zero in the y axis, till the error<tolerance, then it has found a root.