This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-statistics.git
commit 174022b6954d49f345d04e66152493a183ca8a3c Author: aherbert <aherb...@apache.org> AuthorDate: Wed Jul 21 13:55:53 2021 +0100 Use Math.lop1p --- .../apache/commons/statistics/distribution/ExponentialDistribution.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ExponentialDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ExponentialDistribution.java index e076197..dac9bc6 100644 --- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ExponentialDistribution.java +++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ExponentialDistribution.java @@ -109,7 +109,7 @@ public class ExponentialDistribution extends AbstractContinuousDistribution { } else if (p == 1) { ret = Double.POSITIVE_INFINITY; } else { - ret = -mean * Math.log(1 - p); + ret = -mean * Math.log1p(-p); } return ret;