Trowbridge-Reitz Sample, sample surface normal, cosTheta

Specification

?
\[\left(\left(\left(2.328306437 \cdot 10^{-10} \leq u0 \land u0 \leq 1\right) \land \left(2.328306437 \cdot 10^{-10} \leq u1 \land u1 \leq 0.5\right)\right) \land \left(0.0001 \leq alphax \land alphax \leq 1\right)\right) \land \left(0.0001 \leq alphay \land alphay \leq 1\right)\]
\[\begin{array}{l} t_0 := \tan^{-1} \left(\frac{alphay}{alphax} \cdot \tan \left(\left(2 \cdot \pi\right) \cdot u1 + 0.5 \cdot \pi\right)\right)\\ t_1 := \sin t\_0\\ t_2 := \cos t\_0\\ \frac{1}{\sqrt{1 + \frac{\frac{1}{\frac{t\_2 \cdot t\_2}{alphax \cdot alphax} + \frac{t\_1 \cdot t\_1}{alphay \cdot alphay}} \cdot u0}{1 - u0}}} \end{array} \]
(FPCore (u0 u1 alphax alphay)
  :precision binary32
  (let* ((t_0
        (atan
         (*
          (/ alphay alphax)
          (tan (+ (* (* 2.0 PI) u1) (* 0.5 PI))))))
       (t_1 (sin t_0))
       (t_2 (cos t_0)))
  (/
   1.0
   (sqrt
    (+
     1.0
     (/
      (*
       (/
        1.0
        (+
         (/ (* t_2 t_2) (* alphax alphax))
         (/ (* t_1 t_1) (* alphay alphay))))
       u0)
      (- 1.0 u0)))))))
float code(float u0, float u1, float alphax, float alphay) {
	float t_0 = atanf(((alphay / alphax) * tanf((((2.0f * ((float) M_PI)) * u1) + (0.5f * ((float) M_PI))))));
	float t_1 = sinf(t_0);
	float t_2 = cosf(t_0);
	return 1.0f / sqrtf((1.0f + (((1.0f / (((t_2 * t_2) / (alphax * alphax)) + ((t_1 * t_1) / (alphay * alphay)))) * u0) / (1.0f - u0))));
}
function code(u0, u1, alphax, alphay)
	t_0 = atan(Float32(Float32(alphay / alphax) * tan(Float32(Float32(Float32(Float32(2.0) * Float32(pi)) * u1) + Float32(Float32(0.5) * Float32(pi))))))
	t_1 = sin(t_0)
	t_2 = cos(t_0)
	return Float32(Float32(1.0) / sqrt(Float32(Float32(1.0) + Float32(Float32(Float32(Float32(1.0) / Float32(Float32(Float32(t_2 * t_2) / Float32(alphax * alphax)) + Float32(Float32(t_1 * t_1) / Float32(alphay * alphay)))) * u0) / Float32(Float32(1.0) - u0)))))
end
function tmp = code(u0, u1, alphax, alphay)
	t_0 = atan(((alphay / alphax) * tan((((single(2.0) * single(pi)) * u1) + (single(0.5) * single(pi))))));
	t_1 = sin(t_0);
	t_2 = cos(t_0);
	tmp = single(1.0) / sqrt((single(1.0) + (((single(1.0) / (((t_2 * t_2) / (alphax * alphax)) + ((t_1 * t_1) / (alphay * alphay)))) * u0) / (single(1.0) - u0))));
end
\begin{array}{l}
t_0 := \tan^{-1} \left(\frac{alphay}{alphax} \cdot \tan \left(\left(2 \cdot \pi\right) \cdot u1 + 0.5 \cdot \pi\right)\right)\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
\frac{1}{\sqrt{1 + \frac{\frac{1}{\frac{t\_2 \cdot t\_2}{alphax \cdot alphax} + \frac{t\_1 \cdot t\_1}{alphay \cdot alphay}} \cdot u0}{1 - u0}}}
\end{array}

Timeout after 2.5min

Use the --timeout flag to change the timeout.