Skip to content
Permalink
Browse files
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).
  • Loading branch information
aherbert committed Aug 24, 2021
1 parent f092264 commit 3d9f5db936a4934a52ed4a8e6473afe0665f0e98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
@@ -805,7 +805,7 @@ static class ModifiedZigguratNormalizedGaussianSampler implements ContinuousSamp
/** 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 @@ static class ModifiedZigguratNormalizedGaussianSampler512 implements ContinuousS
/** 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. */
@@ -514,8 +514,9 @@ public static final class NormalizedGaussian extends ZigguratSampler
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. */

0 comments on commit 3d9f5db

Please sign in to comment.