public float nextLog() {
        // Generate a non-zero uniformly-distributed random value.
        float u;
        while ((u = gen.nextFloat()) == 0);     // try again if 0
        return (float) (-mean*Math.log(u));
    }