Lines Matching refs:complex

14     complex synopsis
20 class complex
25 complex(const T& re = T(), const T& im = T()); // constexpr in C++14
26 complex(const complex&); // constexpr in C++14
27 template<class X> complex(const complex<X>&); // constexpr in C++14
35 complex<T>& operator= (const T&); // constexpr in C++20
36 complex<T>& operator+=(const T&); // constexpr in C++20
37 complex<T>& operator-=(const T&); // constexpr in C++20
38 complex<T>& operator*=(const T&); // constexpr in C++20
39 complex<T>& operator/=(const T&); // constexpr in C++20
41 complex& operator=(const complex&); // constexpr in C++20
42 template<class X> complex<T>& operator= (const complex<X>&); // constexpr in C++20
43 template<class X> complex<T>& operator+=(const complex<X>&); // constexpr in C++20
44 template<class X> complex<T>& operator-=(const complex<X>&); // constexpr in C++20
45 template<class X> complex<T>& operator*=(const complex<X>&); // constexpr in C++20
46 template<class X> complex<T>& operator/=(const complex<X>&); // constexpr in C++20
50 class complex<float>
55 constexpr complex(float re = 0.0f, float im = 0.0f);
56 explicit constexpr complex(const complex<double>&);
57 explicit constexpr complex(const complex<long double>&);
64 complex<float>& operator= (float); // constexpr in C++20
65 complex<float>& operator+=(float); // constexpr in C++20
66 complex<float>& operator-=(float); // constexpr in C++20
67 complex<float>& operator*=(float); // constexpr in C++20
68 complex<float>& operator/=(float); // constexpr in C++20
70 complex<float>& operator=(const complex<float>&); // constexpr in C++20
71 template<class X> complex<float>& operator= (const complex<X>&); // constexpr in C++20
72 template<class X> complex<float>& operator+=(const complex<X>&); // constexpr in C++20
73 template<class X> complex<float>& operator-=(const complex<X>&); // constexpr in C++20
74 template<class X> complex<float>& operator*=(const complex<X>&); // constexpr in C++20
75 template<class X> complex<float>& operator/=(const complex<X>&); // constexpr in C++20
79 class complex<double>
84 constexpr complex(double re = 0.0, double im = 0.0);
85 constexpr complex(const complex<float>&);
86 explicit constexpr complex(const complex<long double>&);
93 complex<double>& operator= (double); // constexpr in C++20
94 complex<double>& operator+=(double); // constexpr in C++20
95 complex<double>& operator-=(double); // constexpr in C++20
96 complex<double>& operator*=(double); // constexpr in C++20
97 complex<double>& operator/=(double); // constexpr in C++20
98 complex<double>& operator=(const complex<double>&); // constexpr in C++20
100 template<class X> complex<double>& operator= (const complex<X>&); // constexpr in C++20
101 template<class X> complex<double>& operator+=(const complex<X>&); // constexpr in C++20
102 template<class X> complex<double>& operator-=(const complex<X>&); // constexpr in C++20
103 template<class X> complex<double>& operator*=(const complex<X>&); // constexpr in C++20
104 template<class X> complex<double>& operator/=(const complex<X>&); // constexpr in C++20
108 class complex<long double>
113 constexpr complex(long double re = 0.0L, long double im = 0.0L);
114 constexpr complex(const complex<float>&);
115 constexpr complex(const complex<double>&);
122 complex<long double>& operator=(const complex<long double>&); // constexpr in C++20
123 complex<long double>& operator= (long double); // constexpr in C++20
124 complex<long double>& operator+=(long double); // constexpr in C++20
125 complex<long double>& operator-=(long double); // constexpr in C++20
126 complex<long double>& operator*=(long double); // constexpr in C++20
127 complex<long double>& operator/=(long double); // constexpr in C++20
129 template<class X> complex<long double>& operator= (const complex<X>&); // constexpr in C++20
130 template<class X> complex<long double>& operator+=(const complex<X>&); // constexpr in C++20
131 template<class X> complex<long double>& operator-=(const complex<X>&); // constexpr in C++20
132 template<class X> complex<long double>& operator*=(const complex<X>&); // constexpr in C++20
133 template<class X> complex<long double>& operator/=(const complex<X>&); // constexpr in C++20
137 template<class T> complex<T> operator+(const complex<T>&, const complex<T>&); // constexpr in C++20
138 template<class T> complex<T> operator+(const complex<T>&, const T&); // constexpr in C++20
139 template<class T> complex<T> operator+(const T&, const complex<T>&); // constexpr in C++20
140 template<class T> complex<T> operator-(const complex<T>&, const complex<T>&); // constexpr in C++20
141 template<class T> complex<T> operator-(const complex<T>&, const T&); // constexpr in C++20
142 template<class T> complex<T> operator-(const T&, const complex<T>&); // constexpr in C++20
143 template<class T> complex<T> operator*(const complex<T>&, const complex<T>&); // constexpr in C++20
144 template<class T> complex<T> operator*(const complex<T>&, const T&); // constexpr in C++20
145 template<class T> complex<T> operator*(const T&, const complex<T>&); // constexpr in C++20
146 template<class T> complex<T> operator/(const complex<T>&, const complex<T>&); // constexpr in C++20
147 template<class T> complex<T> operator/(const complex<T>&, const T&); // constexpr in C++20
148 template<class T> complex<T> operator/(const T&, const complex<T>&); // constexpr in C++20
149 template<class T> complex<T> operator+(const complex<T>&); // constexpr in C++20
150 template<class T> complex<T> operator-(const complex<T>&); // constexpr in C++20
151 template<class T> bool operator==(const complex<T>&, const complex<T>&); // constexpr in C++14
152 template<class T> bool operator==(const complex<T>&, const T&); // constexpr in C++14
153 template<class T> bool operator==(const T&, const complex<T>&); // constexpr in C++14
154 template<class T> bool operator!=(const complex<T>&, const complex<T>&); // constexpr in C++14
155 template<class T> bool operator!=(const complex<T>&, const T&); // constexpr in C++14
156 template<class T> bool operator!=(const T&, const complex<T>&); // constexpr in C++14
160 operator>>(basic_istream<charT, traits>&, complex<T>&);
163 operator<<(basic_ostream<charT, traits>&, const complex<T>&);
167 template<class T> T real(const complex<T>&); // constexpr in C++14
173 template<class T> T imag(const complex<T>&); // constexpr in C++14
179 template<class T> T abs(const complex<T>&);
181 template<class T> T arg(const complex<T>&);
187 template<class T> T norm(const complex<T>&); // constexpr in C++20
193 template<class T> complex<T> conj(const complex<T>&); // constexpr in C++20
194 complex<long double> conj(long double); // constexpr in C++20
195 complex<double> conj(double); // constexpr in C++20
196 template<Integral T> complex<double> conj(T); // constexpr in C++20
197 complex<float> conj(float); // constexpr in C++20
199 template<class T> complex<T> proj(const complex<T>&);
200 complex<long double> proj(long double);
201 complex<double> proj(double);
202 template<Integral T> complex<double> proj(T);
203 complex<float> proj(float);
205 template<class T> complex<T> polar(const T&, const T& = T());
208 template<class T> complex<T> acos(const complex<T>&);
209 template<class T> complex<T> asin(const complex<T>&);
210 template<class T> complex<T> atan(const complex<T>&);
211 template<class T> complex<T> acosh(const complex<T>&);
212 template<class T> complex<T> asinh(const complex<T>&);
213 template<class T> complex<T> atanh(const complex<T>&);
214 template<class T> complex<T> cos (const complex<T>&);
215 template<class T> complex<T> cosh (const complex<T>&);
216 template<class T> complex<T> exp (const complex<T>&);
217 template<class T> complex<T> log (const complex<T>&);
218 template<class T> complex<T> log10(const complex<T>&);
220 template<class T> complex<T> pow(const complex<T>&, const T&);
221 template<class T> complex<T> pow(const complex<T>&, const complex<T>&);
222 template<class T> complex<T> pow(const T&, const complex<T>&);
224 template<class T> complex<T> sin (const complex<T>&);
225 template<class T> complex<T> sinh (const complex<T>&);
226 template<class T> complex<T> sqrt (const complex<T>&);
227 template<class T> complex<T> tan (const complex<T>&);
228 template<class T> complex<T> tanh (const complex<T>&);
252 template<class _Tp> class _LIBCPP_TEMPLATE_VIS complex;
254 …P_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> operator*(const complex<_Tp>& __z, cons…
255 …P_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp> operator/(const complex<_Tp>& __x, cons…
258 class _LIBCPP_TEMPLATE_VIS complex
267 complex(const value_type& __re = value_type(), const value_type& __im = value_type())
270 complex(const complex<_Xp>& __c)
279 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator= (const value_type& __re)
281 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator+=(const value_type& __re…
282 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator-=(const value_type& __re…
283 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator*=(const value_type& __re…
284 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator/=(const value_type& __re…
286 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator= (const complex<_Xp>…
292 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator+=(const complex<_Xp>…
298 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator-=(const complex<_Xp>…
304 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator*=(const complex<_Xp>…
306 *this = *this * complex(__c.real(), __c.imag());
309 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator/=(const complex<_Xp>…
311 *this = *this / complex(__c.real(), __c.imag());
316 template<> class _LIBCPP_TEMPLATE_VIS complex<double>;
317 template<> class _LIBCPP_TEMPLATE_VIS complex<long double>;
320 class _LIBCPP_TEMPLATE_VIS complex<float>
327 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(float __re = 0.0f, float __im = 0.0f)
330 explicit _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
332 explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
340 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator= (float __re)
342 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator+=(float __re) {__re_ += …
343 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator-=(float __re) {__re_ -= …
344 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator*=(float __re) {__re_ *= …
345 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator/=(float __re) {__re_ /= …
347 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator= (const complex<_Xp>…
353 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator+=(const complex<_Xp>…
359 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator-=(const complex<_Xp>…
365 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator*=(const complex<_Xp>…
367 *this = *this * complex(__c.real(), __c.imag());
370 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator/=(const complex<_Xp>…
372 *this = *this / complex(__c.real(), __c.imag());
378 class _LIBCPP_TEMPLATE_VIS complex<double>
385 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(double __re = 0.0, double __im = 0.0)
388 _LIBCPP_CONSTEXPR complex(const complex<float>& __c);
390 explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
398 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator= (double __re)
400 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator+=(double __re) {__re_ +=…
401 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator-=(double __re) {__re_ -=…
402 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator*=(double __re) {__re_ *=…
403 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator/=(double __re) {__re_ /=…
405 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator= (const complex<_Xp>…
411 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator+=(const complex<_Xp>…
417 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator-=(const complex<_Xp>…
423 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator*=(const complex<_Xp>…
425 *this = *this * complex(__c.real(), __c.imag());
428 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator/=(const complex<_Xp>…
430 *this = *this / complex(__c.real(), __c.imag());
436 class _LIBCPP_TEMPLATE_VIS complex<long double>
443 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(long double __re = 0.0L, long double __im = 0.…
446 _LIBCPP_CONSTEXPR complex(const complex<float>& __c);
448 _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
456 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator= (long double __re)
458 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator+=(long double __re) {__r…
459 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator-=(long double __re) {__r…
460 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator*=(long double __re) {__r…
461 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator/=(long double __re) {__r…
463 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator= (const complex<_Xp>…
469 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator+=(const complex<_Xp>…
475 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator-=(const complex<_Xp>…
481 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator*=(const complex<_Xp>…
483 *this = *this * complex(__c.real(), __c.imag());
486 …Xp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 complex& operator/=(const complex<_Xp>…
488 *this = *this / complex(__c.real(), __c.imag());
495 complex<float>::complex(const complex<double>& __c)
500 complex<float>::complex(const complex<long double>& __c)
505 complex<double>::complex(const complex<float>& __c)
510 complex<double>::complex(const complex<long double>& __c)
515 complex<long double>::complex(const complex<float>& __c)
520 complex<long double>::complex(const complex<double>& __c)
527 complex<_Tp>
528 operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
530 complex<_Tp> __t(__x);
537 complex<_Tp>
538 operator+(const complex<_Tp>& __x, const _Tp& __y)
540 complex<_Tp> __t(__x);
547 complex<_Tp>
548 operator+(const _Tp& __x, const complex<_Tp>& __y)
550 complex<_Tp> __t(__y);
557 complex<_Tp>
558 operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
560 complex<_Tp> __t(__x);
567 complex<_Tp>
568 operator-(const complex<_Tp>& __x, const _Tp& __y)
570 complex<_Tp> __t(__x);
577 complex<_Tp>
578 operator-(const _Tp& __x, const complex<_Tp>& __y)
580 complex<_Tp> __t(-__y);
586 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
587 operator*(const complex<_Tp>& __z, const complex<_Tp>& __w)
611 return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0));
615 return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0));
617 … return complex<_Tp>(_Tp(numeric_limits<_Tp>::infinity()), _Tp(numeric_limits<_Tp>::infinity()));
622 return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0));
674 return complex<_Tp>(__x, __y);
679 complex<_Tp>
680 operator*(const complex<_Tp>& __x, const _Tp& __y)
682 complex<_Tp> __t(__x);
689 complex<_Tp>
690 operator*(const _Tp& __x, const complex<_Tp>& __y)
692 complex<_Tp> __t(__y);
698 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 complex<_Tp>
699 operator/(const complex<_Tp>& __z, const complex<_Tp>& __w)
731 return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0));
737 … return complex<_Tp>(_Tp(numeric_limits<_Tp>::infinity()), _Tp(numeric_limits<_Tp>::infinity()));
739 return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0));
742 return complex<_Tp>(_Tp(0), _Tp(0));
745 … return complex<_Tp>(_Tp(numeric_limits<_Tp>::infinity()), _Tp(numeric_limits<_Tp>::infinity()));
749 return complex<_Tp>(_Tp(numeric_limits<_Tp>::quiet_NaN()), _Tp(0));
751 … return complex<_Tp>(_Tp(numeric_limits<_Tp>::infinity()), _Tp(numeric_limits<_Tp>::infinity()));
778 return complex<_Tp>(__x, __y);
783 complex<_Tp>
784 operator/(const complex<_Tp>& __x, const _Tp& __y)
786 return complex<_Tp>(__x.real() / __y, __x.imag() / __y);
791 complex<_Tp>
792 operator/(const _Tp& __x, const complex<_Tp>& __y)
794 complex<_Tp> __t(__x);
801 complex<_Tp>
802 operator+(const complex<_Tp>& __x)
809 complex<_Tp>
810 operator-(const complex<_Tp>& __x)
812 return complex<_Tp>(-__x.real(), -__x.imag());
818 operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
826 operator==(const complex<_Tp>& __x, const _Tp& __y)
834 operator==(const _Tp& __x, const complex<_Tp>& __y)
842 operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
850 operator!=(const complex<_Tp>& __x, const _Tp& __y)
858 operator!=(const _Tp& __x, const complex<_Tp>& __y)
875 typedef complex<double> _ComplexType;
883 typedef complex<_Tp> _ComplexType;
891 real(const complex<_Tp>& __c)
909 imag(const complex<_Tp>& __c)
927 abs(const complex<_Tp>& __c)
937 arg(const complex<_Tp>& __c)
981 norm(const complex<_Tp>& __c)
1003 complex<_Tp>
1004 conj(const complex<_Tp>& __c)
1006 return complex<_Tp>(__c.real(), -__c.imag());
1024 complex<_Tp>
1025 proj(const complex<_Tp>& __c)
1027 complex<_Tp> __r = __c;
1029 __r = complex<_Tp>(INFINITY, std::copysign(_Tp(0), __c.imag()));
1044 return complex<_Tp>(__re);
1063 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1067 return complex<_Tp>(_Tp(NAN), _Tp(NAN));
1071 return complex<_Tp>(__rho, __theta);
1072 return complex<_Tp>(__theta, __theta);
1077 return complex<_Tp>(__rho, _Tp(NAN));
1078 return complex<_Tp>(_Tp(NAN), _Tp(NAN));
1086 return complex<_Tp>(__x, __y);
1093 complex<_Tp>
1094 log(const complex<_Tp>& __x)
1096 return complex<_Tp>(std::log(std::abs(__x)), std::arg(__x));
1103 complex<_Tp>
1104 log10(const complex<_Tp>& __x)
1112 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1113 sqrt(const complex<_Tp>& __x)
1116 return complex<_Tp>(_Tp(INFINITY), __x.imag());
1120 …return complex<_Tp>(__x.real(), std::__constexpr_isnan(__x.imag()) ? __x.imag() : std::copysign(_T…
1121 …return complex<_Tp>(std::__constexpr_isnan(__x.imag()) ? __x.imag() : _Tp(0), std::copysign(__x.re…
1129 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1130 exp(const complex<_Tp>& __x)
1134 return complex<_Tp>(std::exp(__x.real()), std::copysign(_Tp(0), __x.imag()));
1147 return complex<_Tp>(__x.real(), __i);
1151 return complex<_Tp>(__e * std::cos(__i), __e * std::sin(__i));
1158 complex<_Tp>
1159 pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
1166 complex<typename __promote<_Tp, _Up>::type>
1167 pow(const complex<_Tp>& __x, const complex<_Up>& __y)
1169 typedef complex<typename __promote<_Tp, _Up>::type> result_type;
1178 complex<typename __promote<_Tp, _Up>::type>
1180 pow(const complex<_Tp>& __x, const _Up& __y)
1182 typedef complex<typename __promote<_Tp, _Up>::type> result_type;
1191 complex<typename __promote<_Tp, _Up>::type>
1193 pow(const _Tp& __x, const complex<_Up>& __y)
1195 typedef complex<typename __promote<_Tp, _Up>::type> result_type;
1203 complex<_Tp>
1204 __sqr(const complex<_Tp>& __x)
1206 return complex<_Tp>((__x.real() - __x.imag()) * (__x.real() + __x.imag()),
1213 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1214 asinh(const complex<_Tp>& __x)
1222 return complex<_Tp>(__x.real(), std::copysign(__pi * _Tp(0.25), __x.imag()));
1223 return complex<_Tp>(__x.real(), std::copysign(_Tp(0), __x.imag()));
1228 return complex<_Tp>(__x.imag(), __x.real());
1231 return complex<_Tp>(__x.real(), __x.real());
1234 …return complex<_Tp>(std::copysign(__x.imag(), __x.real()), std::copysign(__pi/_Tp(2), __x.imag()));
1235 complex<_Tp> __z = std::log(__x + std::sqrt(std::__sqr(__x) + _Tp(1)));
1236 … return complex<_Tp>(std::copysign(__z.real(), __x.real()), std::copysign(__z.imag(), __x.imag()));
1242 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1243 acosh(const complex<_Tp>& __x)
1249 return complex<_Tp>(std::abs(__x.real()), __x.imag());
1253 return complex<_Tp>(__x.real(), std::copysign(__pi * _Tp(0.25), __x.imag()));
1255 return complex<_Tp>(-__x.real(), std::copysign(__pi * _Tp(0.75), __x.imag()));
1258 return complex<_Tp>(-__x.real(), std::copysign(__pi, __x.imag()));
1259 return complex<_Tp>(__x.real(), std::copysign(_Tp(0), __x.imag()));
1264 return complex<_Tp>(std::abs(__x.imag()), __x.real());
1265 return complex<_Tp>(__x.real(), __x.real());
1268 return complex<_Tp>(std::abs(__x.imag()), std::copysign(__pi/_Tp(2), __x.imag()));
1269 complex<_Tp> __z = std::log(__x + std::sqrt(std::__sqr(__x) - _Tp(1)));
1270 return complex<_Tp>(std::copysign(__z.real(), _Tp(0)), std::copysign(__z.imag(), __x.imag()));
1276 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1277 atanh(const complex<_Tp>& __x)
1282 … return complex<_Tp>(std::copysign(_Tp(0), __x.real()), std::copysign(__pi/_Tp(2), __x.imag()));
1287 return complex<_Tp>(std::copysign(_Tp(0), __x.real()), __x.imag());
1288 return complex<_Tp>(__x.imag(), __x.imag());
1292 return complex<_Tp>(__x.real(), __x.real());
1296 … return complex<_Tp>(std::copysign(_Tp(0), __x.real()), std::copysign(__pi/_Tp(2), __x.imag()));
1300 … return complex<_Tp>(std::copysign(_Tp(INFINITY), __x.real()), std::copysign(_Tp(0), __x.imag()));
1302 complex<_Tp> __z = std::log((_Tp(1) + __x) / (_Tp(1) - __x)) / _Tp(2);
1303 … return complex<_Tp>(std::copysign(__z.real(), __x.real()), std::copysign(__z.imag(), __x.imag()));
1309 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1310 sinh(const complex<_Tp>& __x)
1313 return complex<_Tp>(__x.real(), _Tp(NAN));
1315 return complex<_Tp>(__x.real(), _Tp(NAN));
1318 …return complex<_Tp>(std::sinh(__x.real()) * std::cos(__x.imag()), std::cosh(__x.real()) * std::sin…
1324 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1325 cosh(const complex<_Tp>& __x)
1328 return complex<_Tp>(std::abs(__x.real()), _Tp(NAN));
1330 return complex<_Tp>(_Tp(NAN), __x.real());
1332 return complex<_Tp>(_Tp(1), __x.imag());
1334 return complex<_Tp>(std::abs(__x.real()), __x.imag());
1335 …return complex<_Tp>(std::cosh(__x.real()) * std::cos(__x.imag()), std::sinh(__x.real()) * std::sin…
1341 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1342 tanh(const complex<_Tp>& __x)
1347 return complex<_Tp>(std::copysign(_Tp(1), __x.real()), _Tp(0));
1348 …return complex<_Tp>(std::copysign(_Tp(1), __x.real()), std::copysign(_Tp(0), std::sin(_Tp(2) * __x…
1357 return complex<_Tp>(__2rsh > _Tp(0) ? _Tp(1) : _Tp(-1),
1359 return complex<_Tp>(__2rsh/__d, std::sin(__2i)/__d);
1365 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1366 asin(const complex<_Tp>& __x)
1368 complex<_Tp> __z = std::asinh(complex<_Tp>(-__x.imag(), __x.real()));
1369 return complex<_Tp>(__z.imag(), -__z.real());
1375 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1376 acos(const complex<_Tp>& __x)
1382 return complex<_Tp>(__x.imag(), __x.real());
1386 return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
1387 return complex<_Tp>(_Tp(0.25) * __pi, -__x.imag());
1390 return complex<_Tp>(__pi, std::signbit(__x.imag()) ? -__x.real() : __x.real());
1391 return complex<_Tp>(_Tp(0), std::signbit(__x.imag()) ? __x.real() : -__x.real());
1396 return complex<_Tp>(__x.real(), -__x.imag());
1397 return complex<_Tp>(__x.real(), __x.real());
1400 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1402 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1403 complex<_Tp> __z = std::log(__x + std::sqrt(std::__sqr(__x) - _Tp(1)));
1405 return complex<_Tp>(std::abs(__z.imag()), std::abs(__z.real()));
1406 return complex<_Tp>(std::abs(__z.imag()), -std::abs(__z.real()));
1412 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1413 atan(const complex<_Tp>& __x)
1415 complex<_Tp> __z = std::atanh(complex<_Tp>(-__x.imag(), __x.real()));
1416 return complex<_Tp>(__z.imag(), -__z.real());
1422 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1423 sin(const complex<_Tp>& __x)
1425 complex<_Tp> __z = std::sinh(complex<_Tp>(-__x.imag(), __x.real()));
1426 return complex<_Tp>(__z.imag(), -__z.real());
1433 complex<_Tp>
1434 cos(const complex<_Tp>& __x)
1436 return std::cosh(complex<_Tp>(-__x.imag(), __x.real()));
1442 _LIBCPP_HIDE_FROM_ABI complex<_Tp>
1443 tan(const complex<_Tp>& __x)
1445 complex<_Tp> __z = std::tanh(complex<_Tp>(-__x.imag(), __x.real()));
1446 return complex<_Tp>(__z.imag(), -__z.real());
1452 operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
1478 __x = complex<_Tp>(__r, __i);
1489 __x = complex<_Tp>(__r, _Tp(0));
1502 __x = complex<_Tp>(__r, _Tp(0));
1514 operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
1526 // Literal suffix for complex number literals [complex.literals]
1531 _LIBCPP_HIDE_FROM_ABI constexpr complex<long double> operator""il(long double __im)
1536 _LIBCPP_HIDE_FROM_ABI constexpr complex<long double> operator""il(unsigned long long __im)
1542 _LIBCPP_HIDE_FROM_ABI constexpr complex<double> operator""i(long double __im)
1547 _LIBCPP_HIDE_FROM_ABI constexpr complex<double> operator""i(unsigned long long __im)
1553 _LIBCPP_HIDE_FROM_ABI constexpr complex<float> operator""if(long double __im)
1558 _LIBCPP_HIDE_FROM_ABI constexpr complex<float> operator""if(unsigned long long __im)