我要评分
获取效率
正确性
完整性
易理解

v?asin

Interface Definition

C interface:

void vsasin(const int len, const float* src, float* dst);

void vdasin(const int len, const double* src, double* dst);

void vcasin(const int len, const float complex *src, float complex *dst);

void vzasin(const int len, const double complex *src, double complex *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

  • Single-precision floating-point type for vsasin
  • Double-precision floating-point type for vdasin
  • Single-precision floating-point complex type for vcasin
  • Double-precision floating-point complex type for vzasin

Input vector src with length len.

If the pointer is null, the system prompts a null pointer error.

Input

dst

  • Single-precision floating-point type for vsasin
  • Double-precision floating-point type for vdasin
  • Single-precision floating-point complex type for vcasin
  • Double-precision floating-point complex type for vzasin

Output vector dst with length len.

If the pointer is null, the system prompts a null pointer error.

Output

Return Value

  • The arcsine y of sine x is returned. y ∈ [-1, +1]
  • For vsasin and vdasin, the special values are listed in the following table.

    Input Value (src)

    Output Value (dst)

    +0

    +0

    -0

    -0

    ±1

    ±π/2

    ±inf

    nan

    nan

    nan

    |x|>1

    nan

  • For vcasin and vzasin, the special values are listed in the following table.

    Real Part of the Input (x.real)

    Imaginary Part of the Input (x.imag)

    Real Part of the Output (y.real)

    Imaginary Part of the Output (y.imag)

    0

    0

    0

    0

    0

    0

    0

    0

    0

    inf

    0

    inf

    0

    -inf

    0

    -inf

    0

    snan

    0

    nan

    0

    -snan

    0

    nan

    0

    qnan

    0

    nan

    0

    -qnan

    0

    nan

    0

    0

    0

    0

    0

    0

    0

    0

    0

    inf

    0

    inf

    0

    -inf

    0

    -inf

    0

    snan

    0

    nan

    0

    -snan

    0

    nan

    0

    qnan

    0

    nan

    0

    -qnan

    0

    nan

    inf

    0

    π/2

    inf

    inf

    0

    π/2

    -inf

    inf

    inf

    π/4

    inf

    inf

    -inf

    π/4

    -inf

    inf

    snan

    nan

    inf

    inf

    -snan

    nan

    inf

    inf

    qnan

    nan

    inf

    inf

    -qnan

    nan

    inf

    -inf

    0

    –π/2

    inf

    -inf

    0

    –π/2

    -inf

    -inf

    inf

    –π/4

    inf

    -inf

    -inf

    –π/4

    -inf

    -inf

    snan

    nan

    inf

    -inf

    -snan

    nan

    inf

    -inf

    qnan

    nan

    inf

    -inf

    -qnan

    nan

    inf

    snan

    0

    nan

    nan

    snan

    0

    nan

    nan

    snan

    inf

    nan

    inf

    snan

    -inf

    nan

    -inf

    snan

    snan

    nan

    nan

    snan

    -snan

    nan

    nan

    snan

    qnan

    nan

    nan

    snan

    -qnan

    nan

    nan

    -snan

    0

    nan

    nan

    -snan

    0

    nan

    nan

    -snan

    inf

    nan

    inf

    -snan

    -inf

    nan

    -inf

    -snan

    snan

    nan

    nan

    -snan

    -snan

    nan

    nan

    -snan

    qnan

    nan

    nan

    -snan

    -qnan

    nan

    nan

    qnan

    0

    nan

    nan

    qnan

    0

    nan

    nan

    qnan

    inf

    nan

    inf

    qnan

    -inf

    nan

    -inf

    qnan

    snan

    nan

    nan

    qnan

    -snan

    nan

    nan

    qnan

    qnan

    nan

    nan

    qnan

    -qnan

    nan

    nan

    -qnan

    0

    nan

    nan

    -qnan

    0

    nan

    nan

    -qnan

    inf

    nan

    inf

    -qnan

    -inf

    nan

    -inf

    -qnan

    snan

    nan

    nan

    -qnan

    -snan

    nan

    nan

    -qnan

    qnan

    nan

    nan

    -qnan

    -qnan

    nan

    nan

Dependency

C: "kvml.h"

Example

C interface:

    int i, len = 4; 
    float src[4] = {0.0f, 2.0f, INFINITY, NAN}; 
    float* dst = (float*)malloc(sizeof(float) * len); 
    if (dst == NULL) { 
        printf("Malloc Failed!\n"); 
        return 0; 
    } 
    vsasin(len, src, dst);

    /** 
     *  Output dst: 
     *     0.000000 nan nan nan
     */