Lines Matching refs:complex
2 //===--------------------------- complex ----------------------------------===//
15 complex synopsis
21 class complex
26 complex(const T& re = T(), const T& im = T()); // constexpr in C++14
27 complex(const complex&); // constexpr in C++14
28 template<class X> complex(const complex<X>&); // constexpr in C++14
36 complex<T>& operator= (const T&);
37 complex<T>& operator+=(const T&);
38 complex<T>& operator-=(const T&);
39 complex<T>& operator*=(const T&);
40 complex<T>& operator/=(const T&);
42 complex& operator=(const complex&);
43 template<class X> complex<T>& operator= (const complex<X>&);
44 template<class X> complex<T>& operator+=(const complex<X>&);
45 template<class X> complex<T>& operator-=(const complex<X>&);
46 template<class X> complex<T>& operator*=(const complex<X>&);
47 template<class X> complex<T>& operator/=(const complex<X>&);
51 class complex<float>
56 constexpr complex(float re = 0.0f, float im = 0.0f);
57 explicit constexpr complex(const complex<double>&);
58 explicit constexpr complex(const complex<long double>&);
65 complex<float>& operator= (float);
66 complex<float>& operator+=(float);
67 complex<float>& operator-=(float);
68 complex<float>& operator*=(float);
69 complex<float>& operator/=(float);
71 complex<float>& operator=(const complex<float>&);
72 template<class X> complex<float>& operator= (const complex<X>&);
73 template<class X> complex<float>& operator+=(const complex<X>&);
74 template<class X> complex<float>& operator-=(const complex<X>&);
75 template<class X> complex<float>& operator*=(const complex<X>&);
76 template<class X> complex<float>& operator/=(const complex<X>&);
80 class complex<double>
85 constexpr complex(double re = 0.0, double im = 0.0);
86 constexpr complex(const complex<float>&);
87 explicit constexpr complex(const complex<long double>&);
94 complex<double>& operator= (double);
95 complex<double>& operator+=(double);
96 complex<double>& operator-=(double);
97 complex<double>& operator*=(double);
98 complex<double>& operator/=(double);
99 complex<double>& operator=(const complex<double>&);
101 template<class X> complex<double>& operator= (const complex<X>&);
102 template<class X> complex<double>& operator+=(const complex<X>&);
103 template<class X> complex<double>& operator-=(const complex<X>&);
104 template<class X> complex<double>& operator*=(const complex<X>&);
105 template<class X> complex<double>& operator/=(const complex<X>&);
109 class complex<long double>
114 constexpr complex(long double re = 0.0L, long double im = 0.0L);
115 constexpr complex(const complex<float>&);
116 constexpr complex(const complex<double>&);
123 complex<long double>& operator=(const complex<long double>&);
124 complex<long double>& operator= (long double);
125 complex<long double>& operator+=(long double);
126 complex<long double>& operator-=(long double);
127 complex<long double>& operator*=(long double);
128 complex<long double>& operator/=(long double);
130 template<class X> complex<long double>& operator= (const complex<X>&);
131 template<class X> complex<long double>& operator+=(const complex<X>&);
132 template<class X> complex<long double>& operator-=(const complex<X>&);
133 template<class X> complex<long double>& operator*=(const complex<X>&);
134 template<class X> complex<long double>& operator/=(const complex<X>&);
138 template<class T> complex<T> operator+(const complex<T>&, const complex<T>&);
139 template<class T> complex<T> operator+(const complex<T>&, const T&);
140 template<class T> complex<T> operator+(const T&, const complex<T>&);
141 template<class T> complex<T> operator-(const complex<T>&, const complex<T>&);
142 template<class T> complex<T> operator-(const complex<T>&, const T&);
143 template<class T> complex<T> operator-(const T&, const complex<T>&);
144 template<class T> complex<T> operator*(const complex<T>&, const complex<T>&);
145 template<class T> complex<T> operator*(const complex<T>&, const T&);
146 template<class T> complex<T> operator*(const T&, const complex<T>&);
147 template<class T> complex<T> operator/(const complex<T>&, const complex<T>&);
148 template<class T> complex<T> operator/(const complex<T>&, const T&);
149 template<class T> complex<T> operator/(const T&, const complex<T>&);
150 template<class T> complex<T> operator+(const complex<T>&);
151 template<class T> complex<T> operator-(const complex<T>&);
152 template<class T> bool operator==(const complex<T>&, const complex<T>&); // constexpr in C++14
153 template<class T> bool operator==(const complex<T>&, const T&); // constexpr in C++14
154 template<class T> bool operator==(const T&, const complex<T>&); // constexpr in C++14
155 template<class T> bool operator!=(const complex<T>&, const complex<T>&); // constexpr in C++14
156 template<class T> bool operator!=(const complex<T>&, const T&); // constexpr in C++14
157 template<class T> bool operator!=(const T&, const complex<T>&); // constexpr in C++14
161 operator>>(basic_istream<charT, traits>&, complex<T>&);
164 operator<<(basic_ostream<charT, traits>&, const complex<T>&);
168 template<class T> T real(const complex<T>&); // constexpr in C++14
174 template<class T> T imag(const complex<T>&); // constexpr in C++14
180 template<class T> T abs(const complex<T>&);
182 template<class T> T arg(const complex<T>&);
188 template<class T> T norm(const complex<T>&);
194 template<class T> complex<T> conj(const complex<T>&);
195 complex<long double> conj(long double);
196 complex<double> conj(double);
197 template<Integral T> complex<double> conj(T);
198 complex<float> conj(float);
200 template<class T> complex<T> proj(const complex<T>&);
201 complex<long double> proj(long double);
202 complex<double> proj(double);
203 template<Integral T> complex<double> proj(T);
204 complex<float> proj(float);
206 template<class T> complex<T> polar(const T&, const T& = T());
209 template<class T> complex<T> acos(const complex<T>&);
210 template<class T> complex<T> asin(const complex<T>&);
211 template<class T> complex<T> atan(const complex<T>&);
212 template<class T> complex<T> acosh(const complex<T>&);
213 template<class T> complex<T> asinh(const complex<T>&);
214 template<class T> complex<T> atanh(const complex<T>&);
215 template<class T> complex<T> cos (const complex<T>&);
216 template<class T> complex<T> cosh (const complex<T>&);
217 template<class T> complex<T> exp (const complex<T>&);
218 template<class T> complex<T> log (const complex<T>&);
219 template<class T> complex<T> log10(const complex<T>&);
221 template<class T> complex<T> pow(const complex<T>&, const T&);
222 template<class T> complex<T> pow(const complex<T>&, const complex<T>&);
223 template<class T> complex<T> pow(const T&, const complex<T>&);
225 template<class T> complex<T> sin (const complex<T>&);
226 template<class T> complex<T> sinh (const complex<T>&);
227 template<class T> complex<T> sqrt (const complex<T>&);
228 template<class T> complex<T> tan (const complex<T>&);
229 template<class T> complex<T> tanh (const complex<T>&);
233 operator>>(basic_istream<charT, traits>& is, complex<T>& x);
237 operator<<(basic_ostream<charT, traits>& o, const complex<T>& x);
256 template<class _Tp> class _LIBCPP_TEMPLATE_VIS complex;
258 template<class _Tp> complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w);
259 template<class _Tp> complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y);
262 class _LIBCPP_TEMPLATE_VIS complex
271 complex(const value_type& __re = value_type(), const value_type& __im = value_type())
274 complex(const complex<_Xp>& __c)
283 _LIBCPP_INLINE_VISIBILITY complex& operator= (const value_type& __re)
285 …_LIBCPP_INLINE_VISIBILITY complex& operator+=(const value_type& __re) {__re_ += __re; return *this…
286 …_LIBCPP_INLINE_VISIBILITY complex& operator-=(const value_type& __re) {__re_ -= __re; return *this…
287 …_LIBCPP_INLINE_VISIBILITY complex& operator*=(const value_type& __re) {__re_ *= __re; __im_ *= __r…
288 …_LIBCPP_INLINE_VISIBILITY complex& operator/=(const value_type& __re) {__re_ /= __re; __im_ /= __r…
290 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
296 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
302 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
308 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
310 *this = *this * complex(__c.real(), __c.imag());
313 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
315 *this = *this / complex(__c.real(), __c.imag());
320 template<> class _LIBCPP_TEMPLATE_VIS complex<double>;
321 template<> class _LIBCPP_TEMPLATE_VIS complex<long double>;
324 class _LIBCPP_TEMPLATE_VIS complex<float>
331 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(float __re = 0.0f, float __im = 0.0f)
334 explicit _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
336 explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
344 _LIBCPP_INLINE_VISIBILITY complex& operator= (float __re)
346 _LIBCPP_INLINE_VISIBILITY complex& operator+=(float __re) {__re_ += __re; return *this;}
347 _LIBCPP_INLINE_VISIBILITY complex& operator-=(float __re) {__re_ -= __re; return *this;}
348 …_LIBCPP_INLINE_VISIBILITY complex& operator*=(float __re) {__re_ *= __re; __im_ *= __re; return *t…
349 …_LIBCPP_INLINE_VISIBILITY complex& operator/=(float __re) {__re_ /= __re; __im_ /= __re; return *t…
351 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
357 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
363 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
369 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
371 *this = *this * complex(__c.real(), __c.imag());
374 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
376 *this = *this / complex(__c.real(), __c.imag());
382 class _LIBCPP_TEMPLATE_VIS complex<double>
389 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(double __re = 0.0, double __im = 0.0)
392 _LIBCPP_CONSTEXPR complex(const complex<float>& __c);
394 explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
402 _LIBCPP_INLINE_VISIBILITY complex& operator= (double __re)
404 _LIBCPP_INLINE_VISIBILITY complex& operator+=(double __re) {__re_ += __re; return *this;}
405 _LIBCPP_INLINE_VISIBILITY complex& operator-=(double __re) {__re_ -= __re; return *this;}
406 …_LIBCPP_INLINE_VISIBILITY complex& operator*=(double __re) {__re_ *= __re; __im_ *= __re; return *…
407 …_LIBCPP_INLINE_VISIBILITY complex& operator/=(double __re) {__re_ /= __re; __im_ /= __re; return *…
409 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
415 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
421 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
427 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
429 *this = *this * complex(__c.real(), __c.imag());
432 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
434 *this = *this / complex(__c.real(), __c.imag());
440 class _LIBCPP_TEMPLATE_VIS complex<long double>
447 …_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(long double __re = 0.0L, long double __im = 0.…
450 _LIBCPP_CONSTEXPR complex(const complex<float>& __c);
452 _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
460 _LIBCPP_INLINE_VISIBILITY complex& operator= (long double __re)
462 _LIBCPP_INLINE_VISIBILITY complex& operator+=(long double __re) {__re_ += __re; return *this;}
463 _LIBCPP_INLINE_VISIBILITY complex& operator-=(long double __re) {__re_ -= __re; return *this;}
464 …_LIBCPP_INLINE_VISIBILITY complex& operator*=(long double __re) {__re_ *= __re; __im_ *= __re; ret…
465 …_LIBCPP_INLINE_VISIBILITY complex& operator/=(long double __re) {__re_ /= __re; __im_ /= __re; ret…
467 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator= (const complex<_Xp>& __c)
473 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator+=(const complex<_Xp>& __c)
479 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator-=(const complex<_Xp>& __c)
485 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator*=(const complex<_Xp>& __c)
487 *this = *this * complex(__c.real(), __c.imag());
490 template<class _Xp> _LIBCPP_INLINE_VISIBILITY complex& operator/=(const complex<_Xp>& __c)
492 *this = *this / complex(__c.real(), __c.imag());
499 complex<float>::complex(const complex<double>& __c)
504 complex<float>::complex(const complex<long double>& __c)
509 complex<double>::complex(const complex<float>& __c)
514 complex<double>::complex(const complex<long double>& __c)
519 complex<long double>::complex(const complex<float>& __c)
524 complex<long double>::complex(const complex<double>& __c)
531 complex<_Tp>
532 operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
534 complex<_Tp> __t(__x);
541 complex<_Tp>
542 operator+(const complex<_Tp>& __x, const _Tp& __y)
544 complex<_Tp> __t(__x);
551 complex<_Tp>
552 operator+(const _Tp& __x, const complex<_Tp>& __y)
554 complex<_Tp> __t(__y);
561 complex<_Tp>
562 operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
564 complex<_Tp> __t(__x);
571 complex<_Tp>
572 operator-(const complex<_Tp>& __x, const _Tp& __y)
574 complex<_Tp> __t(__x);
581 complex<_Tp>
582 operator-(const _Tp& __x, const complex<_Tp>& __y)
584 complex<_Tp> __t(-__y);
590 complex<_Tp>
591 operator*(const complex<_Tp>& __z, const complex<_Tp>& __w)
645 return complex<_Tp>(__x, __y);
650 complex<_Tp>
651 operator*(const complex<_Tp>& __x, const _Tp& __y)
653 complex<_Tp> __t(__x);
660 complex<_Tp>
661 operator*(const _Tp& __x, const complex<_Tp>& __y)
663 complex<_Tp> __t(__y);
669 complex<_Tp>
670 operator/(const complex<_Tp>& __z, const complex<_Tp>& __w)
709 return complex<_Tp>(__x, __y);
714 complex<_Tp>
715 operator/(const complex<_Tp>& __x, const _Tp& __y)
717 return complex<_Tp>(__x.real() / __y, __x.imag() / __y);
722 complex<_Tp>
723 operator/(const _Tp& __x, const complex<_Tp>& __y)
725 complex<_Tp> __t(__x);
732 complex<_Tp>
733 operator+(const complex<_Tp>& __x)
740 complex<_Tp>
741 operator-(const complex<_Tp>& __x)
743 return complex<_Tp>(-__x.real(), -__x.imag());
749 operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
757 operator==(const complex<_Tp>& __x, const _Tp& __y)
765 operator==(const _Tp& __x, const complex<_Tp>& __y)
773 operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
781 operator!=(const complex<_Tp>& __x, const _Tp& __y)
789 operator!=(const _Tp& __x, const complex<_Tp>& __y)
806 typedef complex<double> _ComplexType;
814 typedef complex<_Tp> _ComplexType;
822 real(const complex<_Tp>& __c)
840 imag(const complex<_Tp>& __c)
858 abs(const complex<_Tp>& __c)
868 arg(const complex<_Tp>& __c)
912 norm(const complex<_Tp>& __c)
934 complex<_Tp>
935 conj(const complex<_Tp>& __c)
937 return complex<_Tp>(__c.real(), -__c.imag());
955 complex<_Tp>
956 proj(const complex<_Tp>& __c)
958 std::complex<_Tp> __r = __c;
960 __r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
975 return complex<_Tp>(__re);
994 complex<_Tp>
998 return complex<_Tp>(_Tp(NAN), _Tp(NAN));
1002 return complex<_Tp>(__rho, __theta);
1003 return complex<_Tp>(__theta, __theta);
1008 return complex<_Tp>(__rho, _Tp(NAN));
1009 return complex<_Tp>(_Tp(NAN), _Tp(NAN));
1017 return complex<_Tp>(__x, __y);
1024 complex<_Tp>
1025 log(const complex<_Tp>& __x)
1027 return complex<_Tp>(log(abs(__x)), arg(__x));
1034 complex<_Tp>
1035 log10(const complex<_Tp>& __x)
1043 complex<_Tp>
1044 sqrt(const complex<_Tp>& __x)
1047 return complex<_Tp>(_Tp(INFINITY), __x.imag());
1051 …return complex<_Tp>(__x.real(), __libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : copysign(_Tp(…
1052 …return complex<_Tp>(__libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real…
1060 complex<_Tp>
1061 exp(const complex<_Tp>& __x)
1075 return complex<_Tp>(__x.real(), __i);
1081 return complex<_Tp>(__e * cos(__i), __e * sin(__i));
1088 complex<_Tp>
1089 pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
1096 complex<typename __promote<_Tp, _Up>::type>
1097 pow(const complex<_Tp>& __x, const complex<_Up>& __y)
1099 typedef complex<typename __promote<_Tp, _Up>::type> result_type;
1108 complex<typename __promote<_Tp, _Up>::type>
1110 pow(const complex<_Tp>& __x, const _Up& __y)
1112 typedef complex<typename __promote<_Tp, _Up>::type> result_type;
1121 complex<typename __promote<_Tp, _Up>::type>
1123 pow(const _Tp& __x, const complex<_Up>& __y)
1125 typedef complex<typename __promote<_Tp, _Up>::type> result_type;
1133 complex<_Tp>
1134 __sqr(const complex<_Tp>& __x)
1136 return complex<_Tp>((__x.real() - __x.imag()) * (__x.real() + __x.imag()),
1143 complex<_Tp>
1144 asinh(const complex<_Tp>& __x)
1152 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1153 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1158 return complex<_Tp>(__x.imag(), __x.real());
1161 return complex<_Tp>(__x.real(), __x.real());
1164 return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1165 complex<_Tp> __z = log(__x + sqrt(__sqr(__x) + _Tp(1)));
1166 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1172 complex<_Tp>
1173 acosh(const complex<_Tp>& __x)
1179 return complex<_Tp>(abs(__x.real()), __x.imag());
1183 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1185 return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag()));
1188 return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
1189 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1194 return complex<_Tp>(abs(__x.imag()), __x.real());
1195 return complex<_Tp>(__x.real(), __x.real());
1198 return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag()));
1199 complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1)));
1200 return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
1206 complex<_Tp>
1207 atanh(const complex<_Tp>& __x)
1212 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1217 return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
1218 return complex<_Tp>(__x.imag(), __x.imag());
1222 return complex<_Tp>(__x.real(), __x.real());
1226 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1230 return complex<_Tp>(copysign(_Tp(INFINITY), __x.real()), copysign(_Tp(0), __x.imag()));
1232 complex<_Tp> __z = log((_Tp(1) + __x) / (_Tp(1) - __x)) / _Tp(2);
1233 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1239 complex<_Tp>
1240 sinh(const complex<_Tp>& __x)
1243 return complex<_Tp>(__x.real(), _Tp(NAN));
1245 return complex<_Tp>(__x.real(), _Tp(NAN));
1248 return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
1254 complex<_Tp>
1255 cosh(const complex<_Tp>& __x)
1258 return complex<_Tp>(abs(__x.real()), _Tp(NAN));
1260 return complex<_Tp>(_Tp(NAN), __x.real());
1262 return complex<_Tp>(_Tp(1), __x.imag());
1264 return complex<_Tp>(abs(__x.real()), __x.imag());
1265 return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
1271 complex<_Tp>
1272 tanh(const complex<_Tp>& __x)
1277 return complex<_Tp>(_Tp(1), _Tp(0));
1278 return complex<_Tp>(_Tp(1), copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
1287 return complex<_Tp>(__2rsh > _Tp(0) ? _Tp(1) : _Tp(-1),
1289 return complex<_Tp>(__2rsh/__d, sin(__2i)/__d);
1295 complex<_Tp>
1296 asin(const complex<_Tp>& __x)
1298 complex<_Tp> __z = asinh(complex<_Tp>(-__x.imag(), __x.real()));
1299 return complex<_Tp>(__z.imag(), -__z.real());
1305 complex<_Tp>
1306 acos(const complex<_Tp>& __x)
1312 return complex<_Tp>(__x.imag(), __x.real());
1316 return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
1317 return complex<_Tp>(_Tp(0.25) * __pi, -__x.imag());
1320 return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
1321 return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
1326 return complex<_Tp>(__x.real(), -__x.imag());
1327 return complex<_Tp>(__x.real(), __x.real());
1330 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1332 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1333 complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1)));
1335 return complex<_Tp>(abs(__z.imag()), abs(__z.real()));
1336 return complex<_Tp>(abs(__z.imag()), -abs(__z.real()));
1342 complex<_Tp>
1343 atan(const complex<_Tp>& __x)
1345 complex<_Tp> __z = atanh(complex<_Tp>(-__x.imag(), __x.real()));
1346 return complex<_Tp>(__z.imag(), -__z.real());
1352 complex<_Tp>
1353 sin(const complex<_Tp>& __x)
1355 complex<_Tp> __z = sinh(complex<_Tp>(-__x.imag(), __x.real()));
1356 return complex<_Tp>(__z.imag(), -__z.real());
1363 complex<_Tp>
1364 cos(const complex<_Tp>& __x)
1366 return cosh(complex<_Tp>(-__x.imag(), __x.real()));
1372 complex<_Tp>
1373 tan(const complex<_Tp>& __x)
1375 complex<_Tp> __z = tanh(complex<_Tp>(-__x.imag(), __x.real()));
1376 return complex<_Tp>(__z.imag(), -__z.real());
1381 operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
1407 __x = complex<_Tp>(__r, __i);
1418 __x = complex<_Tp>(__r, _Tp(0));
1431 __x = complex<_Tp>(__r, _Tp(0));
1443 operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
1454 // Literal suffix for complex number literals [complex.literals]
1459 constexpr complex<long double> operator""il(long double __im)
1464 constexpr complex<long double> operator""il(unsigned long long __im)
1470 constexpr complex<double> operator""i(long double __im)
1475 constexpr complex<double> operator""i(unsigned long long __im)
1481 constexpr complex<float> operator""if(long double __im)
1486 constexpr complex<float> operator""if(unsigned long long __im)