LIBML  Version 3.2.4
LIBML DSP Software Library
Macros | Functions | Variables
tpt_pow_f32.c File Reference
#include "tpt_math.h"
Include dependency graph for tpt_pow_f32.c:

Macros

#define N   (1 << EXP2F_TABLE_BITS)
 
#define fp_barrierf   fp_barrierf
 
#define N   (1 << POWF_LOG2_TABLE_BITS)
 
#define T   __powf_log2_data.tab
 
#define A   __powf_log2_data.poly
 
#define OFF   0x3f330000
 
#define N   (1 << EXP2F_TABLE_BITS)
 
#define T   __exp2f_data.tab
 
#define SIGN_BIAS   (1 << (EXP2F_TABLE_BITS + 11))
 
#define C   __exp2f_data.poly
 
#define SHIFT   __exp2f_data.shift_scaled
 

Functions

static float fp_barrierf (float x)
 
static f64_t log2_inline (uint32_t ix)
 
static float exp2_inline (f64_t xd, uint32_t sign_bias)
 
static int checkint (uint32_t iy)
 
static int zeroinfnan (uint32_t ix)
 
f32_t tpt_pow_f32 (f32_t x, f32_t y)
 Calculate the y power of x of the f32 input value. More...
 

Variables

const struct powf_log2_data __powf_log2_data
 
const struct exp2f_data __exp2f_data
 

Macro Definition Documentation

◆ A

#define A   __powf_log2_data.poly

◆ C

#define C   __exp2f_data.poly

◆ fp_barrierf

#define fp_barrierf   fp_barrierf

◆ N [1/3]

#define N   (1 << EXP2F_TABLE_BITS)

◆ N [2/3]

#define N   (1 << POWF_LOG2_TABLE_BITS)

◆ N [3/3]

#define N   (1 << EXP2F_TABLE_BITS)

◆ OFF

#define OFF   0x3f330000

◆ SHIFT

#define SHIFT   __exp2f_data.shift_scaled

◆ SIGN_BIAS

#define SIGN_BIAS   (1 << (EXP2F_TABLE_BITS + 11))

◆ T [1/2]

#define T   __powf_log2_data.tab

◆ T [2/2]

#define T   __exp2f_data.tab

Function Documentation

◆ checkint()

static int checkint ( uint32_t  iy)
inlinestatic

◆ exp2_inline()

static float exp2_inline ( f64_t  xd,
uint32_t  sign_bias 
)
inlinestatic

◆ fp_barrierf()

static float fp_barrierf ( float  x)
inlinestatic

◆ log2_inline()

static f64_t log2_inline ( uint32_t  ix)
inlinestatic

◆ tpt_pow_f32()

f32_t tpt_pow_f32 ( f32_t  x,
f32_t  y 
)

Calculate the y power of x of the f32 input value.

Parameters
xBase
yExponent
Returns
f32_t

◆ zeroinfnan()

static int zeroinfnan ( uint32_t  ix)
inlinestatic

Variable Documentation

◆ __exp2f_data

const struct exp2f_data __exp2f_data
Initial value:
= {
.tab =
{
0x3ff0000000000000, 0x3fefd9b0d3158574, 0x3fefb5586cf9890f,
0x3fef9301d0125b51, 0x3fef72b83c7d517b, 0x3fef54873168b9aa,
0x3fef387a6e756238, 0x3fef1e9df51fdee1, 0x3fef06fe0a31b715,
0x3feef1a7373aa9cb, 0x3feedea64c123422, 0x3feece086061892d,
0x3feebfdad5362a27, 0x3feeb42b569d4f82, 0x3feeab07dd485429,
0x3feea47eb03a5585, 0x3feea09e667f3bcd, 0x3fee9f75e8ec5f74,
0x3feea11473eb0187, 0x3feea589994cce13, 0x3feeace5422aa0db,
0x3feeb737b0cdc5e5, 0x3feec49182a3f090, 0x3feed503b23e255d,
0x3feee89f995ad3ad, 0x3feeff76f2fb5e47, 0x3fef199bdd85529c,
0x3fef3720dcef9069, 0x3fef5818dcfba487, 0x3fef7c97337b9b5f,
0x3fefa4afa2a490da, 0x3fefd0765b6e4540,
},
.shift_scaled = 0x1.8p+52 / N,
.poly = {0x1.c6af84b912394p-5, 0x1.ebfce50fac4f3p-3, 0x1.62e42ff0c52d6p-1},
.shift = 0x1.8p+52,
.invln2_scaled = 0x1.71547652b82fep+0 * N,
.poly_scaled = {0x1.c6af84b912394p-5 / N / N / N,
0x1.ebfce50fac4f3p-3 / N / N, 0x1.62e42ff0c52d6p-1 / N},
}
#define N
Definition: tpt_pow_f32.c:127

◆ __powf_log2_data

const struct powf_log2_data __powf_log2_data
Initial value:
= {
.tab =
{
{0x1.661ec79f8f3bep+0, -0x1.efec65b963019p-2 * POWF_SCALE},
{0x1.571ed4aaf883dp+0, -0x1.b0b6832d4fca4p-2 * POWF_SCALE},
{0x1.49539f0f010bp+0, -0x1.7418b0a1fb77bp-2 * POWF_SCALE},
{0x1.3c995b0b80385p+0, -0x1.39de91a6dcf7bp-2 * POWF_SCALE},
{0x1.30d190c8864a5p+0, -0x1.01d9bf3f2b631p-2 * POWF_SCALE},
{0x1.25e227b0b8eap+0, -0x1.97c1d1b3b7afp-3 * POWF_SCALE},
{0x1.1bb4a4a1a343fp+0, -0x1.2f9e393af3c9fp-3 * POWF_SCALE},
{0x1.12358f08ae5bap+0, -0x1.960cbbf788d5cp-4 * POWF_SCALE},
{0x1.0953f419900a7p+0, -0x1.a6f9db6475fcep-5 * POWF_SCALE},
{0x1p+0, 0x0p+0 * POWF_SCALE},
{0x1.e608cfd9a47acp-1, 0x1.338ca9f24f53dp-4 * POWF_SCALE},
{0x1.ca4b31f026aap-1, 0x1.476a9543891bap-3 * POWF_SCALE},
{0x1.b2036576afce6p-1, 0x1.e840b4ac4e4d2p-3 * POWF_SCALE},
{0x1.9c2d163a1aa2dp-1, 0x1.40645f0c6651cp-2 * POWF_SCALE},
{0x1.886e6037841edp-1, 0x1.88e9c2c1b9ff8p-2 * POWF_SCALE},
{0x1.767dcf5534862p-1, 0x1.ce0a44eb17bccp-2 * POWF_SCALE},
},
.poly = {
0x1.27616c9496e0bp-2 * POWF_SCALE,
-0x1.71969a075c67ap-2 * POWF_SCALE,
0x1.ec70a6ca7baddp-2 * POWF_SCALE,
-0x1.7154748bef6c8p-1 * POWF_SCALE,
0x1.71547652ab82bp0 * POWF_SCALE,
}}
#define POWF_SCALE
Definition: tpt_math_config.h:139