
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* (- 1.0 ux) maxCos) ux))
(t_1 (sqrt (- 1.0 (* t_0 t_0))))
(t_2 (* (* uy 2.0) (PI))))
(+ (+ (* (* (cos t_2) t_1) xi) (* (* (sin t_2) t_1) yi)) (* t_0 zi))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\\
t_1 := \sqrt{1 - t\_0 \cdot t\_0}\\
t_2 := \left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\\
\left(\left(\cos t\_2 \cdot t\_1\right) \cdot xi + \left(\sin t\_2 \cdot t\_1\right) \cdot yi\right) + t\_0 \cdot zi
\end{array}
\end{array}
Sampling outcomes in binary32 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* (- 1.0 ux) maxCos) ux))
(t_1 (sqrt (- 1.0 (* t_0 t_0))))
(t_2 (* (* uy 2.0) (PI))))
(+ (+ (* (* (cos t_2) t_1) xi) (* (* (sin t_2) t_1) yi)) (* t_0 zi))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\\
t_1 := \sqrt{1 - t\_0 \cdot t\_0}\\
t_2 := \left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\\
\left(\left(\cos t\_2 \cdot t\_1\right) \cdot xi + \left(\sin t\_2 \cdot t\_1\right) \cdot yi\right) + t\_0 \cdot zi
\end{array}
\end{array}
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* maxCos (- 1.0 ux)) ux))
(t_1 (sqrt (- 1.0 (* t_0 t_0))))
(t_2 (* (PI) (* 2.0 uy))))
(-
(+ (* yi (* (sin t_2) t_1)) (* xi (* t_1 (cos t_2))))
(* (- ux 1.0) (* zi (* maxCos ux))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\
t_1 := \sqrt{1 - t\_0 \cdot t\_0}\\
t_2 := \mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\\
\left(yi \cdot \left(\sin t\_2 \cdot t\_1\right) + xi \cdot \left(t\_1 \cdot \cos t\_2\right)\right) - \left(ux - 1\right) \cdot \left(zi \cdot \left(maxCos \cdot ux\right)\right)
\end{array}
\end{array}
Initial program 98.9%
lift-*.f32N/A
lift-*.f32N/A
lift-*.f32N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f32N/A
lower-*.f32N/A
lower-*.f3299.0
Applied rewrites99.0%
Final simplification99.0%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* maxCos (- 1.0 ux)) ux)))
(-
(+
(* (sin (* (* (PI) uy) 2.0)) yi)
(* xi (* (sqrt (- 1.0 (* t_0 t_0))) (cos (* (PI) (* 2.0 uy))))))
(* (* (* (- ux 1.0) maxCos) zi) ux))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\
\left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\right) \cdot yi + xi \cdot \left(\sqrt{1 - t\_0 \cdot t\_0} \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right)\right)\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot zi\right) \cdot ux
\end{array}
\end{array}
Initial program 98.9%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f3299.0
lift-*.f32N/A
*-commutativeN/A
lower-*.f3299.0
Applied rewrites99.0%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3299.0
Applied rewrites99.0%
Final simplification99.0%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* (PI) uy) 2.0)))
(-
(+ (* (cos t_0) xi) (* (sin t_0) yi))
(* (* (* (- ux 1.0) maxCos) zi) ux))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\\
\left(\cos t\_0 \cdot xi + \sin t\_0 \cdot yi\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot zi\right) \cdot ux
\end{array}
\end{array}
Initial program 98.9%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f3299.0
lift-*.f32N/A
*-commutativeN/A
lower-*.f3299.0
Applied rewrites99.0%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3299.0
Applied rewrites99.0%
Taylor expanded in maxCos around 0
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3298.9
Applied rewrites98.9%
Final simplification98.9%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (PI) (* 2.0 uy))))
(-
(+ (* xi (cos t_0)) (* yi (sin t_0)))
(* (* (* (- ux 1.0) maxCos) ux) zi))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\\
\left(xi \cdot \cos t\_0 + yi \cdot \sin t\_0\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi
\end{array}
\end{array}
Initial program 98.9%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3229.7
Applied rewrites29.7%
Applied rewrites98.8%
Final simplification98.8%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* maxCos (- 1.0 ux)) ux)))
(-
(+
(*
(sqrt (- 1.0 (* (* maxCos maxCos) (* (* ux ux) 1.0))))
(* (* (* yi (PI)) uy) 2.0))
(* xi (* (sqrt (- 1.0 (* t_0 t_0))) (cos (* (PI) (* 2.0 uy))))))
(* (- ux 1.0) (* zi (* maxCos ux))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\
\left(\sqrt{1 - \left(maxCos \cdot maxCos\right) \cdot \left(\left(ux \cdot ux\right) \cdot 1\right)} \cdot \left(\left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot 2\right) + xi \cdot \left(\sqrt{1 - t\_0 \cdot t\_0} \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right)\right)\right) - \left(ux - 1\right) \cdot \left(zi \cdot \left(maxCos \cdot ux\right)\right)
\end{array}
\end{array}
Initial program 98.9%
lift-*.f32N/A
lift-*.f32N/A
lift-*.f32N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f32N/A
lower-*.f32N/A
lower-*.f3299.0
Applied rewrites99.0%
Taylor expanded in uy around 0
associate-*r*N/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
lower-sqrt.f32N/A
lower--.f32N/A
*-commutativeN/A
lower-*.f32N/A
Applied rewrites89.2%
Taylor expanded in ux around 0
Applied rewrites89.2%
Final simplification89.2%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* maxCos (- 1.0 ux)) ux)))
(-
(+
(* (* (* yi (PI)) uy) 2.0)
(* xi (* (sqrt (- 1.0 (* t_0 t_0))) (cos (* (PI) (* 2.0 uy))))))
(* (* (* (- ux 1.0) maxCos) zi) ux))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\
\left(\left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot 2 + xi \cdot \left(\sqrt{1 - t\_0 \cdot t\_0} \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right)\right)\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot zi\right) \cdot ux
\end{array}
\end{array}
Initial program 98.9%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f3299.0
lift-*.f32N/A
*-commutativeN/A
lower-*.f3299.0
Applied rewrites99.0%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3299.0
Applied rewrites99.0%
Taylor expanded in uy around 0
Applied rewrites89.2%
Final simplification89.2%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(-
(+
(* (* (* (PI) uy) 2.0) yi)
(*
(*
(sqrt (- 1.0 (* (* maxCos maxCos) (* ux ux))))
(cos (* (PI) (* 2.0 uy))))
xi))
(* (* (* (- ux 1.0) maxCos) zi) ux)))\begin{array}{l}
\\
\left(\left(\left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\right) \cdot yi + \left(\sqrt{1 - \left(maxCos \cdot maxCos\right) \cdot \left(ux \cdot ux\right)} \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right)\right) \cdot xi\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot zi\right) \cdot ux
\end{array}
Initial program 98.9%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f3299.0
lift-*.f32N/A
*-commutativeN/A
lower-*.f3299.0
Applied rewrites99.0%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3299.0
Applied rewrites99.0%
Taylor expanded in uy around 0
Applied rewrites89.2%
Taylor expanded in ux around 0
*-commutativeN/A
lower-*.f32N/A
unpow2N/A
lower-*.f32N/A
unpow2N/A
lower-*.f3289.2
Applied rewrites89.2%
Final simplification89.2%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (let* ((t_0 (* (* (PI) uy) 2.0))) (- (+ (* (cos t_0) xi) (* t_0 yi)) (* (* (* (- ux 1.0) maxCos) zi) ux))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\\
\left(\cos t\_0 \cdot xi + t\_0 \cdot yi\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot zi\right) \cdot ux
\end{array}
\end{array}
Initial program 98.9%
lift-*.f32N/A
*-commutativeN/A
lift-*.f32N/A
associate-*r*N/A
lower-*.f32N/A
lower-*.f3299.0
lift-*.f32N/A
*-commutativeN/A
lower-*.f3299.0
Applied rewrites99.0%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3299.0
Applied rewrites99.0%
Taylor expanded in uy around 0
Applied rewrites89.2%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-*.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3289.1
Applied rewrites89.1%
Final simplification89.1%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0
(-
(* (cos (* (* (PI) uy) 2.0)) xi)
(* (* (* (- ux 1.0) maxCos) ux) zi))))
(if (<= xi -1.999999936531045e-20)
t_0
(if (<= xi 4.0000000781659255e-24)
(- (* yi (sin (* (PI) (* 2.0 uy)))) (* (* (* (- ux 1.0) zi) ux) maxCos))
t_0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\right) \cdot xi - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
\mathbf{if}\;xi \leq -1.999999936531045 \cdot 10^{-20}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;xi \leq 4.0000000781659255 \cdot 10^{-24}:\\
\;\;\;\;yi \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) - \left(\left(\left(ux - 1\right) \cdot zi\right) \cdot ux\right) \cdot maxCos\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if xi < -1.99999994e-20 or 4.00000008e-24 < xi Initial program 99.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3215.5
Applied rewrites15.5%
Taylor expanded in xi around inf
Applied rewrites78.8%
if -1.99999994e-20 < xi < 4.00000008e-24Initial program 98.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3253.0
Applied rewrites53.0%
Taylor expanded in xi around 0
Applied rewrites84.9%
lift-+.f32N/A
Applied rewrites71.0%
Applied rewrites85.0%
Final simplification81.1%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (- ux 1.0) maxCos))
(t_1 (- (* (cos (* (* (PI) uy) 2.0)) xi) (* (* t_0 ux) zi))))
(if (<= xi -1.999999936531045e-20)
t_1
(if (<= xi 4.0000000781659255e-24)
(- (* yi (sin (* (PI) (* 2.0 uy)))) (* (* t_0 zi) ux))
t_1))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(ux - 1\right) \cdot maxCos\\
t_1 := \cos \left(\left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\right) \cdot xi - \left(t\_0 \cdot ux\right) \cdot zi\\
\mathbf{if}\;xi \leq -1.999999936531045 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;xi \leq 4.0000000781659255 \cdot 10^{-24}:\\
\;\;\;\;yi \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) - \left(t\_0 \cdot zi\right) \cdot ux\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if xi < -1.99999994e-20 or 4.00000008e-24 < xi Initial program 99.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3215.5
Applied rewrites15.5%
Taylor expanded in xi around inf
Applied rewrites78.8%
if -1.99999994e-20 < xi < 4.00000008e-24Initial program 98.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3253.0
Applied rewrites53.0%
Taylor expanded in xi around 0
Applied rewrites84.9%
lift-+.f32N/A
+-commutativeN/A
Applied rewrites85.0%
Final simplification81.1%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* (* (- ux 1.0) maxCos) ux) zi))
(t_1 (* (* (PI) uy) 2.0))
(t_2 (- (* (cos t_1) xi) t_0)))
(if (<= xi -1.999999936531045e-20)
t_2
(if (<= xi 4.0000000781659255e-24) (- (* (sin t_1) yi) t_0) t_2))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
t_1 := \left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\\
t_2 := \cos t\_1 \cdot xi - t\_0\\
\mathbf{if}\;xi \leq -1.999999936531045 \cdot 10^{-20}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;xi \leq 4.0000000781659255 \cdot 10^{-24}:\\
\;\;\;\;\sin t\_1 \cdot yi - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if xi < -1.99999994e-20 or 4.00000008e-24 < xi Initial program 99.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3215.5
Applied rewrites15.5%
Taylor expanded in xi around inf
Applied rewrites78.8%
if -1.99999994e-20 < xi < 4.00000008e-24Initial program 98.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3253.0
Applied rewrites53.0%
Taylor expanded in xi around 0
Applied rewrites84.9%
Final simplification81.1%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* (* (- ux 1.0) maxCos) ux) zi)))
(if (<= (* 2.0 uy) 0.06849999725818634)
(-
(+ (* (fma -2.0 (* (* (* (PI) (PI)) xi) uy) (* (* yi (PI)) 2.0)) uy) xi)
t_0)
(- (* (cos (* (* (PI) uy) 2.0)) xi) t_0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
\mathbf{if}\;2 \cdot uy \leq 0.06849999725818634:\\
\;\;\;\;\left(\mathsf{fma}\left(-2, \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot xi\right) \cdot uy, \left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot uy + xi\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\right) \cdot xi - t\_0\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 0.0684999973Initial program 99.1%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3234.0
Applied rewrites34.0%
Taylor expanded in uy around 0
Applied rewrites55.5%
Applied rewrites89.9%
if 0.0684999973 < (*.f32 uy #s(literal 2 binary32)) Initial program 98.1%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f326.8
Applied rewrites6.8%
Taylor expanded in xi around inf
Applied rewrites53.7%
Final simplification73.4%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* yi (PI)))
(t_1 (* (* (* (- ux 1.0) maxCos) ux) zi))
(t_2 (* (* (* (PI) (PI)) xi) uy)))
(if (<= xi -3.99999987306209e-19)
(- (fma (fma t_2 -2.0 (* t_0 2.0)) uy xi) t_1)
(if (<= xi 9.999999682655225e-22)
(- (* (* t_0 uy) 2.0) t_1)
(- (fma (fma t_0 2.0 (* t_2 -2.0)) uy xi) t_1)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := yi \cdot \mathsf{PI}\left(\right)\\
t_1 := \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
t_2 := \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot xi\right) \cdot uy\\
\mathbf{if}\;xi \leq -3.99999987306209 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t\_2, -2, t\_0 \cdot 2\right), uy, xi\right) - t\_1\\
\mathbf{elif}\;xi \leq 9.999999682655225 \cdot 10^{-22}:\\
\;\;\;\;\left(t\_0 \cdot uy\right) \cdot 2 - t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t\_0, 2, t\_2 \cdot -2\right), uy, xi\right) - t\_1\\
\end{array}
\end{array}
if xi < -3.99999987e-19Initial program 99.4%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3213.0
Applied rewrites13.0%
Taylor expanded in xi around 0
Applied rewrites19.1%
Taylor expanded in uy around 0
Applied rewrites68.0%
if -3.99999987e-19 < xi < 9.9999997e-22Initial program 98.4%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3252.1
Applied rewrites51.5%
Taylor expanded in xi around 0
Applied rewrites80.4%
Taylor expanded in uy around 0
Applied rewrites65.8%
if 9.9999997e-22 < xi Initial program 99.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3214.7
Applied rewrites14.7%
Taylor expanded in uy around 0
Applied rewrites66.9%
Applied rewrites66.9%
Final simplification66.7%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* yi (PI)))
(t_1 (* (* (* (- ux 1.0) maxCos) ux) zi))
(t_2 (* (PI) (PI))))
(if (<= xi -3.99999987306209e-19)
(- (fma (fma t_2 (* (* xi uy) -2.0) (* t_0 2.0)) uy xi) t_1)
(if (<= xi 9.999999682655225e-22)
(- (* (* t_0 uy) 2.0) t_1)
(- (fma (fma t_0 2.0 (* (* (* t_2 xi) uy) -2.0)) uy xi) t_1)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := yi \cdot \mathsf{PI}\left(\right)\\
t_1 := \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
t_2 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;xi \leq -3.99999987306209 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t\_2, \left(xi \cdot uy\right) \cdot -2, t\_0 \cdot 2\right), uy, xi\right) - t\_1\\
\mathbf{elif}\;xi \leq 9.999999682655225 \cdot 10^{-22}:\\
\;\;\;\;\left(t\_0 \cdot uy\right) \cdot 2 - t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(t\_0, 2, \left(\left(t\_2 \cdot xi\right) \cdot uy\right) \cdot -2\right), uy, xi\right) - t\_1\\
\end{array}
\end{array}
if xi < -3.99999987e-19Initial program 99.4%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3213.0
Applied rewrites13.0%
Taylor expanded in uy around 0
Applied rewrites68.0%
Applied rewrites68.0%
if -3.99999987e-19 < xi < 9.9999997e-22Initial program 98.4%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3251.5
Applied rewrites51.5%
Taylor expanded in xi around 0
Applied rewrites80.4%
Taylor expanded in uy around 0
Applied rewrites65.8%
if 9.9999997e-22 < xi Initial program 99.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3214.7
Applied rewrites14.7%
Taylor expanded in uy around 0
Applied rewrites66.9%
Applied rewrites66.9%
Final simplification66.2%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* (* (- ux 1.0) maxCos) ux) zi))
(t_1 (* yi (PI)))
(t_2
(-
(fma (fma t_1 2.0 (* (* (* (* (PI) (PI)) xi) uy) -2.0)) uy xi)
t_0)))
(if (<= xi -3.99999987306209e-19)
t_2
(if (<= xi 9.999999682655225e-22) (- (* (* t_1 uy) 2.0) t_0) t_2))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
t_1 := yi \cdot \mathsf{PI}\left(\right)\\
t_2 := \mathsf{fma}\left(\mathsf{fma}\left(t\_1, 2, \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot xi\right) \cdot uy\right) \cdot -2\right), uy, xi\right) - t\_0\\
\mathbf{if}\;xi \leq -3.99999987306209 \cdot 10^{-19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;xi \leq 9.999999682655225 \cdot 10^{-22}:\\
\;\;\;\;\left(t\_1 \cdot uy\right) \cdot 2 - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if xi < -3.99999987e-19 or 9.9999997e-22 < xi Initial program 99.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3214.1
Applied rewrites14.1%
Taylor expanded in uy around 0
Applied rewrites67.3%
Applied rewrites67.3%
if -3.99999987e-19 < xi < 9.9999997e-22Initial program 98.4%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3251.5
Applied rewrites51.5%
Taylor expanded in xi around 0
Applied rewrites80.4%
Taylor expanded in uy around 0
Applied rewrites65.8%
Final simplification66.7%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* (* (- ux 1.0) maxCos) ux) zi))
(t_1 (* yi (PI)))
(t_2 (* t_1 uy)))
(if (<= xi -3.99999987306209e-19)
(- (fma t_2 2.0 xi) t_0)
(if (<= xi 4.0000000781659255e-24)
(- (* t_2 2.0) t_0)
(-
(fma uy (fma -2.0 (* (* (* (PI) (PI)) xi) uy) (* t_1 2.0)) xi)
t_0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
t_1 := yi \cdot \mathsf{PI}\left(\right)\\
t_2 := t\_1 \cdot uy\\
\mathbf{if}\;xi \leq -3.99999987306209 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, 2, xi\right) - t\_0\\
\mathbf{elif}\;xi \leq 4.0000000781659255 \cdot 10^{-24}:\\
\;\;\;\;t\_2 \cdot 2 - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(uy, \mathsf{fma}\left(-2, \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot xi\right) \cdot uy, t\_1 \cdot 2\right), xi\right) - t\_0\\
\end{array}
\end{array}
if xi < -3.99999987e-19Initial program 99.4%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3213.0
Applied rewrites13.0%
Taylor expanded in uy around 0
Applied rewrites68.0%
Taylor expanded in uy around 0
Applied rewrites19.3%
if -3.99999987e-19 < xi < 4.00000008e-24Initial program 98.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3252.4
Applied rewrites52.4%
Taylor expanded in xi around 0
Applied rewrites83.6%
Taylor expanded in uy around 0
Applied rewrites67.8%
if 4.00000008e-24 < xi Initial program 99.2%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3216.6
Applied rewrites16.6%
Taylor expanded in uy around 0
Applied rewrites65.8%
Applied rewrites65.8%
Final simplification67.0%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (- (+ (* (fma -2.0 (* (* (* (PI) (PI)) xi) uy) (* (* yi (PI)) 2.0)) uy) xi) (* (* (* (- ux 1.0) maxCos) ux) zi)))
\begin{array}{l}
\\
\left(\mathsf{fma}\left(-2, \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot xi\right) \cdot uy, \left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot uy + xi\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi
\end{array}
Initial program 98.9%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3229.7
Applied rewrites29.7%
Taylor expanded in uy around 0
Applied rewrites49.7%
Applied rewrites80.2%
Final simplification80.5%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* (* (- ux 1.0) maxCos) ux) zi))
(t_1 (* yi (PI)))
(t_2 (* t_1 uy)))
(if (<= xi -3.99999987306209e-19)
(- (fma t_2 2.0 xi) t_0)
(if (<= xi 9.999999682655225e-22)
(- (* t_2 2.0) t_0)
(- (fma (* t_1 2.0) uy xi) t_0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
t_1 := yi \cdot \mathsf{PI}\left(\right)\\
t_2 := t\_1 \cdot uy\\
\mathbf{if}\;xi \leq -3.99999987306209 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, 2, xi\right) - t\_0\\
\mathbf{elif}\;xi \leq 9.999999682655225 \cdot 10^{-22}:\\
\;\;\;\;t\_2 \cdot 2 - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1 \cdot 2, uy, xi\right) - t\_0\\
\end{array}
\end{array}
if xi < -3.99999987e-19Initial program 99.4%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3213.0
Applied rewrites13.0%
Taylor expanded in uy around 0
Applied rewrites68.0%
Taylor expanded in uy around 0
Applied rewrites68.1%
if -3.99999987e-19 < xi < 9.9999997e-22Initial program 98.4%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3252.2
Applied rewrites51.5%
Taylor expanded in xi around 0
Applied rewrites80.4%
Taylor expanded in uy around 0
Applied rewrites65.8%
if 9.9999997e-22 < xi Initial program 99.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3214.7
Applied rewrites14.7%
Taylor expanded in uy around 0
Applied rewrites66.9%
Taylor expanded in xi around 0
Applied rewrites66.8%
Final simplification66.2%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* (* (- ux 1.0) maxCos) ux) zi))
(t_1 (* (* yi (PI)) uy))
(t_2 (- (fma t_1 2.0 xi) t_0)))
(if (<= xi -3.99999987306209e-19)
t_2
(if (<= xi 9.999999682655225e-22) (- (* t_1 2.0) t_0) t_2))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
t_1 := \left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot uy\\
t_2 := \mathsf{fma}\left(t\_1, 2, xi\right) - t\_0\\
\mathbf{if}\;xi \leq -3.99999987306209 \cdot 10^{-19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;xi \leq 9.999999682655225 \cdot 10^{-22}:\\
\;\;\;\;t\_1 \cdot 2 - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if xi < -3.99999987e-19 or 9.9999997e-22 < xi Initial program 99.3%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3214.1
Applied rewrites14.1%
Taylor expanded in uy around 0
Applied rewrites67.3%
Taylor expanded in uy around 0
Applied rewrites67.3%
if -3.99999987e-19 < xi < 9.9999997e-22Initial program 98.4%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3251.5
Applied rewrites51.5%
Taylor expanded in xi around 0
Applied rewrites80.4%
Taylor expanded in uy around 0
Applied rewrites65.8%
Final simplification66.7%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (- (* (* (* yi (PI)) uy) 2.0) (* (* (* (- ux 1.0) maxCos) ux) zi)))
\begin{array}{l}
\\
\left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot uy\right) \cdot 2 - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi
\end{array}
Initial program 98.9%
Taylor expanded in maxCos around 0
*-commutativeN/A
lower-fma.f32N/A
lower-cos.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-sin.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3229.7
Applied rewrites29.7%
Taylor expanded in xi around 0
Applied rewrites45.0%
Taylor expanded in uy around 0
Applied rewrites37.6%
Final simplification37.6%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (* (* (* zi (- 1.0 ux)) maxCos) ux))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
return ((zi * (1.0f - ux)) * maxCos) * ux;
}
real(4) function code(xi, yi, zi, ux, uy, maxcos)
real(4), intent (in) :: xi
real(4), intent (in) :: yi
real(4), intent (in) :: zi
real(4), intent (in) :: ux
real(4), intent (in) :: uy
real(4), intent (in) :: maxcos
code = ((zi * (1.0e0 - ux)) * maxcos) * ux
end function
function code(xi, yi, zi, ux, uy, maxCos) return Float32(Float32(Float32(zi * Float32(Float32(1.0) - ux)) * maxCos) * ux) end
function tmp = code(xi, yi, zi, ux, uy, maxCos) tmp = ((zi * (single(1.0) - ux)) * maxCos) * ux; end
\begin{array}{l}
\\
\left(\left(zi \cdot \left(1 - ux\right)\right) \cdot maxCos\right) \cdot ux
\end{array}
Initial program 98.9%
Taylor expanded in zi around inf
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower--.f3211.7
Applied rewrites11.7%
Applied rewrites11.8%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (* zi (* (* maxCos (- 1.0 ux)) ux)))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
return zi * ((maxCos * (1.0f - ux)) * ux);
}
real(4) function code(xi, yi, zi, ux, uy, maxcos)
real(4), intent (in) :: xi
real(4), intent (in) :: yi
real(4), intent (in) :: zi
real(4), intent (in) :: ux
real(4), intent (in) :: uy
real(4), intent (in) :: maxcos
code = zi * ((maxcos * (1.0e0 - ux)) * ux)
end function
function code(xi, yi, zi, ux, uy, maxCos) return Float32(zi * Float32(Float32(maxCos * Float32(Float32(1.0) - ux)) * ux)) end
function tmp = code(xi, yi, zi, ux, uy, maxCos) tmp = zi * ((maxCos * (single(1.0) - ux)) * ux); end
\begin{array}{l}
\\
zi \cdot \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right)
\end{array}
Initial program 98.9%
Taylor expanded in zi around inf
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower--.f3211.7
Applied rewrites11.7%
Applied rewrites11.7%
Final simplification11.7%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (* (* (- zi (* zi ux)) ux) maxCos))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
return ((zi - (zi * ux)) * ux) * maxCos;
}
real(4) function code(xi, yi, zi, ux, uy, maxcos)
real(4), intent (in) :: xi
real(4), intent (in) :: yi
real(4), intent (in) :: zi
real(4), intent (in) :: ux
real(4), intent (in) :: uy
real(4), intent (in) :: maxcos
code = ((zi - (zi * ux)) * ux) * maxcos
end function
function code(xi, yi, zi, ux, uy, maxCos) return Float32(Float32(Float32(zi - Float32(zi * ux)) * ux) * maxCos) end
function tmp = code(xi, yi, zi, ux, uy, maxCos) tmp = ((zi - (zi * ux)) * ux) * maxCos; end
\begin{array}{l}
\\
\left(\left(zi - zi \cdot ux\right) \cdot ux\right) \cdot maxCos
\end{array}
Initial program 98.9%
Taylor expanded in zi around inf
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower--.f3211.7
Applied rewrites11.7%
Taylor expanded in ux around 0
Applied rewrites11.7%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (* (* zi ux) maxCos))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
return (zi * ux) * maxCos;
}
real(4) function code(xi, yi, zi, ux, uy, maxcos)
real(4), intent (in) :: xi
real(4), intent (in) :: yi
real(4), intent (in) :: zi
real(4), intent (in) :: ux
real(4), intent (in) :: uy
real(4), intent (in) :: maxcos
code = (zi * ux) * maxcos
end function
function code(xi, yi, zi, ux, uy, maxCos) return Float32(Float32(zi * ux) * maxCos) end
function tmp = code(xi, yi, zi, ux, uy, maxCos) tmp = (zi * ux) * maxCos; end
\begin{array}{l}
\\
\left(zi \cdot ux\right) \cdot maxCos
\end{array}
Initial program 98.9%
Taylor expanded in zi around inf
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower--.f3211.7
Applied rewrites11.7%
Taylor expanded in ux around 0
Applied rewrites10.7%
herbie shell --seed 2024276
(FPCore (xi yi zi ux uy maxCos)
:name "UniformSampleCone 2"
:precision binary32
:pre (and (and (and (and (and (and (<= -10000.0 xi) (<= xi 10000.0)) (and (<= -10000.0 yi) (<= yi 10000.0))) (and (<= -10000.0 zi) (<= zi 10000.0))) (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) maxCos) ux) (* (* (- 1.0 ux) maxCos) ux))))) xi) (* (* (sin (* (* uy 2.0) (PI))) (sqrt (- 1.0 (* (* (* (- 1.0 ux) maxCos) ux) (* (* (- 1.0 ux) maxCos) ux))))) yi)) (* (* (* (- 1.0 ux) maxCos) ux) zi)))