Yesterday, nobody contributed anything. :-(
The official answer is:
1 / tan(floor(x ^ 2)) - 1