LogNormalDistribution extends AbstractRealDistribution { public double cumulativeProbability(double x) { if (x <= 0) { return 0; } final double dev = FastMath.log(x) - scale; if (FastMath.abs(dev) > 40 * shape) { return dev < 0 ? 0.0d : 1.0d; } return 0.5 + 0.5 * Erf.erf(dev / (shape * SQRT2)); } LogNormalDistribution();  LogNormalDistribution(double scale, double shape);  LogNormalDistribution(double scale, double shape, double inverseCumAccuracy);  LogNormalDistribution(RandomGenerator rng, double scale, double shape);  LogNormalDistribution(RandomGenerator rng,
                                 double scale,
                                 double shape,
                                 double inverseCumAccuracy); double getScale(); double getShape(); double density(double x); @Override double logDensity(double x); double cumulativeProbability(double x); @Override@Deprecated double cumulativeProbability(double x0, double x1); @Override double probability(double x0,
                              double x1); double getNumericalMean(); double getNumericalVariance(); double getSupportLowerBound(); double getSupportUpperBound(); boolean isSupportLowerBoundInclusive(); boolean isSupportUpperBoundInclusive(); boolean isSupportConnected(); @Override double sample(); static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY; }
@Test public void testExtremeValues() { LogNormalDistribution d = new LogNormalDistribution(0, 1); for (int i = 0; i < 1e5; i++) { double upperTail = d.cumulativeProbability(i); if (i <= 72) { Assert.assertTrue(upperTail < 1.0d); } else { Assert.assertTrue(upperTail > 0.99999); } } Assert.assertEquals(d.cumulativeProbability(Double.MAX_VALUE), 1, 0); Assert.assertEquals(d.cumulativeProbability(-Double.MAX_VALUE), 0, 0); Assert.assertEquals(d.cumulativeProbability(Double.POSITIVE_INFINITY), 1, 0); Assert.assertEquals(d.cumulativeProbability(Double.NEGATIVE_INFINITY), 0, 0); }