Mathematical functions
Mpmath implements the standard functions from Python’s math and cmath modules, for both real and complex numbers and with arbitrary precision. Many other functions are also available in mpmath, including commonly-used variants of standard functions (such as the alternative trigonometric functions sec, csc, cot), but also a large number of “special functions” such as the gamma function, the Riemann zeta function, error functions, Bessel functions, etc.
- Trigonometric functions
- Degree-radian conversion (degrees(), radians())
- Trigonometric functions (cos(), sin(), tan(), sec(), csc(), cot())
- Trigonometric functions with modified argument (cospi(), sinpi())
- Inverse trigonometric functions (acos(), asin(), atan(), asec(), acsc(), acot())
- Sinc function (sinc(), sincpi())
- Hyperbolic functions
- Hyperbolic functions (cosh(), sinh(), tanh(), sech(), csch(), coth())
- Inverse hyperbolic functions (acosh(), asinh(), atanh(), asech(), acsch(), acoth())
- Factorials and gamma functions
- Factorials (factorial()/fac())
- Gamma function (gamma(), gammaprod(), loggamma())
- Binomial coefficients, rising and falling factorials (binomial(), rf(), ff())
- Beta function (beta())
- Double factorials (fac2())
- Super- and hyperfactorials (superfac(), hyperfac(), barnesg())
- Polygamma functions (psi(), digamma(), trigamma(), harmonic())
- Hypergeometric functions, Bessel/Airy, orthogonal polynomials
- Bessel functions (besselj(), bessely())
- Modified Bessel functions (besseli(), besselk())
- Hankel functions (hankel1(), hankel2())
- Airy functions (airyai(), airybi())
- Orthogonal polynomials (jacobi(), legendre(), chebyt(), chebyu())
- Generic hypergeometric series (hyper(), hyp0f1(), hyp1f1(), hyp2f1())