Tweak binary search for 64-bit case

The binary search used in influence estimation was broken for 64-bit
values, since it was implicitly taking advantage of having extra bits.
Rewrite the way we choose the midpoint, and an assertion, so it doesn't
immediately fail (the old code had an infinite loop). Still only
lightly tested, though.