MCPcopy Create free account
hub / github.com/numpy/numpy / random_standard_exponential_f

Function random_standard_exponential_f

numpy/random/src/distributions/distributions.c:97–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97float random_standard_exponential_f(bitgen_t *bitgen_state) {
98 uint32_t ri;
99 uint8_t idx;
100 float x;
101 ri = next_uint32(bitgen_state);
102 ri >>= 1;
103 idx = ri & 0xFF;
104 ri >>= 8;
105 x = ri * we_float[idx];
106 if (ri < ke_float[idx]) {
107 return x; /* 98.9% of the time we return here 1st try */
108 }
109 return standard_exponential_unlikely_f(bitgen_state, idx, x);
110}
111
112void random_standard_exponential_fill_f(bitgen_t * bitgen_state, npy_intp cnt, float * out)
113{

Calls 2

next_uint32Function · 0.85

Tested by

no test coverage detected