Return-Path: X-Original-To: apmail-commons-notifications-archive@minotaur.apache.org Delivered-To: apmail-commons-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A4C7818809 for ; Mon, 27 Jul 2015 19:43:11 +0000 (UTC) Received: (qmail 30137 invoked by uid 500); 27 Jul 2015 19:42:13 -0000 Delivered-To: apmail-commons-notifications-archive@commons.apache.org Received: (qmail 30091 invoked by uid 500); 27 Jul 2015 19:42:13 -0000 Mailing-List: contact notifications-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list notifications@commons.apache.org Received: (qmail 29682 invoked by uid 99); 27 Jul 2015 19:42:12 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jul 2015 19:42:12 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id D2D46AC0ADB for ; Mon, 27 Jul 2015 19:42:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r959803 [18/32] - in /websites/production/commons/content/proper/commons-math: jacoco/ jacoco/org.apache.commons.math3.fraction/ jacoco/org.apache.commons.math3.genetics/ jacoco/org.apache.commons.math3.geometry.euclidean.threed/ jacoco/org... Date: Mon, 27 Jul 2015 19:42:10 -0000 To: notifications@commons.apache.org From: luc@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150727194212.D2D46AC0ADB@hades.apache.org> Modified: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.random/index.source.html ============================================================================== --- websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.random/index.source.html (original) +++ websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.random/index.source.html Mon Jul 27 19:42:09 2015 @@ -1 +1 @@ -org.apache.commons.math3.random

org.apache.commons.math3.random

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
T otal830 of 7,31789%57 of 36384%1074831811,27063299031
RandomDataImpl.java185137%n/a32343843323401
RandomDataGenerator.java12464584%175376%14702414723501
StableRandomGenerator.java8017068%51979%4146330201
EmpiricalDistribution.java5788594%65290%13742219774504
SobolSequenceGenerator.java5444389%63686%629151010801
CorrelatedRandomVectorGenerator.java5010367%3770%41112312601
BitsStreamGenerator.java4222784%41478%32075511101
RandomGeneratorFactory.java386463%2250%41782431502
AbstractRandomGenerator.java3516983%51777%52274711101
ValueServer.java3335291%22392%34178012601
ISAACRandom.java3099297%11995%223512911301
RandomAdaptor.java225371%4233%51772331401
Well44497a.java1516191%2100%264262501
Well512a.java15117 89%n/a254212501
SynchronizedRandomGenerator.java154073%n/a31261831201
MersenneTwister.java48698%12796%1232760901
UncorrelatedRandomVectorGenerator.java7090%1375%151170301
Well19937a.java15796%n/a152241501
Well1024a.java13095%n/a152221501
JDKRandomGenerator.java62%n/a13251 301
HaltonSequenceGenerator.java493100%16100%0150330701
AbstractWell.java241100%8100%0110390701
Well44497b.java192100%2100%0602805 01
Well19937c.java180100%n/a050260501
UnitSphereRandomVectorGenerator.java66100%4100%050160301
UniformRandomGenerator.java20100%n/a03050301
GaussianRandomGenera tor.java10100%n/a02040201
\ No newline at end of file +org.apache.commons.math3.random

org.apache.commons.math3.random

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
T otal837 of 7,31789%57 of 36384%1084831831,27064299031
RandomDataImpl.java185137%n/a32343843323401
RandomDataGenerator.java12464584%175376%14702414723501
StableRandomGenerator.java8017068%51979%4146330201
EmpiricalDistribution.java5788594%65290%13742219774504
SobolSequenceGenerator.java5444389%63686%629151010801
CorrelatedRandomVectorGenerator.java5010367%3770%41112312601
BitsStreamGenerator.java4222784%41478%32075511101
RandomGeneratorFactory.java386463%2250%41782431502
AbstractRandomGenerator.java3516983%51777%52274711101
ValueServer.java3335291%22392%34178012601
ISAACRandom.java3099297%11995%223512911301
RandomAdaptor.java225371%4233%51772331401
Well44497a.java1516191%2100%264262501
Well512a.java15117 89%n/a254212501
SynchronizedRandomGenerator.java154073%n/a31261831201
MersenneTwister.java48698%12796%1232760901
UncorrelatedRandomVectorGenerator.java7090%1375%151170301
Well44497b.java18596%2100%162281501
Well19937a.java15796%n/a152241501
Well1024a.java13095%n/a 152221501
JDKRandomGenerator.java62%n/a13251301
HaltonSequenceGenerator.java493100%16100%0150330701
AbstractWell.java241100%8100%01103907< /td>01
Well19937c.java180100%n/a050260501
UnitSphereRandomVectorGenerator.java66100%4100%050160301
UniformRandomGenerator.java20100%n/a03050301
GaussianRandomGenerat or.java10100%n/a02040201
\ No newline at end of file Modified: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.special/Gamma.html ============================================================================== --- websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.special/Gamma.html (original) +++ websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.special/Gamma.html Mon Jul 27 19:42:09 2015 @@ -1 +1 @@ -Gamma

Gamma

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total29 of 1,02297%7 of 9092%85851 60113
gamma(double)1110891%11393%1812501
regularizedGammaP(double, double, double, int)910492%41882%41221901
trigamma(double)65189%2467%241601
Gamma()0%n/a111111
invGamma1pm1(double)375100%12100%0706401
logGamma(double)95100%12100%0701601
static {...}69100%n/a010201
regularizedGammaQ(double, double, double, int)68100%12100%0701001
digamma(doub le)52100%6100%040601
logGamma1p(double)31100%4100%030501
lanczos(double)28100%2100%020401
regularizedGammaP(double, double)6100%n/a010101
regularizedGammaQ(double, double)6100%n/a010101
\ No newline at end of file +Gamma

Gamma

< td class="ctr1" id="j9">0
ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total29 of 1,03897%7 of 9893%86251 64113
gamma(double)1110891%11393%1812501
regularizedGammaP(double, double, double, int)910492%41882%41221901
trigamma(double)65991%2880%261801
Gamma()0%n/a111111
invGamma1pm1(double)375100%12100%0706401
logGamma(double)95100%12100%0701601
static {...}69100%n/a010201
regularizedGammaQ(double, double, double, int)68100%12100%0701001
digamma(doub le)60100%10100%060801
logGamma1p(double)31100%4100%03051
lanczos(double)28100%2100%020401
regularizedGammaP(double, double)6100%n/a010101
regularizedGammaQ(double, double)6100%n/a010101
\ No newline at end of file Modified: websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.special/Gamma.java.html ============================================================================== --- websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.special/Gamma.java.html (original) +++ websites/production/commons/content/proper/commons-math/jacoco/org.apache.commons.math3.special/Gamma.java.html Mon Jul 27 19:42:09 2015 @@ -442,22 +442,26 @@ public class Gamma { * @since 2.0 */ public static double digamma(double x) { - if (x > 0 && x <= S_LIMIT) { + if (Double.isNaN(x) || Double.isInfinite(x)) { + return x; + } + + if (x > 0 && x <= S_LIMIT) { // use method 5 from Bernardo AS103 // accurate to O(x) - return -GAMMA - 1 / x; + return -GAMMA - 1 / x; } - if (x >= C_LIMIT) { + if (x >= C_LIMIT) { // use method 4 (accurate to O(1/x^8) - double inv = 1 / (x * x); + double inv = 1 / (x * x); // 1 1 1 1 // log(x) - --- - ------ + ------- - ------- // 2 x 12 x^2 120 x^4 252 x^6 - return FastMath.log(x) - 0.5 / x - inv * ((1.0 / 12) + inv * (1.0 / 120 - inv / 252)); + return FastMath.log(x) - 0.5 / x - inv * ((1.0 / 12) + inv * (1.0 / 120 - inv / 252)); } - return digamma(x + 1) - 1 / x; + return digamma(x + 1) - 1 / x; } /** @@ -472,20 +476,24 @@ public class Gamma { * @since 2.0 */ public static double trigamma(double x) { - if (x > 0 && x <= S_LIMIT) { - return 1 / (x * x); + if (Double.isNaN(x) || Double.isInfinite(x)) { + return x; + } + + if (x > 0 && x <= S_LIMIT) { + return 1 / (x * x); } - if (x >= C_LIMIT) { - double inv = 1 / (x * x); + if (x >= C_LIMIT) { + double inv = 1 / (x * x); // 1 1 1 1 1 // - + ---- + ---- - ----- + ----- // x 2 3 5 7 // 2 x 6 x 30 x 42 x - return 1 / x + inv / 2 + inv / x * (1.0 / 6 - inv * (1.0 / 30 + inv / 42)); + return 1 / x + inv / 2 + inv / x * (1.0 / 6 - inv * (1.0 / 30 + inv / 42)); } - return trigamma(x + 1) + 1 / (x * x); + return trigamma(x + 1) + 1 / (x * x); } /** @@ -509,11 +517,11 @@ public class Gamma { * @since 3.1 */ public static double lanczos(final double x) { - double sum = 0.0; - for (int i = LANCZOS.length - 1; i > 0; --i) { - sum += LANCZOS[i] / (x + i); + double sum = 0.0; + for (int i = LANCZOS.length - 1; i > 0; --i) { + sum += LANCZOS[i] / (x + i); } - return sum + LANCZOS[0]; + return sum + LANCZOS[0]; } /** @@ -530,84 +538,84 @@ public class Gamma { */ public static double invGamma1pm1(final double x) { - if (x < -0.5) { - throw new NumberIsTooSmallException(x, -0.5, true); + if (x < -0.5) { + throw new NumberIsTooSmallException(x, -0.5, true); } - if (x > 1.5) { - throw new NumberIsTooLargeException(x, 1.5, true); + if (x > 1.5) { + throw new NumberIsTooLargeException(x, 1.5, true); } final double ret; - final double t = x <= 0.5 ? x : (x - 0.5) - 0.5; - if (t < 0.0) { - final double a = INV_GAMMA1P_M1_A0 + t * INV_GAMMA1P_M1_A1; - double b = INV_GAMMA1P_M1_B8; - b = INV_GAMMA1P_M1_B7 + t * b; - b = INV_GAMMA1P_M1_B6 + t * b; - b = INV_GAMMA1P_M1_B5 + t * b; - b = INV_GAMMA1P_M1_B4 + t * b; - b = INV_GAMMA1P_M1_B3 + t * b; - b = INV_GAMMA1P_M1_B2 + t * b; - b = INV_GAMMA1P_M1_B1 + t * b; - b = 1.0 + t * b; - - double c = INV_GAMMA1P_M1_C13 + t * (a / b); - c = INV_GAMMA1P_M1_C12 + t * c; - c = INV_GAMMA1P_M1_C11 + t * c; - c = INV_GAMMA1P_M1_C10 + t * c; - c = INV_GAMMA1P_M1_C9 + t * c; - c = INV_GAMMA1P_M1_C8 + t * c; - c = INV_GAMMA1P_M1_C7 + t * c; - c = INV_GAMMA1P_M1_C6 + t * c; - c = INV_GAMMA1P_M1_C5 + t * c; - c = INV_GAMMA1P_M1_C4 + t * c; - c = INV_GAMMA1P_M1_C3 + t * c; - c = INV_GAMMA1P_M1_C2 + t * c; - c = INV_GAMMA1P_M1_C1 + t * c; - c = INV_GAMMA1P_M1_C + t * c; - if (x > 0.5) { - ret = t * c / x; + final double t = x <= 0.5 ? x : (x - 0.5) - 0.5; + if (t < 0.0) { + final double a = INV_GAMMA1P_M1_A0 + t * INV_GAMMA1P_M1_A1; + double b = INV_GAMMA1P_M1_B8; + b = INV_GAMMA1P_M1_B7 + t * b; + b = INV_GAMMA1P_M1_B6 + t * b; + b = INV_GAMMA1P_M1_B5 + t * b; + b = INV_GAMMA1P_M1_B4 + t * b; + b = INV_GAMMA1P_M1_B3 + t * b; + b = INV_GAMMA1P_M1_B2 + t * b; + b = INV_GAMMA1P_M1_B1 + t * b; + b = 1.0 + t * b; + + double c = INV_GAMMA1P_M1_C13 + t * (a / b); + c = INV_GAMMA1P_M1_C12 + t * c; + c = INV_GAMMA1P_M1_C11 + t * c; + c = INV_GAMMA1P_M1_C10 + t * c; + c = INV_GAMMA1P_M1_C9 + t * c; + c = INV_GAMMA1P_M1_C8 + t * c; + c = INV_GAMMA1P_M1_C7 + t * c; + c = INV_GAMMA1P_M1_C6 + t * c; + c = INV_GAMMA1P_M1_C5 + t * c; + c = INV_GAMMA1P_M1_C4 + t * c; + c = INV_GAMMA1P_M1_C3 + t * c; + c = INV_GAMMA1P_M1_C2 + t * c; + c = INV_GAMMA1P_M1_C1 + t * c; + c = INV_GAMMA1P_M1_C + t * c; + if (x > 0.5) { + ret = t * c / x; } else { - ret = x * ((c + 0.5) + 0.5); + ret = x * ((c + 0.5) + 0.5); } - } else { - double p = INV_GAMMA1P_M1_P6; - p = INV_GAMMA1P_M1_P5 + t * p; - p = INV_GAMMA1P_M1_P4 + t * p; - p = INV_GAMMA1P_M1_P3 + t * p; - p = INV_GAMMA1P_M1_P2 + t * p; - p = INV_GAMMA1P_M1_P1 + t * p; - p = INV_GAMMA1P_M1_P0 + t * p; - - double q = INV_GAMMA1P_M1_Q4; - q = INV_GAMMA1P_M1_Q3 + t * q; - q = INV_GAMMA1P_M1_Q2 + t * q; - q = INV_GAMMA1P_M1_Q1 + t * q; - q = 1.0 + t * q; - - double c = INV_GAMMA1P_M1_C13 + (p / q) * t; - c = INV_GAMMA1P_M1_C12 + t * c; - c = INV_GAMMA1P_M1_C11 + t * c; - c = INV_GAMMA1P_M1_C10 + t * c; - c = INV_GAMMA1P_M1_C9 + t * c; - c = INV_GAMMA1P_M1_C8 + t * c; - c = INV_GAMMA1P_M1_C7 + t * c; - c = INV_GAMMA1P_M1_C6 + t * c; - c = INV_GAMMA1P_M1_C5 + t * c; - c = INV_GAMMA1P_M1_C4 + t * c; - c = INV_GAMMA1P_M1_C3 + t * c; - c = INV_GAMMA1P_M1_C2 + t * c; - c = INV_GAMMA1P_M1_C1 + t * c; - c = INV_GAMMA1P_M1_C0 + t * c; + } else { + double p = INV_GAMMA1P_M1_P6; + p = INV_GAMMA1P_M1_P5 + t * p; + p = INV_GAMMA1P_M1_P4 + t * p; + p = INV_GAMMA1P_M1_P3 + t * p; + p = INV_GAMMA1P_M1_P2 + t * p; + p = INV_GAMMA1P_M1_P1 + t * p; + p = INV_GAMMA1P_M1_P0 + t * p; + + double q = INV_GAMMA1P_M1_Q4; + q = INV_GAMMA1P_M1_Q3 + t * q; + q = INV_GAMMA1P_M1_Q2 + t * q; + q = INV_GAMMA1P_M1_Q1 + t * q; + q = 1.0 + t * q; + + double c = INV_GAMMA1P_M1_C13 + (p / q) * t; + c = INV_GAMMA1P_M1_C12 + t * c; + c = INV_GAMMA1P_M1_C11 + t * c; + c = INV_GAMMA1P_M1_C10 + t * c; + c = INV_GAMMA1P_M1_C9 + t * c; + c = INV_GAMMA1P_M1_C8 + t * c; + c = INV_GAMMA1P_M1_C7 + t * c; + c = INV_GAMMA1P_M1_C6 + t * c; + c = INV_GAMMA1P_M1_C5 + t * c; + c = INV_GAMMA1P_M1_C4 + t * c; + c = INV_GAMMA1P_M1_C3 + t * c; + c = INV_GAMMA1P_M1_C2 + t * c; + c = INV_GAMMA1P_M1_C1 + t * c; + c = INV_GAMMA1P_M1_C0 + t * c; - if (x > 0.5) { - ret = (t / x) * ((c - 0.5) - 0.5); + if (x > 0.5) { + ret = (t / x) * ((c - 0.5) - 0.5); } else { - ret = x * c; + ret = x * c; } } - return ret; + return ret; } /** @@ -624,14 +632,14 @@ public class Gamma { public static double logGamma1p(final double x) throws NumberIsTooSmallException, NumberIsTooLargeException { - if (x < -0.5) { - throw new NumberIsTooSmallException(x, -0.5, true); + if (x < -0.5) { + throw new NumberIsTooSmallException(x, -0.5, true); } - if (x > 1.5) { - throw new NumberIsTooLargeException(x, 1.5, true); + if (x > 1.5) { + throw new NumberIsTooLargeException(x, 1.5, true); } - return -FastMath.log1p(invGamma1pm1(x)); + return -FastMath.log1p(invGamma1pm1(x)); } @@ -646,14 +654,14 @@ public class Gamma { */ public static double gamma(final double x) { - if ((x == FastMath.rint(x)) && (x <= 0.0)) { - return Double.NaN; + if ((x == FastMath.rint(x)) && (x <= 0.0)) { + return Double.NaN; } final double ret; - final double absX = FastMath.abs(x); - if (absX <= 20.0) { - if (x >= 1.0) { + final double absX = FastMath.abs(x); + if (absX <= 20.0) { + if (x >= 1.0) { /* * From the recurrence relation * Gamma(x) = (x - 1) * ... * (x - n) * Gamma(x - n), @@ -662,14 +670,14 @@ public class Gamma { * where t = x - n. This means that t must satisfy * -0.5 <= t - 1 <= 1.5. */ - double prod = 1.0; - double t = x; - while (t > 2.5) { - t -= 1.0; - prod *= t; + double prod = 1.0; + double t = x; + while (t > 2.5) { + t -= 1.0; + prod *= t; } - ret = prod / (1.0 + invGamma1pm1(t - 1.0)); - } else { + ret = prod / (1.0 + invGamma1pm1(t - 1.0)); + } else { /* * From the recurrence relation * Gamma(x) = Gamma(x + n + 1) / [x * (x + 1) * ... * (x + n)] @@ -677,21 +685,21 @@ public class Gamma { * Gamma(x + n + 1) = 1 / [1 + invGamma1pm1(x + n)], * which requires -0.5 <= x + n <= 1.5. */ - double prod = x; - double t = x; - while (t < -0.5) { - t += 1.0; - prod *= t; + double prod = x; + double t = x; + while (t < -0.5) { + t += 1.0; + prod *= t; } - ret = 1.0 / (prod * (1.0 + invGamma1pm1(t))); - } + ret = 1.0 / (prod * (1.0 + invGamma1pm1(t))); + } } else { - final double y = absX + LANCZOS_G + 0.5; - final double gammaAbs = SQRT_TWO_PI / x * + final double y = absX + LANCZOS_G + 0.5; + final double gammaAbs = SQRT_TWO_PI / x * FastMath.pow(y, absX + 0.5) * FastMath.exp(-y) * lanczos(absX); - if (x > 0.0) { - ret = gammaAbs; + if (x > 0.0) { + ret = gammaAbs; } else { /* * From the reflection formula @@ -701,11 +709,11 @@ public class Gamma { * it is found * Gamma(x) = -pi / [x * sin(pi * x) * Gamma(-x)]. */ - ret = -FastMath.PI / + ret = -FastMath.PI / (x * FastMath.sin(FastMath.PI * x) * gammaAbs); } } - return ret; + return ret; } } \ No newline at end of file