Skip to content

Commit 4cfaf30

Browse files
authored
Merge pull request #1 from CunMayday/codex/fix-issue-with-sample.html-loading
Fix erf definition order to prevent blank page
2 parents d879bb8 + 3a98c27 commit 4cfaf30

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sample.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,12 @@
7070
},
7171
};
7272

73-
const normalCDF = (x) => 0.5 * (1 + erf(x / Math.sqrt(2)));
74-
75-
const erf = (x) => {
76-
const a1 = 0.254829592;
77-
const a2 = -0.284496736;
78-
const a3 = 1.421413741;
79-
const a4 = -1.453152027;
80-
const a5 = 1.061405429;
73+
const erf = (x) => {
74+
const a1 = 0.254829592;
75+
const a2 = -0.284496736;
76+
const a3 = 1.421413741;
77+
const a4 = -1.453152027;
78+
const a5 = 1.061405429;
8179
const p = 0.3275911;
8280

8381
const sign = x >= 0 ? 1 : -1;
@@ -92,6 +90,8 @@
9290
return sign * y;
9391
};
9492

93+
const normalCDF = (x) => 0.5 * (1 + erf(x / Math.sqrt(2)));
94+
9595
const calculatePower = (n1, n2, p1, p2) => {
9696
const pooledP = (n1 * p1 + n2 * p2) / (n1 + n2);
9797
const se1 = Math.sqrt(

0 commit comments

Comments
 (0)