Skip to content

Commit

Permalink
moved minSamplingRate to getUpperBound
Browse files Browse the repository at this point in the history
  • Loading branch information
dorx committed Jul 29, 2014
1 parent eaf5771 commit 245439e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ private[spark] object BinomialBounds {
*/
def getLowerBound(delta: Double, n: Long, fraction: Double): Double = {
val gamma = - math.log(delta) / n * (2.0 / 3.0)
math.max(minSamplingRate,
fraction + gamma - math.sqrt(gamma * gamma + 3 * gamma * fraction))
fraction + gamma - math.sqrt(gamma * gamma + 3 * gamma * fraction)
}

/**
Expand All @@ -158,6 +157,7 @@ private[spark] object BinomialBounds {
*/
def getUpperBound(delta: Double, n: Long, fraction: Double): Double = {
val gamma = - math.log(delta) / n
math.min(1, fraction + gamma + math.sqrt(gamma * gamma + 2 * gamma * fraction))
math.min(1,
math.max(minSamplingRate, fraction + gamma + math.sqrt(gamma * gamma + 2 * gamma * fraction)))
}
}

0 comments on commit 245439e

Please sign in to comment.