I came up with this function:
$$2\left(\frac{1}{1+e^{\textstyle\frac{-6\sin^{-1}(\cos(x))}{\pi/2}}}-\frac12\right)$$
to mimic a 'cosine'-esque function with flat peaks and valleys. Here it is as plotted by Wolfram Alpha:
What I was wondering is, is there a more elegant way to achieve this effect? (The values the function outputs need not be the same as those of this function – it only needs to look cosine-esque and have flat peaks and valleys).
Best Answer
How about
$$\sqrt{\frac{1+b^2}{1+b^2 \cos^2 v}}\cos\,v$$
where $b$ is an adjustable parameter?