optimization-friendly, iterative, 22% faster bsearch()