| 62 | } |
| 63 | return counter; |
| 64 | } |
| 65 | |
| 66 | void box_muller(uint32_t uniform0, uint32_t uniform1, float & normal0, float & normal1) { |
| 67 | const float radius_input = |
| 68 | static_cast<float>(uniform0) * kInvTwoPow32 + (kInvTwoPow32 * 0.5F); |
| 69 | const float angle = |
| 70 | static_cast<float>(uniform1) * kInvTwoPow32TwoPi + (kInvTwoPow32TwoPi * 0.5F); |
| 71 | const float radius = std::sqrt(-2.0F * std::log(radius_input)); |
| 72 | normal0 = radius * std::sin(angle); |
| 73 | normal1 = radius * std::cos(angle); |
| 74 | } |
| 75 |
no outgoing calls
no test coverage detected