v?atanh
Compute the inverse hyperbolic tangent of vector elements.
Interface Definition
C interface:
void vsatanh(const int len, const float* src, float* dst);
void vdatanh(const int len, const double* src, double* 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, the system displays a message indicating that the value of len is invalid. |
Input |
src |
|
Input vector src with length len. If the pointer is null, the system prompts a null pointer error. |
Input |
dst |
|
Output vector dst with length len. If the pointer is null, the system prompts a null pointer error. |
Output |
Return Value
- The inverse hyperbolic tangent y of the radiant angle x is returned for each operation value. x ∈ (-1, +1).
- If the input is +1, the return value is +∞.
- If you enter -1, -∞ is returned.
- If the input |x| is greater than 1, the return value is NaN.
- If the input is ±∞, the return value is NaN.
- If the input is NaN, the return value is NaN.
Dependencies
C: "kvml.h"
Fortran: "kvml.f03"
Examples
C interface:
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
!
Parent topic: Function Syntax