f(x) = x*cos(pi/x)