--- a/src/java.base/share/classes/java/util/random/RandomSupport.java Wed Aug 07 15:35:55 2019 -0300
+++ b/src/java.base/share/classes/java/util/random/RandomSupport.java Thu Aug 08 11:06:54 2019 -0300
@@ -931,7 +931,8 @@
long UA = rng.nextLong();
int j = (int)UA & DoubleZigguratTables.exponentialAliasMask;
if (UA >= DoubleZigguratTables.exponentialAliasThreshold[j]) {
- j = DoubleZigguratTables.exponentialAliasMap[j] & DoubleZigguratTables.exponentialSignCorrectionMask;
+ j = DoubleZigguratTables.exponentialAliasMap[j] &
+ DoubleZigguratTables.exponentialSignCorrectionMask;
}
if (j > 0) { // Sample overhang j
// For the exponential distribution, every overhang is convex.
@@ -944,8 +945,8 @@
// Does the point lie below the curve?
long Udiff = U2 - U1;
if (Udiff < 0) {
- // We picked a point in the upper-right triangle. None of those can be accepted.
- // So remap the point into the lower-left triangle and try that.
+ // We picked a point in the upper-right triangle. None of those can be
+ // accepted. So remap the point into the lower-left triangle and try that.
// In effect, we swap U1 and U2, and invert the sign of Udiff.
Udiff = -Udiff;
U2 = U1;
@@ -1079,7 +1080,7 @@
// Compute the actual y-coordinate of the randomly chosen point.
double y = (Y[j] * 0x1.0p63) + ((Y[j] - Y[j-1]) * (double)U2);
// Now see how that y-coordinate compares to the curve
- if (y <= Math.exp(-0.5*x*x)) break; // The chosen point is below the curve; accept it.
+ if (y <= Math.exp(-0.5*x*x)) break; // The chosen point is below the curve; accept it.
// Otherwise, we reject this sample and have to try again.
}
} else {