From c3b180fd99a2f0f7e7ce4d6126dd527a9c1d8b08 Mon Sep 17 00:00:00 2001 From: diluculo Date: Wed, 25 Sep 2019 12:00:30 +0900 Subject: [PATCH] Fix typos. --- .../Integration/GaussRule/GaussKronrodPoint.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Numerics/Integration/GaussRule/GaussKronrodPoint.cs b/src/Numerics/Integration/GaussRule/GaussKronrodPoint.cs index 8b682b86..e1f4e93a 100644 --- a/src/Numerics/Integration/GaussRule/GaussKronrodPoint.cs +++ b/src/Numerics/Integration/GaussRule/GaussKronrodPoint.cs @@ -412,9 +412,11 @@ namespace MathNet.Numerics.Integration.GaussRule } while (Math.Abs(dx) > eps && j < 100); + if (Math.Abs(x0) < Precision.MachineEpsilon) x0 = 0.0; + kronrodAbscissas[(k - 1) / 2] = x0; } - + // Concatenate two abscissas var abscissas = new double[gaussAbscissas.Length + kronrodAbscissas.Length]; @@ -475,13 +477,13 @@ namespace MathNet.Numerics.Integration.GaussRule if (order == 1) // P(1, x) return new double[] { 0, 1 }; else if (order == 2) // -2/5 * P(0, x) + P(2, x) - return new double[] { -0.4, 0, 1 }; + return new double[] { -0.4, 0, 1 }; else if (order == 3) // -9/14 * P(1, x) + P(3, x) - return new double[] { 0, -0.642857142857142857142857142857, 0, 1 }; - else if (order == 4) // 14/891 * P(0, x) - 30/27 * P(2, x) + P(4, x) - return new double[] { 0.0157126823793490460157126823793, 0, -1.11111111111111111111111111111, 0, 1 }; + return new double[] { 0, -0.642857142857142857142857142857, 0, 1 }; + else if (order == 4) // 14/891 * P(0, x) - 20/27 * P(2, x) + P(4, x) + return new double[] { 0.0157126823793490460157126823793, 0, -0.740740740740740740740740740741, 0, 1 }; else if (order == 5) // 135/12584 * P(1, x) - 35/44 * P(3, x) + P(5, x) - return new double[] { 0, 0.0107279084551811824539097266370, 0, -0.795454545454545454545454545455, 0, 1 }; + return new double[] { 0, 0.0107279084551811824539097266370, 0, -0.795454545454545454545454545455, 0, 1 }; int n = order - 1; int q = n.IsOdd() ? 1 : 0;