Code with new Secant method