Tent map (source code)

= Tent map
{wiki}

The full tent map on the unit interval is
$$
T(x)=
\begin{cases}
2x,&0\leq x\leq1/2,\\
2-2x,&1/2\leq x\leq1.
\end{cases}
$$
Its two affine branches expand lengths by two, and it preserves <Lebesgue measure>.