Changed branching, such that the code complies with the definition
referred to in the doc. [Spotted by D. Hendriks.] git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1292741 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
15a28dad20
commit
f9a9cde5fb
|
@ -260,7 +260,7 @@ public class TriangularDistribution extends AbstractRealDistribution {
|
|||
if (p == 1) {
|
||||
return b;
|
||||
}
|
||||
if (p <= (c - a) / (b - a)) {
|
||||
if (p < (c - a) / (b - a)) {
|
||||
return a + FastMath.sqrt(p * (b - a) * (c - a));
|
||||
}
|
||||
return b - FastMath.sqrt((1 - p) * (b - a) * (b - c));
|
||||
|
|
Loading…
Reference in New Issue