Пример #1
0
_STLP_DECLSPEC complex<double> _STLP_CALL tanh(const complex<double>& z) {
  double re2 = 2. * z._M_re;
  double im2 = 2. * z._M_im;  
  if (fabs(float(re2)) > double_limit)
    return complex<double>((re2 > 0 ? 1. : -1.), 0.);
  else {
    double den = _STLP_COSH(re2) + _STLP_COS(im2);
    return complex<double>(_STLP_SINH(re2) / den, _STLP_SIN(im2) / den);
  }
}
Пример #2
0
_STLP_EXP_DECLSPEC complex<double> _STLP_CALL tanh(const complex<double>& z) {
  double re2 = 2. * z._M_re;
  double im2 = 2. * z._M_im;  
 
#if defined(__LIBSTD_CPP_SYMBIAN32_WSD__) || defined(_STLP_LIBSTD_CPP_NO_STATIC_VAR_)
  if (fabs(float(re2)) > get_complex_trig_double_limit())
# else
  if (fabs(float(re2)) > double_limit)
# endif //__LIBSTD_CPP_SYMBIAN32_WSD__  
    return complex<double>((re2 > 0 ? 1. : -1.), 0.);
  else {
    double den = _STLP_COSH(re2) + _STLP_COS(im2);
    return complex<double>(_STLP_SINH(re2) / den, _STLP_SIN(im2) / den);
  }
}
Пример #3
0
_STLP_DECLSPEC complex<double> _STLP_CALL cos(const complex<double>& z) {
  return complex<double>(_STLP_COS(z._M_re) * _STLP_COSH(z._M_im),
                        -_STLP_SIN(z._M_re) * _STLP_SINH(z._M_im));
}