Lines Matching refs:__x

255 template<class _Tp> complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y);
528 operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
530 complex<_Tp> __t(__x);
538 operator+(const complex<_Tp>& __x, const _Tp& __y)
540 complex<_Tp> __t(__x);
548 operator+(const _Tp& __x, const complex<_Tp>& __y)
551 __t += __x;
558 operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
560 complex<_Tp> __t(__x);
568 operator-(const complex<_Tp>& __x, const _Tp& __y)
570 complex<_Tp> __t(__x);
578 operator-(const _Tp& __x, const complex<_Tp>& __y)
581 __t += __x;
597 _Tp __x = __ac - __bd;
599 if (__libcpp_isnan_or_builtin(__x) && __libcpp_isnan_or_builtin(__y))
637 __x = _Tp(INFINITY) * (__a * __c - __b * __d);
641 return complex<_Tp>(__x, __y);
647 operator*(const complex<_Tp>& __x, const _Tp& __y)
649 complex<_Tp> __t(__x);
657 operator*(const _Tp& __x, const complex<_Tp>& __y)
660 __t *= __x;
681 _Tp __x = scalbn((__a * __c + __b * __d) / __denom, -__ilogbw);
683 if (__libcpp_isnan_or_builtin(__x) && __libcpp_isnan_or_builtin(__y))
687 __x = copysign(_Tp(INFINITY), __c) * __a;
694 __x = _Tp(INFINITY) * (__a * __c + __b * __d);
701 __x = _Tp(0) * (__a * __c + __b * __d);
705 return complex<_Tp>(__x, __y);
711 operator/(const complex<_Tp>& __x, const _Tp& __y)
713 return complex<_Tp>(__x.real() / __y, __x.imag() / __y);
719 operator/(const _Tp& __x, const complex<_Tp>& __y)
721 complex<_Tp> __t(__x);
729 operator+(const complex<_Tp>& __x)
731 return __x;
737 operator-(const complex<_Tp>& __x)
739 return complex<_Tp>(-__x.real(), -__x.imag());
745 operator==(const complex<_Tp>& __x, const complex<_Tp>& __y)
747 return __x.real() == __y.real() && __x.imag() == __y.imag();
753 operator==(const complex<_Tp>& __x, const _Tp& __y)
755 return __x.real() == __y && __x.imag() == 0;
761 operator==(const _Tp& __x, const complex<_Tp>& __y)
763 return __x == __y.real() && 0 == __y.imag();
769 operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y)
771 return !(__x == __y);
777 operator!=(const complex<_Tp>& __x, const _Tp& __y)
779 return !(__x == __y);
785 operator!=(const _Tp& __x, const complex<_Tp>& __y)
787 return !(__x == __y);
1007 _Tp __x = __rho * cos(__theta);
1008 if (__libcpp_isnan_or_builtin(__x))
1009 __x = 0;
1013 return complex<_Tp>(__x, __y);
1021 log(const complex<_Tp>& __x)
1023 return complex<_Tp>(log(abs(__x)), arg(__x));
1031 log10(const complex<_Tp>& __x)
1033 return log(__x) / log(_Tp(10));
1040 sqrt(const complex<_Tp>& __x)
1042 if (__libcpp_isinf_or_builtin(__x.imag()))
1043 return complex<_Tp>(_Tp(INFINITY), __x.imag());
1044 if (__libcpp_isinf_or_builtin(__x.real()))
1046 if (__x.real() > _Tp(0))
1047 …return complex<_Tp>(__x.real(), __libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : copysign(_Tp(…
1048 …return complex<_Tp>(__libcpp_isnan_or_builtin(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real…
1050 return polar(sqrt(abs(__x)), arg(__x) / _Tp(2));
1057 exp(const complex<_Tp>& __x)
1059 _Tp __i = __x.imag();
1061 return complex<_Tp>(exp(__x.real()), copysign(_Tp(0), __x.imag()));
1063 if (__libcpp_isinf_or_builtin(__x.real()))
1065 if (__x.real() < _Tp(0))
1074 return complex<_Tp>(__x.real(), __i);
1077 _Tp __e = exp(__x.real());
1086 pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
1088 return exp(__y * log(__x));
1094 pow(const complex<_Tp>& __x, const complex<_Up>& __y)
1097 return _VSTD::pow(result_type(__x), result_type(__y));
1107 pow(const complex<_Tp>& __x, const _Up& __y)
1110 return _VSTD::pow(result_type(__x), result_type(__y));
1120 pow(const _Tp& __x, const complex<_Up>& __y)
1123 return _VSTD::pow(result_type(__x), result_type(__y));
1131 __sqr(const complex<_Tp>& __x)
1133 return complex<_Tp>((__x.real() - __x.imag()) * (__x.real() + __x.imag()),
1134 _Tp(2) * __x.real() * __x.imag());
1141 asinh(const complex<_Tp>& __x)
1144 if (__libcpp_isinf_or_builtin(__x.real()))
1146 if (__libcpp_isnan_or_builtin(__x.imag()))
1147 return __x;
1148 if (__libcpp_isinf_or_builtin(__x.imag()))
1149 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1150 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1152 if (__libcpp_isnan_or_builtin(__x.real()))
1154 if (__libcpp_isinf_or_builtin(__x.imag()))
1155 return complex<_Tp>(__x.imag(), __x.real());
1156 if (__x.imag() == 0)
1157 return __x;
1158 return complex<_Tp>(__x.real(), __x.real());
1160 if (__libcpp_isinf_or_builtin(__x.imag()))
1161 return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1162 complex<_Tp> __z = log(__x + sqrt(__sqr(__x) + _Tp(1)));
1163 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1170 acosh(const complex<_Tp>& __x)
1173 if (__libcpp_isinf_or_builtin(__x.real()))
1175 if (__libcpp_isnan_or_builtin(__x.imag()))
1176 return complex<_Tp>(abs(__x.real()), __x.imag());
1177 if (__libcpp_isinf_or_builtin(__x.imag()))
1179 if (__x.real() > 0)
1180 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1182 return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag()));
1184 if (__x.real() < 0)
1185 return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
1186 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1188 if (__libcpp_isnan_or_builtin(__x.real()))
1190 if (__libcpp_isinf_or_builtin(__x.imag()))
1191 return complex<_Tp>(abs(__x.imag()), __x.real());
1192 return complex<_Tp>(__x.real(), __x.real());
1194 if (__libcpp_isinf_or_builtin(__x.imag()))
1195 return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag()));
1196 complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1)));
1197 return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
1204 atanh(const complex<_Tp>& __x)
1207 if (__libcpp_isinf_or_builtin(__x.imag()))
1209 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1211 if (__libcpp_isnan_or_builtin(__x.imag()))
1213 if (__libcpp_isinf_or_builtin(__x.real()) || __x.real() == 0)
1214 return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
1215 return complex<_Tp>(__x.imag(), __x.imag());
1217 if (__libcpp_isnan_or_builtin(__x.real()))
1219 return complex<_Tp>(__x.real(), __x.real());
1221 if (__libcpp_isinf_or_builtin(__x.real()))
1223 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1225 if (abs(__x.real()) == _Tp(1) && __x.imag() == _Tp(0))
1227 return complex<_Tp>(copysign(_Tp(INFINITY), __x.real()), copysign(_Tp(0), __x.imag()));
1229 complex<_Tp> __z = log((_Tp(1) + __x) / (_Tp(1) - __x)) / _Tp(2);
1230 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1237 sinh(const complex<_Tp>& __x)
1239 if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag()))
1240 return complex<_Tp>(__x.real(), _Tp(NAN));
1241 if (__x.real() == 0 && !__libcpp_isfinite_or_builtin(__x.imag()))
1242 return complex<_Tp>(__x.real(), _Tp(NAN));
1243 if (__x.imag() == 0 && !__libcpp_isfinite_or_builtin(__x.real()))
1244 return __x;
1245 return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
1252 cosh(const complex<_Tp>& __x)
1254 if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag()))
1255 return complex<_Tp>(abs(__x.real()), _Tp(NAN));
1256 if (__x.real() == 0 && !__libcpp_isfinite_or_builtin(__x.imag()))
1257 return complex<_Tp>(_Tp(NAN), __x.real());
1258 if (__x.real() == 0 && __x.imag() == 0)
1259 return complex<_Tp>(_Tp(1), __x.imag());
1260 if (__x.imag() == 0 && !__libcpp_isfinite_or_builtin(__x.real()))
1261 return complex<_Tp>(abs(__x.real()), __x.imag());
1262 return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
1269 tanh(const complex<_Tp>& __x)
1271 if (__libcpp_isinf_or_builtin(__x.real()))
1273 if (!__libcpp_isfinite_or_builtin(__x.imag()))
1274 return complex<_Tp>(copysign(_Tp(1), __x.real()), _Tp(0));
1275 … return complex<_Tp>(copysign(_Tp(1), __x.real()), copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
1277 if (__libcpp_isnan_or_builtin(__x.real()) && __x.imag() == 0)
1278 return __x;
1279 _Tp __2r(_Tp(2) * __x.real());
1280 _Tp __2i(_Tp(2) * __x.imag());
1293 asin(const complex<_Tp>& __x)
1295 complex<_Tp> __z = asinh(complex<_Tp>(-__x.imag(), __x.real()));
1303 acos(const complex<_Tp>& __x)
1306 if (__libcpp_isinf_or_builtin(__x.real()))
1308 if (__libcpp_isnan_or_builtin(__x.imag()))
1309 return complex<_Tp>(__x.imag(), __x.real());
1310 if (__libcpp_isinf_or_builtin(__x.imag()))
1312 if (__x.real() < _Tp(0))
1313 return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
1314 return complex<_Tp>(_Tp(0.25) * __pi, -__x.imag());
1316 if (__x.real() < _Tp(0))
1317 return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
1318 return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
1320 if (__libcpp_isnan_or_builtin(__x.real()))
1322 if (__libcpp_isinf_or_builtin(__x.imag()))
1323 return complex<_Tp>(__x.real(), -__x.imag());
1324 return complex<_Tp>(__x.real(), __x.real());
1326 if (__libcpp_isinf_or_builtin(__x.imag()))
1327 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1328 if (__x.real() == 0 && (__x.imag() == 0 || isnan(__x.imag())))
1329 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1330 complex<_Tp> __z = log(__x + sqrt(__sqr(__x) - _Tp(1)));
1331 if (signbit(__x.imag()))
1340 atan(const complex<_Tp>& __x)
1342 complex<_Tp> __z = atanh(complex<_Tp>(-__x.imag(), __x.real()));
1350 sin(const complex<_Tp>& __x)
1352 complex<_Tp> __z = sinh(complex<_Tp>(-__x.imag(), __x.real()));
1361 cos(const complex<_Tp>& __x)
1363 return cosh(complex<_Tp>(-__x.imag(), __x.real()));
1370 tan(const complex<_Tp>& __x)
1372 complex<_Tp> __z = tanh(complex<_Tp>(-__x.imag(), __x.real()));
1378 operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
1404 __x = complex<_Tp>(__r, __i);
1415 __x = complex<_Tp>(__r, _Tp(0));
1428 __x = complex<_Tp>(__r, _Tp(0));
1441 operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
1447 __s << '(' << __x.real() << ',' << __x.imag() << ')';