frac32.bipolar density
frac32buffer.bipolar impulses
frac32.u.map density
uint32_t r;
int32_t r2;
int32_t e;
int32_t density;
uint8_t c;
r = 137 + GenerateRandomNumber();
r2 = 123456789;
e = 1 << 27;
c = 0;
density = param_density + inlet_density;
density = ___SMMLA(density << 2, density << 3, density >> 4); // x^2 + x/16
density = ___SMMLA(density << 2, density << 3,
density >> 2); // (x^2 + x/16)^2 + (x^2 + x/16)/4
density >>= 6; // q31
r *= 69069UL;
if ((r >> 5) < density) {
r2 = 123456789;
e = 1 << 28;
}
e = ___SMMUL(e, (1 << 27) - (1 << 21)) << 5;
outlet_out = ___SMMUL(r2, e);
if ((c & 3) == 0)
r2 *= 69069;
c++;