
(FPCore (ux uy maxCos) :precision binary32 (let* ((t_0 (+ (- 1.0 ux) (* ux maxCos)))) (* (cos (* (* 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\\
\cos \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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (ux uy maxCos) :precision binary32 (let* ((t_0 (+ (- 1.0 ux) (* ux maxCos)))) (* (cos (* (* 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\\
\cos \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 (* (cos (* (* uy 2.0) (PI))) (sqrt (* (- (- 2.0 (* (pow (- maxCos 1.0) 2.0) ux)) (* maxCos 2.0)) ux))))
\begin{array}{l}
\\
\cos \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 - {\left(maxCos - 1\right)}^{2} \cdot ux\right) - maxCos \cdot 2\right) \cdot ux}
\end{array}
Initial program 58.9%
Taylor expanded in ux around inf
*-commutativeN/A
lower-*.f32N/A
associate--r+N/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
div-subN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
lower--.f32N/A
lower-/.f32N/A
+-commutativeN/A
lower-fma.f32N/A
lower-pow.f32N/A
lower--.f32N/A
unpow2N/A
lower-*.f3270.1
Applied rewrites70.1%
Taylor expanded in ux around 0
Applied rewrites1.6%
Applied rewrites98.9%
(FPCore (ux uy maxCos)
:precision binary32
(let* ((t_0 (+ (- 1.0 ux) (* ux maxCos))) (t_1 (* (PI) (PI))))
(if (<=
(* (cos (* (* uy 2.0) (PI))) (sqrt (- 1.0 (* t_0 t_0))))
0.01860000006854534)
(* (+ (* (* t_1 uy) (* -2.0 uy)) 1.0) (sqrt (* (fma -2.0 maxCos 2.0) ux)))
(*
(fma (* (* uy uy) -2.0) t_1 1.0)
(sqrt (- 1.0 (* (- (- ux (* maxCos ux)) 1.0) (- ux 1.0))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - ux\right) + ux \cdot maxCos\\
t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;\cos \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - t\_0 \cdot t\_0} \leq 0.01860000006854534:\\
\;\;\;\;\left(\left(t\_1 \cdot uy\right) \cdot \left(-2 \cdot uy\right) + 1\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(uy \cdot uy\right) \cdot -2, t\_1, 1\right) \cdot \sqrt{1 - \left(\left(ux - maxCos \cdot ux\right) - 1\right) \cdot \left(ux - 1\right)}\\
\end{array}
\end{array}
if (*.f32 (cos.f32 (*.f32 (*.f32 uy #s(literal 2 binary32)) (PI.f32))) (sqrt.f32 (-.f32 #s(literal 1 binary32) (*.f32 (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)))))) < 0.0186000001Initial program 38.3%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3231.6
Applied rewrites31.2%
Applied rewrites33.6%
Taylor expanded in ux around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3277.6
Applied rewrites77.2%
if 0.0186000001 < (*.f32 (cos.f32 (*.f32 (*.f32 uy #s(literal 2 binary32)) (PI.f32))) (sqrt.f32 (-.f32 #s(literal 1 binary32) (*.f32 (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)))))) Initial program 90.4%
lift-*.f32N/A
unpow1N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
rem-sqrt-square-revN/A
lift-+.f32N/A
lift--.f32N/A
associate-+l-N/A
fabs-subN/A
unpow1N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
rem-sqrt-square-revN/A
lift-+.f32N/A
lift--.f32N/A
associate-+l-N/A
fabs-subN/A
Applied rewrites90.8%
Taylor expanded in maxCos around 0
lower--.f3287.5
Applied rewrites87.5%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3276.3
Applied rewrites76.3%
(FPCore (ux uy maxCos)
:precision binary32
(let* ((t_0 (+ (- 1.0 ux) (* ux maxCos))) (t_1 (* (PI) (PI))))
(if (<=
(* (cos (* (* uy 2.0) (PI))) (sqrt (- 1.0 (* t_0 t_0))))
0.01860000006854534)
(* (+ (* (* t_1 uy) (* -2.0 uy)) 1.0) (sqrt (* (fma -2.0 maxCos 2.0) ux)))
(* (fma (* (* uy uy) -2.0) t_1 1.0) (sqrt (- 1.0 (* t_0 (- 1.0 ux))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - ux\right) + ux \cdot maxCos\\
t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;\cos \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - t\_0 \cdot t\_0} \leq 0.01860000006854534:\\
\;\;\;\;\left(\left(t\_1 \cdot uy\right) \cdot \left(-2 \cdot uy\right) + 1\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(uy \cdot uy\right) \cdot -2, t\_1, 1\right) \cdot \sqrt{1 - t\_0 \cdot \left(1 - ux\right)}\\
\end{array}
\end{array}
if (*.f32 (cos.f32 (*.f32 (*.f32 uy #s(literal 2 binary32)) (PI.f32))) (sqrt.f32 (-.f32 #s(literal 1 binary32) (*.f32 (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)))))) < 0.0186000001Initial program 38.3%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3231.6
Applied rewrites31.6%
Applied rewrites33.6%
Taylor expanded in ux around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3277.6
Applied rewrites77.2%
if 0.0186000001 < (*.f32 (cos.f32 (*.f32 (*.f32 uy #s(literal 2 binary32)) (PI.f32))) (sqrt.f32 (-.f32 #s(literal 1 binary32) (*.f32 (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)))))) Initial program 90.4%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3278.4
Applied rewrites77.5%
Taylor expanded in maxCos around 0
lower--.f3276.3
Applied rewrites76.3%
(FPCore (ux uy maxCos) :precision binary32 (* (cos (* (* uy 2.0) (PI))) (sqrt (- (* (- 2.0 ux) ux) (* (* (fma -2.0 ux 2.0) ux) maxCos)))))
\begin{array}{l}
\\
\cos \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 - ux\right) \cdot ux - \left(\mathsf{fma}\left(-2, ux, 2\right) \cdot ux\right) \cdot maxCos}
\end{array}
Initial program 58.9%
Taylor expanded in ux around inf
*-commutativeN/A
lower-*.f32N/A
associate--r+N/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
div-subN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
lower--.f32N/A
lower-/.f32N/A
+-commutativeN/A
lower-fma.f32N/A
lower-pow.f32N/A
lower--.f32N/A
unpow2N/A
lower-*.f3270.1
Applied rewrites70.1%
Taylor expanded in ux around 0
Applied rewrites2.7%
Taylor expanded in maxCos around 0
Applied rewrites90.9%
(FPCore (ux uy maxCos) :precision binary32 (* (cos (* (* uy 2.0) (PI))) (sqrt (* (- 2.0 ux) ux))))
\begin{array}{l}
\\
\cos \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 - ux\right) \cdot ux}
\end{array}
Initial program 58.9%
Taylor expanded in ux around inf
*-commutativeN/A
lower-*.f32N/A
associate--r+N/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
div-subN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
lower--.f32N/A
lower-/.f32N/A
+-commutativeN/A
lower-fma.f32N/A
lower-pow.f32N/A
lower--.f32N/A
unpow2N/A
lower-*.f3270.1
Applied rewrites70.7%
Taylor expanded in ux around 0
Applied rewrites1.6%
Taylor expanded in maxCos around 0
Applied rewrites93.7%
(FPCore (ux uy maxCos)
:precision binary32
(let* ((t_0 (+ (* (* (* (PI) (PI)) uy) (* -2.0 uy)) 1.0)))
(if (<= ux 0.00012199999764561653)
(* t_0 (sqrt (* (fma -2.0 maxCos 2.0) ux)))
(*
t_0
(sqrt
(-
1.0
(* (- 1.0 (- ux (* ux maxCos))) (+ (- 1.0 ux) (* ux maxCos)))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot \left(-2 \cdot uy\right) + 1\\
\mathbf{if}\;ux \leq 0.00012199999764561653:\\
\;\;\;\;t\_0 \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sqrt{1 - \left(1 - \left(ux - ux \cdot maxCos\right)\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}\\
\end{array}
\end{array}
if ux < 1.22e-4Initial program 35.0%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3231.5
Applied rewrites31.5%
Applied rewrites32.6%
Taylor expanded in ux around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3280.1
Applied rewrites80.1%
if 1.22e-4 < ux Initial program 89.6%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3274.0
Applied rewrites74.0%
Applied rewrites79.4%
lift-+.f32N/A
lift--.f32N/A
associate-+l-N/A
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
lift--.f32N/A
lower--.f3279.6
lift-*.f32N/A
*-commutativeN/A
lift-*.f3279.6
Applied rewrites79.6%
(FPCore (ux uy maxCos)
:precision binary32
(let* ((t_0 (+ (* (* (* (PI) (PI)) uy) (* -2.0 uy)) 1.0))
(t_1 (+ (- 1.0 ux) (* ux maxCos))))
(if (<= ux 0.00012199999764561653)
(* t_0 (sqrt (* (fma -2.0 maxCos 2.0) ux)))
(* t_0 (sqrt (- 1.0 (* t_1 t_1)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot \left(-2 \cdot uy\right) + 1\\
t_1 := \left(1 - ux\right) + ux \cdot maxCos\\
\mathbf{if}\;ux \leq 0.00012199999764561653:\\
\;\;\;\;t\_0 \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sqrt{1 - t\_1 \cdot t\_1}\\
\end{array}
\end{array}
if ux < 1.22e-4Initial program 35.0%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3231.5
Applied rewrites31.1%
Applied rewrites32.6%
Taylor expanded in ux around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3280.1
Applied rewrites80.1%
if 1.22e-4 < ux Initial program 89.6%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3274.0
Applied rewrites74.0%
Applied rewrites79.4%
(FPCore (ux uy maxCos)
:precision binary32
(let* ((t_0 (+ (* (* (* (PI) (PI)) uy) (* -2.0 uy)) 1.0)))
(if (<= ux 0.0001500000071246177)
(* t_0 (sqrt (* (fma -2.0 maxCos 2.0) ux)))
(* t_0 (sqrt (- 1.0 (* (+ (- 1.0 ux) (* ux maxCos)) (- 1.0 ux))))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot \left(-2 \cdot uy\right) + 1\\
\mathbf{if}\;ux \leq 0.0001500000071246177:\\
\;\;\;\;t\_0 \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(1 - ux\right)}\\
\end{array}
\end{array}
if ux < 1.50000007e-4Initial program 35.7%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3232.1
Applied rewrites31.7%
Applied rewrites33.3%
Taylor expanded in ux around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3279.8
Applied rewrites79.4%
if 1.50000007e-4 < ux Initial program 90.1%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3274.4
Applied rewrites73.5%
Applied rewrites79.7%
Taylor expanded in maxCos around 0
lower--.f3277.5
Applied rewrites77.5%
(FPCore (ux uy maxCos) :precision binary32 (* (+ (* (* (* (PI) (PI)) uy) (* -2.0 uy)) 1.0) (sqrt (* (fma -2.0 maxCos 2.0) ux))))
\begin{array}{l}
\\
\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot \left(-2 \cdot uy\right) + 1\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux}
\end{array}
Initial program 58.9%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3250.1
Applied rewrites49.7%
Applied rewrites53.1%
Taylor expanded in ux around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3265.5
Applied rewrites65.5%
(FPCore (ux uy maxCos) :precision binary32 (* (* (* (* (* uy uy) -2.0) (PI)) (PI)) (sqrt (* (fma -2.0 maxCos 2.0) ux))))
\begin{array}{l}
\\
\left(\left(\left(\left(uy \cdot uy\right) \cdot -2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux}
\end{array}
Initial program 58.9%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3250.1
Applied rewrites49.7%
Taylor expanded in ux around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3261.5
Applied rewrites61.4%
Taylor expanded in uy around inf
Applied rewrites4.7%
Applied rewrites5.0%
(FPCore (ux uy maxCos) :precision binary32 (* (* (* (* (PI) (PI)) (* -2.0 uy)) uy) (sqrt (* (fma -2.0 maxCos 2.0) ux))))
\begin{array}{l}
\\
\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(-2 \cdot uy\right)\right) \cdot uy\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux}
\end{array}
Initial program 58.9%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3250.1
Applied rewrites49.7%
Taylor expanded in ux around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3261.5
Applied rewrites61.4%
Taylor expanded in uy around inf
Applied rewrites4.9%
Applied rewrites5.0%
(FPCore (ux uy maxCos) :precision binary32 (* (fma (* -2.0 (* uy uy)) (* (PI) (PI)) 1.0) (sqrt (* 2.0 ux))))
\begin{array}{l}
\\
\mathsf{fma}\left(-2 \cdot \left(uy \cdot uy\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 1\right) \cdot \sqrt{2 \cdot ux}
\end{array}
Initial program 58.9%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3250.1
Applied rewrites49.7%
Taylor expanded in ux around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3261.5
Applied rewrites61.4%
Applied rewrites61.4%
Taylor expanded in maxCos around 0
Applied rewrites61.4%
Final simplification61.5%
(FPCore (ux uy maxCos) :precision binary32 (* (* (* (* uy uy) -2.0) (* (PI) (PI))) (sqrt (* 2.0 ux))))
\begin{array}{l}
\\
\left(\left(\left(uy \cdot uy\right) \cdot -2\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{2 \cdot ux}
\end{array}
Initial program 58.9%
Taylor expanded in uy around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f32N/A
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
lower-PI.f32N/A
lower-PI.f3250.1
Applied rewrites49.7%
Taylor expanded in ux around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3261.5
Applied rewrites61.4%
Taylor expanded in uy around inf
Applied rewrites4.9%
Taylor expanded in maxCos around 0
Applied rewrites5.0%
herbie shell --seed 2024346
(FPCore (ux uy maxCos)
:name "UniformSampleCone, x"
: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)))
(* (cos (* (* uy 2.0) (PI))) (sqrt (- 1.0 (* (+ (- 1.0 ux) (* ux maxCos)) (+ (- 1.0 ux) (* ux maxCos)))))))