Yesterday, nobody contributed anything. :-(
The official answer is:
log2(-(1 / (abs(x) * floor(-(x + 1)))))