Nu:Tekt NTS-1 digital SDK
v1.1-0
|
Floating Point Math Utilities. More...
#include <math.h>
#include <stdint.h>
Go to the source code of this file.
Classes | |
union | f32_t |
struct | f32pair_t |
Functions | |
Types | |
static f32pair_t | f32pair (const float a, const float b) |
Make a float pair. | |
Operations | |
static float | fsel (const float a, const float b, const float c) |
FSEL construct. | |
static uint8_t | fselb (const float a) |
FSEL boolean construct. | |
static uint8_t | float_is_neg (const f32_t f) |
Sign bit check. | |
static int32_t | float_mantissa (f32_t f) |
Obtain mantissa. | |
static int32_t | float_exponent (f32_t f) |
Obtain exponent. | |
static f32pair_t | f32pair_add (const f32pair_t p0, const f32pair_t p1) |
Pair-wise addition. | |
static f32pair_t | f32pair_sub (const f32pair_t p0, const f32pair_t p1) |
Pair-wise subtraction. | |
static f32pair_t | f32pair_addscal (const f32pair_t p, const float scl) |
Pair-wise scalar addition. | |
static f32pair_t | f32pair_mul (const f32pair_t p0, const f32pair_t p1) |
Pair-wise product. | |
static f32pair_t | f32pair_mulscal (const f32pair_t p, const float scl) |
Pair-wise scalar product. | |
static f32pair_t | f32pair_linint (const float fr, const f32pair_t p0, const f32pair_t p1) |
Pair-wise linear interpolation. | |
static float | si_copysignf (const float x, const float y) |
Return x with sign of y applied. | |
static float | si_fabsf (float x) |
Absolute value. | |
static float | si_floorf (float x) |
Floor function. | |
static float | si_ceilf (float x) |
Ceiling function. | |
static float | si_roundf (float x) |
Round to nearest integer. | |
static float | clampfsel (const float min, float x, const float max) |
static float | clampminfsel (const float min, const float x) |
static float | clampmaxfsel (const float x, const float max) |
static float | clipmaxf (const float x, const float m) |
Clip upper bound of x to m (inclusive) | |
static float | clipminf (const float m, const float x) |
Clip lower bound of x to m (inclusive) | |
static float | clipminmaxf (const float min, const float x, const float max) |
Clip x to min and max (inclusive) | |
static float | clip0f (const float x) |
Clip lower bound of x to 0.f (inclusive) | |
static float | clip1f (const float x) |
Clip upper bound of x to 1.f (inclusive) | |
static float | clip01f (const float x) |
Clip x to [0.f, 1.f] (inclusive) | |
static float | clipm1f (const float x) |
Clip lower bound of x to -1.f (inclusive) | |
static float | clip1m1f (const float x) |
Clip x to [-1.f, 1.f] (inclusive) | |
Faster direct approximations of common trigonometric functions | |
| |
static float | fastsinf (float x) |
"Fast" sine approximation, valid for x in [-M_PI, M_PI] More... | |
static float | fastersinf (float x) |
"Faster" sine approximation, valid for x in [-M_PI, M_PI] More... | |
static float | fastsinfullf (float x) |
"Fast" sine approximation, valid on full x domain More... | |
static float | fastersinfullf (float x) |
"Faster" sine approximation, valid on full x domain More... | |
static float | fastcosf (float x) |
"Fast" cosine approximation, valid for x in [-M_PI, M_PI] More... | |
static float | fastercosf (float x) |
"Faster" cosine approximation, valid for x in [-M_PI, M_PI] More... | |
static float | fastcosfullf (float x) |
"Fast" cosine approximation, valid on full x domain More... | |
static float | fastercosfullf (float x) |
"Faster" cosine approximation, valid on full x domain More... | |
static float | fasttanf (float x) |
"Fast" tangent approximation, valid for x in [-M_PI_2, M_PI_2] More... | |
static float | fastertanf (float x) |
"Faster" tangent approximation, valid for x in [-M_PI_2, M_PI_2] More... | |
static float | fasttanfullf (float x) |
"Fast" tangent approximation, valid on full x domain, except where tangent diverges. More... | |
static float | fastertanfullf (float x) |
"Faster" tangent approximation, valid on full x domain, except where tangent diverges. More... | |
static float | fastlog2f (float x) |
"Fast" log base 2 approximation, valid for positive x as precision allows. More... | |
static float | fasterlog2f (float x) |
"Faster" log base 2 approximation, valid for positive x as precision allows. More... | |
static float | fastlogf (float x) |
"Fast" natural logarithm approximation, valid for positive x as precision allows. More... | |
static float | fasterlogf (float x) |
"Fast" natural logarithm approximation, valid for positive x as precision allows. More... | |
static float | fastpow2f (float p) |
"Fast" power of 2 approximation, valid for x in [ -126, ... More... | |
static float | fasterpow2f (float p) |
"Faster" power of 2 approximation, valid for x in [ -126, ... More... | |
static float | fastpowf (float x, float p) |
"Fast" x to the power of p approximation More... | |
static float | fasterpowf (float x, float p) |
"Faster" x to the power of p approximation More... | |
static float | fastexpf (float p) |
"Fast" exponential approximation, valid for x in [ ~ -87, ... More... | |
static float | fasterexpf (float p) |
"Faster" exponential approximation, valid for x in [ ~ -87, ... More... | |
static float | fasteratan2f (float y, float x) |
atan2 approximation More... | |
static float | fastertanhf (float x) |
Hyperbolic tangent approximation. More... | |
Useful Conversions | |
| |
static float | ampdbf (const float amp) |
Amplitude to dB. More... | |
static float | fasterampdbf (const float amp) |
"Faster" Amplitude to dB | |
static float | dbampf (const float db) |
dB to ampltitude | |
static float | fasterdbampf (const float db) |
"Faster" dB to ampltitude | |
Interpolations | |
| |
static float | linintf (const float fr, const float x0, const float x1) |
Linear interpolation. | |
static float | cosintf (const float fr, const float x0, const float x1) |
Cosine interpolation. | |
Floating Point Math Utilities.
Definition in file float_math.h.