private double createFiniteLowerBound()

in commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/AbstractContinuousDistribution.java [269:293]


    private double createFiniteLowerBound(final double p, final double q, boolean complement,
        double upperBound, final double mu, final double sig, final boolean chebyshevApplies) {
        double lowerBound;
        if (chebyshevApplies) {
            lowerBound = mu - sig * Math.sqrt(q / p);
        } else {
            lowerBound = Double.NEGATIVE_INFINITY;
        }
        // Bound may have been set as infinite
        if (lowerBound == Double.NEGATIVE_INFINITY) {
            lowerBound = Math.min(-1, upperBound);
            if (complement) {
                while (survivalProbability(lowerBound) < q) {
                    lowerBound *= 2;
                }
            } else {
                while (cumulativeProbability(lowerBound) >= p) {
                    lowerBound *= 2;
                }
            }
            // Ensure finite
            lowerBound = Math.max(lowerBound, -Double.MAX_VALUE);
        }
        return lowerBound;
    }