ph-math/src/main/java/com/helger/numbercruncher/mathutils/RandomNormal.java
public float nextRatio ()
  {
    float u, v, x, xx;

    do
    {
      // u and v are two uniformly-distributed random values
      // in [0, 1), and u != 0.
      while ((u = GENERATOR.nextFloat ()) == 0)
      {
        // try again if 0
      }
      v = GENERATOR.nextFloat ();

      // y coord of point (u, y)
      final float y = C1 * (v - 0.5f);

      // ratio of point's coords
      x = y / u;

      xx = x * x;
    } while ((xx > 5f - C2 * u) && // quick acceptance
             ((xx >= C3 / u + 1.4f) || // quick rejection
              (xx > (float) (-4 * Math.log (u)))) // final test
    );

    return m_fStddev * x + m_fMean;
  }
public float nextRatio ()
  {
    float u, v, x, xx;

    do
    {
      // u and v are two uniformly-distributed random values
      // in [0, 1), and u != 0.
      while ((u = GENERATOR.nextFloat ()) == 0)
      {
        // try again if 0
      }
      v = GENERATOR.nextFloat ();

      // y coord of point (u, y)
      final float y = C1 * (v - 0.5f);

      // ratio of point's coords
      x = y / u;

      xx = x * x;
    } while ((xx > 5f - C2 * u) && // quick acceptance
             ((xx >= C3 / u + 1.4f) || // quick rejection
              (xx > (float) (-4 * Math.log (u)))) // final test
    );

    return m_fStddev * x + m_fMean;
  }
Compute the next random value using the ratio algorithm. Requires two
uniformly-distributed random values in [0, 1).