Skip to content
fn

vcos_f32

void vcos_f32(const float * in, float * out, int n)

Single-precision elementwise cosine.

Computes outi=cos⁡(ini)\text{out}_i = \cos(\text{in}_i) via vvcosf, with ∣x∣≤2−12|x| \le 2^{-12} set to 1. Near other multiples of π\pi the result can be 1-2 ulp short of ±1\pm 1.

References

Accelerate.framework vvcosf.

Parameters

inconst float*
Input buffer (radians).
outfloat*
Output buffer.
nstd::size_t
Element count.