
(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 12 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 (* (sin (* (* uy 2.0) (PI))) (sqrt (* (+ (- 2.0 (* (pow (- maxCos 1.0) 2.0) ux)) (* -2.0 maxCos)) ux))))
\begin{array}{l}
\\
\sin \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) + -2 \cdot maxCos\right) \cdot ux}
\end{array}
Initial program 60.2%
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--.f321.6
Applied rewrites2.4%
Applied rewrites98.2%
(FPCore (ux uy maxCos)
:precision binary32
(*
(sin (* (* uy 2.0) (PI)))
(sqrt
(*
(+
(- (- (/ 1.0 ux) (/ (- maxCos 1.0) ux)) (/ maxCos ux))
(* (- 1.0 maxCos) (- maxCos 1.0)))
(* ux ux)))))\begin{array}{l}
\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(\frac{1}{ux} - \frac{maxCos - 1}{ux}\right) - \frac{maxCos}{ux}\right) + \left(1 - maxCos\right) \cdot \left(maxCos - 1\right)\right) \cdot \left(ux \cdot ux\right)}
\end{array}
Initial program 60.2%
lift-*.f32N/A
lift-+.f32N/A
lift--.f32N/A
sub-negN/A
associate-+l+N/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-+.f32N/A
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
*-commutativeN/A
lower-fma.f32N/A
lower-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
*-commutativeN/A
lower-fma.f32N/A
neg-mul-1N/A
lift-*.f32N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f32N/A
Applied rewrites19.0%
Taylor expanded in ux around -inf
*-commutativeN/A
lower-*.f32N/A
Applied rewrites98.2%
Final simplification98.2%
(FPCore (ux uy maxCos)
:precision binary32
(if (<= (* uy 2.0) 0.0006200000061653554)
(*
(* (* 2.0 uy) (PI))
(sqrt (* (+ (- 2.0 (* (pow (- maxCos 1.0) 2.0) ux)) (* -2.0 maxCos)) ux)))
(*
(sin (* (* uy 2.0) (PI)))
(sqrt
(+ (- ux (* (fma (- (- 1.0 ux) ux) ux ux) maxCos)) (* (- 1.0 ux) ux))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;uy \cdot 2 \leq 0.0006200000061653554:\\
\;\;\;\;\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 - {\left(maxCos - 1\right)}^{2} \cdot ux\right) + -2 \cdot maxCos\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux - \mathsf{fma}\left(\left(1 - ux\right) - ux, ux, ux\right) \cdot maxCos\right) + \left(1 - ux\right) \cdot ux}\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 6.20000006e-4Initial program 61.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--.f322.6
Applied rewrites2.0%
Applied rewrites98.6%
Taylor expanded in uy around 0
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
lower-PI.f3298.4
Applied rewrites98.4%
if 6.20000006e-4 < (*.f32 uy #s(literal 2 binary32)) Initial program 58.8%
lift-*.f32N/A
lift-+.f32N/A
lift--.f32N/A
sub-negN/A
associate-+l+N/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-+.f32N/A
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
*-commutativeN/A
lower-fma.f32N/A
lower-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
*-commutativeN/A
lower-fma.f32N/A
neg-mul-1N/A
lift-*.f32N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f32N/A
Applied rewrites13.1%
Taylor expanded in maxCos around 0
associate-*r*N/A
mul-1-negN/A
cancel-sign-subN/A
lower-+.f32N/A
Applied rewrites78.5%
Final simplification90.4%
(FPCore (ux uy maxCos)
:precision binary32
(if (<= (* uy 2.0) 0.0006200000061653554)
(*
(* (* 2.0 uy) (PI))
(sqrt (* (+ (- 2.0 (* (pow (- maxCos 1.0) 2.0) ux)) (* -2.0 maxCos)) ux)))
(* (sin (* (* uy 2.0) (PI))) (sqrt (+ ux (* (- 1.0 ux) ux))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;uy \cdot 2 \leq 0.0006200000061653554:\\
\;\;\;\;\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 - {\left(maxCos - 1\right)}^{2} \cdot ux\right) + -2 \cdot maxCos\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux + \left(1 - ux\right) \cdot ux}\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 6.20000006e-4Initial program 61.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--.f322.6
Applied rewrites1.3%
Applied rewrites98.6%
Taylor expanded in uy around 0
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
lower-PI.f3298.4
Applied rewrites98.4%
if 6.20000006e-4 < (*.f32 uy #s(literal 2 binary32)) Initial program 58.8%
lift-*.f32N/A
lift-+.f32N/A
lift--.f32N/A
sub-negN/A
associate-+l+N/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-+.f32N/A
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
*-commutativeN/A
lower-fma.f32N/A
lower-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
*-commutativeN/A
lower-fma.f32N/A
neg-mul-1N/A
lift-*.f32N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f32N/A
Applied rewrites13.1%
Taylor expanded in maxCos around 0
associate-*r*N/A
mul-1-negN/A
cancel-sign-subN/A
lower-+.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower--.f3294.8
Applied rewrites94.8%
Final simplification97.0%
(FPCore (ux uy maxCos)
:precision binary32
(*
(sin (* (* uy 2.0) (PI)))
(sqrt
(-
(- ux (* ux maxCos))
(* (* (fma ux maxCos (- 1.0 ux)) ux) (- maxCos 1.0))))))\begin{array}{l}
\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux - ux \cdot maxCos\right) - \left(\mathsf{fma}\left(ux, maxCos, 1 - ux\right) \cdot ux\right) \cdot \left(maxCos - 1\right)}
\end{array}
Initial program 60.2%
lift-*.f32N/A
lift-+.f32N/A
lift--.f32N/A
sub-negN/A
associate-+l+N/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-+.f32N/A
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
*-commutativeN/A
lower-fma.f32N/A
lower-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
*-commutativeN/A
lower-fma.f32N/A
neg-mul-1N/A
lift-*.f32N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f32N/A
Applied rewrites18.9%
lift--.f32N/A
lift-+.f32N/A
associate--r+N/A
lower--.f32N/A
lift--.f32N/A
lift-fma.f32N/A
+-commutativeN/A
*-commutativeN/A
lift-*.f32N/A
associate-+l-N/A
associate--r-N/A
metadata-evalN/A
lower-+.f32N/A
lower--.f3248.2
lift-*.f32N/A
lift-*.f32N/A
associate-*r*N/A
lift-+.f32N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lift--.f32N/A
Applied rewrites46.2%
Final simplification45.7%
(FPCore (ux uy maxCos)
:precision binary32
(if (<= maxCos 4.5000000682193786e-5)
(* (sin (* (* uy 2.0) (PI))) (sqrt (+ ux (* (- 1.0 ux) ux))))
(*
(* (* (PI) 2.0) uy)
(sqrt
(*
(-
(/
(*
(- (+ (/ (/ 2.0 ux) maxCos) 2.0) (+ (/ 2.0 ux) (/ 1.0 maxCos)))
(* ux ux))
maxCos)
(* ux ux))
(* maxCos maxCos))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;maxCos \leq 4.5000000682193786 \cdot 10^{-5}:\\
\;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux + \left(1 - ux\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot uy\right) \cdot \sqrt{\left(\frac{\left(\left(\frac{\frac{2}{ux}}{maxCos} + 2\right) - \left(\frac{2}{ux} + \frac{1}{maxCos}\right)\right) \cdot \left(ux \cdot ux\right)}{maxCos} - ux \cdot ux\right) \cdot \left(maxCos \cdot maxCos\right)}\\
\end{array}
\end{array}
if maxCos < 4.50000007e-5Initial program 60.4%
lift-*.f32N/A
lift-+.f32N/A
lift--.f32N/A
sub-negN/A
associate-+l+N/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-+.f32N/A
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
*-commutativeN/A
lower-fma.f32N/A
lower-*.f32N/A
lift-+.f32N/A
+-commutativeN/A
lift-*.f32N/A
*-commutativeN/A
lower-fma.f32N/A
neg-mul-1N/A
lift-*.f32N/A
*-commutativeN/A
distribute-rgt-outN/A
lower-*.f32N/A
Applied rewrites20.0%
Taylor expanded in maxCos around 0
associate-*r*N/A
mul-1-negN/A
cancel-sign-subN/A
lower-+.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower--.f3297.5
Applied rewrites97.5%
if 4.50000007e-5 < maxCos Initial program 57.7%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3252.8
Applied rewrites52.8%
Taylor expanded in maxCos around -inf
*-commutativeN/A
lower-*.f32N/A
Applied rewrites50.9%
Taylor expanded in ux around inf
Applied rewrites86.1%
Final simplification96.4%
(FPCore (ux uy maxCos) :precision binary32 (if (<= (* uy 2.0) 0.0026000000070780516) (* (* (* 2.0 uy) (PI)) (sqrt (* (- 2.0 ux) ux))) (* (sin (* (* (PI) uy) 2.0)) (sqrt (* 2.0 ux)))))
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;uy \cdot 2 \leq 0.0026000000070780516:\\
\;\;\;\;\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 - ux\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\right) \cdot \sqrt{2 \cdot ux}\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 0.00260000001Initial program 62.4%
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--.f322.4
Applied rewrites1.3%
Taylor expanded in maxCos around 0
Applied rewrites92.8%
Taylor expanded in uy around 0
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
lower-PI.f3291.0
Applied rewrites91.0%
if 0.00260000001 < (*.f32 uy #s(literal 2 binary32)) Initial program 55.1%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3236.4
Applied rewrites36.4%
Taylor expanded in ux around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3247.4
Applied rewrites46.8%
Taylor expanded in maxCos around 0
Applied rewrites47.4%
Taylor expanded in uy around inf
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3275.8
Applied rewrites75.8%
(FPCore (ux uy maxCos)
:precision binary32
(if (<= maxCos 4.5000000682193786e-5)
(* (sin (* (* uy 2.0) (PI))) (sqrt (* (- 2.0 ux) ux)))
(*
(* (* (PI) 2.0) uy)
(sqrt
(*
(-
(/
(*
(- (+ (/ (/ 2.0 ux) maxCos) 2.0) (+ (/ 2.0 ux) (/ 1.0 maxCos)))
(* ux ux))
maxCos)
(* ux ux))
(* maxCos maxCos))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;maxCos \leq 4.5000000682193786 \cdot 10^{-5}:\\
\;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 - ux\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot uy\right) \cdot \sqrt{\left(\frac{\left(\left(\frac{\frac{2}{ux}}{maxCos} + 2\right) - \left(\frac{2}{ux} + \frac{1}{maxCos}\right)\right) \cdot \left(ux \cdot ux\right)}{maxCos} - ux \cdot ux\right) \cdot \left(maxCos \cdot maxCos\right)}\\
\end{array}
\end{array}
if maxCos < 4.50000007e-5Initial program 60.4%
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--.f320.9
Applied rewrites1.4%
Taylor expanded in maxCos around 0
Applied rewrites97.5%
if 4.50000007e-5 < maxCos Initial program 57.7%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3252.8
Applied rewrites52.8%
Taylor expanded in maxCos around -inf
*-commutativeN/A
lower-*.f32N/A
Applied rewrites50.9%
Taylor expanded in ux around inf
Applied rewrites86.1%
(FPCore (ux uy maxCos)
:precision binary32
(if (<= maxCos 4.999999969612645e-9)
(* (* (* 2.0 uy) (PI)) (sqrt (* (- 2.0 ux) ux)))
(*
(* (* (PI) 2.0) uy)
(sqrt
(*
(-
(/
(*
(- (+ (/ (/ 2.0 ux) maxCos) 2.0) (+ (/ 2.0 ux) (/ 1.0 maxCos)))
(* ux ux))
maxCos)
(* ux ux))
(* maxCos maxCos))))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;maxCos \leq 4.999999969612645 \cdot 10^{-9}:\\
\;\;\;\;\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 - ux\right) \cdot ux}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot uy\right) \cdot \sqrt{\left(\frac{\left(\left(\frac{\frac{2}{ux}}{maxCos} + 2\right) - \left(\frac{2}{ux} + \frac{1}{maxCos}\right)\right) \cdot \left(ux \cdot ux\right)}{maxCos} - ux \cdot ux\right) \cdot \left(maxCos \cdot maxCos\right)}\\
\end{array}
\end{array}
if maxCos < 4.99999997e-9Initial program 59.4%
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--.f320.1
Applied rewrites1.5%
Taylor expanded in maxCos around 0
Applied rewrites98.3%
Taylor expanded in uy around 0
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
lower-PI.f3282.2
Applied rewrites82.2%
if 4.99999997e-9 < maxCos Initial program 63.0%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3256.6
Applied rewrites56.6%
Taylor expanded in maxCos around -inf
*-commutativeN/A
lower-*.f32N/A
Applied rewrites55.6%
Taylor expanded in ux around inf
Applied rewrites81.4%
(FPCore (ux uy maxCos)
:precision binary32
(let* ((t_0 (* (- 2.0 ux) ux)))
(if (<= maxCos 5.200000158098144e-20)
(* (* (* 2.0 uy) (PI)) (sqrt t_0))
(*
(* (* (PI) 2.0) uy)
(sqrt
(*
(- (/ (+ (/ t_0 maxCos) (* (* (+ -1.0 ux) ux) 2.0)) maxCos) (* ux ux))
(* maxCos maxCos)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(2 - ux\right) \cdot ux\\
\mathbf{if}\;maxCos \leq 5.200000158098144 \cdot 10^{-20}:\\
\;\;\;\;\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot 2\right) \cdot uy\right) \cdot \sqrt{\left(\frac{\frac{t\_0}{maxCos} + \left(\left(-1 + ux\right) \cdot ux\right) \cdot 2}{maxCos} - ux \cdot ux\right) \cdot \left(maxCos \cdot maxCos\right)}\\
\end{array}
\end{array}
if maxCos < 5.20000016e-20Initial program 60.6%
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--.f321.7
Applied rewrites1.7%
Taylor expanded in maxCos around 0
Applied rewrites98.4%
Taylor expanded in uy around 0
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
lower-PI.f3280.0
Applied rewrites80.0%
if 5.20000016e-20 < maxCos Initial program 59.7%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3255.5
Applied rewrites55.5%
Taylor expanded in maxCos around -inf
*-commutativeN/A
lower-*.f32N/A
Applied rewrites54.3%
Taylor expanded in ux around 0
Applied rewrites84.1%
Final simplification82.0%
(FPCore (ux uy maxCos) :precision binary32 (* (* (* 2.0 uy) (PI)) (sqrt (* (- 2.0 ux) ux))))
\begin{array}{l}
\\
\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 - ux\right) \cdot ux}
\end{array}
Initial program 60.2%
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--.f321.9
Applied rewrites2.0%
Taylor expanded in maxCos around 0
Applied rewrites93.2%
Taylor expanded in uy around 0
associate-*r*N/A
lower-*.f32N/A
lower-*.f32N/A
lower-PI.f3278.1
Applied rewrites78.1%
(FPCore (ux uy maxCos) :precision binary32 (* (* (PI) (+ uy uy)) (sqrt (* 2.0 ux))))
\begin{array}{l}
\\
\left(\mathsf{PI}\left(\right) \cdot \left(uy + uy\right)\right) \cdot \sqrt{2 \cdot ux}
\end{array}
Initial program 60.2%
Taylor expanded in uy around 0
*-commutativeN/A
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3254.0
Applied rewrites54.0%
Taylor expanded in ux around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f32N/A
+-commutativeN/A
lower-fma.f3263.2
Applied rewrites63.0%
Taylor expanded in maxCos around 0
Applied rewrites63.2%
Applied rewrites63.2%
herbie shell --seed 2024322
(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)))))))