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