Scalar API quick reference#

Scalar type conversion#

Fixed-point scalar ops#

Table 11 Fixed-point scalar ops#

Function

Input Depth

Fractional Bits

Brief

s16_inverse()

16

0

\(x^{-1}\)

s32_inverse()

32

0

\(x^{-1}\)

sbrad_sin()

32

31

\(\sin(x)\)

sbrad_tan()

32

31

\(\tan(x)\)

q24_sin()

32

24

\(\sin(x)\)

q24_cos()

32

24

\(\cos(x)\)

q24_tan()

32

24

\(\tan(x)\)

q30_exp_small()

32

30

\(\exp(x)\)

q24_logistic()

32

24

\(\frac{1}{1+e^{-x}}\)

q24_logistic_fast()

32

24

\(\frac{1}{1+e^{-x}}\)

q30_powers()

32

30

\((0,x,x^2,x^3,\dots)\)

u32_ceil_log2()

32

0

\(\lceil\log_2(x)\rceil\)

IEEE 754 float ops#

Table 12 IEEE 754 float ops#

Function

Brief

f32_sin()

\(sin(x)\)

f32_cos()

\(cos(x)\)

f32_log2()

\(log_2(x)\)

f32_power_series()

Evaluate Power Series

f32_normA()

Normalized Form A

Non-standard scalar float ops#

Table 13 Non-standard scalar float ops#

Function

Brief

float_s32_mul()

\(x \times y\)

float_s32_add()

\(x + y\)

float_s32_sub()

\(x - y\)

float_s32_div()

\(\frac{x}{y}\)

float_s32_abs()

\(\left|x\right|\)

float_s32_gt()

\(x > y\)

float_s32_gte()

\(x \ge y\)

float_s32_ema()

\(\alpha x + (1 - \alpha) y\)

float_s32_sqrt()

\(\sqrt{x}\)

float_s32_exp()

\(exp(x)\)

s16_mul()

\(x \times y\)

s32_sqrt()

\(\sqrt{x}\)

s32_mul()

\(x \times y\)

s32_odd_powers()

\(x, x^3, x^5, x^7, \dots\)

Non-standard complex scalar float ops#

Table 14 Non-standard complex scalar float ops#

Function

Brief

float_complex_s16_mul()

\(x \times y\)

float_complex_s16_add()

\(x + y\)

float_complex_s16_sub()

\(x - y\)

float_complex_s32_mul()

\(x \times y\)

float_complex_s32_add()

\(x + y\)

float_complex_s32_sub()

\(x - y\)