I am writing a glsl fragment shader in which I use shadow mapping. Following this tutorial http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/ , I wrote this line to evaluate the shaodw bias to avoid the shadow acne
float bias = 0.005 * tan( acos ( N_L_dot ) );
But I know from math that
tan ( acos ( x ) = sqrt ( 1 - x^2 ) / x
Would it be faster to use such identity instead of tan and acos? In practice, to use this line of code
float bias = 0.005 * sqrt ( 1.f - N_L_dot * N_L_dot ) / N_L_dot ;
I think my question is something like "Is the gpu faster at doing sqrt and divisions or tan and acos?" ...or am I missing something?