removing precision suffixes from bw_math functions (now all is broken)

This commit is contained in:
Stefano D'Angelo 2023-08-10 08:00:44 +02:00
parent ffe1db7749
commit 08c8656259
17 changed files with 366 additions and 365 deletions

View File

@ -164,7 +164,7 @@ static inline void bw_bd_reduce_reset_coeffs(bw_bd_reduce_coeffs *BW_RESTRICT co
static inline void bw_bd_reduce_update_coeffs_ctrl(bw_bd_reduce_coeffs *BW_RESTRICT coeffs) {
if (coeffs->bit_depth_prev != coeffs->bit_depth) {
coeffs->k = bw_pow2f_3(coeffs->bit_depth - 1);
coeffs->ki = bw_rcpf_2(coeffs->k);
coeffs->ki = bw_rcpf(coeffs->k);
coeffs->max = 1.f - 0.5f * coeffs->ki;
coeffs->bit_depth_prev = coeffs->bit_depth;
}

View File

@ -225,7 +225,7 @@ static inline void _bw_clip_do_update_coeffs(bw_clip_coeffs *BW_RESTRICT coeffs,
float gain_cur = bw_one_pole_get_y_z1(&coeffs->smooth_gain_state);
if (force || coeffs->gain != gain_cur) {
gain_cur = bw_one_pole_process1_sticky_rel(&coeffs->smooth_coeffs, &coeffs->smooth_gain_state, coeffs->gain);
coeffs->inv_gain = bw_rcpf_2(gain_cur);
coeffs->inv_gain = bw_rcpf(gain_cur);
}
}

View File

@ -275,7 +275,7 @@ static inline void bw_comp_update_coeffs_audio(bw_comp_coeffs *BW_RESTRICT coeff
static inline float bw_comp_process1(const bw_comp_coeffs *BW_RESTRICT coeffs, bw_comp_state *BW_RESTRICT state, float x, float x_sc) {
const float env = bw_env_follow_process1(&coeffs->env_follow_coeffs, &state->env_follow_state, x_sc);
const float thresh = bw_one_pole_get_y_z1(&coeffs->smooth_thresh_state);
const float y = env > thresh ? bw_pow2f_3(coeffs->kc * bw_log2f_3(thresh * bw_rcpf_2(env))) * x : x;
const float y = env > thresh ? bw_pow2f_3(coeffs->kc * bw_log2f_3(thresh * bw_rcpf(env))) * x : x;
return bw_gain_process1(&coeffs->gain_coeffs, y);
}

View File

@ -315,11 +315,11 @@ static inline void bw_env_gen_update_coeffs_ctrl(bw_env_gen_coeffs *BW_RESTRICT
if (coeffs->param_changed) {
// 1 ns considered instantaneous
if (coeffs->param_changed & _BW_ENV_GEN_PARAM_ATTACK)
coeffs->attack_inc = coeffs->attack > 1e-9f ? coeffs->T * bw_rcpf_2(coeffs->attack) : INFINITY;
coeffs->attack_inc = coeffs->attack > 1e-9f ? coeffs->T * bw_rcpf(coeffs->attack) : INFINITY;
if (coeffs->param_changed & (_BW_ENV_GEN_PARAM_DECAY | _BW_ENV_GEN_PARAM_SUSTAIN))
coeffs->decay_inc = coeffs->decay > 1e-9f ? (coeffs->sustain - 1.f) * coeffs->T * bw_rcpf_2(coeffs->decay) : -INFINITY;
coeffs->decay_inc = coeffs->decay > 1e-9f ? (coeffs->sustain - 1.f) * coeffs->T * bw_rcpf(coeffs->decay) : -INFINITY;
if (coeffs->param_changed & (_BW_ENV_GEN_PARAM_SUSTAIN | _BW_ENV_GEN_PARAM_RELEASE))
coeffs->release_inc = coeffs->release > 1e-9f ? -coeffs->sustain * coeffs->T * bw_rcpf_2(coeffs->release) : -INFINITY;
coeffs->release_inc = coeffs->release > 1e-9f ? -coeffs->sustain * coeffs->T * bw_rcpf(coeffs->release) : -INFINITY;
}
}

View File

@ -235,9 +235,9 @@ static inline void _bw_lp1_do_update_coeffs(bw_lp1_coeffs *BW_RESTRICT coeffs, c
}
if (cutoff_changed) {
cutoff_cur = bw_one_pole_process1_sticky_rel(&coeffs->smooth_coeffs, &coeffs->smooth_cutoff_state, coeffs->cutoff);
coeffs->y_X = bw_rcpf_2(cutoff_cur);
coeffs->y_X = bw_rcpf(cutoff_cur);
}
const float k = cutoff_cur * bw_rcpf_2(cutoff_cur * coeffs->t + prewarp_freq_cur);
const float k = cutoff_cur * bw_rcpf(cutoff_cur * coeffs->t + prewarp_freq_cur);
coeffs->X_x = k * prewarp_freq_cur;
coeffs->X_X_z1 = k * coeffs->t;
}

View File

@ -205,7 +205,7 @@ static inline void bw_ls1_set_sample_rate(bw_ls1_coeffs *BW_RESTRICT coeffs, flo
static inline void _bw_ls1_update_mm1_params(bw_ls1_coeffs *BW_RESTRICT coeffs) {
if (coeffs->update) {
bw_mm1_set_cutoff(&coeffs->mm1_coeffs, coeffs->cutoff * bw_rcpf_2(bw_sqrtf_2(coeffs->dc_gain)));
bw_mm1_set_cutoff(&coeffs->mm1_coeffs, coeffs->cutoff * bw_rcpf(bw_sqrtf_2(coeffs->dc_gain)));
bw_mm1_set_coeff_lp(&coeffs->mm1_coeffs, coeffs->dc_gain - 1.f);
bw_mm1_set_prewarp_freq(&coeffs->mm1_coeffs, coeffs->cutoff);
coeffs->update = 0;

View File

@ -222,7 +222,7 @@ static inline void _bw_ls2_update_mm2_params(bw_ls2_coeffs *BW_RESTRICT coeffs)
if (coeffs->param_changed) {
if (coeffs->param_changed & _BW_LS2_PARAM_DC_GAIN) {
coeffs->sg = bw_sqrtf_2(coeffs->dc_gain);
coeffs->issg = bw_sqrtf_2(bw_rcpf_2(coeffs->sg));
coeffs->issg = bw_sqrtf_2(bw_rcpf(coeffs->sg));
bw_mm2_set_coeff_x(&coeffs->mm2_coeffs, coeffs->sg);
bw_mm2_set_coeff_lp(&coeffs->mm2_coeffs, coeffs->dc_gain - coeffs->sg);
bw_mm2_set_coeff_hp(&coeffs->mm2_coeffs, 1.f - coeffs->sg);

View File

@ -48,6 +48,7 @@
* <ul>
* <li>Renamed <code>bw_min0xf()</code> as <code>bw_min0f()</code> and
* <code>bw_max0xf()</code> as <code>bw_max0f()</code>.</li>
* <li>Removed precision suffixes from function names.</li>
* <li>New implementations for <code>bw_min0f()</code>,
* <code>bw_max0f()</code>, <code>bw_minf()</code>,
* <code>bw_maxf()</code>, and <code>bw_clipf()</code>.</li>
@ -256,9 +257,9 @@ static inline void bw_intfracf(float x, float *i, float *f);
* Puts the integer part (floor) of `x` in `i` and the fractional part in
* `f`.
*
* #### bw_rcpf_2()
* #### bw_rcpf()
* ```>>> */
static inline float bw_rcpf_2(float x);
static inline float bw_rcpf(float x);
/*! <<<```
* Returns the reciprocal of `x` (i.e., `1.f / x`).
*
@ -267,9 +268,9 @@ static inline float bw_rcpf_2(float x);
*
* Relative error < 0.0013%.
*
* #### bw_sin2pif_3()
* #### bw_sin2pif()
* ```>>> */
static inline float bw_sin2pif_3(float x);
static inline float bw_sin2pif(float x);
/*! <<<```
* Returns an approximation of the sine of 2 * pi * `x`, where `x` is given
* in radians.
@ -278,9 +279,9 @@ static inline float bw_sin2pif_3(float x);
*
* `x` must be finite.
*
* #### bw_sinf_3()
* #### bw_sinf()
* ```>>> */
static inline float bw_sinf_3(float x);
static inline float bw_sinf(float x);
/*! <<<```
* Returns an approximation of the sine of `x`, where `x` is given in
* radians.
@ -289,9 +290,9 @@ static inline float bw_sinf_3(float x);
*
* `x` must be finite.
*
* #### bw_cos2pif_3()
* #### bw_cos2pif()
* ```>>> */
static inline float bw_cos2pif_3(float x);
static inline float bw_cos2pif(float x);
/*! <<<```
* Returns an approximation of the cosine of 2 * pi * `x`, where `x` is given
* in radians.
@ -300,9 +301,9 @@ static inline float bw_cos2pif_3(float x);
*
* `x` must be finite.
*
* #### bw_cosf_3()
* #### bw_cosf()
* ```>>> */
static inline float bw_cosf_3(float x);
static inline float bw_cosf(float x);
/*! <<<```
* Returns an approximation of the cosine of `x`, where `x` is given in
* radians.
@ -311,9 +312,9 @@ static inline float bw_cosf_3(float x);
*
* `x` must be finite.
*
* #### bw_tan2pif_3()
* #### bw_tan2pif()
* ```>>> */
static inline float bw_tan2pif_3(float x);
static inline float bw_tan2pif(float x);
/*! <<<```
* Returns an approximation of the tangent of 2 * pi * `x`, where `x` is
* given in radians.
@ -326,9 +327,9 @@ static inline float bw_tan2pif_3(float x);
*
* `x` must be finite.
*
* #### bw_tanf_3()
* #### bw_tanf()
* ```>>> */
static inline float bw_tanf_3(float x);
static inline float bw_tanf(float x);
/*! <<<```
* Returns an approximation of the tangent of `x`, where `x` is given in
* radians.
@ -341,75 +342,75 @@ static inline float bw_tanf_3(float x);
*
* `x` must be finite.
*
* #### bw_log2f_3()
* #### bw_log2f()
* ```>>> */
static inline float bw_log2f_3(float x);
static inline float bw_log2f(float x);
/*! <<<```
* Returns an approximation of the base-2 logarithm of `x`.
*
* Absolute error < 0.0055, relative error < 1.5%.
*
* #### bw_logf_3()
* #### bw_logf()
* ```>>> */
static inline float bw_logf_3(float x);
static inline float bw_logf(float x);
/*! <<<```
* Returns an approximation of the natural logarithm of `x`.
*
* Absolute error < 0.0039, relative error < 1.5%.
*
* #### bw_log10f_3()
* #### bw_log10f()
* ```>>> */
static inline float bw_log10f_3(float x);
static inline float bw_log10f(float x);
/*! <<<```
* Returns an approximation of the base-10 logarithm of `x`.
*
* Absolute error < 0.0017, relative error < 1.5%.
*
* #### bw_pow2f_3()
* #### bw_pow2f()
* ```>>> */
static inline float bw_pow2f_3(float x);
static inline float bw_pow2f(float x);
/*! <<<```
* Returns an approximation of 2 raised to the power of `x`.
*
* Relative error < 0.062%.
*
* #### bw_expf_3()
* #### bw_expf()
* ```>>> */
static inline float bw_expf_3(float x);
static inline float bw_expf(float x);
/*! <<<```
* Returns an approximation of e (Euler's number) raised to the power of `x`.
*
* Relative error < 0.062%.
*
* #### bw_pow10f_3()
* #### bw_pow10f()
* ```>>> */
static inline float bw_pow10f_3(float x);
static inline float bw_pow10f(float x);
/*! <<<```
* Returns an approximation of 10 raised to the power of `x`.
*
* Relative error < 0.062%.
*
* #### bw_dB2linf_3()
* #### bw_dB2linf()
* ```>>> */
static inline float bw_dB2linf_3(float x);
static inline float bw_dB2linf(float x);
/*! <<<```
* Returns an approximation of 10 raised to the power of `x` / 20 (dB to
* linear ratio conversion).
*
* Relative error < 0.062%.
*
* #### bw_lin2dBf_3()
* #### bw_lin2dBf()
* ```>>> */
static inline float bw_lin2dBf_3(float x);
static inline float bw_lin2dBf(float x);
/*! <<<```
* Returns an approximation of 20 times the base-10 logarithm of `x` (linear
* ratio to dB conversion).
*
* Absolute error < 0.032, relative error < 1.5%.
*
* #### bw_sqrtf_2()
* #### bw_sqrtf()
* ```>>> */
static inline float bw_sqrtf_2(float x);
static inline float bw_sqrtf(float x);
/*! <<<```
* Returns an approximation of the square root of `x`.
*
@ -417,41 +418,41 @@ static inline float bw_sqrtf_2(float x);
*
* Relative error < 0.0007%.
*
* #### bw_tanhf_3()
* #### bw_tanhf()
* ```>>> */
static inline float bw_tanhf_3(float x);
static inline float bw_tanhf(float x);
/*! <<<```
* Returns an approximation of the hyperbolic tangent of `x`.
*
* Absolute error < 0.035, relative error < 6.5%.
*
* #### bw_sinhf_3()
* #### bw_sinhf()
* ```>>> */
static inline float bw_sinhf_3(float x);
static inline float bw_sinhf(float x);
/*! <<<```
* Returns an approximation of the hyperbolic sine of `x`.
*
* Relative error < 0.07%.
*
* #### bw_coshf_3()
* #### bw_coshf()
* ```>>> */
static inline float bw_coshf_3(float x);
static inline float bw_coshf(float x);
/*! <<<```
* Returns an approximation of the hyperbolic cosine of `x`.
*
* Relative error < 0.07%.
*
* #### bw_asinhf_3()
* #### bw_asinhf()
* ```>>> */
static inline float bw_asinhf_3(float x);
static inline float bw_asinhf(float x);
/*! <<<```
* Returns an approximation of the hyperbolic arcsine of `x`.
*
* Absolute error < 0.004, relative error < 1.2%.
*
* #### bw_acoshf_3()
* #### bw_acoshf()
* ```>>> */
static inline float bw_acoshf_3(float x);
static inline float bw_acoshf(float x);
/*! <<<```
* Returns an approximation of the hyperbolic arccosine of `x`.
*
@ -633,7 +634,7 @@ static inline void bw_intfracf(float x, float *i, float *f) {
BW_ASSERT(bw_is_finite(*f));
}
static inline float bw_rcpf_2(float x) {
static inline float bw_rcpf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT((x >= 8.077935669e-28f && x <= 1.237940039e27f) || (x <= -8.077935669e-28f && x >= -1.237940039e27f));
union { float f; int32_t i; } v;
@ -645,7 +646,7 @@ static inline float bw_rcpf_2(float x) {
return v.f;
}
static inline float bw_sin2pif_3(float x) {
static inline float bw_sin2pif(float x) {
BW_ASSERT(bw_is_finite(x));
x = x - bw_floorf(x);
float xp1 = x + x - 1.f;
@ -656,47 +657,47 @@ static inline float bw_sin2pif_3(float x) {
return y;
}
static inline float bw_sinf_3(float x) {
static inline float bw_sinf(float x) {
BW_ASSERT(bw_is_finite(x));
const float y = bw_sin2pif_3(0.1591549430918953f * x);
const float y = bw_sin2pif(0.1591549430918953f * x);
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_cos2pif_3(float x) {
static inline float bw_cos2pif(float x) {
BW_ASSERT(bw_is_finite(x));
const float y = bw_sin2pif_3(x + 0.25f);
const float y = bw_sin2pif(x + 0.25f);
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_cosf_3(float x) {
static inline float bw_cosf(float x) {
BW_ASSERT(bw_is_finite(x));
const float y = bw_cos2pif_3(0.1591549430918953f * x);
const float y = bw_cos2pif(0.1591549430918953f * x);
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_tan2pif_3(float x) {
static inline float bw_tan2pif(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT((x - 0.5f * bw_floorf(x + x) <= 0.249840845056908f)
|| (x - 0.5f * bw_floorf(x + x) >= 0.250159154943092f));
const float y = bw_sin2pif_3(x) * bw_rcpf_2(bw_cos2pif_3(x));
const float y = bw_sin2pif(x) * bw_rcpf(bw_cos2pif(x));
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_tanf_3(float x) {
static inline float bw_tanf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT((x - 3.141592653589793f * bw_floorf(0.318309886183791f * x) <= 1.569796326794897f)
|| (x - 3.141592653589793f * bw_floorf(0.318309886183791f * x) >= 1.571796326794896f));
x = 0.1591549430918953f * x;
const float y = bw_sin2pif_3(x) * bw_rcpf_2(bw_cos2pif_3(x));
const float y = bw_sin2pif(x) * bw_rcpf(bw_cos2pif(x));
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_log2f_3(float x) {
static inline float bw_log2f(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x >= 1.175494350822287e-38f);
union { float f; int32_t i; } v;
@ -708,23 +709,23 @@ static inline float bw_log2f_3(float x) {
return y;
}
static inline float bw_logf_3(float x) {
static inline float bw_logf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x >= 1.175494350822287e-38f);
const float y = 0.693147180559945f * bw_log2f_3(x);
const float y = 0.693147180559945f * bw_log2f(x);
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_log10f_3(float x) {
static inline float bw_log10f(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x >= 1.175494350822287e-38f);
const float y = 0.3010299956639811f * bw_log2f_3(x);
const float y = 0.3010299956639811f * bw_log2f(x);
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_pow2f_3(float x) {
static inline float bw_pow2f(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x <= 127.999f);
if (x < -126.f)
@ -740,39 +741,39 @@ static inline float bw_pow2f_3(float x) {
return y;
}
static inline float bw_expf_3(float x) {
static inline float bw_expf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x <= 88.722f);
const float y = bw_pow2f_3(1.442695040888963f * x);
const float y = bw_pow2f(1.442695040888963f * x);
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_pow10f_3(float x) {
static inline float bw_pow10f(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x <= 38.531f);
const float y = bw_pow2f_3(3.321928094887363f * x);
const float y = bw_pow2f(3.321928094887363f * x);
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_dB2linf_3(float x) {
static inline float bw_dB2linf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x <= 770.630f);
const float y = bw_pow2f_3(0.1660964047443682f * x);
const float y = bw_pow2f(0.1660964047443682f * x);
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_lin2dBf_3(float x) {
static inline float bw_lin2dBf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x >= 1.175494350822287e-38f);
const float y = 20.f * bw_log10f_3(x);
const float y = 20.f * bw_log10f(x);
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_sqrtf_2(float x) {
static inline float bw_sqrtf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x >= 0.f);
if (x < 8.077935669463161e-28f) {
@ -783,14 +784,14 @@ static inline float bw_sqrtf_2(float x) {
union { float f; uint32_t u; } v;
v.f = x;
v.u = (((v.u - 0x3f82a127) >> 1) + 0x3f7d8fc7) & 0x7fffffff;
float r = bw_rcpf_2(x);
float r = bw_rcpf(x);
v.f = v.f + v.f * (0.5f - 0.5f * r * v.f * v.f);
v.f = v.f + v.f * (0.5f - 0.5f * r * v.f * v.f);
BW_ASSERT(bw_is_finite(v.f));
return v.f;
}
static inline float bw_tanhf_3(float x) {
static inline float bw_tanhf(float x) {
BW_ASSERT(bw_is_finite(x));
const float xm = bw_clipf(x, -2.115287308554551f, 2.115287308554551f);
const float axm = bw_absf(xm);
@ -799,35 +800,35 @@ static inline float bw_tanhf_3(float x) {
return y;
}
static inline float bw_sinhf_3(float x) {
static inline float bw_sinhf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x >= -88.722f && x <= 88.722f);
const float y = 0.5f * (bw_expf_3(x) - bw_expf_3(-x));
const float y = 0.5f * (bw_expf(x) - bw_expf(-x));
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_coshf_3(float x) {
static inline float bw_coshf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x >= -88.722f && x <= 88.722f);
const float y = 0.5f * (bw_expf_3(x) + bw_expf_3(-x));
const float y = 0.5f * (bw_expf(x) + bw_expf(-x));
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_asinhf_3(float x) {
static inline float bw_asinhf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x >= -1.7e38f && x <= 1.7e38f);
float a = bw_absf(x);
const float y = bw_copysignf(bw_logf_3((a >= 4096.f ? a : bw_sqrtf_2(a * a + 1.f)) + a), x);
const float y = bw_copysignf(bw_logf((a >= 4096.f ? a : bw_sqrtf(a * a + 1.f)) + a), x);
BW_ASSERT(bw_is_finite(y));
return y;
}
static inline float bw_acoshf_3(float x) {
static inline float bw_acoshf(float x) {
BW_ASSERT(bw_is_finite(x));
BW_ASSERT(x >= 1.f);
const float y = bw_logf_3((x >= 8192.f ? x : bw_sqrtf_2(x * x - 1.f)) + x);
const float y = bw_logf((x >= 8192.f ? x : bw_sqrtf(x * x - 1.f)) + x);
BW_ASSERT(bw_is_finite(y));
return y;
}

View File

@ -228,7 +228,7 @@ static inline void bw_noise_gate_set_sample_rate(bw_noise_gate_coeffs *BW_RESTRI
static inline void bw_noise_gate_reset_coeffs(bw_noise_gate_coeffs *BW_RESTRICT coeffs) {
bw_env_follow_reset_coeffs(&coeffs->env_follow_coeffs);
bw_one_pole_reset_state(&coeffs->smooth_coeffs, &coeffs->smooth_thresh_state, coeffs->thresh);
bw_one_pole_reset_state(&coeffs->smooth_coeffs, &coeffs->smooth_ratio_state, coeffs->ratio > 1e12f ? 0.f : bw_rcpf_2(coeffs->ratio));
bw_one_pole_reset_state(&coeffs->smooth_coeffs, &coeffs->smooth_ratio_state, coeffs->ratio > 1e12f ? 0.f : bw_rcpf(coeffs->ratio));
}
static inline void bw_noise_gate_reset_state(const bw_noise_gate_coeffs *BW_RESTRICT coeffs, bw_noise_gate_state *BW_RESTRICT state) {
@ -242,14 +242,14 @@ static inline void bw_noise_gate_update_coeffs_ctrl(bw_noise_gate_coeffs *BW_RES
static inline void bw_noise_gate_update_coeffs_audio(bw_noise_gate_coeffs *BW_RESTRICT coeffs) {
bw_env_follow_update_coeffs_audio(&coeffs->env_follow_coeffs);
bw_one_pole_process1(&coeffs->smooth_coeffs, &coeffs->smooth_thresh_state, coeffs->thresh);
const float rev_ratio = bw_one_pole_process1(&coeffs->smooth_coeffs, &coeffs->smooth_ratio_state, coeffs->ratio > 1e12f ? 0.f : bw_rcpf_2(coeffs->ratio));
coeffs->kc = rev_ratio < 1e-12f ? -INFINITY : 1.f - bw_rcpf_2(rev_ratio);
const float rev_ratio = bw_one_pole_process1(&coeffs->smooth_coeffs, &coeffs->smooth_ratio_state, coeffs->ratio > 1e12f ? 0.f : bw_rcpf(coeffs->ratio));
coeffs->kc = rev_ratio < 1e-12f ? -INFINITY : 1.f - bw_rcpf(rev_ratio);
}
static inline float bw_noise_gate_process1(const bw_noise_gate_coeffs *BW_RESTRICT coeffs, bw_noise_gate_state *BW_RESTRICT state, float x, float x_sc) {
const float env = bw_env_follow_process1(&coeffs->env_follow_coeffs, &state->env_follow_state, x_sc);
const float thresh = bw_one_pole_get_y_z1(&coeffs->smooth_thresh_state);
return env < thresh ? bw_pow2f_3(coeffs->kc * bw_log2f_3(thresh * bw_rcpf_2(env))) * x : x;
return env < thresh ? bw_pow2f_3(coeffs->kc * bw_log2f_3(thresh * bw_rcpf(env))) * x : x;
}
static inline void bw_noise_gate_process(bw_noise_gate_coeffs *BW_RESTRICT coeffs, bw_noise_gate_state *BW_RESTRICT state, const float *x, const float *x_sc, float *y, int n_samples) {

View File

@ -864,7 +864,7 @@ static inline void bw_one_pole_set_tau_up(bw_one_pole_coeffs *BW_RESTRICT coeffs
BW_ASSERT(!bw_is_nan(value));
BW_ASSERT(value >= 0.f);
bw_one_pole_set_cutoff_up(coeffs, value < 1e-9f ? INFINITY : 0.1591549430918953f * bw_rcpf_2(value));
bw_one_pole_set_cutoff_up(coeffs, value < 1e-9f ? INFINITY : 0.1591549430918953f * bw_rcpf(value));
// tau < 1 ns is instantaneous for any practical purpose
BW_ASSERT_DEEP(bw_one_pole_coeffs_is_valid(coeffs));
@ -878,7 +878,7 @@ static inline void bw_one_pole_set_tau_down(bw_one_pole_coeffs *BW_RESTRICT coef
BW_ASSERT(!bw_is_nan(value));
BW_ASSERT(value >= 0.f);
bw_one_pole_set_cutoff_down(coeffs, value < 1e-9f ? INFINITY : 0.1591549430918953f * bw_rcpf_2(value));
bw_one_pole_set_cutoff_down(coeffs, value < 1e-9f ? INFINITY : 0.1591549430918953f * bw_rcpf(value));
// as before
BW_ASSERT_DEEP(bw_one_pole_coeffs_is_valid(coeffs));

View File

@ -230,7 +230,7 @@ static inline float bw_osc_pulse_process1_antialias(const bw_osc_pulse_coeffs *B
float v = bw_copysignf(1.f, pw_m_phase); // pw = phase case should be properly compensated by the AA
if (x_phase_inc != 0.f) {
const float phase_inc_2 = x_phase_inc + x_phase_inc;
const float phase_inc_rcp = bw_rcpf_2(x_phase_inc);
const float phase_inc_rcp = bw_rcpf(x_phase_inc);
const float phase_2 = 0.5f * v + 0.5f - pw_m_phase;
const float s_1_m_phase = 1.f - x;
const float s_1_m_phase_2 = 1.f - phase_2;

View File

@ -169,7 +169,7 @@ static inline float bw_osc_saw_process1_antialias(const bw_osc_saw_coeffs *BW_RE
float v = x - s_1_m_phase;
if (x_phase_inc != 0.f) {
const float phase_inc_2 = x_phase_inc + x_phase_inc;
const float phase_inc_rcp = bw_rcpf_2(x_phase_inc);
const float phase_inc_rcp = bw_rcpf(x_phase_inc);
if (s_1_m_phase < phase_inc_2)
v += _bw_osc_saw_blep_diff(s_1_m_phase * phase_inc_rcp);
if (x < phase_inc_2)

View File

@ -217,7 +217,7 @@ static inline void bw_osc_tri_update_coeffs_audio(bw_osc_tri_coeffs *BW_RESTRICT
static inline float bw_osc_tri_process1(const bw_osc_tri_coeffs *BW_RESTRICT coeffs, float x) {
const float slope = bw_one_pole_get_y_z1(&coeffs->smooth_state);
const float phase_d = x + x;
return x < slope ? (phase_d - slope) * bw_rcpf_2(slope) : (1.f + slope - phase_d) * bw_rcpf_2(1.f - slope);
return x < slope ? (phase_d - slope) * bw_rcpf(slope) : (1.f + slope - phase_d) * bw_rcpf(1.f - slope);
}
// PolyBLAMP residual based on Parzen window (4th-order B-spline), one-sided (x in [0, 2])
@ -232,10 +232,10 @@ static inline float bw_osc_tri_process1_antialias(const bw_osc_tri_coeffs *BW_RE
const float s_1_p_pw = 1.f + slope;
const float s_1_m_pw = 1.f - slope;
const float phase_d = x + x;
float v = x < slope ? (phase_d - slope) * bw_rcpf_2(slope) : (s_1_p_pw - phase_d) * bw_rcpf_2(s_1_m_pw);
float v = x < slope ? (phase_d - slope) * bw_rcpf(slope) : (s_1_p_pw - phase_d) * bw_rcpf(s_1_m_pw);
if (x_phase_inc != 0.f) {
const float phase_inc_2 = x_phase_inc + x_phase_inc;
const float phase_inc_rcp = bw_rcpf_2(x_phase_inc);
const float phase_inc_rcp = bw_rcpf(x_phase_inc);
const float pw_m_phase = slope - x;
const float phase_2 = bw_copysignf(0.5f, pw_m_phase) + 0.5f - pw_m_phase;
const float s_1_m_phase = 1.f - x;
@ -249,7 +249,7 @@ static inline float bw_osc_tri_process1_antialias(const bw_osc_tri_coeffs *BW_RE
blamp -= _bw_osc_tri_blamp_diff(x * phase_inc_rcp);
if (phase_2 < phase_inc_2)
blamp += _bw_osc_tri_blamp_diff(phase_2 * phase_inc_rcp);
v -= bw_rcpf_2(slope * s_1_m_pw) * bw_absf(x_phase_inc) * blamp;
v -= bw_rcpf(slope * s_1_m_pw) * bw_absf(x_phase_inc) * blamp;
}
return v;
}

View File

@ -254,15 +254,15 @@ static inline void _bw_peak_update_mm2_params(bw_peak_coeffs *BW_RESTRICT coeffs
if (coeffs->param_changed & (_BW_PEAK_PARAM_PEAK_GAIN | _BW_PEAK_PARAM_BANDWIDTH)) {
if (coeffs->param_changed & _BW_PEAK_PARAM_BANDWIDTH)
coeffs->bw_k = bw_pow2f_3(coeffs->bandwidth);
const float Q = bw_sqrtf_2(coeffs->bw_k * coeffs->peak_gain) * bw_rcpf_2(coeffs->bw_k - 1.f);
const float Q = bw_sqrtf_2(coeffs->bw_k * coeffs->peak_gain) * bw_rcpf(coeffs->bw_k - 1.f);
bw_mm2_set_Q(&coeffs->mm2_coeffs, Q);
bw_mm2_set_coeff_bp(&coeffs->mm2_coeffs, (coeffs->peak_gain - 1.f) * bw_rcpf_2(Q));
bw_mm2_set_coeff_bp(&coeffs->mm2_coeffs, (coeffs->peak_gain - 1.f) * bw_rcpf(Q));
}
} else {
if (coeffs->param_changed & (_BW_PEAK_PARAM_PEAK_GAIN | _BW_PEAK_PARAM_Q)) {
if (coeffs->param_changed & _BW_PEAK_PARAM_Q)
bw_mm2_set_Q(&coeffs->mm2_coeffs, coeffs->Q);
bw_mm2_set_coeff_bp(&coeffs->mm2_coeffs, (coeffs->peak_gain - 1.f) * bw_rcpf_2(coeffs->Q));
bw_mm2_set_coeff_bp(&coeffs->mm2_coeffs, (coeffs->peak_gain - 1.f) * bw_rcpf(coeffs->Q));
}
}
coeffs->param_changed = 0;

View File

@ -244,7 +244,7 @@ static inline void _bw_satur_do_update_coeffs(bw_satur_coeffs *BW_RESTRICT coeff
float gain_cur = bw_one_pole_get_y_z1(&coeffs->smooth_gain_state);
if (force || coeffs->gain != gain_cur) {
gain_cur = bw_one_pole_process1_sticky_rel(&coeffs->smooth_coeffs, &coeffs->smooth_gain_state, coeffs->gain);
coeffs->inv_gain = bw_rcpf_2(gain_cur);
coeffs->inv_gain = bw_rcpf(gain_cur);
}
}
@ -273,7 +273,7 @@ static inline float bw_satur_process1(const bw_satur_coeffs *BW_RESTRICT coeffs,
const float ax = bw_absf(x);
const float F = ax >= 2.115287308554551f ? ax - 0.6847736211329452f : ax * ax * ((0.00304518315009429f * ax - 0.09167437770414569f) * ax + 0.5f);
const float d = x - state->x_z1;
const float y = d * d < 1e-6f ? _bw_satur_tanhf_3(0.5f * (x + state->x_z1)) : (F - state->F_z1) * bw_rcpf_2(d);
const float y = d * d < 1e-6f ? _bw_satur_tanhf_3(0.5f * (x + state->x_z1)) : (F - state->F_z1) * bw_rcpf(d);
state->x_z1 = x;
state->F_z1 = F;
return y - coeffs->bias_dc;

View File

@ -278,16 +278,16 @@ static inline void _bw_svf_do_update_coeffs(bw_svf_coeffs *BW_RESTRICT coeffs, c
if (prewarp_freq_changed) {
prewarp_freq_cur = bw_one_pole_process1_sticky_rel(&coeffs->smooth_coeffs, &coeffs->smooth_prewarp_freq_state, prewarp_freq);
coeffs->t = bw_tanf_3(coeffs->t_k * prewarp_freq_cur);
coeffs->kf = coeffs->t * bw_rcpf_2(prewarp_freq_cur);
coeffs->kf = coeffs->t * bw_rcpf(prewarp_freq_cur);
}
coeffs->kbl = coeffs->kf * cutoff_cur;
}
if (Q_changed) {
Q_cur = bw_one_pole_process1_sticky_abs(&coeffs->smooth_coeffs, &coeffs->smooth_Q_state, coeffs->Q);
coeffs->k = bw_rcpf_2(Q_cur);
coeffs->k = bw_rcpf(Q_cur);
}
coeffs->hp_hb = coeffs->k + coeffs->kbl;
coeffs->hp_x = bw_rcpf_2(1.f + coeffs->kbl * coeffs->hp_hb);
coeffs->hp_x = bw_rcpf(1.f + coeffs->kbl * coeffs->hp_hb);
}
}

View File

@ -575,268 +575,268 @@ int main() {
TEST_BW_INTFRAC(-1.123e3f, -1.123e3f, 0.f);
TEST_BW_INTFRAC(-1.999e3f, -1.999e3f, 0.f);
TEST_REL(bw_rcpf_2(1.2e27f), 8.333333333e-28f, 0.000013f);
TEST_REL(bw_rcpf_2(1e20f), 1e-20f, 0.000013f);
TEST_REL(bw_rcpf_2(1e10f), 1e-10f, 0.000013f);
TEST_REL(bw_rcpf_2(1e3f), 0.001f, 0.000013f);
TEST_REL(bw_rcpf_2(500.f), 0.002f, 0.000013f);
TEST_REL(bw_rcpf_2(200.f), 0.005f, 0.000013f);
TEST_REL(bw_rcpf_2(100.f), 0.01f, 0.000013f);
TEST_REL(bw_rcpf_2(50.f), 0.02f, 0.000013f);
TEST_REL(bw_rcpf_2(20.f), 0.05f, 0.000013f);
TEST_REL(bw_rcpf_2(10.f), 0.1f, 0.000013f);
TEST_REL(bw_rcpf_2(5.f), 0.2f, 0.000013f);
TEST_REL(bw_rcpf_2(2.f), 0.5f, 0.000013f);
TEST_REL(bw_rcpf_2(1.f), 1.f, 0.000013f);
TEST_REL(bw_rcpf_2(0.5f), 2.f, 0.000013f);
TEST_REL(bw_rcpf_2(0.2f), 5.f, 0.000013f);
TEST_REL(bw_rcpf_2(0.1f), 10.f, 0.000013f);
TEST_REL(bw_rcpf_2(0.05f), 20.f, 0.000013f);
TEST_REL(bw_rcpf_2(0.02f), 50.f, 0.000013f);
TEST_REL(bw_rcpf_2(0.01f), 100.f, 0.000013f);
TEST_REL(bw_rcpf_2(0.005f), 200.f, 0.000013f);
TEST_REL(bw_rcpf_2(0.002f), 500.f, 0.000013f);
TEST_REL(bw_rcpf_2(0.001f), 1000.f, 0.000013f);
TEST_REL(bw_rcpf_2(1e-10f), 1e10f, 0.000013f);
TEST_REL(bw_rcpf_2(1e-20f), 1e20f, 0.000013f);
TEST_REL(bw_rcpf_2(8.1e-28f), 1.234567901e27f, 0.000013f);
TEST_REL(bw_rcpf_2(-1.2e27f), -8.333333333e-28f, 0.000013f);
TEST_REL(bw_rcpf_2(-1e20f), -1e-20f, 0.000013f);
TEST_REL(bw_rcpf_2(-1e10f), -1e-10f, 0.000013f);
TEST_REL(bw_rcpf_2(-1e3f), -0.001f, 0.000013f);
TEST_REL(bw_rcpf_2(-500.f), -0.002f, 0.000013f);
TEST_REL(bw_rcpf_2(-200.f), -0.005f, 0.000013f);
TEST_REL(bw_rcpf_2(-100.f), -0.01f, 0.000013f);
TEST_REL(bw_rcpf_2(-50.f), -0.02f, 0.000013f);
TEST_REL(bw_rcpf_2(-20.f), -0.05f, 0.000013f);
TEST_REL(bw_rcpf_2(-10.f), -0.1f, 0.000013f);
TEST_REL(bw_rcpf_2(-5.f), -0.2f, 0.000013f);
TEST_REL(bw_rcpf_2(-2.f), -0.5f, 0.000013f);
TEST_REL(bw_rcpf_2(-1.f), -1.f, 0.000013f);
TEST_REL(bw_rcpf_2(-0.5f), -2.f, 0.000013f);
TEST_REL(bw_rcpf_2(-0.2f), -5.f, 0.000013f);
TEST_REL(bw_rcpf_2(-0.1f), -10.f, 0.000013f);
TEST_REL(bw_rcpf_2(-0.05f), -20.f, 0.000013f);
TEST_REL(bw_rcpf_2(-0.02f), -50.f, 0.000013f);
TEST_REL(bw_rcpf_2(-0.01f), -100.f, 0.000013f);
TEST_REL(bw_rcpf_2(-0.005f), -200.f, 0.000013f);
TEST_REL(bw_rcpf_2(-0.002f), -500.f, 0.000013f);
TEST_REL(bw_rcpf_2(-0.001f), -1000.f, 0.000013f);
TEST_REL(bw_rcpf_2(-1e-10f), -1e10f, 0.000013f);
TEST_REL(bw_rcpf_2(-1e-20f), -1e20f, 0.000013f);
TEST_REL(bw_rcpf_2(-8.1e-28f), -1.234567901e27f, 0.000013f);
TEST_REL(bw_rcpf(1.2e27f), 8.333333333e-28f, 0.000013f);
TEST_REL(bw_rcpf(1e20f), 1e-20f, 0.000013f);
TEST_REL(bw_rcpf(1e10f), 1e-10f, 0.000013f);
TEST_REL(bw_rcpf(1e3f), 0.001f, 0.000013f);
TEST_REL(bw_rcpf(500.f), 0.002f, 0.000013f);
TEST_REL(bw_rcpf(200.f), 0.005f, 0.000013f);
TEST_REL(bw_rcpf(100.f), 0.01f, 0.000013f);
TEST_REL(bw_rcpf(50.f), 0.02f, 0.000013f);
TEST_REL(bw_rcpf(20.f), 0.05f, 0.000013f);
TEST_REL(bw_rcpf(10.f), 0.1f, 0.000013f);
TEST_REL(bw_rcpf(5.f), 0.2f, 0.000013f);
TEST_REL(bw_rcpf(2.f), 0.5f, 0.000013f);
TEST_REL(bw_rcpf(1.f), 1.f, 0.000013f);
TEST_REL(bw_rcpf(0.5f), 2.f, 0.000013f);
TEST_REL(bw_rcpf(0.2f), 5.f, 0.000013f);
TEST_REL(bw_rcpf(0.1f), 10.f, 0.000013f);
TEST_REL(bw_rcpf(0.05f), 20.f, 0.000013f);
TEST_REL(bw_rcpf(0.02f), 50.f, 0.000013f);
TEST_REL(bw_rcpf(0.01f), 100.f, 0.000013f);
TEST_REL(bw_rcpf(0.005f), 200.f, 0.000013f);
TEST_REL(bw_rcpf(0.002f), 500.f, 0.000013f);
TEST_REL(bw_rcpf(0.001f), 1000.f, 0.000013f);
TEST_REL(bw_rcpf(1e-10f), 1e10f, 0.000013f);
TEST_REL(bw_rcpf(1e-20f), 1e20f, 0.000013f);
TEST_REL(bw_rcpf(8.1e-28f), 1.234567901e27f, 0.000013f);
TEST_REL(bw_rcpf(-1.2e27f), -8.333333333e-28f, 0.000013f);
TEST_REL(bw_rcpf(-1e20f), -1e-20f, 0.000013f);
TEST_REL(bw_rcpf(-1e10f), -1e-10f, 0.000013f);
TEST_REL(bw_rcpf(-1e3f), -0.001f, 0.000013f);
TEST_REL(bw_rcpf(-500.f), -0.002f, 0.000013f);
TEST_REL(bw_rcpf(-200.f), -0.005f, 0.000013f);
TEST_REL(bw_rcpf(-100.f), -0.01f, 0.000013f);
TEST_REL(bw_rcpf(-50.f), -0.02f, 0.000013f);
TEST_REL(bw_rcpf(-20.f), -0.05f, 0.000013f);
TEST_REL(bw_rcpf(-10.f), -0.1f, 0.000013f);
TEST_REL(bw_rcpf(-5.f), -0.2f, 0.000013f);
TEST_REL(bw_rcpf(-2.f), -0.5f, 0.000013f);
TEST_REL(bw_rcpf(-1.f), -1.f, 0.000013f);
TEST_REL(bw_rcpf(-0.5f), -2.f, 0.000013f);
TEST_REL(bw_rcpf(-0.2f), -5.f, 0.000013f);
TEST_REL(bw_rcpf(-0.1f), -10.f, 0.000013f);
TEST_REL(bw_rcpf(-0.05f), -20.f, 0.000013f);
TEST_REL(bw_rcpf(-0.02f), -50.f, 0.000013f);
TEST_REL(bw_rcpf(-0.01f), -100.f, 0.000013f);
TEST_REL(bw_rcpf(-0.005f), -200.f, 0.000013f);
TEST_REL(bw_rcpf(-0.002f), -500.f, 0.000013f);
TEST_REL(bw_rcpf(-0.001f), -1000.f, 0.000013f);
TEST_REL(bw_rcpf(-1e-10f), -1e10f, 0.000013f);
TEST_REL(bw_rcpf(-1e-20f), -1e20f, 0.000013f);
TEST_REL(bw_rcpf(-8.1e-28f), -1.234567901e27f, 0.000013f);
TEST_ABS_REL(bw_sin2pif_3(0.f), sinf(6.283185307f * 0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(0.1f), sinf(6.283185307f * 0.1f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(0.2f), sinf(6.283185307f * 0.2f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(0.3f), sinf(6.283185307f * 0.3f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(0.4f), sinf(6.283185307f * 0.4f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(0.5f), sinf(6.283185307f * 0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(0.6f), sinf(6.283185307f * 0.6f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(0.7f), sinf(6.283185307f * 0.7f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(0.8f), sinf(6.283185307f * 0.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(0.9f), sinf(6.283185307f * 0.9f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(1.f), sinf(6.283185307f * 1.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(5.678f), sinf(6.283185307f * 5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(56.78f), sinf(6.283185307f * 56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(567.8f), sinf(6.283185307f * 567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(5678.f), sinf(6.283185307f * 5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-0.f), sinf(6.283185307f * -0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-0.1f), sinf(6.283185307f * -0.1f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-0.2f), sinf(6.283185307f * -0.2f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-0.3f), sinf(6.283185307f * -0.3f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-0.4f), sinf(6.283185307f * -0.4f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-0.5f), sinf(6.283185307f * -0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-0.6f), sinf(6.283185307f * -0.6f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-0.7f), sinf(6.283185307f * -0.7f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-0.8f), sinf(6.283185307f * -0.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-0.9f), sinf(6.283185307f * -0.9f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-1.f), sinf(6.283185307f * -1.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-5.678f), sinf(6.283185307f * -5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-56.78f), sinf(6.283185307f * -56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-567.8f), sinf(6.283185307f * -567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif_3(-5678.f), sinf(6.283185307f * -5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(0.f), sinf(6.283185307f * 0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(0.1f), sinf(6.283185307f * 0.1f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(0.2f), sinf(6.283185307f * 0.2f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(0.3f), sinf(6.283185307f * 0.3f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(0.4f), sinf(6.283185307f * 0.4f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(0.5f), sinf(6.283185307f * 0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(0.6f), sinf(6.283185307f * 0.6f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(0.7f), sinf(6.283185307f * 0.7f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(0.8f), sinf(6.283185307f * 0.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(0.9f), sinf(6.283185307f * 0.9f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(1.f), sinf(6.283185307f * 1.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(5.678f), sinf(6.283185307f * 5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(56.78f), sinf(6.283185307f * 56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(567.8f), sinf(6.283185307f * 567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(5678.f), sinf(6.283185307f * 5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-0.f), sinf(6.283185307f * -0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-0.1f), sinf(6.283185307f * -0.1f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-0.2f), sinf(6.283185307f * -0.2f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-0.3f), sinf(6.283185307f * -0.3f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-0.4f), sinf(6.283185307f * -0.4f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-0.5f), sinf(6.283185307f * -0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-0.6f), sinf(6.283185307f * -0.6f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-0.7f), sinf(6.283185307f * -0.7f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-0.8f), sinf(6.283185307f * -0.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-0.9f), sinf(6.283185307f * -0.9f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-1.f), sinf(6.283185307f * -1.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-5.678f), sinf(6.283185307f * -5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-56.78f), sinf(6.283185307f * -56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-567.8f), sinf(6.283185307f * -567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sin2pif(-5678.f), sinf(6.283185307f * -5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(0.f), sinf(0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(0.5f), sinf(0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(1.0f), sinf(1.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(1.5f), sinf(1.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(2.0f), sinf(2.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(2.5f), sinf(2.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(3.0f), sinf(3.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(3.5f), sinf(3.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(4.0f), sinf(4.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(4.5f), sinf(4.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(5.0f), sinf(5.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(5.5f), sinf(5.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(6.0f), sinf(6.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(5.678f), sinf(5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(56.78f), sinf(56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(567.8f), sinf(567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(5678.f), sinf(5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-0.f), sinf(-0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-0.5f), sinf(-0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-1.0f), sinf(-1.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-1.5f), sinf(-1.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-2.0f), sinf(-2.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-2.5f), sinf(-2.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-3.0f), sinf(-3.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-3.5f), sinf(-3.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-4.0f), sinf(-4.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-4.5f), sinf(-4.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-5.0f), sinf(-5.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-5.5f), sinf(-5.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-6.0f), sinf(-6.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-5.678f), sinf(-5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-56.78f), sinf(-56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-567.8f), sinf(-567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf_3(-5678.f), sinf(-5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(0.f), sinf(0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(0.5f), sinf(0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(1.0f), sinf(1.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(1.5f), sinf(1.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(2.0f), sinf(2.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(2.5f), sinf(2.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(3.0f), sinf(3.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(3.5f), sinf(3.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(4.0f), sinf(4.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(4.5f), sinf(4.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(5.0f), sinf(5.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(5.5f), sinf(5.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(6.0f), sinf(6.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(5.678f), sinf(5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(56.78f), sinf(56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(567.8f), sinf(567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(5678.f), sinf(5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-0.f), sinf(-0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-0.5f), sinf(-0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-1.0f), sinf(-1.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-1.5f), sinf(-1.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-2.0f), sinf(-2.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-2.5f), sinf(-2.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-3.0f), sinf(-3.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-3.5f), sinf(-3.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-4.0f), sinf(-4.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-4.5f), sinf(-4.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-5.0f), sinf(-5.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-5.5f), sinf(-5.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-6.0f), sinf(-6.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-5.678f), sinf(-5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-56.78f), sinf(-56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-567.8f), sinf(-567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_sinf(-5678.f), sinf(-5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(0.f), cosf(6.283185307f * 0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(0.1f), cosf(6.283185307f * 0.1f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(0.2f), cosf(6.283185307f * 0.2f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(0.3f), cosf(6.283185307f * 0.3f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(0.4f), cosf(6.283185307f * 0.4f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(0.5f), cosf(6.283185307f * 0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(0.6f), cosf(6.283185307f * 0.6f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(0.7f), cosf(6.283185307f * 0.7f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(0.8f), cosf(6.283185307f * 0.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(0.9f), cosf(6.283185307f * 0.9f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(1.f), cosf(6.283185307f * 1.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(5.678f), cosf(6.283185307f * 5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(56.78f), cosf(6.283185307f * 56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(567.8f), cosf(6.283185307f * 567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(5678.f), cosf(6.283185307f * 5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-0.f), cosf(6.283185307f * -0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-0.1f), cosf(6.283185307f * -0.1f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-0.2f), cosf(6.283185307f * -0.2f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-0.3f), cosf(6.283185307f * -0.3f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-0.4f), cosf(6.283185307f * -0.4f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-0.5f), cosf(6.283185307f * -0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-0.6f), cosf(6.283185307f * -0.6f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-0.7f), cosf(6.283185307f * -0.7f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-0.8f), cosf(6.283185307f * -0.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-0.9f), cosf(6.283185307f * -0.9f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-1.f), cosf(6.283185307f * -1.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-5.678f), cosf(6.283185307f * -5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-56.78f), cosf(6.283185307f * -56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-567.8f), cosf(6.283185307f * -567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif_3(-5678.f), cosf(6.283185307f * -5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(0.f), cosf(6.283185307f * 0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(0.1f), cosf(6.283185307f * 0.1f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(0.2f), cosf(6.283185307f * 0.2f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(0.3f), cosf(6.283185307f * 0.3f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(0.4f), cosf(6.283185307f * 0.4f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(0.5f), cosf(6.283185307f * 0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(0.6f), cosf(6.283185307f * 0.6f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(0.7f), cosf(6.283185307f * 0.7f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(0.8f), cosf(6.283185307f * 0.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(0.9f), cosf(6.283185307f * 0.9f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(1.f), cosf(6.283185307f * 1.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(5.678f), cosf(6.283185307f * 5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(56.78f), cosf(6.283185307f * 56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(567.8f), cosf(6.283185307f * 567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(5678.f), cosf(6.283185307f * 5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-0.f), cosf(6.283185307f * -0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-0.1f), cosf(6.283185307f * -0.1f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-0.2f), cosf(6.283185307f * -0.2f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-0.3f), cosf(6.283185307f * -0.3f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-0.4f), cosf(6.283185307f * -0.4f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-0.5f), cosf(6.283185307f * -0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-0.6f), cosf(6.283185307f * -0.6f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-0.7f), cosf(6.283185307f * -0.7f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-0.8f), cosf(6.283185307f * -0.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-0.9f), cosf(6.283185307f * -0.9f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-1.f), cosf(6.283185307f * -1.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-5.678f), cosf(6.283185307f * -5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-56.78f), cosf(6.283185307f * -56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-567.8f), cosf(6.283185307f * -567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cos2pif(-5678.f), cosf(6.283185307f * -5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(0.f), cosf(0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(0.5f), cosf(0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(1.0f), cosf(1.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(1.5f), cosf(1.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(2.0f), cosf(2.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(2.5f), cosf(2.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(3.0f), cosf(3.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(3.5f), cosf(3.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(4.0f), cosf(4.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(4.5f), cosf(4.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(5.0f), cosf(5.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(5.5f), cosf(5.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(6.0f), cosf(6.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(5.678f), cosf(5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(56.78f), cosf(56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(567.8f), cosf(567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(5678.f), cosf(5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-0.f), cosf(-0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-0.5f), cosf(-0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-1.0f), cosf(-1.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-1.5f), cosf(-1.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-2.0f), cosf(-2.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-2.5f), cosf(-2.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-3.0f), cosf(-3.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-3.5f), cosf(-3.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-4.0f), cosf(-4.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-4.5f), cosf(-4.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-5.0f), cosf(-5.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-5.5f), cosf(-5.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-6.0f), cosf(-6.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-5.678f), cosf(-5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-56.78f), cosf(-56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-567.8f), cosf(-567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf_3(-5678.f), cosf(-5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(0.f), cosf(0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(0.5f), cosf(0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(1.0f), cosf(1.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(1.5f), cosf(1.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(2.0f), cosf(2.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(2.5f), cosf(2.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(3.0f), cosf(3.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(3.5f), cosf(3.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(4.0f), cosf(4.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(4.5f), cosf(4.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(5.0f), cosf(5.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(5.5f), cosf(5.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(6.0f), cosf(6.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(5.678f), cosf(5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(56.78f), cosf(56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(567.8f), cosf(567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(5678.f), cosf(5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-0.f), cosf(-0.f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-0.5f), cosf(-0.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-1.0f), cosf(-1.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-1.5f), cosf(-1.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-2.0f), cosf(-2.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-2.5f), cosf(-2.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-3.0f), cosf(-3.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-3.5f), cosf(-3.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-4.0f), cosf(-4.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-4.5f), cosf(-4.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-5.0f), cosf(-5.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-5.5f), cosf(-5.5f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-6.0f), cosf(-6.0f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-5.678f), cosf(-5.678f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-56.78f), cosf(-56.78f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-567.8f), cosf(-567.8f), 0.011f, 0.017);
TEST_ABS_REL(bw_cosf(-5678.f), cosf(-5678.f), 0.011f, 0.017);
TEST_ABS_REL(bw_tan2pif_3(0.f), tanf(6.283185307f * 0.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.02f), tanf(6.283185307f * 0.02f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.04f), tanf(6.283185307f * 0.04f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.06f), tanf(6.283185307f * 0.06f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.08f), tanf(6.283185307f * 0.08f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.10f), tanf(6.283185307f * 0.10f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.12f), tanf(6.283185307f * 0.12f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.14f), tanf(6.283185307f * 0.14f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.16f), tanf(6.283185307f * 0.16f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.18f), tanf(6.283185307f * 0.18f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.20f), tanf(6.283185307f * 0.20f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.22f), tanf(6.283185307f * 0.22f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.24f), tanf(6.283185307f * 0.24f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(0.249f), tanf(6.283185307f * 0.249f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(5.678f), tanf(6.283185307f * 5.678f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(56.78f), tanf(6.283185307f * 56.78f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(567.8f), tanf(6.283185307f * 567.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(5678.f), tanf(6.283185307f * 5678.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.f), tanf(6.283185307f * -0.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.02f), tanf(6.283185307f * -0.02f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.04f), tanf(6.283185307f * -0.04f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.06f), tanf(6.283185307f * -0.06f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.08f), tanf(6.283185307f * -0.08f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.10f), tanf(6.283185307f * -0.10f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.12f), tanf(6.283185307f * -0.12f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.14f), tanf(6.283185307f * -0.14f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.16f), tanf(6.283185307f * -0.16f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.18f), tanf(6.283185307f * -0.18f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.20f), tanf(6.283185307f * -0.20f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.22f), tanf(6.283185307f * -0.22f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.24f), tanf(6.283185307f * -0.24f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-0.249f), tanf(6.283185307f * -0.249f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-5.678f), tanf(6.283185307f * -5.678f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-56.78f), tanf(6.283185307f * -56.78f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-567.8f), tanf(6.283185307f * -567.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif_3(-5678.f), tanf(6.283185307f * -5678.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.f), tanf(6.283185307f * 0.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.02f), tanf(6.283185307f * 0.02f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.04f), tanf(6.283185307f * 0.04f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.06f), tanf(6.283185307f * 0.06f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.08f), tanf(6.283185307f * 0.08f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.10f), tanf(6.283185307f * 0.10f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.12f), tanf(6.283185307f * 0.12f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.14f), tanf(6.283185307f * 0.14f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.16f), tanf(6.283185307f * 0.16f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.18f), tanf(6.283185307f * 0.18f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.20f), tanf(6.283185307f * 0.20f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.22f), tanf(6.283185307f * 0.22f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.24f), tanf(6.283185307f * 0.24f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(0.249f), tanf(6.283185307f * 0.249f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(5.678f), tanf(6.283185307f * 5.678f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(56.78f), tanf(6.283185307f * 56.78f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(567.8f), tanf(6.283185307f * 567.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(5678.f), tanf(6.283185307f * 5678.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.f), tanf(6.283185307f * -0.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.02f), tanf(6.283185307f * -0.02f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.04f), tanf(6.283185307f * -0.04f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.06f), tanf(6.283185307f * -0.06f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.08f), tanf(6.283185307f * -0.08f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.10f), tanf(6.283185307f * -0.10f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.12f), tanf(6.283185307f * -0.12f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.14f), tanf(6.283185307f * -0.14f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.16f), tanf(6.283185307f * -0.16f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.18f), tanf(6.283185307f * -0.18f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.20f), tanf(6.283185307f * -0.20f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.22f), tanf(6.283185307f * -0.22f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.24f), tanf(6.283185307f * -0.24f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-0.249f), tanf(6.283185307f * -0.249f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-5.678f), tanf(6.283185307f * -5.678f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-56.78f), tanf(6.283185307f * -56.78f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-567.8f), tanf(6.283185307f * -567.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tan2pif(-5678.f), tanf(6.283185307f * -5678.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(0.f), tanf(0.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(0.1f), tanf(0.1f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(0.2f), tanf(0.2f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(0.3f), tanf(0.3f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(0.4f), tanf(0.4f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(0.5f), tanf(0.5f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(0.6f), tanf(0.6f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(0.7f), tanf(0.7f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(0.8f), tanf(0.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(0.9f), tanf(0.9f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(1.0f), tanf(1.0f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(1.1f), tanf(1.1f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(1.2f), tanf(1.2f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(1.3f), tanf(1.3f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(1.4f), tanf(1.4f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(1.5f), tanf(1.5f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(1.56f), tanf(1.56f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(5.678f), tanf(5.678f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(56.78f), tanf(56.78f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(567.8f), tanf(567.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(5678.f), tanf(5678.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-0.f), tanf(-0.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-0.1f), tanf(-0.1f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-0.2f), tanf(-0.2f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-0.3f), tanf(-0.3f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-0.4f), tanf(-0.4f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-0.5f), tanf(-0.5f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-0.6f), tanf(-0.6f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-0.7f), tanf(-0.7f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-0.8f), tanf(-0.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-0.9f), tanf(-0.9f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-1.0f), tanf(-1.0f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-1.1f), tanf(-1.1f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-1.2f), tanf(-1.2f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-1.3f), tanf(-1.3f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-1.4f), tanf(-1.4f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-1.5f), tanf(-1.5f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-1.56f), tanf(-1.56f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-5.678f), tanf(-5.678f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-56.78f), tanf(-56.78f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-567.8f), tanf(-567.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf_3(-5678.f), tanf(-5678.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(0.f), tanf(0.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(0.1f), tanf(0.1f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(0.2f), tanf(0.2f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(0.3f), tanf(0.3f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(0.4f), tanf(0.4f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(0.5f), tanf(0.5f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(0.6f), tanf(0.6f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(0.7f), tanf(0.7f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(0.8f), tanf(0.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(0.9f), tanf(0.9f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(1.0f), tanf(1.0f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(1.1f), tanf(1.1f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(1.2f), tanf(1.2f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(1.3f), tanf(1.3f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(1.4f), tanf(1.4f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(1.5f), tanf(1.5f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(1.56f), tanf(1.56f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(5.678f), tanf(5.678f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(56.78f), tanf(56.78f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(567.8f), tanf(567.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(5678.f), tanf(5678.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-0.f), tanf(-0.f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-0.1f), tanf(-0.1f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-0.2f), tanf(-0.2f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-0.3f), tanf(-0.3f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-0.4f), tanf(-0.4f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-0.5f), tanf(-0.5f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-0.6f), tanf(-0.6f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-0.7f), tanf(-0.7f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-0.8f), tanf(-0.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-0.9f), tanf(-0.9f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-1.0f), tanf(-1.0f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-1.1f), tanf(-1.1f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-1.2f), tanf(-1.2f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-1.3f), tanf(-1.3f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-1.4f), tanf(-1.4f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-1.5f), tanf(-1.5f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-1.56f), tanf(-1.56f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-5.678f), tanf(-5.678f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-56.78f), tanf(-56.78f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-567.8f), tanf(-567.8f), 0.06f, 0.008);
TEST_ABS_REL(bw_tanf(-5678.f), tanf(-5678.f), 0.06f, 0.008);
printf("\nsuceeded: %d, failed: %d\n\n", n_ok, n_ko);