libstdc++
math.h
Go to the documentation of this file.
1 // -*- C++ -*- compatibility header.
2 
3 // Copyright (C) 2002-2017 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10 
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19 
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
24 
25 /** @file math.h
26  * This is a Standard C++ Library header.
27  */
28 
29 #if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS
30 # include_next <math.h>
31 #else
32 
33 #ifndef _GLIBCXX_MATH_H
34 #define _GLIBCXX_MATH_H 1
35 
36 # include <cmath>
37 
38 using std::abs;
39 using std::acos;
40 using std::asin;
41 using std::atan;
42 using std::atan2;
43 using std::cos;
44 using std::sin;
45 using std::tan;
46 using std::cosh;
47 using std::sinh;
48 using std::tanh;
49 using std::exp;
50 using std::frexp;
51 using std::ldexp;
52 using std::log;
53 using std::log10;
54 using std::modf;
55 using std::pow;
56 using std::sqrt;
57 using std::ceil;
58 using std::fabs;
59 using std::floor;
60 using std::fmod;
61 
62 #if _GLIBCXX_USE_C99_MATH
63 using std::fpclassify;
64 using std::isfinite;
65 using std::isinf;
66 using std::isnan;
67 using std::isnormal;
68 using std::signbit;
69 using std::isgreater;
70 using std::isgreaterequal;
71 using std::isless;
72 using std::islessequal;
73 using std::islessgreater;
74 using std::isunordered;
75 #endif
76 
77 #if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99_MATH_TR1)
78 using std::acosh;
79 using std::asinh;
80 using std::atanh;
81 using std::cbrt;
82 using std::copysign;
83 using std::erf;
84 using std::erfc;
85 using std::exp2;
86 using std::expm1;
87 using std::fdim;
88 using std::fma;
89 using std::fmax;
90 using std::fmin;
91 using std::hypot;
92 using std::ilogb;
93 using std::lgamma;
94 using std::llrint;
95 using std::llround;
96 using std::log1p;
97 using std::log2;
98 using std::logb;
99 using std::lrint;
100 using std::lround;
101 using std::nearbyint;
102 using std::nextafter;
103 using std::nexttoward;
104 using std::remainder;
105 using std::remquo;
106 using std::rint;
107 using std::round;
108 using std::scalbln;
109 using std::scalbn;
110 using std::tgamma;
111 using std::trunc;
112 #endif // C++11 && _GLIBCXX_USE_C99_MATH_TR1
113 
114 #if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
117 using std::assoc_laguerre;
120 using std::assoc_legendre;
121 using std::betaf;
122 using std::betal;
123 using std::beta;
124 using std::comp_ellint_1f;
125 using std::comp_ellint_1l;
126 using std::comp_ellint_1;
127 using std::comp_ellint_2f;
128 using std::comp_ellint_2l;
129 using std::comp_ellint_2;
130 using std::comp_ellint_3f;
131 using std::comp_ellint_3l;
132 using std::comp_ellint_3;
133 using std::cyl_bessel_if;
134 using std::cyl_bessel_il;
135 using std::cyl_bessel_i;
136 using std::cyl_bessel_jf;
137 using std::cyl_bessel_jl;
138 using std::cyl_bessel_j;
139 using std::cyl_bessel_kf;
140 using std::cyl_bessel_kl;
141 using std::cyl_bessel_k;
142 using std::cyl_neumannf;
143 using std::cyl_neumannl;
144 using std::cyl_neumann;
145 using std::ellint_1f;
146 using std::ellint_1l;
147 using std::ellint_1;
148 using std::ellint_2f;
149 using std::ellint_2l;
150 using std::ellint_2;
151 using std::ellint_3f;
152 using std::ellint_3l;
153 using std::ellint_3;
154 using std::expintf;
155 using std::expintl;
156 using std::expint;
157 using std::hermitef;
158 using std::hermitel;
159 using std::hermite;
160 using std::laguerref;
161 using std::laguerrel;
162 using std::laguerre;
163 using std::legendref;
164 using std::legendrel;
165 using std::legendre;
166 using std::riemann_zetaf;
167 using std::riemann_zetal;
168 using std::riemann_zeta;
169 using std::sph_besself;
170 using std::sph_bessell;
171 using std::sph_bessel;
172 using std::sph_legendref;
173 using std::sph_legendrel;
174 using std::sph_legendre;
175 using std::sph_neumannf;
176 using std::sph_neumannl;
177 using std::sph_neumann;
178 #endif // __STDCPP_WANT_MATH_SPEC_FUNCS__
179 
180 #endif // _GLIBCXX_MATH_H
181 #endif // __cplusplus
float riemann_zetaf(float __s)
Definition: specfun.h:1022
_Tp abs(const complex< _Tp > &)
Return magnitude of z.
Definition: complex:601
complex< _Tp > sinh(const complex< _Tp > &)
Return complex hyperbolic sine of z.
Definition: complex:857
__gnu_cxx::__promote_2< _Tp, _Tpp >::__type ellint_1(_Tp __k, _Tpp __phi)
Definition: specfun.h:729
float expintf(float __x)
Definition: specfun.h:844
long double betal(long double __a, long double __b)
Definition: specfun.h:322
complex< _Tp > log(const complex< _Tp > &)
Return complex natural logarithm of z.
Definition: complex:792
float betaf(float __a, float __b)
Definition: specfun.h:312
float cyl_bessel_if(float __nu, float __x)
Definition: specfun.h:504
std::complex< _Tp > atan(const std::complex< _Tp > &)
atan(__z) [8.1.4].
Definition: complex:1697
__gnu_cxx::__promote< _Tp >::__type legendre(unsigned int __l, _Tp __x)
Definition: specfun.h:1007
complex< _Tp > tan(const complex< _Tp > &)
Return complex tangent of z.
Definition: complex:928
float laguerref(unsigned int __n, float __x)
Definition: specfun.h:933
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_bessel_j(_Tpnu __nu, _Tp __x)
Definition: specfun.h:581
__gnu_cxx::__promote< _Tp >::__type expint(_Tp __x)
Definition: specfun.h:870
float cyl_neumannf(float __nu, float __x)
Definition: specfun.h:648
complex< _Tp > log10(const complex< _Tp > &)
Return complex base 10 logarithm of z.
Definition: complex:797
float assoc_legendref(unsigned int __l, unsigned int __m, float __x)
Definition: specfun.h:267
__gnu_cxx::__promote_2< _Tp, _Tpp >::__type ellint_2(_Tp __k, _Tpp __phi)
Definition: specfun.h:777
complex< _Tp > pow(const complex< _Tp > &, int)
Return x to the y&#39;th power.
Definition: complex:987
__gnu_cxx::__promote< _Tp >::__type sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
Definition: specfun.h:1149
__gnu_cxx::__promote_3< _Tp, _Tpn, _Tpp >::__type ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
Return the incomplete elliptic integral of the third kind .
Definition: specfun.h:830
__gnu_cxx::__promote< _Tp >::__type assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
Definition: specfun.h:298
__gnu_cxx::__promote< _Tp >::__type sph_neumann(unsigned int __n, _Tp __x)
Definition: specfun.h:1193
complex< _Tp > sin(const complex< _Tp > &)
Return complex sine of z.
Definition: complex:827
complex< _Tp > tanh(const complex< _Tp > &)
Return complex hyperbolic tangent of z.
Definition: complex:956
long double sph_neumannl(unsigned int __n, long double __x)
Definition: specfun.h:1174
long double sph_bessell(unsigned int __n, long double __x)
Definition: specfun.h:1083
std::complex< _Tp > atanh(const std::complex< _Tp > &)
atanh(__z) [8.1.7].
Definition: complex:1816
float sph_besself(unsigned int __n, float __x)
Definition: specfun.h:1073
float comp_ellint_3f(float __k, float __nu)
Return the complete elliptic integral of the third kind for float modulus k.
Definition: specfun.h:453
float ellint_1f(float __k, float __phi)
Definition: specfun.h:696
long double assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x)
Definition: specfun.h:216
float comp_ellint_1f(float __k)
Definition: specfun.h:358
float sph_neumannf(unsigned int __n, float __x)
Definition: specfun.h:1164
complex< _Tp > cosh(const complex< _Tp > &)
Return complex hyperbolic cosine of z.
Definition: complex:739
long double ellint_3l(long double __k, long double __nu, long double __phi)
Return the incomplete elliptic integral of the third kind .
Definition: specfun.h:802
long double assoc_legendrel(unsigned int __l, unsigned int __m, long double __x)
Definition: specfun.h:276
__gnu_cxx::__promote_2< _Tp, _Tpn >::__type comp_ellint_3(_Tp __k, _Tpn __nu)
Definition: specfun.h:489
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_bessel_k(_Tpnu __nu, _Tp __x)
Definition: specfun.h:633
float ellint_3f(float __k, float __nu, float __phi)
Return the incomplete elliptic integral of the third kind for float argument.
Definition: specfun.h:792
_Tp fabs(const std::complex< _Tp > &)
fabs(__z) [8.1.8].
Definition: complex:1825
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_bessel_i(_Tpnu __nu, _Tp __x)
Definition: specfun.h:535
std::complex< _Tp > asinh(const std::complex< _Tp > &)
asinh(__z) [8.1.6].
Definition: complex:1772
std::complex< _Tp > asin(const std::complex< _Tp > &)
asin(__z) [8.1.3].
Definition: complex:1653
float cyl_bessel_jf(float __nu, float __x)
Definition: specfun.h:550
float assoc_laguerref(unsigned int __n, unsigned int __m, float __x)
Definition: specfun.h:206
long double sph_legendrel(unsigned int __l, unsigned int __m, long double __theta)
Definition: specfun.h:1128
long double laguerrel(unsigned int __n, long double __x)
Definition: specfun.h:943
long double ellint_2l(long double __k, long double __phi)
Return the incomplete elliptic integral of the second kind .
Definition: specfun.h:754
long double riemann_zetal(long double __s)
Definition: specfun.h:1032
float sph_legendref(unsigned int __l, unsigned int __m, float __theta)
Definition: specfun.h:1117
long double cyl_bessel_kl(long double __nu, long double __x)
Definition: specfun.h:606
long double comp_ellint_3l(long double __k, long double __nu)
Return the complete elliptic integral of the third kind for long double modulus k.
Definition: specfun.h:463
float hermitef(unsigned int __n, float __x)
Definition: specfun.h:885
__gnu_cxx::__promote< _Tp >::__type riemann_zeta(_Tp __s)
Definition: specfun.h:1058
float legendref(unsigned int __l, float __x)
Definition: specfun.h:977
long double cyl_bessel_il(long double __nu, long double __x)
Definition: specfun.h:514
long double comp_ellint_2l(long double __k)
Definition: specfun.h:416
long double hermitel(unsigned int __n, long double __x)
Definition: specfun.h:895
long double cyl_neumannl(long double __nu, long double __x)
Definition: specfun.h:658
complex< _Tp > cos(const complex< _Tp > &)
Return complex cosine of z.
Definition: complex:709
float ellint_2f(float __k, float __phi)
Return the incomplete elliptic integral of the second kind for float argument.
Definition: specfun.h:744
__gnu_cxx::__promote< _Tp >::__type assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
Definition: specfun.h:252
__gnu_cxx::__promote< _Tp >::__type sph_bessel(unsigned int __n, _Tp __x)
Definition: specfun.h:1102
__gnu_cxx::__promote_2< _Tpa, _Tpb >::__type beta(_Tpa __a, _Tpb __b)
Definition: specfun.h:343
long double cyl_bessel_jl(long double __nu, long double __x)
Definition: specfun.h:560
long double comp_ellint_1l(long double __k)
Definition: specfun.h:368
float cyl_bessel_kf(float __nu, float __x)
Definition: specfun.h:596
float comp_ellint_2f(float __k)
Definition: specfun.h:406
__gnu_cxx::__promote< _Tp >::__type comp_ellint_1(_Tp __k)
Definition: specfun.h:391
__gnu_cxx::__promote< _Tp >::__type laguerre(unsigned int __n, _Tp __x)
Definition: specfun.h:962
long double expintl(long double __x)
Definition: specfun.h:854
__gnu_cxx::__promote< _Tp >::__type comp_ellint_2(_Tp __k)
Definition: specfun.h:438
__gnu_cxx::__promote_2< _Tpnu, _Tp >::__type cyl_neumann(_Tpnu __nu, _Tp __x)
Definition: specfun.h:681
long double legendrel(unsigned int __l, long double __x)
Definition: specfun.h:987
complex< _Tp > sqrt(const complex< _Tp > &)
Return complex square root of z.
Definition: complex:901
complex< _Tp > exp(const complex< _Tp > &)
Return complex base e exponential of z.
Definition: complex:765
std::complex< _Tp > acos(const std::complex< _Tp > &)
acos(__z) [8.1.2].
Definition: complex:1617
std::complex< _Tp > acosh(const std::complex< _Tp > &)
acosh(__z) [8.1.5].
Definition: complex:1733
long double ellint_1l(long double __k, long double __phi)
Definition: specfun.h:706
__gnu_cxx::__promote< _Tp >::__type hermite(unsigned int __n, _Tp __x)
Definition: specfun.h:918