Rate This Document
Findability
Accuracy
Completeness
Readability

svml128_sincos_f?

Compute the sine and cosine of the input vector.

Interface Definition

C interface:

void svml128_sincos_f32(float32x4_t src, float32x4_t *sindst, float32x4_t *cosdst);

void svml128_sincos_f64(float64x2_t src, float64x2_t *sindst ,float64x2_t *cosdst);

Parameters

Parameter

Type

Description

Input/Output

src

  • For svml128_sincos_f32, src is of single-precision floating-point type.
  • For svml128_sincos_f64, src is of double-precision floating-point type.

Floating-point value of the input vector

Input

sindst

  • For svml128_sincos_f32, sindst is of single-precision floating-point type.
  • For svml128_sincos_f64, sindst is of double-precision floating-point type.

Floating-point value of the output vector

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

Output

cosdst

  • For svml128_sincos_f32, cosdst is of single-precision floating-point type.
  • For svml128_sincos_f64, cosdst is of double-precision floating-point type.

Floating-point value of the output vector

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

Output

Return Value

  • The sine sinx and cosine cosx of the radian angle x is returned for each operation value. sinx ∈ [-1, +1]; cosx ∈ [-1, +1]
  • If the input is +0, the sine is +0 and the cosine is +1.
  • If the input is -0, the sine is -0 and the cosine is +1.
  • If the input is ±∞, the sine and cosine are both NaN.
  • If the input is NaN, the sine and cosine are both NaN.

Dependencies

C: "ksvml.h"

Examples

C interface:

    float32x4_t src = {0.0f, 2.0f, INFINITY, NAN};
    float32x4_t dst = (float32x4_t*)malloc(4*sizeof(float32x4_t));
    float32x4_t dst2 = (float32x4_t*)malloc(4*sizeof(float32x4_t));
    vatan_neon_f32(src, dst, dst2);
    printf("%.15g  %.15g  %.15g  %.15g\n", dst[0], dst[1], dst[2], dst[3]); 
    printf("%.15g  %.15g  %.15g  %.15g\n", dst2[0], dst2[1], dst2[2], dst2[3]);
    /**
     *  Output dst:
     *     0  0.909297426825682  nan  -nan
     *     1  -0.416146836547142  nan  -nan
     *
     */