Maths

mpmath – arbitrary-precision numerical mathematics

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-learnMachine learning library for Python
NumPyCore package for scientific computing with Python
SciPyEcosystem for mathematics, science, and engineering.
statsmodelsStatistical modeling and econometrics
JAXPython library for high-performance numerical computing
SageMathComputer algebra system
SymPyLibrary for symbolic mathematics
PyMCBayesian statistical modeling and probabilistic programming
PyomoObject-oriented algebraic modeling language
patsyPackage for describing statistical models and to build design matrices
mpmathLibrary for arbitrary-precision floating-point arithmetic
SfePyFinite element software package

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted