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