in cpc/cpc_compressed_state.go [1093:1125]
func determinePseudoPhase(lgK int, numCoupons int64) int {
k := int64(1) << uint(lgK)
c := numCoupons
// Midrange logic.
if (1000 * c) < (2375 * k) {
if (4 * c) < (3 * k) {
return 16 + 0
} else if (10 * c) < (11 * k) {
return 16 + 1
} else if (100 * c) < (132 * k) {
return 16 + 2
} else if (3 * c) < (5 * k) {
return 16 + 3
} else if (1000 * c) < (1965 * k) {
return 16 + 4
} else if (1000 * c) < (2275 * k) {
return 16 + 5
} else {
return 6 // steady-state table employed before its actual phase.
}
} else {
// Steady-state logic.
if lgK < 4 {
panic("determinePseudoPhase: lgK must be at least 4")
}
tmp := c >> uint(lgK-4)
phase := int(tmp & 15)
if phase < 0 || phase >= 16 {
panic(fmt.Sprintf("determinePseudoPhase: phase out of range: %d", phase))
}
return phase
}
}