Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Nov 28, 2021
1 parent 3350085 commit 823853c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/stats/welch.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,8 @@ export const isDiffPrecise = function (
return false
}

const adjustedLoopsA = applyImpreciseEnvDev(
loopsA,
envDevA,
ENV_DEV_IMPRECISION,
)
const adjustedLoopsB = applyImpreciseEnvDev(
loopsB,
envDevB,
ENV_DEV_IMPRECISION,
)
const adjustedLoopsA = adjustLoops(loopsA, envDevA)
const adjustedLoopsB = adjustLoops(loopsB, envDevB)
return (
hasPreciseLoops(adjustedLoopsA, adjustedLoopsB) &&
welchTTest({
Expand All @@ -72,6 +64,11 @@ const hasPreciseStdev = function (stdevA, stdevB) {
)
}

// We take `envDev` into account
const adjustLoops = function (loops, envDev) {
return applyImpreciseEnvDev(loops, envDev, ENV_DEV_IMPRECISION)
}

// A higher value creates more false negatives.
// A lower value creates more false positives.
// False positives are more disruptives to the user experience, so we prefer
Expand Down

0 comments on commit 823853c

Please sign in to comment.