Difference between revisions of "cpp/numeric/complex/asinh"
m (+link to acosh(std::complex), atanh(std::complex), asinh and C documentation, -2 links) |
Andreas Krug (Talk | contribs) m (fmt, headers sorted) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{cpp/title|asinh{{small|(std::complex)}}}} | {{cpp/title|asinh{{small|(std::complex)}}}} | ||
{{cpp/numeric/complex/navbar}} | {{cpp/numeric/complex/navbar}} | ||
− | {{ddcl | header=complex | since=c++11 | 1= | + | {{ddcl|header=complex|since=c++11|1= |
template< class T > | template< class T > | ||
complex<T> asinh( const complex<T>& z ); | complex<T> asinh( const complex<T>& z ); | ||
}} | }} | ||
− | Computes complex | + | Computes complex arc hyperbolic sine of a complex value {{c|z}} with branch cuts outside the interval {{math|[−i; +i]}} along the imaginary axis. |
===Parameters=== | ===Parameters=== | ||
{{par begin}} | {{par begin}} | ||
− | {{par | z | complex value}} | + | {{par|z|complex value}} |
{{par end}} | {{par end}} | ||
===Return value=== | ===Return value=== | ||
+ | If no errors occur, the complex arc hyperbolic sine of {{c|z}} is returned, in the range of a strip mathematically unbounded along the real axis and in the interval {{math|[−iπ/2; +iπ/2]}} along the imaginary axis. | ||
− | + | ===Error handling and special values=== | |
+ | Errors are reported consistent with {{lc|math_errhandling}}. | ||
+ | |||
+ | If the implementation supports IEEE floating-point arithmetic, | ||
+ | * {{c|std::asinh(std::conj(z)) {{==}} std::conj(std::asinh(z))}} | ||
+ | * {{c|std::asinh(-z) {{==}} -std::asinh(z)}} | ||
+ | * If {{c|z}} is {{tt|(+0,+0)}}, the result is {{tt|(+0,+0)}} | ||
+ | * If {{c|z}} is {{tt|(x,+∞)}} (for any positive finite x), the result is {{tt|(+∞,π/2)}} | ||
+ | * If {{c|z}} is {{tt|(x,NaN)}} (for any finite x), the result is {{tt|(NaN,NaN)}} and {{lc|FE_INVALID}} may be raised | ||
+ | * If {{c|z}} is {{tt|(+∞,y)}} (for any positive finite y), the result is {{tt|(+∞,+0)}} | ||
+ | * If {{c|z}} is {{tt|(+∞,+∞)}}, the result is {{tt|(+∞,π/4)}} | ||
+ | * If {{c|z}} is {{tt|(+∞,NaN)}}, the result is {{tt|(+∞,NaN)}} | ||
+ | * If {{c|z}} is {{tt|(NaN,+0)}}, the result is {{tt|(NaN,+0)}} | ||
+ | * If {{c|z}} is {{tt|(NaN,y)}} (for any finite nonzero y), the result is {{tt|(NaN,NaN)}} and {{lc|FE_INVALID}} may be raised | ||
+ | * If {{c|z}} is {{tt|(NaN,+∞)}}, the result is {{tt|(±∞,NaN)}} (the sign of the real part is unspecified) | ||
+ | * If {{c|z}} is {{tt|(NaN,NaN)}}, the result is {{tt|(NaN,NaN)}} | ||
+ | |||
+ | ===Notes=== | ||
+ | Although the C++ standard names this function "complex arc hyperbolic sine", the inverse functions of the hyperbolic functions are the area functions. Their argument is the area of a hyperbolic sector, not an arc. The correct name is "complex inverse hyperbolic sine", and, less common, "complex area hyperbolic sine". | ||
+ | |||
+ | Inverse hyperbolic sine is a multivalued function and requires a branch cut on the complex plane. The branch cut is conventionally placed at the line segments {{math|(-''i''∞,-''i'')}} and {{math|(''i'',''i''∞)}} of the imaginary axis. | ||
+ | |||
+ | The mathematical definition of the principal value of the inverse hyperbolic sine is {{math|asinh z {{=}} ln(z + {{mrad|1+z{{su|p=2}}}})}}. | ||
+ | |||
+ | For any {{c|z}}, {{math|asinh(z) {{=}} {{mfrac|asin(iz)|i}}}}. | ||
+ | |||
+ | ===Example=== | ||
+ | {{example| | ||
+ | |code= | ||
+ | #include <complex> | ||
+ | #include <iostream> | ||
+ | |||
+ | int main() | ||
+ | { | ||
+ | std::cout << std::fixed; | ||
+ | std::complex<double> z1(0.0, -2.0); | ||
+ | std::cout << "asinh" << z1 << " = " << std::asinh(z1) << '\n'; | ||
+ | |||
+ | std::complex<double> z2(-0.0, -2); | ||
+ | std::cout << "asinh" << z2 << " (the other side of the cut) = " | ||
+ | << std::asinh(z2) << '\n'; | ||
+ | |||
+ | // for any z, asinh(z) = asin(iz) / i | ||
+ | std::complex<double> z3(1.0, 2.0); | ||
+ | std::complex<double> i(0.0, 1.0); | ||
+ | std::cout << "asinh" << z3 << " = " << std::asinh(z3) << '\n' | ||
+ | << "asin" << z3 * i << " / i = " << std::asin(z3 * i) / i << '\n'; | ||
+ | } | ||
+ | |output= | ||
+ | asinh(0.000000,-2.000000) = (1.316958,-1.570796) | ||
+ | asinh(-0.000000,-2.000000) (the other side of the cut) = (-1.316958,-1.570796) | ||
+ | asinh(1.000000,2.000000) = (1.469352,1.063440) | ||
+ | asin(-2.000000,1.000000) / i = (1.469352,1.063440) | ||
+ | }} | ||
===See also=== | ===See also=== | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc inc | cpp/numeric/complex/dsc acosh}} | + | {{dsc inc|cpp/numeric/complex/dsc acosh}} |
− | {{dsc inc | cpp/numeric/complex/dsc atanh}} | + | {{dsc inc|cpp/numeric/complex/dsc atanh}} |
− | {{dsc inc | cpp/numeric/complex/dsc sinh}} | + | {{dsc inc|cpp/numeric/complex/dsc sinh}} |
− | {{dsc inc | cpp/numeric/math/dsc asinh}} | + | {{dsc inc|cpp/numeric/math/dsc asinh}} |
− | {{dsc see c | c/numeric/complex/casinh}} | + | {{dsc see c|c/numeric/complex/casinh}} |
{{dsc end}} | {{dsc end}} | ||
− | + | {{langlinks|de|es|fr|it|ja|pt|ru|zh}} | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + |
Latest revision as of 09:03, 21 April 2023
Defined in header <complex>
|
||
template< class T > complex<T> asinh( const complex<T>& z ); |
(since C++11) | |
Computes complex arc hyperbolic sine of a complex value z with branch cuts outside the interval [−i; +i] along the imaginary axis.
Contents |
[edit] Parameters
z | - | complex value |
[edit] Return value
If no errors occur, the complex arc hyperbolic sine of z is returned, in the range of a strip mathematically unbounded along the real axis and in the interval [−iπ/2; +iπ/2] along the imaginary axis.
[edit] Error handling and special values
Errors are reported consistent with math_errhandling.
If the implementation supports IEEE floating-point arithmetic,
- std::asinh(std::conj(z)) == std::conj(std::asinh(z))
- std::asinh(-z) == -std::asinh(z)
- If z is
(+0,+0)
, the result is(+0,+0)
- If z is
(x,+∞)
(for any positive finite x), the result is(+∞,π/2)
- If z is
(x,NaN)
(for any finite x), the result is(NaN,NaN)
and FE_INVALID may be raised - If z is
(+∞,y)
(for any positive finite y), the result is(+∞,+0)
- If z is
(+∞,+∞)
, the result is(+∞,π/4)
- If z is
(+∞,NaN)
, the result is(+∞,NaN)
- If z is
(NaN,+0)
, the result is(NaN,+0)
- If z is
(NaN,y)
(for any finite nonzero y), the result is(NaN,NaN)
and FE_INVALID may be raised - If z is
(NaN,+∞)
, the result is(±∞,NaN)
(the sign of the real part is unspecified) - If z is
(NaN,NaN)
, the result is(NaN,NaN)
[edit] Notes
Although the C++ standard names this function "complex arc hyperbolic sine", the inverse functions of the hyperbolic functions are the area functions. Their argument is the area of a hyperbolic sector, not an arc. The correct name is "complex inverse hyperbolic sine", and, less common, "complex area hyperbolic sine".
Inverse hyperbolic sine is a multivalued function and requires a branch cut on the complex plane. The branch cut is conventionally placed at the line segments (-i∞,-i) and (i,i∞) of the imaginary axis.
The mathematical definition of the principal value of the inverse hyperbolic sine is asinh z = ln(z + √1+z2).
For any z, asinh(z) =asin(iz) |
i |
[edit] Example
#include <complex> #include <iostream> int main() { std::cout << std::fixed; std::complex<double> z1(0.0, -2.0); std::cout << "asinh" << z1 << " = " << std::asinh(z1) << '\n'; std::complex<double> z2(-0.0, -2); std::cout << "asinh" << z2 << " (the other side of the cut) = " << std::asinh(z2) << '\n'; // for any z, asinh(z) = asin(iz) / i std::complex<double> z3(1.0, 2.0); std::complex<double> i(0.0, 1.0); std::cout << "asinh" << z3 << " = " << std::asinh(z3) << '\n' << "asin" << z3 * i << " / i = " << std::asin(z3 * i) / i << '\n'; }
Output:
asinh(0.000000,-2.000000) = (1.316958,-1.570796) asinh(-0.000000,-2.000000) (the other side of the cut) = (-1.316958,-1.570796) asinh(1.000000,2.000000) = (1.469352,1.063440) asin(-2.000000,1.000000) / i = (1.469352,1.063440)
[edit] See also
(C++11) |
computes area hyperbolic cosine of a complex number (arcosh(z)) (function template) |
(C++11) |
computes area hyperbolic tangent of a complex number (artanh(z)) (function template) |
computes hyperbolic sine of a complex number (sinh(z)) (function template) | |
(C++11)(C++11)(C++11) |
computes the inverse hyperbolic sine (arsinh(x)) (function) |
C documentation for casinh
|