std::tanh(std::complex) - cppreference.com (original) (raw)

| | | | | -------------------------------------------------------------- | | ------------- | | template< class T > complex<T> tanh( const complex<T>& z ); | | (since C++11) |

Computes complex hyperbolic tangent of a complex value z.

Contents

[edit] Parameters

[edit] Return value

If no errors occur, complex hyperbolic tangent of z is returned.

[edit] Error handling and special values

Errors are reported consistent with math_errhandling.

If the implementation supports IEEE floating-point arithmetic,

  1. per C11 DR471, this only holds for non-zero x. If z is (0,∞), the result should be (0,NaN).
  2. per C11 DR471, this only holds for non-zero x. If z is (0,NaN), the result should be (0,NaN).

[edit] Notes

Mathematical definition of hyperbolic tangent is tanh z = .

Hyperbolic tangent is an analytical function on the complex plane and has no branch cuts. It is periodic with respect to the imaginary component, with period πi, and has poles of the first order along the imaginary line, at coordinates (0, π(1/2 + n)). However no common floating-point representation is able to represent π/2 exactly, thus there is no value of the argument for which a pole error occurs.

[edit] Example

Output:

tanh(1.000000,0.000000) = (0.761594,0.000000) (tanh(1) = 0.761594) tanh(0.000000,1.000000) = (0.000000,1.557408) ( tan(1) = 1.557408)

[edit] See also

sinh(std::complex) computes hyperbolic sine of a complex number (\({\small\sinh{z}}\)sinh(z)) (function template) [edit]
cosh(std::complex) computes hyperbolic cosine of a complex number (\({\small\cosh{z}}\)cosh(z)) (function template) [edit]
atanh(std::complex)(C++11) computes area hyperbolic tangent of a complex number (\({\small\operatorname{artanh}{z}}\)artanh(z)) (function template) [edit]
tanhtanhftanhl(C++11)(C++11) computes hyperbolic tangent (\({\small\tanh{x}}\)tanh(x)) (function) [edit]
tanh(std::valarray) applies the function std::tanh to each element of valarray (function template) [edit]
C documentation for ctanh