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

Function random_standard_exponential

numpy/random/src/distributions/distributions.c:60–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60double random_standard_exponential(bitgen_t *bitgen_state) {
61 uint64_t ri;
62 uint8_t idx;
63 double x;
64 ri = next_uint64(bitgen_state);
65 ri >>= 3;
66 idx = ri & 0xFF;
67 ri >>= 8;
68 x = ri * we_double[idx];
69 if (ri < ke_double[idx]) {
70 return x; /* 98.9% of the time we return here 1st try */
71 }
72 return standard_exponential_unlikely(bitgen_state, idx, x);
73}
74
75void random_standard_exponential_fill(bitgen_t * bitgen_state, npy_intp cnt, double * out)
76{

Callers 9

random_standard_gammaFunction · 0.85
random_exponentialFunction · 0.85
random_paretoFunction · 0.85
random_weibullFunction · 0.85
random_powerFunction · 0.85
random_rayleighFunction · 0.85

Calls 2

next_uint64Function · 0.85

Tested by

no test coverage detected