Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
giladbarkan-github committed Sep 17, 2024
1 parent 887202b commit 27fd95e
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions ts/src/flexible-event/privacy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,28 @@ void test('epsilonToBoundInfoGainAndDp', async (t) => {
const numTests = 500

await Promise.all(
Array(numTests).fill(0).map((_, i) =>
t.test(`${i}`, () => {
const numStates = Math.ceil(Math.random() * numStatesRange)
const infoGainUpper = infoGainUppers[Math.round(Math.random())]!
Array(numTests)
.fill(0)
.map((_, i) =>
t.test(`${i}`, () => {
const numStates = Math.ceil(Math.random() * numStatesRange)
const infoGainUpper = infoGainUppers[Math.round(Math.random())]!

const epsilon = epsilonToBoundInfoGainAndDp(
numStates,
infoGainUpper,
epsilonUpper
)
const epsilon = epsilonToBoundInfoGainAndDp(
numStates,
infoGainUpper,
epsilonUpper
)

assert(maxInformationGain(numStates, epsilon) <= infoGainUpper)
assert(maxInformationGain(numStates, epsilon) <= infoGainUpper)

if (epsilon < epsilonUpper) {
assert(maxInformationGain(numStates, epsilon + 1e-15) > infoGainUpper)
}
})
)
if (epsilon < epsilonUpper) {
assert(
maxInformationGain(numStates, epsilon + 1e-15) > infoGainUpper
)
}
})
)
)
})

Expand Down

0 comments on commit 27fd95e

Please sign in to comment.