
(FPCore (ux uy maxCos) :precision binary32 (let* ((t_0 (+ (- 1.0 ux) (* ux maxCos)))) (* (sin (* (* uy 2.0) (PI))) (sqrt (- 1.0 (* t_0 t_0))))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - ux\right) + ux \cdot maxCos\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - t\_0 \cdot t\_0}
\end{array}
\end{array}
Sampling outcomes in binary32 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (ux uy maxCos) :precision binary32 (let* ((t_0 (+ (- 1.0 ux) (* ux maxCos)))) (* (sin (* (* uy 2.0) (PI))) (sqrt (- 1.0 (* t_0 t_0))))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - ux\right) + ux \cdot maxCos\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - t\_0 \cdot t\_0}
\end{array}
\end{array}
(FPCore (ux uy maxCos) :precision binary32 (* (sqrt (* (- (- 2.0 (* (pow (- maxCos 1.0) 2.0) ux)) (* maxCos 2.0)) ux)) (sin (* 2.0 (* uy (PI))))))
\begin{array}{l}
\\
\sqrt{\left(\left(2 - {\left(maxCos - 1\right)}^{2} \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)
\end{array}
Initial program 57.1%
Taylor expanded in ux around inf
*-commutativeN/A
lower-*.f32N/A
lower--.f32N/A
+-commutativeN/A
lower-+.f32N/A
lower-/.f3258.1
Applied rewrites58.1%
lift-*.f32N/A
*-commutativeN/A
lift-PI.f32N/A
add-cube-cbrtN/A
lift-PI.f32N/A
lift-cbrt.f32N/A
associate-*l*N/A
lower-*.f32N/A
lift-PI.f32N/A
lift-cbrt.f32N/A
lift-PI.f32N/A
lift-cbrt.f32N/A
pow2N/A
lower-pow.f32N/A
lower-*.f3258.2
lift-*.f32N/A
*-commutativeN/A
lower-*.f3258.2
Applied rewrites58.2%
Taylor expanded in ux around 0
*-commutativeN/A
lower-*.f32N/A
lower--.f32N/A
mul-1-negN/A
unsub-negN/A
lower--.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-pow.f32N/A
lower--.f32N/A
lower-*.f3297.3
Applied rewrites97.3%
lift-*.f32N/A
lift-pow.f32N/A
unpow2N/A
lift-cbrt.f32N/A
lift-cbrt.f32N/A
cbrt-prodN/A
lift-*.f32N/A
lift-cbrt.f32N/A
lift-*.f32N/A
associate-*r*N/A
lift-cbrt.f32N/A
lift-*.f32N/A
cbrt-prodN/A
lift-cbrt.f32N/A
rem-3cbrt-lftN/A
lift-*.f32N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f3298.4
Applied rewrites98.4%
Final simplification98.4%
(FPCore (ux uy maxCos)
:precision binary32
(let* ((t_0 (- 2.0 (* (pow (- maxCos 1.0) 2.0) ux))))
(if (<= (* 2.0 uy) 0.014999999664723873)
(* (sqrt (* (- t_0 (* maxCos 2.0)) ux)) (* (* 2.0 (PI)) uy))
(* (sqrt (* (fma -2.0 maxCos t_0) ux)) (sin (* (* 2.0 uy) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 - {\left(maxCos - 1\right)}^{2} \cdot ux\\
\mathbf{if}\;2 \cdot uy \leq 0.014999999664723873:\\
\;\;\;\;\sqrt{\left(t\_0 - maxCos \cdot 2\right) \cdot ux} \cdot \left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-2, maxCos, t\_0\right) \cdot ux} \cdot \sin \left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 0.0149999997Initial program 56.5%
lift-+.f32N/A
lift--.f32N/A
flip--N/A
metadata-evalN/A
div-subN/A
associate-+l-N/A
lower--.f32N/A
lower-/.f32N/A
+-commutativeN/A
lower-+.f32N/A
lower--.f32N/A
lower-/.f32N/A
lower-*.f32N/A
+-commutativeN/A
lower-+.f3257.0
lift-*.f32N/A
*-commutativeN/A
lower-*.f3257.0
Applied rewrites57.0%
Taylor expanded in uy around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
lower-sqrt.f32N/A
lower--.f32N/A
Applied rewrites50.3%
Taylor expanded in ux around 0
Applied rewrites93.9%
if 0.0149999997 < (*.f32 uy #s(literal 2 binary32)) Initial program 59.1%
Taylor expanded in ux around 0
*-commutativeN/A
lower-*.f32N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f32N/A
mul-1-negN/A
unsub-negN/A
lower--.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-pow.f32N/A
lower--.f324.4
Applied rewrites2.8%
Final simplification93.5%
(FPCore (ux uy maxCos)
:precision binary32
(if (<= (* 2.0 uy) 0.005499999970197678)
(*
(sqrt (* (- (- 2.0 (* (pow (- maxCos 1.0) 2.0) ux)) (* maxCos 2.0)) ux))
(* (* 2.0 (PI)) uy))
(*
(sqrt
(- 1.0 (* (- (- (* maxCos ux) -1.0) ux) (- (* maxCos ux) (+ -1.0 ux)))))
(sin (* (* 2.0 uy) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot uy \leq 0.005499999970197678:\\
\;\;\;\;\sqrt{\left(\left(2 - {\left(maxCos - 1\right)}^{2} \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \cdot \left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 - \left(\left(maxCos \cdot ux - -1\right) - ux\right) \cdot \left(maxCos \cdot ux - \left(-1 + ux\right)\right)} \cdot \sin \left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 0.00549999997Initial program 55.8%
lift-+.f32N/A
lift--.f32N/A
flip--N/A
metadata-evalN/A
div-subN/A
associate-+l-N/A
lower--.f32N/A
lower-/.f32N/A
+-commutativeN/A
lower-+.f32N/A
lower--.f32N/A
lower-/.f32N/A
lower-*.f32N/A
+-commutativeN/A
lower-+.f3256.3
lift-*.f32N/A
*-commutativeN/A
lower-*.f3256.3
Applied rewrites56.3%
Taylor expanded in uy around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
lower-sqrt.f32N/A
lower--.f32N/A
Applied rewrites53.1%
Taylor expanded in ux around 0
Applied rewrites95.5%
if 0.00549999997 < (*.f32 uy #s(literal 2 binary32)) Initial program 60.5%
lift-+.f32N/A
lift--.f32N/A
sub-negN/A
+-commutativeN/A
associate-+l+N/A
lower-+.f32N/A
lower-neg.f32N/A
lower-+.f3261.1
lift-*.f32N/A
*-commutativeN/A
lower-*.f3261.1
Applied rewrites61.1%
Final simplification85.8%
(FPCore (ux uy maxCos)
:precision binary32
(if (<= (* 2.0 uy) 0.005499999970197678)
(*
(sqrt (* (- (- 2.0 (* (pow (- maxCos 1.0) 2.0) ux)) (* maxCos 2.0)) ux))
(* (* 2.0 (PI)) uy))
(*
(sqrt
(- 1.0 (* (- 1.0 (- ux (* maxCos ux))) (- (* maxCos ux) (+ -1.0 ux)))))
(sin (* (* 2.0 uy) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot uy \leq 0.005499999970197678:\\
\;\;\;\;\sqrt{\left(\left(2 - {\left(maxCos - 1\right)}^{2} \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \cdot \left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 - \left(1 - \left(ux - maxCos \cdot ux\right)\right) \cdot \left(maxCos \cdot ux - \left(-1 + ux\right)\right)} \cdot \sin \left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 0.00549999997Initial program 55.8%
lift-+.f32N/A
lift--.f32N/A
flip--N/A
metadata-evalN/A
div-subN/A
associate-+l-N/A
lower--.f32N/A
lower-/.f32N/A
+-commutativeN/A
lower-+.f32N/A
lower--.f32N/A
lower-/.f32N/A
lower-*.f32N/A
+-commutativeN/A
lower-+.f3256.3
lift-*.f32N/A
*-commutativeN/A
lower-*.f3256.3
Applied rewrites56.3%
Taylor expanded in uy around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
lower-sqrt.f32N/A
lower--.f32N/A
Applied rewrites53.9%
Taylor expanded in ux around 0
Applied rewrites95.5%
if 0.00549999997 < (*.f32 uy #s(literal 2 binary32)) Initial program 60.5%
lift-+.f32N/A
lift--.f32N/A
associate-+l-N/A
lower--.f32N/A
lower--.f3260.8
lift-*.f32N/A
*-commutativeN/A
lower-*.f3260.8
Applied rewrites60.8%
Final simplification85.8%
(FPCore (ux uy maxCos)
:precision binary32
(let* ((t_0 (- (+ -1.0 ux) (* maxCos ux))))
(if (<= (* 2.0 uy) 0.005499999970197678)
(*
(sqrt (* (- (- 2.0 (* (pow (- maxCos 1.0) 2.0) ux)) (* maxCos 2.0)) ux))
(* (* 2.0 (PI)) uy))
(* (sqrt (- 1.0 (* t_0 t_0))) (sin (* (* 2.0 uy) (PI)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-1 + ux\right) - maxCos \cdot ux\\
\mathbf{if}\;2 \cdot uy \leq 0.005499999970197678:\\
\;\;\;\;\sqrt{\left(\left(2 - {\left(maxCos - 1\right)}^{2} \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \cdot \left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 - t\_0 \cdot t\_0} \cdot \sin \left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 0.00549999997Initial program 55.8%
lift-+.f32N/A
lift--.f32N/A
flip--N/A
metadata-evalN/A
div-subN/A
associate-+l-N/A
lower--.f32N/A
lower-/.f32N/A
+-commutativeN/A
lower-+.f32N/A
lower--.f32N/A
lower-/.f32N/A
lower-*.f32N/A
+-commutativeN/A
lower-+.f3256.3
lift-*.f32N/A
*-commutativeN/A
lower-*.f3256.3
Applied rewrites56.3%
Taylor expanded in uy around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
lower-sqrt.f32N/A
lower--.f32N/A
Applied rewrites53.1%
Taylor expanded in ux around 0
Applied rewrites95.5%
if 0.00549999997 < (*.f32 uy #s(literal 2 binary32)) Initial program 60.5%
Final simplification85.7%
(FPCore (ux uy maxCos)
:precision binary32
(if (<= (* 2.0 uy) 0.005499999970197678)
(*
(sqrt (* (- (- 2.0 (* (pow (- maxCos 1.0) 2.0) ux)) (* maxCos 2.0)) ux))
(* (* 2.0 (PI)) uy))
(*
(sqrt (- 1.0 (* (- 1.0 ux) (- 1.0 (- ux (* maxCos ux))))))
(sin (* (* 2.0 uy) (PI))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot uy \leq 0.005499999970197678:\\
\;\;\;\;\sqrt{\left(\left(2 - {\left(maxCos - 1\right)}^{2} \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \cdot \left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 - \left(1 - ux\right) \cdot \left(1 - \left(ux - maxCos \cdot ux\right)\right)} \cdot \sin \left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 0.00549999997Initial program 55.8%
lift-+.f32N/A
lift--.f32N/A
flip--N/A
metadata-evalN/A
div-subN/A
associate-+l-N/A
lower--.f32N/A
lower-/.f32N/A
+-commutativeN/A
lower-+.f32N/A
lower--.f32N/A
lower-/.f32N/A
lower-*.f32N/A
+-commutativeN/A
lower-+.f3256.3
lift-*.f32N/A
*-commutativeN/A
lower-*.f3256.3
Applied rewrites56.3%
Taylor expanded in uy around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
lower-sqrt.f32N/A
lower--.f32N/A
Applied rewrites51.8%
Taylor expanded in ux around 0
Applied rewrites95.5%
if 0.00549999997 < (*.f32 uy #s(literal 2 binary32)) Initial program 60.5%
lift-+.f32N/A
lift--.f32N/A
associate-+l-N/A
lower--.f32N/A
lower--.f3260.8
lift-*.f32N/A
*-commutativeN/A
lower-*.f3260.8
Applied rewrites60.8%
Taylor expanded in maxCos around 0
lower--.f3260.0
Applied rewrites60.0%
Final simplification85.5%
(FPCore (ux uy maxCos) :precision binary32 (* (sqrt (- 1.0 (* (- 1.0 ux) (- 1.0 (- ux (* maxCos ux)))))) (sin (* (* 2.0 uy) (PI)))))
\begin{array}{l}
\\
\sqrt{1 - \left(1 - ux\right) \cdot \left(1 - \left(ux - maxCos \cdot ux\right)\right)} \cdot \sin \left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)
\end{array}
Initial program 57.1%
lift-+.f32N/A
lift--.f32N/A
associate-+l-N/A
lower--.f32N/A
lower--.f3257.3
lift-*.f32N/A
*-commutativeN/A
lower-*.f3257.3
Applied rewrites57.3%
Taylor expanded in maxCos around 0
lower--.f3255.8
Applied rewrites55.8%
Final simplification55.8%
(FPCore (ux uy maxCos) :precision binary32 (* (sqrt (- 1.0 (* (- 1.0 ux) (- (* maxCos ux) (+ -1.0 ux))))) (sin (* (* 2.0 uy) (PI)))))
\begin{array}{l}
\\
\sqrt{1 - \left(1 - ux\right) \cdot \left(maxCos \cdot ux - \left(-1 + ux\right)\right)} \cdot \sin \left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)
\end{array}
Initial program 57.1%
Taylor expanded in maxCos around 0
lower--.f3255.8
Applied rewrites55.8%
Final simplification55.8%
(FPCore (ux uy maxCos)
:precision binary32
(*
(sqrt
(-
1.0
(* (* (- maxCos (- 1.0 (/ 1.0 ux))) ux) (- (* maxCos ux) (+ -1.0 ux)))))
(* (* 2.0 (PI)) uy)))\begin{array}{l}
\\
\sqrt{1 - \left(\left(maxCos - \left(1 - \frac{1}{ux}\right)\right) \cdot ux\right) \cdot \left(maxCos \cdot ux - \left(-1 + ux\right)\right)} \cdot \left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right)
\end{array}
Initial program 57.1%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3249.4
Applied rewrites49.4%
Taylor expanded in ux around -inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f32N/A
mul-1-negN/A
sub-negN/A
associate--r+N/A
+-commutativeN/A
associate--r+N/A
lower--.f32N/A
lower--.f32N/A
lower-/.f32N/A
mul-1-negN/A
lower-neg.f3250.2
Applied rewrites50.2%
Final simplification50.2%
(FPCore (ux uy maxCos)
:precision binary32
(*
(sqrt
(-
1.0
(* (* (+ (/ (- 1.0 ux) maxCos) ux) maxCos) (- (* maxCos ux) (+ -1.0 ux)))))
(* (* 2.0 (PI)) uy)))\begin{array}{l}
\\
\sqrt{1 - \left(\left(\frac{1 - ux}{maxCos} + ux\right) \cdot maxCos\right) \cdot \left(maxCos \cdot ux - \left(-1 + ux\right)\right)} \cdot \left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right)
\end{array}
Initial program 57.1%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3249.4
Applied rewrites49.4%
Taylor expanded in maxCos around inf
*-commutativeN/A
lower-*.f32N/A
associate--l+N/A
div-subN/A
lower-+.f32N/A
lower-/.f32N/A
lower--.f3249.7
Applied rewrites49.7%
Final simplification49.7%
(FPCore (ux uy maxCos) :precision binary32 (* (* (* 2.0 (PI)) uy) (sqrt (- 1.0 (* (- 1.0 (- ux (* maxCos ux))) (- (* maxCos ux) (+ -1.0 ux)))))))
\begin{array}{l}
\\
\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot \sqrt{1 - \left(1 - \left(ux - maxCos \cdot ux\right)\right) \cdot \left(maxCos \cdot ux - \left(-1 + ux\right)\right)}
\end{array}
Initial program 57.1%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3249.4
Applied rewrites49.4%
lift-+.f32N/A
lift--.f32N/A
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
associate--r-N/A
lift--.f32N/A
lift--.f3249.4
Applied rewrites49.4%
Final simplification49.4%
(FPCore (ux uy maxCos) :precision binary32 (let* ((t_0 (- (+ -1.0 ux) (* maxCos ux)))) (* (* (* 2.0 (PI)) uy) (sqrt (- 1.0 (* t_0 t_0))))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-1 + ux\right) - maxCos \cdot ux\\
\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot \sqrt{1 - t\_0 \cdot t\_0}
\end{array}
\end{array}
Initial program 57.1%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3249.4
Applied rewrites49.4%
Final simplification49.4%
(FPCore (ux uy maxCos) :precision binary32 (* (* (* 2.0 (PI)) uy) (sqrt (- 1.0 (* (- 1.0 ux) (- 1.0 (- ux (* maxCos ux))))))))
\begin{array}{l}
\\
\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot \sqrt{1 - \left(1 - ux\right) \cdot \left(1 - \left(ux - maxCos \cdot ux\right)\right)}
\end{array}
Initial program 57.1%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3249.4
Applied rewrites49.4%
Taylor expanded in maxCos around 0
lower--.f3248.3
Applied rewrites48.3%
lift-+.f32N/A
lift--.f32N/A
associate-+l-N/A
lower--.f32N/A
lower--.f3248.3
lift-*.f32N/A
*-commutativeN/A
lift-*.f3248.3
Applied rewrites48.3%
Final simplification48.3%
(FPCore (ux uy maxCos) :precision binary32 (* (* (* 2.0 (PI)) uy) (sqrt (- 1.0 (* (- 1.0 ux) (- (* maxCos ux) (+ -1.0 ux)))))))
\begin{array}{l}
\\
\left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot \sqrt{1 - \left(1 - ux\right) \cdot \left(maxCos \cdot ux - \left(-1 + ux\right)\right)}
\end{array}
Initial program 57.1%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3249.4
Applied rewrites49.4%
Taylor expanded in maxCos around 0
lower--.f3248.3
Applied rewrites48.3%
Final simplification48.3%
(FPCore (ux uy maxCos) :precision binary32 (* (sqrt (- 1.0 (* (- 1.0 ux) (- 1.0 ux)))) (* (* 2.0 (PI)) uy)))
\begin{array}{l}
\\
\sqrt{1 - \left(1 - ux\right) \cdot \left(1 - ux\right)} \cdot \left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right)
\end{array}
Initial program 57.1%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3249.4
Applied rewrites49.4%
Taylor expanded in maxCos around 0
lower--.f3248.3
Applied rewrites48.3%
Taylor expanded in maxCos around 0
lower--.f3248.1
Applied rewrites48.1%
Final simplification48.1%
(FPCore (ux uy maxCos) :precision binary32 (* (sqrt (* (fma -2.0 maxCos 2.0) ux)) (* (* 2.0 (PI)) uy)))
\begin{array}{l}
\\
\sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux} \cdot \left(\left(2 \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right)
\end{array}
Initial program 57.1%
lift-+.f32N/A
lift--.f32N/A
flip--N/A
metadata-evalN/A
div-subN/A
associate-+l-N/A
lower--.f32N/A
lower-/.f32N/A
+-commutativeN/A
lower-+.f32N/A
lower--.f32N/A
lower-/.f32N/A
lower-*.f32N/A
+-commutativeN/A
lower-+.f3257.5
lift-*.f32N/A
*-commutativeN/A
lower-*.f3257.5
Applied rewrites57.5%
Taylor expanded in uy around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
lower-sqrt.f32N/A
lower--.f32N/A
Applied rewrites47.4%
Taylor expanded in ux around 0
Applied rewrites62.9%
Final simplification62.9%
(FPCore (ux uy maxCos) :precision binary32 (* (* (* (* (* (sqrt -1.0) (PI)) uy) ux) maxCos) 2.0))
\begin{array}{l}
\\
\left(\left(\left(\left(\sqrt{-1} \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot ux\right) \cdot maxCos\right) \cdot 2
\end{array}
Initial program 57.1%
lift-+.f32N/A
lift--.f32N/A
flip--N/A
metadata-evalN/A
div-subN/A
associate-+l-N/A
lower--.f32N/A
lower-/.f32N/A
+-commutativeN/A
lower-+.f32N/A
lower--.f32N/A
lower-/.f32N/A
lower-*.f32N/A
+-commutativeN/A
lower-+.f3257.5
lift-*.f32N/A
*-commutativeN/A
lower-*.f3257.5
Applied rewrites57.5%
Taylor expanded in uy around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
lower-sqrt.f32N/A
lower--.f32N/A
Applied rewrites46.4%
Taylor expanded in maxCos around inf
Applied rewrites-0.0%
herbie shell --seed 2024332
(FPCore (ux uy maxCos)
:name "UniformSampleCone, y"
:precision binary32
:pre (and (and (and (<= 2.328306437e-10 ux) (<= ux 1.0)) (and (<= 2.328306437e-10 uy) (<= uy 1.0))) (and (<= 0.0 maxCos) (<= maxCos 1.0)))
(* (sin (* (* uy 2.0) (PI))) (sqrt (- 1.0 (* (+ (- 1.0 ux) (* ux maxCos)) (+ (- 1.0 ux) (* ux maxCos)))))))