Generates rationals in (-1, 1]
| 61 | |
| 62 | // Generates rationals in (-1, 1] |
| 63 | static float getFloatNegative11(uint *val, uint index) { |
| 64 | // Conversion to floats adapted from Random123 |
| 65 | constexpr float factor = |
| 66 | ((1.0) / |
| 67 | (static_cast<double>(std::numeric_limits<int>::max()) + (1.0))); |
| 68 | constexpr float half_factor = ((0.5f) * factor); |
| 69 | |
| 70 | return fmaf(static_cast<float>(val[index]), factor, half_factor); |
| 71 | } |
| 72 | |
| 73 | // Generates rationals in [0, 1) |
| 74 | arrayfire::common::half getHalf01(uint *val, uint index) { |
no test coverage detected