v?atan
Compute the arctangent of input vectors.
Interface Definition
C interface:
void vsatan(const int len, const float* src, float* dst);
void vdatan(const int len, const double* src, double* dst);
void vcatan(const int len, const float complex *src, float complex *dst);
void vzatan(const int len, const double complex *src, double complex *dst);
Fortran interface:
CALL VSATAN(LEN, SRC, DST);
CALL VDATAN(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
- Each operation value returns the arctangent y of the input x, that is, y = arctan(x). y ∈(-π/2, +π/2)
- For special values, see the following table.
Input Value (src)
Output Value (dst)
+0
+0
-0
-0
±inf
±π/2
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, 2.0f, INFINITY, NAN}; float* dst = (float*)malloc(sizeof(float) * len); if (dst == NULL) { printf("Malloc Failed!\n"); return 0; } vsatan(len, src, dst); /** * Output dst: * 0.0 1.107148766517639 1.570796370506287 nan * */ |
Fortran interface:
INTEGER :: LEN = 4
REAL(4) SRC(4)
REAL(4) DST(4)
DATA SRC /1, 2, 3, 4/
CALL VSATAN(LEN, SRC, DST)
!
! OUTPUT DST:
! 0.785398185, 1.10714877, 1.24904573, 1.32581770
!