implementation of Broyden's method to iterate the zero of a given function