Lines Matching refs:__z

139         _GLIBCXX_CONSTEXPR complex(const complex<_Up>& __z)
140 : _M_real(__z.real()), _M_imag(__z.imag()) { }
263 complex<_Tp>::operator=(const complex<_Up>& __z)
265 _M_real = __z.real();
266 _M_imag = __z.imag();
274 complex<_Tp>::operator+=(const complex<_Up>& __z)
276 _M_real += __z.real();
277 _M_imag += __z.imag();
285 complex<_Tp>::operator-=(const complex<_Up>& __z)
287 _M_real -= __z.real();
288 _M_imag -= __z.imag();
297 complex<_Tp>::operator*=(const complex<_Up>& __z)
299 const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag();
300 _M_imag = _M_real * __z.imag() + _M_imag * __z.real();
310 complex<_Tp>::operator/=(const complex<_Up>& __z)
312 const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag();
313 const _Tp __n = std::norm(__z);
314 _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n;
538 real(const complex<_Tp>& __z)
539 { return __z.real(); }
543 imag(const complex<_Tp>& __z)
544 { return __z.imag(); }
548 real(complex<_Tp>& __z)
549 { return __z.real(); }
553 real(const complex<_Tp>& __z)
554 { return __z.real(); }
558 imag(complex<_Tp>& __z)
559 { return __z.imag(); }
563 imag(const complex<_Tp>& __z)
564 { return __z.imag(); }
567 // 26.2.7/3 abs(__z): Returns the magnitude of __z.
570 __complex_abs(const complex<_Tp>& __z)
572 _Tp __x = __z.real();
573 _Tp __y = __z.imag();
584 __complex_abs(__complex__ float __z) { return __builtin_cabsf(__z); }
587 __complex_abs(__complex__ double __z) { return __builtin_cabs(__z); }
590 __complex_abs(const __complex__ long double& __z)
591 { return __builtin_cabsl(__z); }
595 abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
599 abs(const complex<_Tp>& __z) { return __complex_abs(__z); }
603 // 26.2.7/4: arg(__z): Returns the phase angle of __z.
606 __complex_arg(const complex<_Tp>& __z)
607 { return atan2(__z.imag(), __z.real()); }
611 __complex_arg(__complex__ float __z) { return __builtin_cargf(__z); }
614 __complex_arg(__complex__ double __z) { return __builtin_carg(__z); }
617 __complex_arg(const __complex__ long double& __z)
618 { return __builtin_cargl(__z); }
622 arg(const complex<_Tp>& __z) { return __complex_arg(__z.__rep()); }
626 arg(const complex<_Tp>& __z) { return __complex_arg(__z); }
629 // 26.2.7/5: norm(__z) returns the squared magnitude of __z.
638 static inline _Tp _S_do_it(const complex<_Tp>& __z)
640 const _Tp __x = __z.real();
641 const _Tp __y = __z.imag();
650 static inline _Tp _S_do_it(const complex<_Tp>& __z)
652 _Tp __res = std::abs(__z);
659 norm(const complex<_Tp>& __z)
662 && !_GLIBCXX_FAST_MATH>::_S_do_it(__z);
672 conj(const complex<_Tp>& __z)
673 { return complex<_Tp>(__z.real(), -__z.imag()); }
677 // 26.2.8/1 cos(__z): Returns the cosine of __z.
680 __complex_cos(const complex<_Tp>& __z)
682 const _Tp __x = __z.real();
683 const _Tp __y = __z.imag();
689 __complex_cos(__complex__ float __z) { return __builtin_ccosf(__z); }
692 __complex_cos(__complex__ double __z) { return __builtin_ccos(__z); }
695 __complex_cos(const __complex__ long double& __z)
696 { return __builtin_ccosl(__z); }
700 cos(const complex<_Tp>& __z) { return __complex_cos(__z.__rep()); }
704 cos(const complex<_Tp>& __z) { return __complex_cos(__z); }
707 // 26.2.8/2 cosh(__z): Returns the hyperbolic cosine of __z.
710 __complex_cosh(const complex<_Tp>& __z)
712 const _Tp __x = __z.real();
713 const _Tp __y = __z.imag();
719 __complex_cosh(__complex__ float __z) { return __builtin_ccoshf(__z); }
722 __complex_cosh(__complex__ double __z) { return __builtin_ccosh(__z); }
725 __complex_cosh(const __complex__ long double& __z)
726 { return __builtin_ccoshl(__z); }
730 cosh(const complex<_Tp>& __z) { return __complex_cosh(__z.__rep()); }
734 cosh(const complex<_Tp>& __z) { return __complex_cosh(__z); }
737 // 26.2.8/3 exp(__z): Returns the complex base e exponential of x
740 __complex_exp(const complex<_Tp>& __z)
741 { return std::polar(exp(__z.real()), __z.imag()); }
745 __complex_exp(__complex__ float __z) { return __builtin_cexpf(__z); }
748 __complex_exp(__complex__ double __z) { return __builtin_cexp(__z); }
751 __complex_exp(const __complex__ long double& __z)
752 { return __builtin_cexpl(__z); }
756 exp(const complex<_Tp>& __z) { return __complex_exp(__z.__rep()); }
760 exp(const complex<_Tp>& __z) { return __complex_exp(__z); }
763 // 26.2.8/5 log(__z): Returns the natural complex logarithm of __z.
767 __complex_log(const complex<_Tp>& __z)
768 { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); }
772 __complex_log(__complex__ float __z) { return __builtin_clogf(__z); }
775 __complex_log(__complex__ double __z) { return __builtin_clog(__z); }
778 __complex_log(const __complex__ long double& __z)
779 { return __builtin_clogl(__z); }
783 log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); }
787 log(const complex<_Tp>& __z) { return __complex_log(__z); }
792 log10(const complex<_Tp>& __z)
793 { return std::log(__z) / log(_Tp(10.0)); }
795 // 26.2.8/10 sin(__z): Returns the sine of __z.
798 __complex_sin(const complex<_Tp>& __z)
800 const _Tp __x = __z.real();
801 const _Tp __y = __z.imag();
807 __complex_sin(__complex__ float __z) { return __builtin_csinf(__z); }
810 __complex_sin(__complex__ double __z) { return __builtin_csin(__z); }
813 __complex_sin(const __complex__ long double& __z)
814 { return __builtin_csinl(__z); }
818 sin(const complex<_Tp>& __z) { return __complex_sin(__z.__rep()); }
822 sin(const complex<_Tp>& __z) { return __complex_sin(__z); }
825 // 26.2.8/11 sinh(__z): Returns the hyperbolic sine of __z.
828 __complex_sinh(const complex<_Tp>& __z)
830 const _Tp __x = __z.real();
831 const _Tp __y = __z.imag();
837 __complex_sinh(__complex__ float __z) { return __builtin_csinhf(__z); }
840 __complex_sinh(__complex__ double __z) { return __builtin_csinh(__z); }
843 __complex_sinh(const __complex__ long double& __z)
844 { return __builtin_csinhl(__z); }
848 sinh(const complex<_Tp>& __z) { return __complex_sinh(__z.__rep()); }
852 sinh(const complex<_Tp>& __z) { return __complex_sinh(__z); }
855 // 26.2.8/13 sqrt(__z): Returns the complex square root of __z.
859 __complex_sqrt(const complex<_Tp>& __z)
861 _Tp __x = __z.real();
862 _Tp __y = __z.imag();
871 _Tp __t = sqrt(2 * (std::abs(__z) + abs(__x)));
881 __complex_sqrt(__complex__ float __z) { return __builtin_csqrtf(__z); }
884 __complex_sqrt(__complex__ double __z) { return __builtin_csqrt(__z); }
887 __complex_sqrt(const __complex__ long double& __z)
888 { return __builtin_csqrtl(__z); }
892 sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); }
896 sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z); }
899 // 26.2.8/14 tan(__z): Return the complex tangent of __z.
903 __complex_tan(const complex<_Tp>& __z)
904 { return std::sin(__z) / std::cos(__z); }
908 __complex_tan(__complex__ float __z) { return __builtin_ctanf(__z); }
911 __complex_tan(__complex__ double __z) { return __builtin_ctan(__z); }
914 __complex_tan(const __complex__ long double& __z)
915 { return __builtin_ctanl(__z); }
919 tan(const complex<_Tp>& __z) { return __complex_tan(__z.__rep()); }
923 tan(const complex<_Tp>& __z) { return __complex_tan(__z); }
927 // 26.2.8/15 tanh(__z): Returns the hyperbolic tangent of __z.
931 __complex_tanh(const complex<_Tp>& __z)
932 { return std::sinh(__z) / std::cosh(__z); }
936 __complex_tanh(__complex__ float __z) { return __builtin_ctanhf(__z); }
939 __complex_tanh(__complex__ double __z) { return __builtin_ctanh(__z); }
942 __complex_tanh(const __complex__ long double& __z)
943 { return __builtin_ctanhl(__z); }
947 tanh(const complex<_Tp>& __z) { return __complex_tanh(__z.__rep()); }
951 tanh(const complex<_Tp>& __z) { return __complex_tanh(__z); }
979 pow(const complex<_Tp>& __z, int __n)
982 ? complex<_Tp>(1) / std::__complex_pow_unsigned(__z, -(unsigned)__n)
983 : std::__complex_pow_unsigned(__z, __n);
1049 _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }
1137 operator=(const complex<_Tp>& __z)
1139 __real__ _M_value = __z.real();
1140 __imag__ _M_value = __z.imag();
1146 operator+=(const complex<_Tp>& __z)
1148 __real__ _M_value += __z.real();
1149 __imag__ _M_value += __z.imag();
1155 operator-=(const complex<_Tp>& __z)
1157 __real__ _M_value -= __z.real();
1158 __imag__ _M_value -= __z.imag();
1164 operator*=(const complex<_Tp>& __z)
1167 __real__ __t = __z.real();
1168 __imag__ __t = __z.imag();
1175 operator/=(const complex<_Tp>& __z)
1178 __real__ __t = __z.real();
1179 __imag__ __t = __z.imag();
1198 _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }
1210 _GLIBCXX_CONSTEXPR complex(const complex<float>& __z)
1211 : _M_value(__z.__rep()) { }
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)
1307 __real__ _M_value -= __z.real();
1308 __imag__ _M_value -= __z.imag();
1314 operator*=(const complex<_Tp>& __z)
1317 __real__ __t = __z.real();
1318 __imag__ __t = __z.imag();
1325 operator/=(const complex<_Tp>& __z)
1328 __real__ __t = __z.real();
1329 __imag__ __t = __z.imag();
1348 _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }
1361 _GLIBCXX_CONSTEXPR complex(const complex<float>& __z)
1362 : _M_value(__z.__rep()) { }
1364 _GLIBCXX_CONSTEXPR complex(const complex<double>& __z)
1365 : _M_value(__z.__rep()) { }
1439 operator=(const complex<_Tp>& __z)
1441 __real__ _M_value = __z.real();
1442 __imag__ _M_value = __z.imag();
1448 operator+=(const complex<_Tp>& __z)
1450 __real__ _M_value += __z.real();
1451 __imag__ _M_value += __z.imag();
1457 operator-=(const complex<_Tp>& __z)
1459 __real__ _M_value -= __z.real();
1460 __imag__ _M_value -= __z.imag();
1466 operator*=(const complex<_Tp>& __z)
1469 __real__ __t = __z.real();
1470 __imag__ __t = __z.imag();
1477 operator/=(const complex<_Tp>& __z)
1480 __real__ __t = __z.real();
1481 __imag__ __t = __z.imag();
1495 complex<float>::complex(const complex<double>& __z)
1496 : _M_value(__z.__rep()) { }
1499 complex<float>::complex(const complex<long double>& __z)
1500 : _M_value(__z.__rep()) { }
1503 complex<double>::complex(const complex<long double>& __z)
1504 : _M_value(__z.__rep()) { }
1580 __complex_acos(const std::complex<_Tp>& __z)
1582 const std::complex<_Tp> __t = std::asin(__z);
1589 __complex_acos(__complex__ float __z)
1590 { return __builtin_cacosf(__z); }
1593 __complex_acos(__complex__ double __z)
1594 { return __builtin_cacos(__z); }
1597 __complex_acos(const __complex__ long double& __z)
1598 { return __builtin_cacosl(__z); }
1602 acos(const std::complex<_Tp>& __z)
1603 { return __complex_acos(__z.__rep()); }
1605 /// acos(__z) [8.1.2].
1610 acos(const std::complex<_Tp>& __z)
1611 { return __complex_acos(__z); }
1616 __complex_asin(const std::complex<_Tp>& __z)
1618 std::complex<_Tp> __t(-__z.imag(), __z.real());
1625 __complex_asin(__complex__ float __z)
1626 { return __builtin_casinf(__z); }
1629 __complex_asin(__complex__ double __z)
1630 { return __builtin_casin(__z); }
1633 __complex_asin(const __complex__ long double& __z)
1634 { return __builtin_casinl(__z); }
1638 asin(const std::complex<_Tp>& __z)
1639 { return __complex_asin(__z.__rep()); }
1641 /// asin(__z) [8.1.3].
1646 asin(const std::complex<_Tp>& __z)
1647 { return __complex_asin(__z); }
1652 __complex_atan(const std::complex<_Tp>& __z)
1654 const _Tp __r2 = __z.real() * __z.real();
1655 const _Tp __x = _Tp(1.0) - __r2 - __z.imag() * __z.imag();
1657 _Tp __num = __z.imag() + _Tp(1.0);
1658 _Tp __den = __z.imag() - _Tp(1.0);
1663 return std::complex<_Tp>(_Tp(0.5) * atan2(_Tp(2.0) * __z.real(), __x),
1669 __complex_atan(__complex__ float __z)
1670 { return __builtin_catanf(__z); }
1673 __complex_atan(__complex__ double __z)
1674 { return __builtin_catan(__z); }
1677 __complex_atan(const __complex__ long double& __z)
1678 { return __builtin_catanl(__z); }
1682 atan(const std::complex<_Tp>& __z)
1683 { return __complex_atan(__z.__rep()); }
1685 /// atan(__z) [8.1.4].
1690 atan(const std::complex<_Tp>& __z)
1691 { return __complex_atan(__z); }
1696 __complex_acosh(const std::complex<_Tp>& __z)
1699 return _Tp(2.0) * std::log(std::sqrt(_Tp(0.5) * (__z + _Tp(1.0)))
1700 + std::sqrt(_Tp(0.5) * (__z - _Tp(1.0))));
1705 __complex_acosh(__complex__ float __z)
1706 { return __builtin_cacoshf(__z); }
1709 __complex_acosh(__complex__ double __z)
1710 { return __builtin_cacosh(__z); }
1713 __complex_acosh(const __complex__ long double& __z)
1714 { return __builtin_cacoshl(__z); }
1718 acosh(const std::complex<_Tp>& __z)
1719 { return __complex_acosh(__z.__rep()); }
1721 /// acosh(__z) [8.1.5].
1726 acosh(const std::complex<_Tp>& __z)
1727 { return __complex_acosh(__z); }
1732 __complex_asinh(const std::complex<_Tp>& __z)
1734 std::complex<_Tp> __t((__z.real() - __z.imag())
1735 * (__z.real() + __z.imag()) + _Tp(1.0),
1736 _Tp(2.0) * __z.real() * __z.imag());
1739 return std::log(__t + __z);
1744 __complex_asinh(__complex__ float __z)
1745 { return __builtin_casinhf(__z); }
1748 __complex_asinh(__complex__ double __z)
1749 { return __builtin_casinh(__z); }
1752 __complex_asinh(const __complex__ long double& __z)
1753 { return __builtin_casinhl(__z); }
1757 asinh(const std::complex<_Tp>& __z)
1758 { return __complex_asinh(__z.__rep()); }
1760 /// asinh(__z) [8.1.6].
1765 asinh(const std::complex<_Tp>& __z)
1766 { return __complex_asinh(__z); }
1771 __complex_atanh(const std::complex<_Tp>& __z)
1773 const _Tp __i2 = __z.imag() * __z.imag();
1774 const _Tp __x = _Tp(1.0) - __i2 - __z.real() * __z.real();
1776 _Tp __num = _Tp(1.0) + __z.real();
1777 _Tp __den = _Tp(1.0) - __z.real();
1783 _Tp(0.5) * atan2(_Tp(2.0) * __z.imag(), __x));
1788 __complex_atanh(__complex__ float __z)
1789 { return __builtin_catanhf(__z); }
1792 __complex_atanh(__complex__ double __z)
1793 { return __builtin_catanh(__z); }
1796 __complex_atanh(const __complex__ long double& __z)
1797 { return __builtin_catanhl(__z); }
1801 atanh(const std::complex<_Tp>& __z)
1802 { return __complex_atanh(__z.__rep()); }
1804 /// atanh(__z) [8.1.7].
1809 atanh(const std::complex<_Tp>& __z)
1810 { return __complex_atanh(__z); }
1815 /// fabs(__z) [8.1.8].
1818 fabs(const std::complex<_Tp>& __z)
1819 { return std::abs(__z); }
1884 __complex_proj(const std::complex<_Tp>& __z)
1886 const _Tp __den = (__z.real() * __z.real()
1887 + __z.imag() * __z.imag() + _Tp(1.0));
1889 return std::complex<_Tp>((_Tp(2.0) * __z.real()) / __den,
1890 (_Tp(2.0) * __z.imag()) / __den);
1895 __complex_proj(__complex__ float __z)
1896 { return __builtin_cprojf(__z); }
1899 __complex_proj(__complex__ double __z)
1900 { return __builtin_cproj(__z); }
1903 __complex_proj(const __complex__ long double& __z)
1904 { return __builtin_cprojl(__z); }
1908 proj(const std::complex<_Tp>& __z)
1909 { return __complex_proj(__z.__rep()); }
1913 proj(const std::complex<_Tp>& __z)
1914 { return __complex_proj(__z); }