Skip to content
Permalink
Browse files
Update ZigguaratSampler concave epsilon for the exponential.
This should be equal to approximately 9.2%. The previous value was
approximately 5.6% resulting in fast acceptance too often for overhangs.
  • Loading branch information
aherbert committed Aug 24, 2021
1 parent 99002cd commit f092264615c5d81b6ff7f1a01ec6b64bb80eeb9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
@@ -2166,8 +2166,8 @@ protected static double fastPrngSampleY(int i, long uy) {
static class ModifiedZigguratExponentialSampler implements ContinuousSampler {
/** Maximum i value for early exit. */
protected static final int I_MAX = 252;
/** Maximum distance value for early exit. */
protected static final long IE_MAX = 513303011048449570L;
/** Maximum distance value for early exit. Equal to approximately 0.0926 scaled by 2^63. */
protected static final long IE_MAX = 853965788476313646L;
/** Beginning of tail. */
protected static final double X_0 = 7.569274694148063;

@@ -2858,8 +2858,8 @@ protected int expSampleA() {
static class ModifiedZigguratExponentialSampler512 implements ContinuousSampler {
/** Maximum i value for early exit. */
protected static final int I_MAX = 508;
/** Maximum distance value for early exit. */
protected static final long IE_MAX = 507874389497522840L;
/** Maximum distance value for early exit. Equal to approximately 0.0919 scaled by 2^63. */
protected static final long IE_MAX = 847415790149374212L;
/** Beginning of tail. */
protected static final double X_0 = 8.362025281328359;

@@ -121,8 +121,8 @@ public abstract class ZigguratSampler implements SharedStateContinuousSampler {
public static class Exponential extends ZigguratSampler {
/** Maximum i value for early exit. */
private static final int I_MAX = 252;
/** Maximum distance value for early exit. */
private static final long IE_MAX = 513303011048449570L;
/** Maximum distance value for early exit. Equal to approximately 0.0926 scaled by 2^63. */
private static final long IE_MAX = 853965788476313646L;
/** Beginning of tail. */
private static final double X_0 = 7.569274694148063;

0 comments on commit f092264

Please sign in to comment.