(floor(x) - (-1)^floor(x) * cos(pi*x))*abs(x)/pi