Skip to content

Commit

Permalink
minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
oertl committed Nov 19, 2023
1 parent 94d6793 commit 3f84c0c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ static void checkPrecisionParameter(int p, int minP, int maxP) {
}
}

private static final double C0 = -1. / 3.;
private static final double C1 = 1. / 45.;
private static final double C2 = 1. / 472.5;

/**
* Maximizes the expression
*
Expand Down Expand Up @@ -156,11 +160,7 @@ static double solveMaximumLikelihoodEquation(double a, int[] b, double relativeE
rawX - ((Math.max(kMax, kappa) + 1L) << 52)); // xPrime in [0, 0.25]

double xPrime2 = xPrime * xPrime;
double h =
xPrime
+ xPrime2
* (-0.3333333333333333
+ xPrime2 * (0.022222222222222223 - xPrime2 * 0.0021164021164021165));
double h = xPrime + xPrime2 * (C0 + xPrime2 * (C1 - xPrime2 * C2));
for (int k = kappa - 1; k >= kMax; --k) {
double hPrime = 1. - h;
h = (xPrime + h * hPrime) / (xPrime + hPrime);
Expand Down

0 comments on commit 3f84c0c

Please sign in to comment.