| 116 | // |
| 117 | template<typename Tc> |
| 118 | static void boxMullerTransform(cfloat *const cOut, const Tc &r1, const Tc &r2) { |
| 119 | /* |
| 120 | * The log of a real value x where 0 < x < 1 is negative. |
| 121 | */ |
| 122 | Tc r = sycl::sqrt(neg_two<Tc>() * sycl::log(r2)); |
| 123 | Tc s, c; |
| 124 | |
| 125 | // Multiplying by PI instead of 2*PI seems to yeild a better distribution |
| 126 | // even though the original boxMuller algorithm calls for 2 * PI |
| 127 | // sincos(two_pi<Tc>() * r1, &s, &c); |
| 128 | sincospi(r1, &s, &c); |
| 129 | cOut->real(static_cast<float>(r * s)); |
| 130 | cOut->imag(static_cast<float>(r * c)); |
| 131 | } |
| 132 | |
| 133 | template<typename Tc> |
| 134 | static void boxMullerTransform(cdouble *const cOut, const Tc &r1, |
no test coverage detected