Distance between incentre and orthocentre.
So applying cosine rule I got $$\small PI^2=4R^2+16R^2\sin^2\frac{B}{2}\sin^2\frac{C}{2} -16R^2\cos A\sin\frac{B}{2}\sin\frac{C}{2}\Bigg(\cos\frac{B}{2}\cos\frac{C}{2}+\sin\frac{B}{2}\sin\frac{C}{2}\Bigg)$$
I think that you have a typo (the red part) :
$$\begin{align}&\small PI^2=4R^2\color{red}{\cos^2A}+16R^2\sin^2\frac{B}{2}\sin^2\frac{C}{2} -16R^2\cos A\sin\frac{B}{2}\sin\frac{C}{2}\Bigg(\cos\frac{B}{2}\cos\frac{C}{2}+\sin\frac{B}{2}\sin\frac{C}{2}\Bigg)\\&\small=4R^2\left(\cos^2A+4\sin^2\frac{B}{2}\sin^2\frac{C}{2} -4\cos A\sin\frac{B}{2}\sin\frac{C}{2}\Bigg(\cos\frac{B}{2}\cos\frac{C}{2}+\sin\frac{B}{2}\sin\frac{C}{2}\Bigg)\right)\\&\small=4R^2\left(\cos^2A+4\sin^2\frac{B}{2}\sin^2\frac{C}{2}-\cos A\cdot \color{green}{2\sin\frac{B}{2}\cos\frac{B}{2}\cdot 2\sin\frac{C}{2}\cos\frac{C}{2}}-4\cos A\sin^2\frac{B}{2}\sin^2\frac{C}{2}\right)\\&\small=4R^2\left(\cos^2A+8\sin^2\frac{B}{2}\sin^2\frac{C}{2}\cdot \color{blue}{\frac 12\left(1-\cos A\right)}-\cos A\color{green}{\sin B\sin C}\right)\\&\small=4R^2\left(\cos^2A+8\color{blue}{\sin^2\frac A2}\sin^2\frac{B}{2}\sin^2\frac{C}{2}-\cos A\sin B\sin C\right)\\&\small=4R^2\left(8\sin^2\frac A2\sin^2\frac{B}{2}\sin^2\frac{C}{2}+\cos A(\cos A-\sin B\sin C)\right)\\&\small=4R^2\left(8\sin^2\frac A2\sin^2\frac{B}{2}\sin^2\frac{C}{2}+\cos A(\cos(180^\circ-(B+C))-\sin B\sin C)\right)\\&\small=4R^2\left(8\sin^2\frac A2\sin^2\frac{B}{2}\sin^2\frac{C}{2}-\cos A\cos B\cos C\right)\\&\small =2\left(4R\sin \frac A2\sin \frac B2\sin\frac C2\right)^2-4R^2\cos A\cos B\cos C\\&\small=2r^2-4R^2\cos A\cos B\cos C\end{align}$$