Solution (source code)

= Solution

The <quadratic formula> gives $t=-1\pm\sqrt2$. The <tangent function> is positive in the first quadrant, so the positive <polynomial root> is selected:
$$
\boxed{\tan\frac\pi8=\sqrt2-1.}
$$