-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath_103.diff
23 lines (23 loc) · 1.52 KB
/
math_103.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/src/java/org/apache/commons/math/distribution/NormalDistributionImpl.java b/src/java/org/apache/commons/math/distribution/NormalDistributionImpl.java
index 02810e142..28d87dfd6 100644
--- a/src/java/org/apache/commons/math/distribution/NormalDistributionImpl.java
+++ b/src/java/org/apache/commons/math/distribution/NormalDistributionImpl.java
@@ -106,6 +106,18 @@ public class NormalDistributionImpl extends AbstractContinuousDistribution
* convergence exception is caught and 0 or 1 is returned.
*/
public double cumulativeProbability(double x) throws MathException {
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ try { // defects4j.instrumentation
+ return cumulativeProbability_original(x); // defects4j.instrumentation
+ } catch (org.apache.commons.math.ConvergenceException e) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return cumulativeProbability_original(x); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
+ public double cumulativeProbability_original(double x) throws MathException { // defects4j.instrumentation
return 0.5 * (1.0 + Erf.erf((x - mean) /
(standardDeviation * Math.sqrt(2.0))));
}