Vector Optimized Library of Kernels  3.0.0
Architecture-tuned implementations of math kernels

Overview

Computes the tangent of each element of the aVector.

b[i] = tan(a[i])

Dispatcher Prototype

void volk_32f_tan_32f(float* bVector, const float* aVector, unsigned int num_points)

Inputs

  • aVector: The buffer of points.
  • num_points: The number of values in input buffer.

Outputs

  • bVector: The output buffer.

Example Calculate tan(theta) for common angles.

int N = 10;
unsigned int alignment = volk_get_alignment();
float* in = (float*)volk_malloc(sizeof(float)*N, alignment);
float* out = (float*)volk_malloc(sizeof(float)*N, alignment);
in[0] = 0.000;
in[1] = 0.524;
in[2] = 0.785;
in[3] = 1.047;
in[4] = 1.571 ;
in[5] = 1.571 ;
in[6] = -1.047;
in[7] = -0.785;
in[8] = -0.524;
in[9] = -0.000;
volk_32f_tan_32f(out, in, N);
for(unsigned int ii = 0; ii < N; ++ii){
printf("tan(%1.3f) = %1.3f\n", in[ii], out[ii]);
}
volk_free(out);
size_t volk_get_alignment(void)
Get the machine alignment in bytes.
Definition: volk.tmpl.c:90
__VOLK_DECL_BEGIN VOLK_API void * volk_malloc(size_t size, size_t alignment)
Allocate size bytes of data aligned to alignment.
Definition: volk_malloc.c:38
VOLK_API void volk_free(void *aptr)
Free's memory allocated by volk_malloc.
Definition: volk_malloc.c:80