Skip to content

Instantly share code, notes, and snippets.

View danielhomola's full-sized avatar

Daniel Homola danielhomola

View GitHub Profile
@danielhomola
danielhomola / newtons_method.py
Last active April 10, 2021 16:41
Newton’s method is an old numerical approximation technique that could be used to find the roots of complex polynomials and any differentiable function.
"""
Newton's method
Author: Daniel Homola
Licence: BSD 3-clause
"""
from scipy.optimize import newton
from sklearn.utils.testing import assert_almost_equal
def f(x):