
(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 15 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)))
(-
(+
(* yi (* (sqrt (- 1.0 (* t_0 t_0))) (sin (* (PI) (* 2.0 uy)))))
(*
xi
(*
(sqrt (- 1.0 (* (* maxCos ux) t_0)))
(cos (* (* (log (E)) (PI)) (* 2.0 uy))))))
(* (* (* (- ux 1.0) maxCos) ux) zi))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\
\left(yi \cdot \left(\sqrt{1 - t\_0 \cdot t\_0} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right)\right) + xi \cdot \left(\sqrt{1 - \left(maxCos \cdot ux\right) \cdot t\_0} \cdot \cos \left(\left(\log \mathsf{E}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(2 \cdot uy\right)\right)\right)\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi
\end{array}
\end{array}
Initial program 98.6%
Taylor expanded in ux around 0
*-commutativeN/A
lower-*.f3298.6
Applied rewrites98.6%
rem-3cbrt-lftN/A
lift-cbrt.f32N/A
lift-cbrt.f32N/A
lift-cbrt.f32N/A
pow3N/A
lower-pow.f3298.6
Applied rewrites98.6%
lift-pow.f32N/A
lift-cbrt.f32N/A
rem-cube-cbrt98.6
lift-PI.f32N/A
add-log-expN/A
*-un-lft-identityN/A
lift-PI.f32N/A
exp-prodN/A
log-powN/A
lower-*.f32N/A
lower-log.f32N/A
exp-1-eN/A
lower-E.f3298.6
Applied rewrites98.6%
Final simplification98.6%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* maxCos (- 1.0 ux)) ux)) (t_1 (* (PI) (* 2.0 uy))))
(-
(+
(* (* (cos t_1) (sqrt (- 1.0 (* (* maxCos ux) t_0)))) xi)
(* yi (* (sqrt (- 1.0 (* t_0 t_0))) (sin t_1))))
(* (* (* (- ux 1.0) maxCos) ux) zi))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\
t_1 := \mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\\
\left(\left(\cos t\_1 \cdot \sqrt{1 - \left(maxCos \cdot ux\right) \cdot t\_0}\right) \cdot xi + yi \cdot \left(\sqrt{1 - t\_0 \cdot t\_0} \cdot \sin t\_1\right)\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi
\end{array}
\end{array}
Initial program 98.6%
Taylor expanded in ux around 0
*-commutativeN/A
lower-*.f3298.6
Applied rewrites98.6%
Final simplification98.6%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* maxCos (- 1.0 ux)) ux)))
(-
(+
(* (cos (* (* (PI) uy) 2.0)) xi)
(* yi (* (sqrt (- 1.0 (* t_0 t_0))) (sin (* (PI) (* 2.0 uy))))))
(* (* (* (- ux 1.0) maxCos) ux) zi))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\
\left(\cos \left(\left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\right) \cdot xi + yi \cdot \left(\sqrt{1 - t\_0 \cdot t\_0} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right)\right)\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi
\end{array}
\end{array}
Initial program 98.6%
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.f3298.6
Applied rewrites98.6%
Final simplification98.6%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (PI) (* 2.0 uy))))
(-
(+
(* (* 1.0 (sin t_0)) yi)
(*
(*
(cos t_0)
(sqrt (- 1.0 (* (* maxCos ux) (* (* maxCos (- 1.0 ux)) ux)))))
xi))
(* (* (* (- 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(\left(1 \cdot \sin t\_0\right) \cdot yi + \left(\cos t\_0 \cdot \sqrt{1 - \left(maxCos \cdot ux\right) \cdot \left(\left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\right)}\right) \cdot xi\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi
\end{array}
\end{array}
Initial program 98.6%
Taylor expanded in ux around 0
*-commutativeN/A
lower-*.f3298.6
Applied rewrites98.6%
Taylor expanded in maxCos around 0
Applied rewrites98.6%
Final simplification98.6%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* maxCos (- 1.0 ux)) ux))
(t_1 (* (* (PI) uy) 2.0))
(t_2 (* (PI) (* 2.0 uy))))
(if (<= (* 2.0 uy) 0.027000000700354576)
(-
(+
(* (* t_1 (sqrt (- 1.0 (* t_0 t_0)))) yi)
(* (* (cos t_2) (sqrt (- 1.0 (* (* maxCos ux) t_0)))) xi))
(* (* (* (- ux 1.0) maxCos) ux) zi))
(+ (* (cos t_1) xi) (* yi (sin t_2))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\
t_1 := \left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\\
t_2 := \mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\\
\mathbf{if}\;2 \cdot uy \leq 0.027000000700354576:\\
\;\;\;\;\left(\left(t\_1 \cdot \sqrt{1 - t\_0 \cdot t\_0}\right) \cdot yi + \left(\cos t\_2 \cdot \sqrt{1 - \left(maxCos \cdot ux\right) \cdot t\_0}\right) \cdot xi\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
\mathbf{else}:\\
\;\;\;\;\cos t\_1 \cdot xi + yi \cdot \sin t\_2\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 0.0270000007Initial program 99.1%
Taylor expanded in ux around 0
*-commutativeN/A
lower-*.f3299.1
Applied rewrites99.1%
Taylor expanded in uy around 0
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-PI.f3296.9
Applied rewrites96.9%
if 0.0270000007 < (*.f32 uy #s(literal 2 binary32)) Initial program 96.9%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites7.0%
Applied rewrites14.9%
Taylor expanded in xi around inf
Applied rewrites91.3%
Final simplification95.6%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (let* ((t_0 (* (PI) (* 2.0 uy)))) (+ (* yi (sin t_0)) (+ (* (cos t_0) xi) (* (* zi ux) maxCos)))))
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\\
yi \cdot \sin t\_0 + \left(\cos t\_0 \cdot xi + \left(zi \cdot ux\right) \cdot maxCos\right)
\end{array}
\end{array}
Initial program 98.6%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites10.5%
Applied rewrites38.8%
Applied rewrites94.9%
Final simplification94.9%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (sin (* (PI) (* 2.0 uy)))) (t_1 (* (* maxCos (- 1.0 ux)) ux)))
(if (<= (* 2.0 uy) 0.0012799999676644802)
(-
(+
(* (* 1.0 (sqrt (- 1.0 (* (* maxCos ux) t_1)))) xi)
(* yi (* (sqrt (- 1.0 (* t_1 t_1))) t_0)))
(* (* (* (- ux 1.0) maxCos) ux) zi))
(+ (* (cos (* (* (PI) uy) 2.0)) xi) (* yi t_0)))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right)\\
t_1 := \left(maxCos \cdot \left(1 - ux\right)\right) \cdot ux\\
\mathbf{if}\;2 \cdot uy \leq 0.0012799999676644802:\\
\;\;\;\;\left(\left(1 \cdot \sqrt{1 - \left(maxCos \cdot ux\right) \cdot t\_1}\right) \cdot xi + yi \cdot \left(\sqrt{1 - t\_1 \cdot t\_1} \cdot t\_0\right)\right) - \left(\left(\left(ux - 1\right) \cdot maxCos\right) \cdot ux\right) \cdot zi\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\right) \cdot xi + yi \cdot t\_0\\
\end{array}
\end{array}
if (*.f32 uy #s(literal 2 binary32)) < 0.00127999997Initial program 99.2%
Taylor expanded in ux around 0
*-commutativeN/A
lower-*.f3299.2
Applied rewrites99.2%
Taylor expanded in uy around 0
Applied rewrites98.3%
if 0.00127999997 < (*.f32 uy #s(literal 2 binary32)) Initial program 97.5%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites7.2%
Applied rewrites22.7%
Taylor expanded in xi around inf
Applied rewrites88.5%
Final simplification94.9%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (+ (* (cos (* (* (PI) uy) 2.0)) xi) (* yi (sin (* (PI) (* 2.0 uy))))))
\begin{array}{l}
\\
\cos \left(\left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\right) \cdot xi + yi \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right)
\end{array}
Initial program 98.6%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites10.5%
Applied rewrites38.8%
Taylor expanded in xi around inf
Applied rewrites88.0%
Final simplification88.0%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (cos (* (* (PI) uy) 2.0)) xi)))
(if (<= xi -1.999999936531045e-21)
t_0
(if (<= xi 2.00000009162741e-18)
(+ (* (* zi ux) maxCos) (* yi (sin (* (PI) (* 2.0 uy)))))
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\\
\mathbf{if}\;xi \leq -1.999999936531045 \cdot 10^{-21}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;xi \leq 2.00000009162741 \cdot 10^{-18}:\\
\;\;\;\;\left(zi \cdot ux\right) \cdot maxCos + yi \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if xi < -1.9999999e-21 or 2.00000009e-18 < xi Initial program 98.7%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites7.7%
Taylor expanded in xi around inf
Applied rewrites71.1%
if -1.9999999e-21 < xi < 2.00000009e-18Initial program 98.5%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites13.6%
Applied rewrites59.7%
Taylor expanded in xi around 0
Applied rewrites70.7%
Final simplification70.9%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (+ (fma (* zi ux) maxCos xi) (* yi (sin (* (PI) (* 2.0 uy))))))
\begin{array}{l}
\\
\mathsf{fma}\left(zi \cdot ux, maxCos, xi\right) + yi \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right)
\end{array}
Initial program 98.6%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites10.5%
Applied rewrites38.8%
Taylor expanded in uy around 0
Applied rewrites46.0%
Final simplification45.9%
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* (PI) uy) 2.0)) (t_1 (* (sin t_0) yi)))
(if (<= yi -3.99999992980668e-14)
t_1
(if (<= yi 4.999999969612645e-9) (* (cos t_0) xi) t_1))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\\
t_1 := \sin t\_0 \cdot yi\\
\mathbf{if}\;yi \leq -3.99999992980668 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;yi \leq 4.999999969612645 \cdot 10^{-9}:\\
\;\;\;\;\cos t\_0 \cdot xi\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if yi < -3.99999993e-14 or 4.99999997e-9 < yi Initial program 98.5%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites8.4%
Taylor expanded in yi around inf
Applied rewrites73.7%
if -3.99999993e-14 < yi < 4.99999997e-9Initial program 98.7%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites11.8%
Taylor expanded in xi around inf
Applied rewrites64.5%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (* (cos (* (* (PI) uy) 2.0)) xi))
\begin{array}{l}
\\
\cos \left(\left(\mathsf{PI}\left(\right) \cdot uy\right) \cdot 2\right) \cdot xi
\end{array}
Initial program 98.6%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites10.5%
Taylor expanded in xi around inf
Applied rewrites47.3%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (+ (* (* zi ux) maxCos) xi))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
return ((zi * ux) * maxCos) + xi;
}
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) + xi
end function
function code(xi, yi, zi, ux, uy, maxCos) return Float32(Float32(Float32(zi * ux) * maxCos) + xi) end
function tmp = code(xi, yi, zi, ux, uy, maxCos) tmp = ((zi * ux) * maxCos) + xi; end
\begin{array}{l}
\\
\left(zi \cdot ux\right) \cdot maxCos + xi
\end{array}
Initial program 98.6%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites10.5%
Taylor expanded in uy around 0
Applied rewrites38.8%
Applied rewrites43.0%
(FPCore (xi yi zi ux uy maxCos) :precision binary32 (fma maxCos (* zi ux) xi))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
return fmaf(maxCos, (zi * ux), xi);
}
function code(xi, yi, zi, ux, uy, maxCos) return fma(maxCos, Float32(zi * ux), xi) end
\begin{array}{l}
\\
\mathsf{fma}\left(maxCos, zi \cdot ux, xi\right)
\end{array}
Initial program 98.6%
Taylor expanded in ux around 0
+-commutativeN/A
associate-+l+N/A
*-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-fma.f32N/A
Applied rewrites10.5%
Taylor expanded in uy around 0
Applied rewrites38.8%
Applied rewrites26.4%
(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.6%
Taylor expanded in zi around inf
*-commutativeN/A
lower-*.f32N/A
*-commutativeN/A
lower-*.f32N/A
lower-*.f32N/A
lower--.f3214.1
Applied rewrites14.1%
Taylor expanded in ux around 0
Applied rewrites12.2%
herbie shell --seed 2024271
(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)))