Generates rationals in (-1, 1]
| 120 | |
| 121 | // Generates rationals in (-1, 1] |
| 122 | __device__ static float getFloatNegative11(uint num) { |
| 123 | // Conversion to floats adapted from Random123 |
| 124 | constexpr float factor = |
| 125 | ((1.0) / |
| 126 | (static_cast<double>(std::numeric_limits<int>::max()) + (1.0))); |
| 127 | constexpr float half_factor = ((0.5f) * factor); |
| 128 | |
| 129 | return fmaf(static_cast<float>(num), factor, half_factor); |
| 130 | } |
| 131 | |
| 132 | // Generates rationals in (0, 1] |
| 133 | __device__ static double getDouble01(uint num1, uint num2) { |
no test coverage detected