libstdc++
|
Functions | |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | __gnu_cxx::airy_ai (_Tp __x) |
float | __gnu_cxx::airy_aif (float __x) |
long double | __gnu_cxx::airy_ail (long double __x) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | __gnu_cxx::airy_bi (_Tp __x) |
float | __gnu_cxx::airy_bif (float __x) |
long double | __gnu_cxx::airy_bil (long double __x) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::assoc_laguerre (unsigned int __n, unsigned int __m, _Tp __x) |
float | std::assoc_laguerref (unsigned int __n, unsigned int __m, float __x) |
long double | std::assoc_laguerrel (unsigned int __n, unsigned int __m, long double __x) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::assoc_legendre (unsigned int __l, unsigned int __m, _Tp __x) |
float | std::assoc_legendref (unsigned int __l, unsigned int __m, float __x) |
long double | std::assoc_legendrel (unsigned int __l, unsigned int __m, long double __x) |
template<typename _Tpa , typename _Tpb > | |
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type | std::beta (_Tpa __a, _Tpb __b) |
float | std::betaf (float __a, float __b) |
long double | std::betal (long double __a, long double __b) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::comp_ellint_1 (_Tp __k) |
float | std::comp_ellint_1f (float __k) |
long double | std::comp_ellint_1l (long double __k) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::comp_ellint_2 (_Tp __k) |
float | std::comp_ellint_2f (float __k) |
long double | std::comp_ellint_2l (long double __k) |
template<typename _Tp , typename _Tpn > | |
__gnu_cxx::__promote_2< _Tp, _Tpn >::__type | std::comp_ellint_3 (_Tp __k, _Tpn __nu) |
float | std::comp_ellint_3f (float __k, float __nu) |
long double | std::comp_ellint_3l (long double __k, long double __nu) |
template<typename _Tpa , typename _Tpc , typename _Tp > | |
__gnu_cxx::__promote_3< _Tpa, _Tpc, _Tp >::__type | __gnu_cxx::conf_hyperg (_Tpa __a, _Tpc __c, _Tp __x) |
float | __gnu_cxx::conf_hypergf (float __a, float __c, float __x) |
long double | __gnu_cxx::conf_hypergl (long double __a, long double __c, long double __x) |
template<typename _Tpnu , typename _Tp > | |
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type | std::cyl_bessel_i (_Tpnu __nu, _Tp __x) |
float | std::cyl_bessel_if (float __nu, float __x) |
long double | std::cyl_bessel_il (long double __nu, long double __x) |
template<typename _Tpnu , typename _Tp > | |
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type | std::cyl_bessel_j (_Tpnu __nu, _Tp __x) |
float | std::cyl_bessel_jf (float __nu, float __x) |
long double | std::cyl_bessel_jl (long double __nu, long double __x) |
template<typename _Tpnu , typename _Tp > | |
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type | std::cyl_bessel_k (_Tpnu __nu, _Tp __x) |
float | std::cyl_bessel_kf (float __nu, float __x) |
long double | std::cyl_bessel_kl (long double __nu, long double __x) |
template<typename _Tpnu , typename _Tp > | |
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type | std::cyl_neumann (_Tpnu __nu, _Tp __x) |
float | std::cyl_neumannf (float __nu, float __x) |
long double | std::cyl_neumannl (long double __nu, long double __x) |
template<typename _Tp , typename _Tpp > | |
__gnu_cxx::__promote_2< _Tp, _Tpp >::__type | std::ellint_1 (_Tp __k, _Tpp __phi) |
float | std::ellint_1f (float __k, float __phi) |
long double | std::ellint_1l (long double __k, long double __phi) |
template<typename _Tp , typename _Tpp > | |
__gnu_cxx::__promote_2< _Tp, _Tpp >::__type | std::ellint_2 (_Tp __k, _Tpp __phi) |
float | std::ellint_2f (float __k, float __phi) |
long double | std::ellint_2l (long double __k, long double __phi) |
template<typename _Tp , typename _Tpn , typename _Tpp > | |
__gnu_cxx::__promote_3< _Tp, _Tpn, _Tpp >::__type | std::ellint_3 (_Tp __k, _Tpn __nu, _Tpp __phi) |
float | std::ellint_3f (float __k, float __nu, float __phi) |
long double | std::ellint_3l (long double __k, long double __nu, long double __phi) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::expint (_Tp __x) |
float | std::expintf (float __x) |
long double | std::expintl (long double __x) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::hermite (unsigned int __n, _Tp __x) |
float | std::hermitef (unsigned int __n, float __x) |
long double | std::hermitel (unsigned int __n, long double __x) |
template<typename _Tpa , typename _Tpb , typename _Tpc , typename _Tp > | |
__gnu_cxx::__promote_4< _Tpa, _Tpb, _Tpc, _Tp >::__type | __gnu_cxx::hyperg (_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x) |
float | __gnu_cxx::hypergf (float __a, float __b, float __c, float __x) |
long double | __gnu_cxx::hypergl (long double __a, long double __b, long double __c, long double __x) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::laguerre (unsigned int __n, _Tp __x) |
float | std::laguerref (unsigned int __n, float __x) |
long double | std::laguerrel (unsigned int __n, long double __x) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::legendre (unsigned int __l, _Tp __x) |
float | std::legendref (unsigned int __l, float __x) |
long double | std::legendrel (unsigned int __l, long double __x) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::riemann_zeta (_Tp __s) |
float | std::riemann_zetaf (float __s) |
long double | std::riemann_zetal (long double __s) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::sph_bessel (unsigned int __n, _Tp __x) |
float | std::sph_besself (unsigned int __n, float __x) |
long double | std::sph_bessell (unsigned int __n, long double __x) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::sph_legendre (unsigned int __l, unsigned int __m, _Tp __theta) |
float | std::sph_legendref (unsigned int __l, unsigned int __m, float __theta) |
long double | std::sph_legendrel (unsigned int __l, unsigned int __m, long double __theta) |
template<typename _Tp > | |
__gnu_cxx::__promote< _Tp >::__type | std::sph_neumann (unsigned int __n, _Tp __x) |
float | std::sph_neumannf (unsigned int __n, float __x) |
long double | std::sph_neumannl (unsigned int __n, long double __x) |
A collection of advanced mathematical special functions, defined by ISO/IEC IS 29124 and then added to ISO C++ 2017.
The first significant library upgrade on the road to C++2011, TR1, included a set of 23 mathematical functions that significantly extended the standard transcendental functions inherited from C and declared in <cmath>.
Although most components from TR1 were eventually adopted for C++11 these math functions were left behind out of concern for implementability. The math functions were published as a separate international standard IS 29124 - Extensions to the C++ Library to Support Mathematical Special Functions.
For C++17 these functions were incorporated into the main standard.
The following functions are implemented in namespace std:
The hypergeometric functions were stricken from the TR29124 and C++17 versions of this math library because of implementation concerns. However, since they were in the TR1 version and since they are popular we kept them as an extension in namespace __gnu_cxx:
The arguments suppled to the non-suffixed functions will be promoted according to the following rules:
If any of the floating point arguments supplied to these functions is invalid or NaN (std::numeric_limits<Tp>::quiet_NaN), the value NaN is returned.
We strive to implement the underlying math with type generic algorithms to the greatest extent possible. In practice, the functions are thin wrappers that dispatch to function templates. Type dependence is controlled with std::numeric_limits and functions thereof.
We don't promote float
to double
or double
to long double
reflexively. The goal is for float
functions to operate more quickly, at the cost of float
accuracy and possibly a smaller domain of validity. Similaryly, long double
should give you more dynamic range and slightly more pecision than double
on many systems.
These functions have been tested against equivalent implementations from the Gnu Scientific Library, GSL and Boost and the ratio
is generally found to be within 10-15 for 64-bit double on linux-x86_64 systems over most of the ranges of validity.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the associated Laguerre polynomial of nonnegative order n
, nonnegative degree m
and real argument x:
The associated Laguerre function of real degree
where
The associated Laguerre polynomial is defined for integral degree
where the Laguerre polynomial is defined by:
and
n
_Tp | The floating-point type of the argument __x . |
__n | The order of the Laguerre function, __n >= 0 . |
__m | The degree of the Laguerre function, __m >= 0 . |
__x | The argument of the Laguerre function, __x >= 0 . |
std::domain_error | if __x < 0 . |
|
inline |
|
inline |
|
inline |
Return the associated Legendre function of degree l
and order m
.
The associated Legendre function is derived from the Legendre function
l
_Tp | The floating-point type of the argument __x . |
__l | The degree __l >= 0 . |
__m | The order __m <= l . |
__x | The argument, abs(__x) <= 1 . |
std::domain_error | if abs(__x) > 1 . |
|
inline |
|
inline |
|
inline |
Return the beta function, a
, b
.
The beta function is defined by
where
_Tpa | The floating-point type of the parameter __a . |
_Tpb | The floating-point type of the parameter __b . |
__a | The first argument of the beta function, __a > 0 . |
__b | The second argument of the beta function, __b > 0 . |
std::domain_error | if __a < 0 or __b < 0 . |
|
inline |
|
inline |
|
inline |
Return the complete elliptic integral of the first kind k
.
The complete elliptic integral of the first kind is defined as
where
_Tp | The floating-point type of the modulus __k . |
__k | The modulus, abs(__k) <= 1 |
std::domain_error | if abs(__k) > 1 . |
|
inline |
|
inline |
|
inline |
Return the complete elliptic integral of the second kind k
.
The complete elliptic integral of the second kind is defined as
where
_Tp | The floating-point type of the modulus __k . |
__k | The modulus, abs(__k) <= 1 |
std::domain_error | if abs(__k) > 1. |
|
inline |
|
inline |
|
inline |
Return the complete elliptic integral of the third kind k
.
The complete elliptic integral of the third kind is defined as
where
_Tp | The floating-point type of the modulus __k . |
_Tpn | The floating-point type of the argument __nu . |
__k | The modulus, abs(__k) <= 1 |
__nu | The argument |
std::domain_error | if abs(__k) > 1. |
|
inline |
|
inline |
|
inline |
Return the confluent hypergeometric function a
, denominatorial parameter c
, and argument x
.
The confluent hypergeometric function is defined by
where the Pochhammer symbol is
__a | The numeratorial parameter |
__c | The denominatorial parameter |
__x | The argument |
|
inline |
|
inline |
|
inline |
Return the regular modified Bessel function
The regular modified cylindrical Bessel function is:
_Tpnu | The floating-point type of the order __nu . |
_Tp | The floating-point type of the argument __x . |
__nu | The order |
__x | The argument, __x >= 0 |
std::domain_error | if __x < 0 . |
|
inline |
|
inline |
|
inline |
Return the Bessel function
The cylindrical Bessel function is:
_Tpnu | The floating-point type of the order __nu . |
_Tp | The floating-point type of the argument __x . |
__nu | The order |
__x | The argument, __x >= 0 |
std::domain_error | if __x < 0 . |
|
inline |
|
inline |
|
inline |
Return the irregular modified Bessel function
The irregular modified Bessel function is defined by:
where for integral
_Tpnu | The floating-point type of the order __nu . |
_Tp | The floating-point type of the argument __x . |
__nu | The order |
__x | The argument, __x >= 0 |
std::domain_error | if __x < 0 . |
|
inline |
|
inline |
|
inline |
Return the Neumann function
The Neumann function is defined by:
where
_Tpnu | The floating-point type of the order __nu . |
_Tp | The floating-point type of the argument __x . |
__nu | The order |
__x | The argument, __x >= 0 |
std::domain_error | if __x < 0 . |
|
inline |
|
inline |
|
inline |
Return the incomplete elliptic integral of the first kind real
modulus
The incomplete elliptic integral of the first kind is defined as
For
_Tp | The floating-point type of the modulus __k . |
_Tpp | The floating-point type of the angle __phi . |
__k | The modulus, abs(__k) <= 1 |
__phi | The integral limit argument in radians |
std::domain_error | if abs(__k) > 1 . |
|
inline |
|
inline |
|
inline |
Return the incomplete elliptic integral of the second kind
The incomplete elliptic integral of the second kind is defined as
For
_Tp | The floating-point type of the modulus __k . |
_Tpp | The floating-point type of the angle __phi . |
__k | The modulus, abs(__k) <= 1 |
__phi | The integral limit argument in radians |
std::domain_error | if abs(__k) > 1 . |
|
inline |
|
inline |
|
inline |
Return the incomplete elliptic integral of the third kind
The incomplete elliptic integral of the third kind is defined by:
For
_Tp | The floating-point type of the modulus __k . |
_Tpn | The floating-point type of the argument __nu . |
_Tpp | The floating-point type of the angle __phi . |
__k | The modulus, abs(__k) <= 1 |
__nu | The second argument |
__phi | The integral limit argument in radians |
std::domain_error | if abs(__k) > 1 . |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the Hermite polynomial real
argument x
.
The Hermite polynomial is defined by:
The Hermite polynomial obeys a reflection formula:
_Tp | The floating-point type of the argument __x . |
__n | The order |
__x | The argument |
|
inline |
|
inline |
|
inline |
Return the hypergeometric function a
and b
, denominatorial parameter c
, and argument x
.
The hypergeometric function is defined by
where the Pochhammer symbol is
__a | The first numeratorial parameter |
__b | The second numeratorial parameter |
__c | The denominatorial parameter |
__x | The argument |
|
inline |
|
inline |
|
inline |
Returns the Laguerre polynomial n
and real argument
The Laguerre polynomial is defined by:
_Tp | The floating-point type of the argument __x . |
__n | The nonnegative order |
__x | The argument __x >= 0 |
std::domain_error | if __x < 0 . |
|
inline |
|
inline |
|
inline |
Return the Legendre polynomial
The Legendre function of order
_Tp | The floating-point type of the argument __x . |
__l | The degree ![]() |
__x | The argument abs(__x) <= 1 |
std::domain_error | if abs(__x) > 1 |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the spherical Bessel function
The spherical Bessel function is defined by:
_Tp | The floating-point type of the argument __x . |
__n | The integral order n >= 0 |
__x | The real argument x >= 0 |
std::domain_error | if __x < 0 . |
|
inline |
|
inline |
|
inline |
Return the spherical Legendre function of nonnegative integral degree l
and order m
and real angle
The spherical Legendre function is defined by
_Tp | The floating-point type of the angle __theta . |
__l | The order __l >= 0 |
__m | The degree __m >= 0 and __m <= __l |
__theta | The radian polar angle argument |
|
inline |
|
inline |
|
inline |
Return the spherical Neumann function of integral order
The spherical Neumann function is defined by
_Tp | The floating-point type of the argument __x . |
__n | The integral order n >= 0 |
__x | The real argument __x >= 0 |
std::domain_error | if __x < 0 . |
|
inline |