Lines Matching refs:__x

261 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 (isnan(__x) && isnan(__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 (isnan(__x) && isnan(__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);
1093 _Tp __x = __rho * cos(__theta);
1094 if (isnan(__x))
1095 __x = 0;
1099 return complex<_Tp>(__x, __y);
1107 log(const complex<_Tp>& __x)
1109 return complex<_Tp>(log(abs(__x)), arg(__x));
1117 log10(const complex<_Tp>& __x)
1119 return log(__x) / log(_Tp(10));
1126 sqrt(const complex<_Tp>& __x)
1128 if (isinf(__x.imag()))
1129 return complex<_Tp>(_Tp(INFINITY), __x.imag());
1130 if (isinf(__x.real()))
1132 if (__x.real() > _Tp(0))
1133 … return complex<_Tp>(__x.real(), isnan(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.imag()));
1134 … return complex<_Tp>(isnan(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.imag()));
1136 return polar(sqrt(abs(__x)), arg(__x) / _Tp(2));
1143 exp(const complex<_Tp>& __x)
1145 _Tp __i = __x.imag();
1146 if (isinf(__x.real()))
1148 if (__x.real() < _Tp(0))
1157 return complex<_Tp>(__x.real(), __i);
1160 else if (isnan(__x.real()) && __x.imag() == 0)
1161 return __x;
1162 _Tp __e = exp(__x.real());
1171 pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
1173 return exp(__y * log(__x));
1179 pow(const complex<_Tp>& __x, const complex<_Up>& __y)
1182 return _VSTD::pow(result_type(__x), result_type(__y));
1192 pow(const complex<_Tp>& __x, const _Up& __y)
1195 return _VSTD::pow(result_type(__x), result_type(__y));
1205 pow(const _Tp& __x, const complex<_Up>& __y)
1208 return _VSTD::pow(result_type(__x), result_type(__y));
1215 asinh(const complex<_Tp>& __x)
1218 if (isinf(__x.real()))
1220 if (isnan(__x.imag()))
1221 return __x;
1222 if (isinf(__x.imag()))
1223 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1224 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1226 if (isnan(__x.real()))
1228 if (isinf(__x.imag()))
1229 return complex<_Tp>(__x.imag(), __x.real());
1230 if (__x.imag() == 0)
1231 return __x;
1232 return complex<_Tp>(__x.real(), __x.real());
1234 if (isinf(__x.imag()))
1235 return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1236 complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) + _Tp(1)));
1237 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1244 acosh(const complex<_Tp>& __x)
1247 if (isinf(__x.real()))
1249 if (isnan(__x.imag()))
1250 return complex<_Tp>(abs(__x.real()), __x.imag());
1251 if (isinf(__x.imag()))
1253 if (__x.real() > 0)
1254 return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
1256 return complex<_Tp>(-__x.real(), copysign(__pi * _Tp(0.75), __x.imag()));
1258 if (__x.real() < 0)
1259 return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
1260 return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
1262 if (isnan(__x.real()))
1264 if (isinf(__x.imag()))
1265 return complex<_Tp>(abs(__x.imag()), __x.real());
1266 return complex<_Tp>(__x.real(), __x.real());
1268 if (isinf(__x.imag()))
1269 return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag()));
1270 complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) - _Tp(1)));
1271 return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
1278 atanh(const complex<_Tp>& __x)
1281 if (isinf(__x.imag()))
1283 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1285 if (isnan(__x.imag()))
1287 if (isinf(__x.real()) || __x.real() == 0)
1288 return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
1289 return complex<_Tp>(__x.imag(), __x.imag());
1291 if (isnan(__x.real()))
1293 return complex<_Tp>(__x.real(), __x.real());
1295 if (isinf(__x.real()))
1297 return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
1299 if (abs(__x.real()) == _Tp(1) && __x.imag() == _Tp(0))
1301 return complex<_Tp>(copysign(_Tp(INFINITY), __x.real()), copysign(_Tp(0), __x.imag()));
1303 complex<_Tp> __z = log((_Tp(1) + __x) / (_Tp(1) - __x)) / _Tp(2);
1304 return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
1311 sinh(const complex<_Tp>& __x)
1313 if (isinf(__x.real()) && !isfinite(__x.imag()))
1314 return complex<_Tp>(__x.real(), _Tp(NAN));
1315 if (__x.real() == 0 && !isfinite(__x.imag()))
1316 return complex<_Tp>(__x.real(), _Tp(NAN));
1317 if (__x.imag() == 0 && !isfinite(__x.real()))
1318 return __x;
1319 return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
1326 cosh(const complex<_Tp>& __x)
1328 if (isinf(__x.real()) && !isfinite(__x.imag()))
1329 return complex<_Tp>(abs(__x.real()), _Tp(NAN));
1330 if (__x.real() == 0 && !isfinite(__x.imag()))
1331 return complex<_Tp>(_Tp(NAN), __x.real());
1332 if (__x.real() == 0 && __x.imag() == 0)
1333 return complex<_Tp>(_Tp(1), __x.imag());
1334 if (__x.imag() == 0 && !isfinite(__x.real()))
1335 return complex<_Tp>(abs(__x.real()), __x.imag());
1336 return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
1343 tanh(const complex<_Tp>& __x)
1345 if (isinf(__x.real()))
1347 if (!isfinite(__x.imag()))
1349 return complex<_Tp>(_Tp(1), copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
1351 if (isnan(__x.real()) && __x.imag() == 0)
1352 return __x;
1353 _Tp __2r(_Tp(2) * __x.real());
1354 _Tp __2i(_Tp(2) * __x.imag());
1367 asin(const complex<_Tp>& __x)
1369 complex<_Tp> __z = asinh(complex<_Tp>(-__x.imag(), __x.real()));
1377 acos(const complex<_Tp>& __x)
1380 if (isinf(__x.real()))
1382 if (isnan(__x.imag()))
1383 return complex<_Tp>(__x.imag(), __x.real());
1384 if (isinf(__x.imag()))
1386 if (__x.real() < _Tp(0))
1387 return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
1388 return complex<_Tp>(_Tp(0.25) * __pi, -__x.imag());
1390 if (__x.real() < _Tp(0))
1391 return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
1392 return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
1394 if (isnan(__x.real()))
1396 if (isinf(__x.imag()))
1397 return complex<_Tp>(__x.real(), -__x.imag());
1398 return complex<_Tp>(__x.real(), __x.real());
1400 if (isinf(__x.imag()))
1401 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1402 if (__x.real() == 0)
1403 return complex<_Tp>(__pi/_Tp(2), -__x.imag());
1404 complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) - _Tp(1)));
1405 if (signbit(__x.imag()))
1414 atan(const complex<_Tp>& __x)
1416 complex<_Tp> __z = atanh(complex<_Tp>(-__x.imag(), __x.real()));
1424 sin(const complex<_Tp>& __x)
1426 complex<_Tp> __z = sinh(complex<_Tp>(-__x.imag(), __x.real()));
1435 cos(const complex<_Tp>& __x)
1437 return cosh(complex<_Tp>(-__x.imag(), __x.real()));
1444 tan(const complex<_Tp>& __x)
1446 complex<_Tp> __z = tanh(complex<_Tp>(-__x.imag(), __x.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)
1520 __s << '(' << __x.real() << ',' << __x.imag() << ')';