spinn_common  7.4.2
Support code for SpiNNaker applications.
Functions | Variables
stdfix-exp.c File Reference

An implementation of exponential for fixpoint accum. More...

#include "stdfix-exp.h"
#include "utils.h"

Functions

static uint32_t coef_mult (uint32_t c, uint32_t x)
 Multiplies a coefficient and the variable term correctly and efficiently, implementing multiplication of accum values. More...
 
static uint32_t exp_series (uint32_t x)
 Exponential series, part of implementation of expk() More...
 
uint64_t __expi64 (int_k_t n)
 
accum expk (accum x)
 Fixed point exponential. More...
 
unsigned accum expuk (accum x)
 Fixed point exponential. More...
 
unsigned long fract expulr (accum x)
 Fixed point exponential. More...
 

Variables

static uint64_t __exp_hi [26]
 Series to support exponential: upper coefficients. More...
 
static uint32_t __expm1_mid [16]
 Series to support exponential: middle coefficients. More...
 
static uint32_t __exp_series [3] = { 5294, 4293434720, 2081624032 }
 Series to support exponential: lower coefficients.
 

Detailed Description

An implementation of exponential for fixpoint accum.

Author
Dave Lester (david.nosp@m..r.l.nosp@m.ester.nosp@m.@man.nosp@m.chest.nosp@m.er.a.nosp@m.c.uk)
Date
20 February, 2014

Function Documentation

◆ coef_mult()

static uint32_t coef_mult ( uint32_t  c,
uint32_t  x 
)
inlinestatic

Multiplies a coefficient and the variable term correctly and efficiently, implementing multiplication of accum values.

Parameters
[in]ca bit-cast accum
[in]xa bit-cast accum
Returns
The product, c × x, a bit-cast accum

◆ exp_series()

static uint32_t exp_series ( uint32_t  x)
inlinestatic

Exponential series, part of implementation of expk()

Parameters
[in]xThe argument
Returns
the result

◆ expk()

accum expk ( s1615  x)

Fixed point exponential.

Parameters
[in]xValue to compute the exponential of.
Returns
The best approximation to ex possible in an s1615

◆ expuk()

unsigned accum expuk ( s1615  x)

Fixed point exponential.

Parameters
[in]xValue to compute the exponential of.
Returns
The best approximation to ex possible in a u1616

◆ expulr()

unsigned long fract expulr ( s1615  x)

Fixed point exponential.

Parameters
[in]xValue to compute the exponential of.
Returns
The best approximation to ex possible in a u032

Variable Documentation

◆ __exp_hi

uint64_t __exp_hi[26]
static
Initial value:
= {
9708, 26389, 71733, 194991, 530041, 1440801,
3916503, 10646160, 28939262, 78665070, 213833830,
581260615, 1580030169, 4294967296, 11674931555, 31735754293,
86266724208, 234497268814, 637429664642, 1732713474316, 4710003551159,
12803117065094, 34802480465680, 94602950235157, 257157480542844, 699026506411923
}

Series to support exponential: upper coefficients.

◆ __expm1_mid

uint32_t __expm1_mid[16]
static
Initial value:
= {
0, 260218914, 504671961, 734314346,
950043403, 1152702096, 1343082321, 1521927990,
1689937949, 1847768698, 1996036966, 2135322113,
2266168400, 2389087112, 2504558555, 2613033936
}

Series to support exponential: middle coefficients.