mpmath is a library for performing floating-point arithmetic and advanced numerical mathematics with user-controlled precision. It supports real and complex numbers and allows calculations to use substantially more precision than ordinary machine floating-point arithmetic.
The library is useful when conventional numerical precision is insufficient, such as when investigating sensitive mathematical problems, evaluating special functions or checking numerical results to many decimal places.
mpmath combines basic arithmetic with a broad range of numerical algorithms. It provides tools for calculus, equation solving, linear algebra and mathematical function evaluation, allowing developers to perform high-precision computations within a consistent numerical environment.
The library can be used interactively or incorporated into mathematical applications. It is also used by symbolic mathematics systems, where high-precision numerical evaluation complements exact symbolic calculations.
This is free and open source software.
Key Features
- Arbitrary-precision arithmetic with real and complex floating-point numbers.
- Configurable decimal and binary precision through numerical context objects.
- Mathematical constants including pi, Euler’s constant, the golden ratio and Catalan’s constant.
- Elementary functions covering exponentials, logarithms, trigonometry and hyperbolic functions.
- Special functions including gamma, zeta, Bessel, elliptic and hypergeometric functions.
- High-precision numerical integration with multiple quadrature algorithms.
- Numerical differentiation, including higher-order and partial derivatives.
- Root finding for scalar equations and systems of nonlinear equations.
- Numerical limits, infinite sums and products with convergence acceleration methods.
- Polynomial evaluation and polynomial root finding.
- Ordinary differential equation solution methods.
- Matrix arithmetic, linear system solving, eigenvalue problems and matrix decompositions.
- Matrix functions including exponentials, logarithms and square roots.
- Numerical inverse Laplace transforms and Fourier-related calculations.
- Integer relation detection and recognition of mathematical constants using PSLQ.
- Real and complex plotting facilities for mathematical functions.
- Interval arithmetic through a separate numerical context.
Website: mpmath.org
Support:
Developer: Fredrik Johansson and mpmath contributors
License: BSD 3-Clause ‘New’ or ‘Revised’ License
mpmath is written in Python. Learn Python with our recommended free books and free tutorials.
Related Software
| Python Mathematics Tools | |
|---|---|
| scikit-learn | Machine learning library for Python |
| NumPy | Core package for scientific computing with Python |
| SciPy | Ecosystem for mathematics, science, and engineering. |
| statsmodels | Statistical modeling and econometrics |
| JAX | Python library for high-performance numerical computing |
| SageMath | Computer algebra system |
| SymPy | Library for symbolic mathematics |
| PyMC | Bayesian statistical modeling and probabilistic programming |
| Pyomo | Object-oriented algebraic modeling language |
| patsy | Package for describing statistical models and to build design matrices |
| mpmath | Library for arbitrary-precision floating-point arithmetic |
| SfePy | Finite element software package |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.