ReactOS 0.4.15-dev-8109-gd7be748
complex_trig.cpp File Reference
#include "stlport_prefix.h"
#include <complex>
#include <cfloat>
#include <cmath>
Include dependency graph for complex_trig.cpp:

Go to the source code of this file.

Functions

template<class _Tp >
static complex< _Tp > sinT (const complex< _Tp > &z)
 
_STLP_DECLSPEC complex< float > _STLP_CALL sin (const complex< float > &z)
 
_STLP_DECLSPEC complex< double > _STLP_CALL sin (const complex< double > &z)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL sin (const complex< long double > &z)
 
template<class _Tp >
static complex< _Tp > cosT (const complex< _Tp > &z)
 
_STLP_DECLSPEC complex< float > _STLP_CALL cos (const complex< float > &z)
 
_STLP_DECLSPEC complex< double > _STLP_CALL cos (const complex< double > &z)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL cos (const complex< long double > &z)
 
template<class _Tp >
static complex< _Tp > tanT (const complex< _Tp > &z, const _Tp &Tp_limit)
 
_STLP_DECLSPEC complex< float > _STLP_CALL tan (const complex< float > &z)
 
_STLP_DECLSPEC complex< double > _STLP_CALL tan (const complex< double > &z)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL tan (const complex< long double > &z)
 
template<class _Tp >
static complex< _Tp > sinhT (const complex< _Tp > &z)
 
_STLP_DECLSPEC complex< float > _STLP_CALL sinh (const complex< float > &z)
 
_STLP_DECLSPEC complex< double > _STLP_CALL sinh (const complex< double > &z)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL sinh (const complex< long double > &z)
 
template<class _Tp >
static complex< _Tp > coshT (const complex< _Tp > &z)
 
_STLP_DECLSPEC complex< float > _STLP_CALL cosh (const complex< float > &z)
 
_STLP_DECLSPEC complex< double > _STLP_CALL cosh (const complex< double > &z)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL cosh (const complex< long double > &z)
 
template<class _Tp >
static complex< _Tp > tanhT (const complex< _Tp > &z, const _Tp &Tp_limit)
 
_STLP_DECLSPEC complex< float > _STLP_CALL tanh (const complex< float > &z)
 
_STLP_DECLSPEC complex< double > _STLP_CALL tanh (const complex< double > &z)
 
_STLP_DECLSPEC complex< long double > _STLP_CALL tanh (const complex< long double > &z)
 

Variables

static _STLP_BEGIN_NAMESPACE const float float_limit = ::log(FLT_MAX)
 
static const double double_limit = ::log(DBL_MAX)
 
static const long double ldouble_limit = ::log(LDBL_MAX)
 

Function Documentation

◆ cos() [1/3]

Definition at line 95 of file complex_trig.cpp.

96{ return cosT(z); }
static complex< _Tp > cosT(const complex< _Tp > &z)
GLdouble GLdouble z
Definition: glext.h:5874

◆ cos() [2/3]

◆ cos() [3/3]

Definition at line 99 of file complex_trig.cpp.

100{ return cosT(z); }

◆ cosh() [1/3]

Definition at line 159 of file complex_trig.cpp.

160{ return coshT(z); }
static complex< _Tp > coshT(const complex< _Tp > &z)

◆ cosh() [2/3]

◆ cosh() [3/3]

Definition at line 163 of file complex_trig.cpp.

164{ return coshT(z); }

◆ coshT()

template<class _Tp >
static complex< _Tp > coshT ( const complex< _Tp > &  z)
static

Definition at line 151 of file complex_trig.cpp.

151 {
152 return complex<_Tp>(::cosh(z._M_re) * ::cos(z._M_im),
153 ::sinh(z._M_re) * ::sin(z._M_im));
154}
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &z)
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &z)
_STLP_DECLSPEC complex< float > _STLP_CALL cosh(const complex< float > &z)
_STLP_DECLSPEC complex< float > _STLP_CALL sinh(const complex< float > &z)

Referenced by cosh().

◆ cosT()

template<class _Tp >
static complex< _Tp > cosT ( const complex< _Tp > &  z)
static

Definition at line 87 of file complex_trig.cpp.

87 {
88 return complex<_Tp>(::cos(z._M_re) * ::cosh(z._M_im),
89 -::sin(z._M_re) * ::sinh(z._M_im));
90}

Referenced by cos().

◆ sin() [1/3]

Definition at line 76 of file complex_trig.cpp.

77{ return sinT(z); }
static complex< _Tp > sinT(const complex< _Tp > &z)

◆ sin() [2/3]

◆ sin() [3/3]

Definition at line 80 of file complex_trig.cpp.

81{ return sinT(z); }

◆ sinh() [1/3]

Definition at line 140 of file complex_trig.cpp.

141{ return sinhT(z); }
static complex< _Tp > sinhT(const complex< _Tp > &z)

◆ sinh() [2/3]

◆ sinh() [3/3]

Definition at line 144 of file complex_trig.cpp.

145{ return sinhT(z); }

◆ sinhT()

template<class _Tp >
static complex< _Tp > sinhT ( const complex< _Tp > &  z)
static

Definition at line 132 of file complex_trig.cpp.

132 {
133 return complex<_Tp>(::sinh(z._M_re) * ::cos(z._M_im),
134 ::cosh(z._M_re) * ::sin(z._M_im));
135}

Referenced by sinh().

◆ sinT()

template<class _Tp >
static complex< _Tp > sinT ( const complex< _Tp > &  z)
static

Definition at line 68 of file complex_trig.cpp.

68 {
69 return complex<_Tp>(::sin(z._M_re) * ::cosh(z._M_im),
70 ::cos(z._M_re) * ::sinh(z._M_im));
71}

Referenced by sin().

◆ tan() [1/3]

Definition at line 121 of file complex_trig.cpp.

122{ return tanT(z, double_limit); }
static complex< _Tp > tanT(const complex< _Tp > &z, const _Tp &Tp_limit)
static const double double_limit

◆ tan() [2/3]

◆ tan() [3/3]

Definition at line 125 of file complex_trig.cpp.

126{ return tanT(z, ldouble_limit); }
static const long double ldouble_limit

◆ tanh() [1/3]

Definition at line 184 of file complex_trig.cpp.

185{ return tanhT(z, double_limit); }
static complex< _Tp > tanhT(const complex< _Tp > &z, const _Tp &Tp_limit)

◆ tanh() [2/3]

Definition at line 181 of file complex_trig.cpp.

182{ return tanhT(z, float_limit); }

Referenced by _CItanh(), rpn_tanh(), tanhf(), and ValarrayTest::transcendentals().

◆ tanh() [3/3]

Definition at line 188 of file complex_trig.cpp.

189{ return tanhT(z, ldouble_limit); }

◆ tanhT()

template<class _Tp >
static complex< _Tp > tanhT ( const complex< _Tp > &  z,
const _Tp &  Tp_limit 
)
static

Definition at line 170 of file complex_trig.cpp.

170 {
171 _Tp re2 = 2.f * z._M_re;
172 _Tp im2 = 2.f * z._M_im;
173 if (::abs(re2) > Tp_limit)
174 return complex<_Tp>((re2 > 0 ? 1.f : -1.f), 0.f);
175 else {
176 _Tp den = ::cosh(re2) + ::cos(im2);
177 return complex<_Tp>(::sinh(re2) / den, ::sin(im2) / den);
178 }
179}
#define abs(i)
Definition: fconv.c:206

Referenced by tanh().

◆ tanT()

template<class _Tp >
static complex< _Tp > tanT ( const complex< _Tp > &  z,
const _Tp &  Tp_limit 
)
static

Definition at line 106 of file complex_trig.cpp.

106 {
107 _Tp re2 = 2.f * z._M_re;
108 _Tp im2 = 2.f * z._M_im;
109
110 if (::abs(im2) > Tp_limit)
111 return complex<_Tp>(0.f, (im2 > 0 ? 1.f : -1.f));
112 else {
113 _Tp den = ::cos(re2) + ::cosh(im2);
114 return complex<_Tp>(::sin(re2) / den, ::sinh(im2) / den);
115 }
116}

Referenced by tan().

Variable Documentation

◆ double_limit

const double double_limit = ::log(DBL_MAX)
static

Definition at line 53 of file complex_trig.cpp.

Referenced by tan(), and tanh().

◆ float_limit

Definition at line 52 of file complex_trig.cpp.

Referenced by tan(), and tanh().

◆ ldouble_limit

const long double ldouble_limit = ::log(LDBL_MAX)
static

Definition at line 59 of file complex_trig.cpp.

Referenced by tan(), and tanh().