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

Function pcg_cm_step_r

numpy/random/src/pcg64/pcg64.h:217–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217static inline void pcg_cm_step_r(pcg_state_setseq_128 *rng) {
218#if defined _WIN32 && _M_AMD64
219 uint64_t h1;
220 pcg128_t product;
221
222 /* Manually inline the multiplication and addition using intrinsics */
223 h1 = rng->state.high * PCG_CHEAP_MULTIPLIER_128;
224 product.low =
225 _umul128(rng->state.low, PCG_CHEAP_MULTIPLIER_128, &(product.high));
226 product.high += h1;
227 _addcarry_u64(_addcarry_u64(0, product.low, rng->inc.low, &(rng->state.low)),
228 product.high, rng->inc.high, &(rng->state.high));
229#else
230 rng->state = pcg128_add(pcg128_mult_64(rng->state, PCG_CHEAP_MULTIPLIER_128),
231 rng->inc);
232#endif
233}
234
235
236static inline void pcg_cm_srandom_r(pcg_state_setseq_128 *rng, pcg128_t initstate, pcg128_t initseq) {

Callers 2

pcg_cm_srandom_rFunction · 0.85
pcg_cm_random_rFunction · 0.85

Calls 3

_umul128Function · 0.85
pcg128_addFunction · 0.85
pcg128_mult_64Function · 0.85

Tested by

no test coverage detected