A Python implementation of Muller's method.
This library requires no dependencies beyond the Python standard library.
Here is a quick example to show how it is used:
from mullerpy import muller
from math import exp, sin
def f(x):
return exp(-x) * sin(x)
xguesses = (-1, 0, 1)
res = muller(f, xguesses)
print(res.root)This finds a root of the function
which has roots at .root attribute storing the estimated solution.
It is easy to install mullerpy with pip:
pip install mullerpy
To test, run
python -m unittest tests.test_muller
in the root directory. I like to use pytest, where you can simply enter
pytest
