New highly efficient root-finding Python library

Hello everyone,

I am happy to share that new and highly efficient bracketing root-finding Python library was recently created and is available for use under the MIT license:

It outperforms the available SciPy bracketing root-finding functions of about five times!!! It uses the new Modified Anderson-Bjorks (modAB) method that provides excellent convergence for well-behaved cases while preserving the worst-case optimality of bisection. The algorithm is very simple and has very low computational overhead per iteration. This makes the actual execution speed to be even faster when implemented in software:

Execution times (ms per problem, 100 iterations)

Func bisect brentq brenth ridder chandr modAB
SUM 1266.30 797.21 800.98 921.14 48639.60 145.55
AVG 13.7641 8.6654 8.7063 10.0124 528.6913 1.5820
MEDIAN 13.8022 4.5878 4.3595 5.6256 306.4098 1.2803
MIN 1.4287 1.7302 1.6219 1.3884 72.9172 0.6143
MAX 21.8886 36.7684 50.2981 54.4431 1542.8365 4.3991
FACTOR 8.700x 5.477x 5.503x 6.329x 334.189x 1.000x

Function evaluations

Func bisect brentq brenth ridder chandr modAB
SUM 4411 2548 2512 3158 1873 1758
AVG 48 28 27 34 20 19
MEDIAN 49 12 12 16 12 12
MIN 3 4 4 4 3 3
MAX 53 102 102 202 58 56
FACTOR 2.509x 1.449x 1.429x 1.796x 1.065x 1.000x

The library is available on PyPi:
pip install pymodab

Everyone who needs to solve nonlinear equations with Python in fast and reliable way, can use it under the MIT license.

1 Like