frac32.bipolar density
frac32buffer.bipolar out
frac32.u.map density
float c = 64.0f;
float maxC = 0.0f;
int32_t acc, r1, r2, rm;
rm = GenerateRandomNumber();
int32_t jitter = (1 << 27) - __USAT(param_density + inlet_density, 27);
jitter = (___SMMUL(jitter, jitter) << 7);
if (c >= maxC) {
c = 0.0f;
maxC = arm::q_to_float(___SMMUL(jitter, GenerateRandomNumber()), 20) + 1.0f;
rm = -1511872763 * (rm - 1);
r1 = r2 = rm;
acc = 0;
}
c += 1.0f;
float _c = 1 / c;
// box add and substract
r1 = r1 * 69069 + 1;
acc -= r1 >> 16;
r2 = r2 * 69069 + 1;
acc += r2 >> 16;
// addition to the box
r2 = r2 * 69069 + 1;
acc += r2 >> 16;
outlet_out = arm::float_to_q(acc * _c, 27 - 15);