Discrete cosine transform from an even-reflected discrete Fourier transform
= Discrete cosine transform from an even-reflected discrete Fourier transform
Reflect $x$ evenly to length $2N$ by $y_n=x_n$ and $y_{2N-1-n}=x_n$. If $Y$ is the discrete Fourier transform of $y$, then
$$
Z_k=\frac12e^{-\pi ik/(2N)}Y_k.
$$
This reduction computes the cosine transform with one fast Fourier transform and $O(N)$ additional work.