code: public double nextGaussian() {
          // See Knuth, ACP, Section 3.4.1 Algorithm C.
          if (haveNextNextGaussian) {
              haveNextNextGaussian = false;
              return nextNextGaussian;
          } else {
              double v1, v2, s;
              do {
                  v1 = 2 * nextDouble() - 1; // between -1 and 1
                  v2 = 2 * nextDouble() - 1; // between -1 and 1
                  s = v1 * v1 + v2 * v2;
              } while (s >= 1 || s == 0);
              double multiplier = StrictMath.sqrt(-2 * StrictMath.log(s) / s);
              nextNextGaussian = v2 * multiplier;
              haveNextNextGaussian = true;
              return v1 * multiplier;
          }
      }
docs: Returns the next pseudorandom, Gaussian ("normally") distributed
  {@code double} value with mean {@code 0.0} and standard
  deviation {@code 1.0} from this random number generator's sequence.
  
  @see java.util.Random#nextGaussian()