/** * Returns a random value according to the exponential distribution with the provided mean. * * @param random a uniformly distributed random value. * @param mean the desired mean. */ public static float exponential (float random, float mean) { return -FloatMath.log(1f - random) * mean; }
/** * Returns a random value according to the exponential distribution with the provided mean. * * @param random a uniformly distributed random value. * @param mean the desired mean. */ public static float exponential (float random, float mean) { return -FloatMath.log(1f - random) * mean; }