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 |
|
Floating-point value of the input vector. |
Input |
sindst |
|
Floating-point value of the output vector. If the pointer is null, a null pointer error is reported and the function returns. |
Output |
cosdst |
|
Floating-point value of the output vector. If the pointer is null, a null pointer error is reported and the function returns. |
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.
Dependency
C: "ksvml.h"
Example
C interface:
1 2 3 4 5 6 7 8 9 10 11 12 | 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 * */ |
Parent topic: Function Syntax