69 final double EPSILONLR = 1.E-15;
70 final double EPSILON = 1.0E-290;
71 final double NXAPARAM = 6.5;
83 throw new IllegalArgumentException(
"Calling kolmogorovSmirnovPlusJumpOne " +
"with N < 1");
84 if (a >= 1.0 || a <= 0.0)
85 throw new IllegalArgumentException(
"Calling kolmogorovSmirnovPlusJumpOne " +
"with a outside (0, 1)");
90 LogCom = Math.log((
double) N);
95 if (N * (x + a) < NXAPARAM && a + x < 0.5) {
96 jmax = (int) (N * (x + a));
97 for (j = 1; j <= jmax; j++) {
101 if ((q < 0.0 && ((j & 1) != 0)) || ((q > 1.0) && (((N - j - 1) & 1) != 0)))
108 p1 = Math.abs(1.0 - q);
109 if (q1 > EPSILON && p1 > EPSILON) {
110 term = LogCom + jreal * Math.log(q1) + (Njreal - 1.0) * Math.log(p1);
111 Sum += Sign * Math.exp(term);
113 LogCom += Math.log(Njreal / (jreal + 1.0));
116 Sum += Math.exp((N - 1) * Math.log(1.0 + x));
126 jmax = (int) (N * (1.0 - a - x - EPSILONLR));
127 for (j = 1; j <= jmax; j++) {
131 if (1.0 - q > EPSILON) {
132 term = LogCom + (jreal - 1.0) * Math.log(q) + Njreal * Math.log(1.0 - q);
133 Sum += Math.exp(term);
135 LogCom += Math.log(Njreal / (jreal + 1.0));
140 if (1.0 - x > EPSILON)
141 Sum += Math.exp(N * Math.log(1.0 - x));