| 160 | } |
| 161 | |
| 162 | static double RndGaussian(random::SimplePhilox* rnd) { |
| 163 | // Box-Muller transformation. |
| 164 | // See, for example, http://www.taygeta.com/random/gaussian.html |
| 165 | double x1, x2; |
| 166 | double r; |
| 167 | do { |
| 168 | x1 = 2 * rnd->RandDouble() - 1; |
| 169 | x2 = 2 * rnd->RandDouble() - 1; |
| 170 | r = x1 * x1 + x2 * x2; |
| 171 | } while (r == 0 || r >= 1.0); |
| 172 | double w = sqrt(-2.0 * log(r) / r); |
| 173 | return x1 * w; |
| 174 | } |
| 175 | |
| 176 | #define TCASE(NAME, DEPTH, BATCH, DEPTH_RADIUS, BIAS, ALPHA, BETA) \ |
| 177 | TEST_F(LRNFloatTest, NAME) { \ |
nothing calls this directly
no test coverage detected