diff --git a/src/Numerics/Distributions/Binomial.cs b/src/Numerics/Distributions/Binomial.cs index a3fa2330..a1f3f096 100644 --- a/src/Numerics/Distributions/Binomial.cs +++ b/src/Numerics/Distributions/Binomial.cs @@ -265,13 +265,8 @@ namespace MathNet.Numerics.Distributions if (x < 0.0) return 0.0; if (x > _trials) return 1.0; - var cdf = 0.0; - for (var i = 0; i <= (int)Math.Floor(x); i++) - { - cdf += Combinatorics.Combinations(_trials, i)*Math.Pow(_p, i)*Math.Pow(1.0 - _p, _trials - i); - } - - return cdf; + double k = Math.Floor(x); + return SpecialFunctions.BetaRegularized(_trials - k, k + 1, 1 - _p); } /// diff --git a/src/Numerics/RootFinding/Broyden.cs b/src/Numerics/RootFinding/Broyden.cs index 1ebec75e..69c1a0fd 100644 --- a/src/Numerics/RootFinding/Broyden.cs +++ b/src/Numerics/RootFinding/Broyden.cs @@ -114,7 +114,7 @@ namespace MathNet.Numerics.RootFinding } /// - /// Helper method to calculate an approxiamtion of the Jacobian. + /// Helper method to calculate an approximation of the Jacobian. /// /// The function. /// The argument (initial guess).