This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-rng.git
commit 3d9f5db936a4934a52ed4a8e6473afe0665f0e98 Author: aherbert <[email protected]> AuthorDate: Tue Aug 24 14:36:26 2021 +0100 Update ZigguaratSampler point of inflection for the Gaussian. The point of inflection is the largest x value below 1. When x=1 the second derivative of the Gaussian is zero (i.e. the point of inflection). --- .../jmh/sampling/distribution/ZigguratSamplerPerformance.java | 4 ++-- .../apache/commons/rng/sampling/distribution/ZigguratSampler.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/ZigguratSamplerPerformance.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/ZigguratSamplerPerformance.java index a0812c8..8e2beca 100644 --- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/ZigguratSamplerPerformance.java +++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/ZigguratSamplerPerformance.java @@ -805,7 +805,7 @@ public class ZigguratSamplerPerformance { /** Maximum i value for early exit. */ protected static final int I_MAX = 253; /** The point where the Gaussian switches from convex to concave. */ - protected static final int J_INFLECTION = 205; + protected static final int J_INFLECTION = 204; /** Used for largest deviations of f(x) from y_i. This is negated on purpose. */ protected static final long MAX_IE = -2269182951627976004L; /** Used for largest deviations of f(x) from y_i. */ @@ -1556,7 +1556,7 @@ public class ZigguratSamplerPerformance { /** Maximum i value for early exit. */ protected static final int I_MAX = 509; /** The point where the Gaussian switches from convex to concave. */ - protected static final int J_INFLECTION = 410; + protected static final int J_INFLECTION = 409; /** Used for largest deviations of f(x) from y_i. This is negated on purpose. */ protected static final long MAX_IE = -2284356979160975476L; /** Used for largest deviations of f(x) from y_i. */ diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ZigguratSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ZigguratSampler.java index 7885360..cf10fbc 100644 --- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ZigguratSampler.java +++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/ZigguratSampler.java @@ -514,8 +514,9 @@ public abstract class ZigguratSampler implements SharedStateContinuousSampler { implements NormalizedGaussianSampler, SharedStateContinuousSampler { /** Maximum i value for early exit. */ private static final int I_MAX = 253; - /** The point where the Gaussian switches from convex to concave. */ - private static final int J_INFLECTION = 205; + /** The point where the Gaussian switches from convex to concave. + * This is the largest value of X[j] below 1. */ + private static final int J_INFLECTION = 204; /** Used for largest deviations of f(x) from y_i. This is negated on purpose. */ private static final long MAX_IE = -2269182951627976004L; /** Used for largest deviations of f(x) from y_i. */
