C
数值 | Numerics

catanh

catanhf, catanh, catanhl

在头文件中定义
float complex catanhf( float complex z (1)(since C99)
double complex catanh( double complex z (2)(since C99)
long double complex catanhl( long double complex z (3)(since C99)
Defined in header <tgmath.h>
#define atanh( z )(4)(since C99)

1-3)计算z区间-1以外的分支切口的复数双曲正切; +1沿实轴。

4)类型 - 通用宏:如果z有类型long double complexcatanhl被调用。如果z有类型double complexcatanh称为,如果z有类型float complexcatanhf称为。如果z是真实的或整数,则宏调用相应的实函数(atanhfatanhatanhl)。如果z是虚构的,那么宏调用相应的真实版本atan,实现公式atanh(iy)= i atan(y),并且返回类型是虚构的。

参数

z-复杂的论点

返回值

如果没有出现错误,z则返回复数圆弧双曲正切值,该值在半径数值范围内沿着实轴且在区间-iπ/ 2中是数学上无界的; +iπ/ 2沿着虚轴。

错误处理和特殊值

报告的错误与math_errhandling一致。

如果实现支持IEEE浮点运算,

  • catanh(conj(z)) == conj(catanh(z))

笔记

尽管C标准将这个函数命名为“复圆弧双曲正切”,但双曲函数的反函数是区域函数。他们的论点是双曲线领域,而不是弧线。正确的名称是“复反双曲正切”,并且不太常见的是“复曲面双曲正切”。

逆双曲正切是一种多值函数,需要在复平面上进行分支切割。分支切割通常放置在实轴的线段(-∞,-1)和[+ 1,+∞)处。反双曲正弦的主值的数学定义是atanh z =

| ln(1+z)-ln(z-1) |

|:----|

| 2 |

.

For any z, atanh(z) =

| atan(iz) |

|:----|

| i |

#include <stdio.h> #include <complex.h> int main(void) { double complex z = catanh(2 printf("catanh(+2+0i) = %f%+fi\n", creal(z), cimag(z) double complex z2 = catanh(conj(2) // or catanh(CMPLX(2, -0.0)) in C11 printf("catanh(+2-0i) (the other side of the cut) = %f%+fi\n", creal(z2), cimag(z2) // for any z, atanh(z) = atan(iz)/i double complex z3 = catanh(1+2*I printf("catanh(1+2i) = %f%+fi\n", creal(z3), cimag(z3) double complex z4 = catan((1+2*I)*I)/I; printf("catan(i * (1+2i))/i = %f%+fi\n", creal(z4), cimag(z4) }

输出:

catanh(+2+0i) = 0.549306+1.570796i catanh(+2-0i) (the other side of the cut) = 0.549306-1.570796i catanh(1+2i) = 0.173287+1.178097i catan(i * (1+2i))/i = 0.173287+1.178097i

参考

  • C11标准(ISO / IEC 9899:2011):