MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / getHalf01

Function getHalf01

src/backend/cpu/kernel/random_engine.hpp:74–78  ·  view source on GitHub ↗

Generates rationals in [0, 1)

Source from the content-addressed store, hash-verified

72
73// Generates rationals in [0, 1)
74arrayfire::common::half getHalf01(uint *val, uint index) {
75 float v = val[index >> 1U] >> (16U * (index & 1U)) & 0x0000ffff;
76 return static_cast<arrayfire::common::half>(
77 fmaf(v, unsigned_half_factor, unsigned_half_half_factor));
78}
79
80// Generates rationals in (-1, 1]
81static arrayfire::common::half getHalfNegative11(uint *val, uint index) {

Callers 1

boxMullerTransformFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected