Yesterday, nobody contributed anything. :-(
The official answer is:
cos(x) * floor(-ln(2 ^ x))