|\tan(x/2)|=\frac{|\sin(x/2)|}{|\cos(x/2)|}=\sqrt{\frac{1-\cos x}{1+\cos x}}