v?atanh
计算输入弧度的双曲反正切值,输入为向量。
接口定义
C interface:
void vsatanh(const int len, const float* src, float* dst);
void vdatanh(const int len, const double* src, double* dst);
void vcatanh(const int len, const float complex *src, float complex *dst);
void vzatanh(const int len, const double complex *src, double complex *dst);
Fortran interface:
CALL VSATANH(LEN, SRC, DST);
CALL VDATANH(LEN, SRC, DST);
参数
| 参数名 | 类型 | 描述 | 输入/输出 | 
|---|---|---|---|
| len | 整型数 | 表示输入向量的元素个数。 len≤0时会提示len无效并返回。 | 输入 | 
| src | 
 | 输入向量src,向量长度为len。 若为空指针,会提示空指针错误并返回。 | 输入 | 
| dst | 
 | 输出dst,向量长度为len。 若为空指针,会提示空指针错误并返回。 | 输出 | 
输出结果
- 每个运算值返回弧度角x的双曲反正切函数值y=atanh(x),x ∈ (-1, +1)。
- 其他特殊值参考如下说明。
输入弧度(src) 输出双曲反正切值(dst) +1 +inf -1 -inf |x| > 1 nan +inf nan -inf nan nan nan 
依赖
C: "kvml.h"
示例
C interface:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | int i, len = 4; float src[len] = {0.0f, 0.2f, inf, nan}; float* dst = (float*)malloc(sizeof(float) * len); if (dst == NULL) { printf("Malloc Failed!\n"); return 0; } vsatanh(len, src, dst); /** * Output dst: * 0.0 0.202732554 nan nan * */ | 
Fortran interface:
    INTEGER :: LEN = 4 
    REAL(4) SRC(4)  
    REAL(4) DST(4) 
    DATA SRC /0.1, 0.2, 0.3, 0.4/ 
    CALL VSATANH(LEN, SRC, DST) 
    !  
    ! OUTPUT DST: 
    !     0.100335348, 0.202732554, 0.309519604, 0.423648930
    !
父主题: 函数定义