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 = gen.nextFloat()) == 0);  // try again if 0
            v = gen.nextFloat();
            
            float y = C1*(v - 0.5f);    // y coord of point (u, y)
            x = y/u;                    // ratio of point's coords
            
            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 stddev*x + mean;
    }