A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../algorithm/../numeric/complex/tanh.html below:

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

template< class T >
complex<T> tanh( const complex<T>& z );

(since C++11)

Computes complex hyperbolic tangent of a complex value z.

[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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4