Yesterday, the best answer is: abs(ceil(x)-2-floor(cos(x))). (Contributed by fire. Good Job!)