1#ifndef CODEC2_MOD_UTIL_H
2#define CODEC2_MOD_UTIL_H
11#if defined(HAVE_SINCOSF)
12#define codec2_sincosf(x, s, c) sincosf((x), (s), (c))
29 *prng_state = *prng_state * 1103515245U + 12345U;
30 return ((
unsigned)(*prng_state >> 16) & 0x7FFF);
37 union {
float f; uint32_t u; } v = {x};
40 float e = (float)((
int)(v.u >> 23) - 127);
41 v.u = (v.u & 0x007FFFFFu) | 0x3F800000u;
43 float l2 = e + m * (1.441879776f + m * (-0.708863876f + m * (0.4152409602f + m * (-0.193510391f + m * 0.04526550458f))));
49 float p = 0.999999896f + f * (0.6931546159f + f * (0.2401407868f + f * (0.05586325839f + f * (0.008946224944f + f * 0.001895108641f))));
51 v.u += (uint32_t)((int32_t)fl << 23);
static float fast_powf_pos(float x, float y)
Definition util.h:35
float fast_acosf(float x)
static int ceilf_fast(float x)
Definition util.h:21
float fast_atan2f(float y, float x)
static void codec2_sincosf(float x, float *s, float *c)
Definition util.h:14
static int codec2_rand(uint32_t *prng_state)
Definition util.h:27