Step 1: Apply the sum formula for two inverse tangents.
We use the formula $\tan^{-1} x + \tan^{-1} y = \tan^{-1} \left(\frac{x+y}{1-xy}\right)$, provided $xy<1$.
First, combine the first two terms: $\tan^{-1} \left(\frac{1}{8}\right) + \tan^{-1} \left(\frac{1}{2}\right)$.
Here $x = \frac{1}{8}$ and $y = \frac{1}{2}$. $xy = \frac{1}{8} \cdot \frac{1}{2} = \frac{1}{16}<1$.
\[ \tan^{-1} \left(\frac{1}{8}
ight) + \tan^{-1} \left(\frac{1}{2}
ight) = \tan^{-1} \left(\frac{\frac{1}{8} + \frac{1}{2{1 - \frac{1}{8} \cdot \frac{1}{2\right) \]
\[ = \tan^{-1} \left(\frac{\frac{1+4}{8{1 - \frac{1}{16\right) \]
\[ = \tan^{-1} \left(\frac{\frac{5}{8{\frac{16-1}{16\right) \]
\[ = \tan^{-1} \left(\frac{\frac{5}{8{\frac{15}{16\right) \]
Step 2: Simplify the result from Step 1.
\[ = \tan^{-1} \left(\frac{5}{8} \times \frac{16}{15}\right) \]
\[ = \tan^{-1} \left(\frac{5 \times 16}{8 \times 15}\right) \]
\[ = \tan^{-1} \left(\frac{1 \times 2}{1 \times 3}\right) \]
\[ = \tan^{-1} \left(\frac{2}{3}\right) \]
Step 3: Combine this result with the third term.
Now we need to calculate $\tan^{-1} \left(\frac{2}{3}
ight) + \tan^{-1} \left(\frac{1}{5}
ight)$.
Here $x = \frac{2}{3}$ and $y = \frac{1}{5}$. $xy = \frac{2}{3} \cdot \frac{1}{5} = \frac{2}{15}<1$.
\[ \tan^{-1} \left(\frac{2}{3}
ight) + \tan^{-1} \left(\frac{1}{5}
ight) = \tan^{-1} \left(\frac{\frac{2}{3} + \frac{1}{5{1 - \frac{2}{3} \cdot \frac{1}{5\right) \]
\[ = \tan^{-1} \left(\frac{\frac{10+3}{15{1 - \frac{2}{15\right) \]
\[ = \tan^{-1} \left(\frac{\frac{13}{15{\frac{15-2}{15\right) \]
\[ = \tan^{-1} \left(\frac{\frac{13}{15{\frac{13}{15\right) \]
Step 4: Determine the final value.
\[ = \tan^{-1} (1) \]
The value of $\theta$ for which $\tan \theta = 1$ is $\frac{\pi}{4}$.
\[ = \frac{\pi}{4} \]