Lines Matching refs:__z

136         _GLIBCXX_CONSTEXPR complex(const complex<_Up>& __z)
137 : _M_real(__z.real()), _M_imag(__z.imag()) { }
258 complex<_Tp>::operator=(const complex<_Up>& __z)
260 _M_real = __z.real();
261 _M_imag = __z.imag();
269 complex<_Tp>::operator+=(const complex<_Up>& __z)
271 _M_real += __z.real();
272 _M_imag += __z.imag();
280 complex<_Tp>::operator-=(const complex<_Up>& __z)
282 _M_real -= __z.real();
283 _M_imag -= __z.imag();
292 complex<_Tp>::operator*=(const complex<_Up>& __z)
294 const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag();
295 _M_imag = _M_real * __z.imag() + _M_imag * __z.real();
305 complex<_Tp>::operator/=(const complex<_Up>& __z)
307 const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag();
308 const _Tp __n = std::norm(__z);
309 _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n;
533 real(const complex<_Tp>& __z)
534 { return __z.real(); }
538 imag(const complex<_Tp>& __z)
539 { return __z.imag(); }
543 real(complex<_Tp>& __z)
544 { return __z.real(); }
548 real(const complex<_Tp>& __z)
549 { return __z.real(); }
553 imag(complex<_Tp>& __z)
554 { return __z.imag(); }
558 imag(const complex<_Tp>& __z)
559 { return __z.imag(); }
562 // 26.2.7/3 abs(__z): Returns the magnitude of __z.
565 __complex_abs(const complex<_Tp>& __z)
567 _Tp __x = __z.real();
568 _Tp __y = __z.imag();
579 __complex_abs(__complex__ float __z) { return __builtin_cabsf(__z); }
582 __complex_abs(__complex__ double __z) { return __builtin_cabs(__z); }
585 __complex_abs(const __complex__ long double& __z)
586 { return __builtin_cabsl(__z); }
590 abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
594 abs(const complex<_Tp>& __z) { return __complex_abs(__z); }
598 // 26.2.7/4: arg(__z): Returns the phase angle of __z.
601 __complex_arg(const complex<_Tp>& __z)
602 { return atan2(__z.imag(), __z.real()); }
606 __complex_arg(__complex__ float __z) { return __builtin_cargf(__z); }
609 __complex_arg(__complex__ double __z) { return __builtin_carg(__z); }
612 __complex_arg(const __complex__ long double& __z)
613 { return __builtin_cargl(__z); }
617 arg(const complex<_Tp>& __z) { return __complex_arg(__z.__rep()); }
621 arg(const complex<_Tp>& __z) { return __complex_arg(__z); }
624 // 26.2.7/5: norm(__z) returns the squared magnitude of __z.
633 static inline _Tp _S_do_it(const complex<_Tp>& __z)
635 const _Tp __x = __z.real();
636 const _Tp __y = __z.imag();
645 static inline _Tp _S_do_it(const complex<_Tp>& __z)
647 _Tp __res = std::abs(__z);
654 norm(const complex<_Tp>& __z)
657 && !_GLIBCXX_FAST_MATH>::_S_do_it(__z);
667 conj(const complex<_Tp>& __z)
668 { return complex<_Tp>(__z.real(), -__z.imag()); }
672 // 26.2.8/1 cos(__z): Returns the cosine of __z.
675 __complex_cos(const complex<_Tp>& __z)
677 const _Tp __x = __z.real();
678 const _Tp __y = __z.imag();
684 __complex_cos(__complex__ float __z) { return __builtin_ccosf(__z); }
687 __complex_cos(__complex__ double __z) { return __builtin_ccos(__z); }
690 __complex_cos(const __complex__ long double& __z)
691 { return __builtin_ccosl(__z); }
695 cos(const complex<_Tp>& __z) { return __complex_cos(__z.__rep()); }
699 cos(const complex<_Tp>& __z) { return __complex_cos(__z); }
702 // 26.2.8/2 cosh(__z): Returns the hyperbolic cosine of __z.
705 __complex_cosh(const complex<_Tp>& __z)
707 const _Tp __x = __z.real();
708 const _Tp __y = __z.imag();
714 __complex_cosh(__complex__ float __z) { return __builtin_ccoshf(__z); }
717 __complex_cosh(__complex__ double __z) { return __builtin_ccosh(__z); }
720 __complex_cosh(const __complex__ long double& __z)
721 { return __builtin_ccoshl(__z); }
725 cosh(const complex<_Tp>& __z) { return __complex_cosh(__z.__rep()); }
729 cosh(const complex<_Tp>& __z) { return __complex_cosh(__z); }
732 // 26.2.8/3 exp(__z): Returns the complex base e exponential of x
735 __complex_exp(const complex<_Tp>& __z)
736 { return std::polar(exp(__z.real()), __z.imag()); }
740 __complex_exp(__complex__ float __z) { return __builtin_cexpf(__z); }
743 __complex_exp(__complex__ double __z) { return __builtin_cexp(__z); }
746 __complex_exp(const __complex__ long double& __z)
747 { return __builtin_cexpl(__z); }
751 exp(const complex<_Tp>& __z) { return __complex_exp(__z.__rep()); }
755 exp(const complex<_Tp>& __z) { return __complex_exp(__z); }
758 // 26.2.8/5 log(__z): Returns the natural complex logarithm of __z.
762 __complex_log(const complex<_Tp>& __z)
763 { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); }
767 __complex_log(__complex__ float __z) { return __builtin_clogf(__z); }
770 __complex_log(__complex__ double __z) { return __builtin_clog(__z); }
773 __complex_log(const __complex__ long double& __z)
774 { return __builtin_clogl(__z); }
778 log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); }
782 log(const complex<_Tp>& __z) { return __complex_log(__z); }
787 log10(const complex<_Tp>& __z)
788 { return std::log(__z) / log(_Tp(10.0)); }
790 // 26.2.8/10 sin(__z): Returns the sine of __z.
793 __complex_sin(const complex<_Tp>& __z)
795 const _Tp __x = __z.real();
796 const _Tp __y = __z.imag();
802 __complex_sin(__complex__ float __z) { return __builtin_csinf(__z); }
805 __complex_sin(__complex__ double __z) { return __builtin_csin(__z); }
808 __complex_sin(const __complex__ long double& __z)
809 { return __builtin_csinl(__z); }
813 sin(const complex<_Tp>& __z) { return __complex_sin(__z.__rep()); }
817 sin(const complex<_Tp>& __z) { return __complex_sin(__z); }
820 // 26.2.8/11 sinh(__z): Returns the hyperbolic sine of __z.
823 __complex_sinh(const complex<_Tp>& __z)
825 const _Tp __x = __z.real();
826 const _Tp __y = __z.imag();
832 __complex_sinh(__complex__ float __z) { return __builtin_csinhf(__z); }
835 __complex_sinh(__complex__ double __z) { return __builtin_csinh(__z); }
838 __complex_sinh(const __complex__ long double& __z)
839 { return __builtin_csinhl(__z); }
843 sinh(const complex<_Tp>& __z) { return __complex_sinh(__z.__rep()); }
847 sinh(const complex<_Tp>& __z) { return __complex_sinh(__z); }
850 // 26.2.8/13 sqrt(__z): Returns the complex square root of __z.
854 __complex_sqrt(const complex<_Tp>& __z)
856 _Tp __x = __z.real();
857 _Tp __y = __z.imag();
866 _Tp __t = sqrt(2 * (std::abs(__z) + abs(__x)));
876 __complex_sqrt(__complex__ float __z) { return __builtin_csqrtf(__z); }
879 __complex_sqrt(__complex__ double __z) { return __builtin_csqrt(__z); }
882 __complex_sqrt(const __complex__ long double& __z)
883 { return __builtin_csqrtl(__z); }
887 sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); }
891 sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z); }
894 // 26.2.8/14 tan(__z): Return the complex tangent of __z.
898 __complex_tan(const complex<_Tp>& __z)
899 { return std::sin(__z) / std::cos(__z); }
903 __complex_tan(__complex__ float __z) { return __builtin_ctanf(__z); }
906 __complex_tan(__complex__ double __z) { return __builtin_ctan(__z); }
909 __complex_tan(const __complex__ long double& __z)
910 { return __builtin_ctanl(__z); }
914 tan(const complex<_Tp>& __z) { return __complex_tan(__z.__rep()); }
918 tan(const complex<_Tp>& __z) { return __complex_tan(__z); }
922 // 26.2.8/15 tanh(__z): Returns the hyperbolic tangent of __z.
926 __complex_tanh(const complex<_Tp>& __z)
927 { return std::sinh(__z) / std::cosh(__z); }
931 __complex_tanh(__complex__ float __z) { return __builtin_ctanhf(__z); }
934 __complex_tanh(__complex__ double __z) { return __builtin_ctanh(__z); }
937 __complex_tanh(const __complex__ long double& __z)
938 { return __builtin_ctanhl(__z); }
942 tanh(const complex<_Tp>& __z) { return __complex_tanh(__z.__rep()); }
946 tanh(const complex<_Tp>& __z) { return __complex_tanh(__z); }
974 pow(const complex<_Tp>& __z, int __n)
977 ? complex<_Tp>(1) / std::__complex_pow_unsigned(__z, -(unsigned)__n)
978 : std::__complex_pow_unsigned(__z, __n);
1044 _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }
1130 operator=(const complex<_Tp>& __z)
1132 __real__ _M_value = __z.real();
1133 __imag__ _M_value = __z.imag();
1139 operator+=(const complex<_Tp>& __z)
1141 __real__ _M_value += __z.real();
1142 __imag__ _M_value += __z.imag();
1148 operator-=(const complex<_Tp>& __z)
1150 __real__ _M_value -= __z.real();
1151 __imag__ _M_value -= __z.imag();
1157 operator*=(const complex<_Tp>& __z)
1160 __real__ __t = __z.real();
1161 __imag__ __t = __z.imag();
1168 operator/=(const complex<_Tp>& __z)
1171 __real__ __t = __z.real();
1172 __imag__ __t = __z.imag();
1191 _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }
1203 _GLIBCXX_CONSTEXPR complex(const complex<float>& __z)
1204 : _M_value(__z.__rep()) { }
1278 operator=(const complex<_Tp>& __z)
1280 __real__ _M_value = __z.real();
1281 __imag__ _M_value = __z.imag();
1287 operator+=(const complex<_Tp>& __z)
1289 __real__ _M_value += __z.real();
1290 __imag__ _M_value += __z.imag();
1296 operator-=(const complex<_Tp>& __z)
1298 __real__ _M_value -= __z.real();
1299 __imag__ _M_value -= __z.imag();
1305 operator*=(const complex<_Tp>& __z)
1308 __real__ __t = __z.real();
1309 __imag__ __t = __z.imag();
1316 operator/=(const complex<_Tp>& __z)
1319 __real__ __t = __z.real();
1320 __imag__ __t = __z.imag();
1339 _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }
1352 _GLIBCXX_CONSTEXPR complex(const complex<float>& __z)
1353 : _M_value(__z.__rep()) { }
1355 _GLIBCXX_CONSTEXPR complex(const complex<double>& __z)
1356 : _M_value(__z.__rep()) { }
1428 operator=(const complex<_Tp>& __z)
1430 __real__ _M_value = __z.real();
1431 __imag__ _M_value = __z.imag();
1437 operator+=(const complex<_Tp>& __z)
1439 __real__ _M_value += __z.real();
1440 __imag__ _M_value += __z.imag();
1446 operator-=(const complex<_Tp>& __z)
1448 __real__ _M_value -= __z.real();
1449 __imag__ _M_value -= __z.imag();
1455 operator*=(const complex<_Tp>& __z)
1458 __real__ __t = __z.real();
1459 __imag__ __t = __z.imag();
1466 operator/=(const complex<_Tp>& __z)
1469 __real__ __t = __z.real();
1470 __imag__ __t = __z.imag();
1484 complex<float>::complex(const complex<double>& __z)
1485 : _M_value(__z.__rep()) { }
1488 complex<float>::complex(const complex<long double>& __z)
1489 : _M_value(__z.__rep()) { }
1492 complex<double>::complex(const complex<long double>& __z)
1493 : _M_value(__z.__rep()) { }
1569 __complex_acos(const std::complex<_Tp>& __z)
1571 const std::complex<_Tp> __t = std::asin(__z);
1578 __complex_acos(__complex__ float __z)
1579 { return __builtin_cacosf(__z); }
1582 __complex_acos(__complex__ double __z)
1583 { return __builtin_cacos(__z); }
1586 __complex_acos(const __complex__ long double& __z)
1587 { return __builtin_cacosl(__z); }
1591 acos(const std::complex<_Tp>& __z)
1592 { return __complex_acos(__z.__rep()); }
1594 /// acos(__z) [8.1.2].
1599 acos(const std::complex<_Tp>& __z)
1600 { return __complex_acos(__z); }
1605 __complex_asin(const std::complex<_Tp>& __z)
1607 std::complex<_Tp> __t(-__z.imag(), __z.real());
1614 __complex_asin(__complex__ float __z)
1615 { return __builtin_casinf(__z); }
1618 __complex_asin(__complex__ double __z)
1619 { return __builtin_casin(__z); }
1622 __complex_asin(const __complex__ long double& __z)
1623 { return __builtin_casinl(__z); }
1627 asin(const std::complex<_Tp>& __z)
1628 { return __complex_asin(__z.__rep()); }
1630 /// asin(__z) [8.1.3].
1635 asin(const std::complex<_Tp>& __z)
1636 { return __complex_asin(__z); }
1641 __complex_atan(const std::complex<_Tp>& __z)
1643 const _Tp __r2 = __z.real() * __z.real();
1644 const _Tp __x = _Tp(1.0) - __r2 - __z.imag() * __z.imag();
1646 _Tp __num = __z.imag() + _Tp(1.0);
1647 _Tp __den = __z.imag() - _Tp(1.0);
1652 return std::complex<_Tp>(_Tp(0.5) * atan2(_Tp(2.0) * __z.real(), __x),
1658 __complex_atan(__complex__ float __z)
1659 { return __builtin_catanf(__z); }
1662 __complex_atan(__complex__ double __z)
1663 { return __builtin_catan(__z); }
1666 __complex_atan(const __complex__ long double& __z)
1667 { return __builtin_catanl(__z); }
1671 atan(const std::complex<_Tp>& __z)
1672 { return __complex_atan(__z.__rep()); }
1674 /// atan(__z) [8.1.4].
1679 atan(const std::complex<_Tp>& __z)
1680 { return __complex_atan(__z); }
1685 __complex_acosh(const std::complex<_Tp>& __z)
1688 return _Tp(2.0) * std::log(std::sqrt(_Tp(0.5) * (__z + _Tp(1.0)))
1689 + std::sqrt(_Tp(0.5) * (__z - _Tp(1.0))));
1694 __complex_acosh(__complex__ float __z)
1695 { return __builtin_cacoshf(__z); }
1698 __complex_acosh(__complex__ double __z)
1699 { return __builtin_cacosh(__z); }
1702 __complex_acosh(const __complex__ long double& __z)
1703 { return __builtin_cacoshl(__z); }
1707 acosh(const std::complex<_Tp>& __z)
1708 { return __complex_acosh(__z.__rep()); }
1710 /// acosh(__z) [8.1.5].
1715 acosh(const std::complex<_Tp>& __z)
1716 { return __complex_acosh(__z); }
1721 __complex_asinh(const std::complex<_Tp>& __z)
1723 std::complex<_Tp> __t((__z.real() - __z.imag())
1724 * (__z.real() + __z.imag()) + _Tp(1.0),
1725 _Tp(2.0) * __z.real() * __z.imag());
1728 return std::log(__t + __z);
1733 __complex_asinh(__complex__ float __z)
1734 { return __builtin_casinhf(__z); }
1737 __complex_asinh(__complex__ double __z)
1738 { return __builtin_casinh(__z); }
1741 __complex_asinh(const __complex__ long double& __z)
1742 { return __builtin_casinhl(__z); }
1746 asinh(const std::complex<_Tp>& __z)
1747 { return __complex_asinh(__z.__rep()); }
1749 /// asinh(__z) [8.1.6].
1754 asinh(const std::complex<_Tp>& __z)
1755 { return __complex_asinh(__z); }
1760 __complex_atanh(const std::complex<_Tp>& __z)
1762 const _Tp __i2 = __z.imag() * __z.imag();
1763 const _Tp __x = _Tp(1.0) - __i2 - __z.real() * __z.real();
1765 _Tp __num = _Tp(1.0) + __z.real();
1766 _Tp __den = _Tp(1.0) - __z.real();
1772 _Tp(0.5) * atan2(_Tp(2.0) * __z.imag(), __x));
1777 __complex_atanh(__complex__ float __z)
1778 { return __builtin_catanhf(__z); }
1781 __complex_atanh(__complex__ double __z)
1782 { return __builtin_catanh(__z); }
1785 __complex_atanh(const __complex__ long double& __z)
1786 { return __builtin_catanhl(__z); }
1790 atanh(const std::complex<_Tp>& __z)
1791 { return __complex_atanh(__z.__rep()); }
1793 /// atanh(__z) [8.1.7].
1798 atanh(const std::complex<_Tp>& __z)
1799 { return __complex_atanh(__z); }
1804 /// fabs(__z) [8.1.8].
1807 fabs(const std::complex<_Tp>& __z)
1808 { return std::abs(__z); }
1873 __complex_proj(const std::complex<_Tp>& __z)
1875 const _Tp __den = (__z.real() * __z.real()
1876 + __z.imag() * __z.imag() + _Tp(1.0));
1878 return std::complex<_Tp>((_Tp(2.0) * __z.real()) / __den,
1879 (_Tp(2.0) * __z.imag()) / __den);
1884 __complex_proj(__complex__ float __z)
1885 { return __builtin_cprojf(__z); }
1888 __complex_proj(__complex__ double __z)
1889 { return __builtin_cproj(__z); }
1892 __complex_proj(const __complex__ long double& __z)
1893 { return __builtin_cprojl(__z); }
1897 proj(const std::complex<_Tp>& __z)
1898 { return __complex_proj(__z.__rep()); }
1902 proj(const std::complex<_Tp>& __z)
1903 { return __complex_proj(__z); }