v?atanh
Compute the hyperbolic arctangent of the input radian, which is a vector.
Interface Definition
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);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
len |
Integer |
Number of elements in the input vector. If len ≤ 0, an invalid parameter error is reported and the function returns. |
Input |
src |
|
Input vector src with length len. If the pointer is null, a null pointer error is reported and the function returns. |
Input |
dst |
|
Output vector dst with length len. If the pointer is null, a null pointer error is reported and the function returns. |
Output |
Return Value
- The hyperbolic arctangent y of radian angle x is returned for each operation value, that is, y = atanh(x). x ∈ (-1, +1)
- For special values, see the following table.
Input Radian (src)
Output Hyperbolic Arctangent (dst)
+1
+inf
-1
-inf
|x| > 1
nan
+inf
nan
-inf
nan
nan
nan
Dependencies
C: "kvml.h"
Examples
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, INFINITY, 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
!