If \(\cos^2 \theta + \frac{1}{8} = \sin^2 \theta\), find \(\tan \theta\).