I am using a package/class called \'Libmr\' for my project. The source code of the package is in C and can be found from the below link.
https://pypi.org/project/libm