| 257 | |
| 258 | template<typename T> |
| 259 | void boxMullerTransform(data_t<T> *const out1, data_t<T> *const out2, |
| 260 | const T r1, const T r2) { |
| 261 | /* |
| 262 | * The log of a real value x where 0 < x < 1 is negative. |
| 263 | */ |
| 264 | using Tc = compute_t<T>; |
| 265 | Tc r = sqrt((Tc)(-2.0) * log(static_cast<Tc>(r2))); |
| 266 | Tc theta = PI_VAL * (static_cast<Tc>(r1)); |
| 267 | |
| 268 | *out1 = r * sin(theta); |
| 269 | *out2 = r * cos(theta); |
| 270 | } |
| 271 | |
| 272 | void boxMullerTransform(uint val[4], double *temp) { |
| 273 | boxMullerTransform<double>(&temp[0], &temp[1], getDoubleNegative11(val, 0), |
no test coverage detected