Proving $\pi = 48\tan^{-1}\frac{1}{18} + 32 \tan^{-1}\frac{1}{57} - 20\tan^{-1}\frac{1}{239}$ The below equation represents $\pi$ to some decimals using tangent inverse. I need to prove that the left hand side of the equation equals the right hand side.
$$
\pi = 48\tan^{-1}\frac{1}{18} + 32 \tan^{-1}\frac{1}{57} - 20\tan^{-1}\frac{1}{239}
$$

To prove given formula, we'll use identity (see here)
$$
\arctan\frac{a_1}{b_1} + \arctan\frac{a_2}{b_2} = \arctan\frac{a_1 b_2+a_2b_1}{b_1b_2-a_1a_2}.
\tag{1}
$$
Denote $$\arctan\frac{1}{b} = f(b).\tag{2}$$
Then given formula will have form
$$
f(1) = 12 f(18) + 8 f(57) - 5 f(239).\tag{3}
$$
The proof will be based on $2$-term-RHS identities which can be easily checked via $(1)$.
a): since $f(239)=4f(5)-f(1)$ (see Machin's Formula), after substituting $f(239)$ to $(3)$ we get equivalent formula to prove:
$$
f(1) = 5f(5)-3f(18)-2f(57).\tag{4}
$$
b): since $f(18)=f(5)-f(7)$, we get new identity to prove:
$$
f(1)=2f(5)+3f(7)-2f(57).\tag{5}
$$
c): since $f(57)=f(7)-f(8)$, we came to new identity to prove:
$$
f(1) = 2f(5)+f(7)+2f(8).\tag{6}
$$
d):
since $f(8)=f(3)-f(5)$, we came to $2$-term-RHS formula:
$$
f(1)=2f(3)+f(7),\tag{7}
$$
e):
and since $f(7)=f(2)-f(3)$, we came to another well-known Machin-like (Euler's) formula:
$$
f(1)=f(2)+f(3).\tag{8}
$$

So, given formula can be obtained from $(8)$: each step replaces argument to more appropriate two arguments (and replace $5$ at the final step). The sketch is:
$(2),3 \longrightarrow \color{red}{3},\color{red}{7}$ 
$(3),7 \longrightarrow \color{red}{5},7,\color{red}{8}$ 
$5,7,(8) \longrightarrow 5,\color{red}{7},\color{red}{57}$ 
$5,(7),57 \longrightarrow \color{red}{5},\color{red}{18},57$
$(5),18,57 \longrightarrow \color{red}{1},18,57,\color{red}{239}$.
