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.

The modab root-finding algorithm is now included in mpmath, thanks to the Ayush Baranwal contribution:

The latest pymodab 1.1.1 performs nearly 10 times faster than the available methods in SciPy:

Function evaluations

Func bisect brentq brenth ridder chandr cybrentq modAB_ct modAB_SG
SUM 4883 2810 2769 3425 2112 2810 1993 1971
AVG 48 28 27 34 21 28 20 20
MEDIAN 49 13 12 16 12 13 13 13
MIN 3 4 4 3 3 4 3 3
MAX 53 102 102 202 70 102 78 76
FACTOR 2.477x 1.426x 1.405x 1.738x 1.072x 1.426x 1.011x 1.000x

Execution times (ms per problem, 200 iterations)

Func bisect brentq brenth ridder chandr cybrentq modAB_ct modAB_SG
SUM 1385.66 841.73 814.23 976.14 57729.06 114.57 165.90 87.27
AVG 13.7194 8.3340 8.0617 9.6647 571.5749 1.1344 1.6426 0.8641
MEDIAN 13.9073 4.3587 4.2225 5.4357 336.8105 0.6225 1.3061 0.6450
MIN 1.4121 1.6385 1.7789 1.3487 64.7960 0.1986 0.5643 0.1897
MAX 17.2491 31.5796 32.1298 53.2028 2002.6788 5.4763 4.3412 2.7929
FACTOR 15.877x 9.645x 9.330x 11.185x 661.479x 1.313x 1.901x 1.000x