\sqrt{\frac{u1}{1 - u1}} \cdot \sin \left(6.28318530718 \cdot u2\right)\sqrt{\frac{u1}{1 - u1 \cdot u1} \cdot \left(u1 + 1\right)} \cdot \sin \left(\sqrt[3]{\left(\left(\sqrt[3]{6.28318530718} \cdot \sqrt[3]{6.28318530718}\right) \cdot \left(\left(\sqrt[3]{6.28318530718} \cdot \sqrt[3]{6.28318530718}\right) \cdot \left(\sqrt[3]{6.28318530718} \cdot \sqrt[3]{6.28318530718}\right)\right)\right) \cdot \left(6.28318530718 \cdot \left(u2 \cdot \left(u2 \cdot u2\right)\right)\right)}\right)(FPCore (cosTheta_i u1 u2) :precision binary32 (* (sqrt (/ u1 (- 1.0 u1))) (sin (* 6.28318530718 u2))))
(FPCore (cosTheta_i u1 u2)
:precision binary32
(*
(sqrt (* (/ u1 (- 1.0 (* u1 u1))) (+ u1 1.0)))
(sin
(cbrt
(*
(*
(* (cbrt 6.28318530718) (cbrt 6.28318530718))
(*
(* (cbrt 6.28318530718) (cbrt 6.28318530718))
(* (cbrt 6.28318530718) (cbrt 6.28318530718))))
(* 6.28318530718 (* u2 (* u2 u2))))))))float code(float cosTheta_i, float u1, float u2) {
return sqrtf(u1 / (1.0f - u1)) * sinf(6.28318530718f * u2);
}
float code(float cosTheta_i, float u1, float u2) {
return sqrtf((u1 / (1.0f - (u1 * u1))) * (u1 + 1.0f)) * sinf(cbrtf(((cbrtf(6.28318530718f) * cbrtf(6.28318530718f)) * ((cbrtf(6.28318530718f) * cbrtf(6.28318530718f)) * (cbrtf(6.28318530718f) * cbrtf(6.28318530718f)))) * (6.28318530718f * (u2 * (u2 * u2)))));
}



Bits error versus cosTheta_i



Bits error versus u1



Bits error versus u2
Results
Initial program 0.5
rmApplied add-cube-cbrt_binary320.5
Applied associate-*l*_binary320.5
Simplified0.5
rmApplied flip--_binary320.5
Applied associate-/r/_binary320.5
Simplified0.5
rmApplied add-cbrt-cube_binary320.5
Applied cbrt-unprod_binary320.6
Applied add-cbrt-cube_binary320.6
Applied cbrt-unprod_binary320.5
Final simplification0.5
herbie shell --seed 2021174
(FPCore (cosTheta_i u1 u2)
:name "Trowbridge-Reitz Sample, near normal, slope_y"
:precision binary32
:pre (and (> cosTheta_i 0.9999) (<= cosTheta_i 1.0) (<= 2.328306437e-10 u1 1.0) (<= 2.328306437e-10 u2 1.0))
(* (sqrt (/ u1 (- 1.0 u1))) (sin (* 6.28318530718 u2))))