\[\left(\left(\left(\left(\left(-10000 \leq xi \land xi \leq 10000\right) \land \left(-10000 \leq yi \land yi \leq 10000\right)\right) \land \left(-10000 \leq zi \land zi \leq 10000\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\right)\right) \land \left(2.328306437 \cdot 10^{-10} \leq uy \land uy \leq 1\right)\right) \land \left(0 \leq maxCos \land maxCos \leq 1\right)\]
\[\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi
\]
↓
\[\begin{array}{l}
t_0 := \left(uy \cdot 2\right) \cdot \pi\\
\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(ux, \left(ux + -1\right) \cdot \left(\left(ux \cdot maxCos\right) \cdot \left(maxCos - ux \cdot maxCos\right)\right), 1\right)}, \mathsf{fma}\left(\cos t_0, xi, \sin t_0 \cdot yi\right), \left(ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)
\end{array}
\]
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(+
(+
(*
(*
(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)))↓
(FPCore (xi yi zi ux uy maxCos)
:precision binary32
(let* ((t_0 (* (* uy 2.0) PI)))
(fma
(sqrt
(fma ux (* (+ ux -1.0) (* (* ux maxCos) (- maxCos (* ux maxCos)))) 1.0))
(fma (cos t_0) xi (* (sin t_0) yi))
(* (* ux maxCos) (* (- 1.0 ux) zi)))))float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
return (((cosf(((uy * 2.0f) * ((float) M_PI))) * sqrtf((1.0f - ((((1.0f - ux) * maxCos) * ux) * (((1.0f - ux) * maxCos) * ux))))) * xi) + ((sinf(((uy * 2.0f) * ((float) M_PI))) * sqrtf((1.0f - ((((1.0f - ux) * maxCos) * ux) * (((1.0f - ux) * maxCos) * ux))))) * yi)) + ((((1.0f - ux) * maxCos) * ux) * zi);
}
↓
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
float t_0 = (uy * 2.0f) * ((float) M_PI);
return fmaf(sqrtf(fmaf(ux, ((ux + -1.0f) * ((ux * maxCos) * (maxCos - (ux * maxCos)))), 1.0f)), fmaf(cosf(t_0), xi, (sinf(t_0) * yi)), ((ux * maxCos) * ((1.0f - ux) * zi)));
}
function code(xi, yi, zi, ux, uy, maxCos)
return Float32(Float32(Float32(Float32(cos(Float32(Float32(uy * Float32(2.0)) * Float32(pi))) * sqrt(Float32(Float32(1.0) - Float32(Float32(Float32(Float32(Float32(1.0) - ux) * maxCos) * ux) * Float32(Float32(Float32(Float32(1.0) - ux) * maxCos) * ux))))) * xi) + Float32(Float32(sin(Float32(Float32(uy * Float32(2.0)) * Float32(pi))) * sqrt(Float32(Float32(1.0) - Float32(Float32(Float32(Float32(Float32(1.0) - ux) * maxCos) * ux) * Float32(Float32(Float32(Float32(1.0) - ux) * maxCos) * ux))))) * yi)) + Float32(Float32(Float32(Float32(Float32(1.0) - ux) * maxCos) * ux) * zi))
end
↓
function code(xi, yi, zi, ux, uy, maxCos)
t_0 = Float32(Float32(uy * Float32(2.0)) * Float32(pi))
return fma(sqrt(fma(ux, Float32(Float32(ux + Float32(-1.0)) * Float32(Float32(ux * maxCos) * Float32(maxCos - Float32(ux * maxCos)))), Float32(1.0))), fma(cos(t_0), xi, Float32(sin(t_0) * yi)), Float32(Float32(ux * maxCos) * Float32(Float32(Float32(1.0) - ux) * zi)))
end
\left(\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot xi + \left(\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right)}\right) \cdot yi\right) + \left(\left(\left(1 - ux\right) \cdot maxCos\right) \cdot ux\right) \cdot zi
↓
\begin{array}{l}
t_0 := \left(uy \cdot 2\right) \cdot \pi\\
\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(ux, \left(ux + -1\right) \cdot \left(\left(ux \cdot maxCos\right) \cdot \left(maxCos - ux \cdot maxCos\right)\right), 1\right)}, \mathsf{fma}\left(\cos t_0, xi, \sin t_0 \cdot yi\right), \left(ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.3 |
|---|
| Cost | 21088 |
|---|
\[\begin{array}{l}
t_0 := ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\\
t_1 := \sqrt{1 - t_0 \cdot t_0}\\
t_2 := \left(uy \cdot 2\right) \cdot \pi\\
\left(xi \cdot \left(\cos t_2 \cdot t_1\right) + yi \cdot \left(\sin t_2 \cdot t_1\right)\right) + zi \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right)
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.3 |
|---|
| Cost | 20448 |
|---|
\[\begin{array}{l}
t_0 := uy \cdot \left(2 \cdot \pi\right)\\
\mathsf{fma}\left(ux, \left(1 - ux\right) \cdot \left(maxCos \cdot zi\right), \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi \cdot \cos t_0 + yi \cdot \sin t_0\right)\right)
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.4 |
|---|
| Cost | 17312 |
|---|
\[\begin{array}{l}
t_0 := ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\\
zi \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) + \left(xi \cdot \left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - t_0 \cdot t_0}\right) + yi \cdot \sin \left(uy \cdot \left(2 \cdot \pi\right)\right)\right)
\end{array}
\]
| Alternative 4 |
|---|
| Error | 3.3 |
|---|
| Cost | 17248 |
|---|
\[\mathsf{fma}\left(ux, maxCos \cdot \left(zi - ux \cdot zi\right), \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi \cdot \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right)\right)
\]
| Alternative 5 |
|---|
| Error | 3.3 |
|---|
| Cost | 17248 |
|---|
\[\mathsf{fma}\left(ux, \left(1 - ux\right) \cdot \left(maxCos \cdot zi\right), \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi \cdot \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) + 2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\right)\right)
\]
| Alternative 6 |
|---|
| Error | 3.3 |
|---|
| Cost | 17248 |
|---|
\[\mathsf{fma}\left(ux, \left(1 - ux\right) \cdot \left(maxCos \cdot zi\right), \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi \cdot \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) + yi \cdot \left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)
\]
| Alternative 7 |
|---|
| Error | 4.2 |
|---|
| Cost | 17120 |
|---|
\[\mathsf{fma}\left(ux, maxCos \cdot zi, \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi \cdot \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right)\right)\right)
\]
| Alternative 8 |
|---|
| Error | 4.8 |
|---|
| Cost | 17060 |
|---|
\[\begin{array}{l}
t_0 := 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\\
\mathbf{if}\;uy \cdot 2 \leq 0.0013000000035390258:\\
\;\;\;\;\mathsf{fma}\left(ux, maxCos \cdot zi, \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi + t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right), xi \cdot \sqrt{1 + \left(1 - ux\right) \cdot \left(maxCos \cdot \left(\left(ux \cdot ux\right) \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)}, t_0\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 4.8 |
|---|
| Cost | 17060 |
|---|
\[\begin{array}{l}
\mathbf{if}\;uy \cdot 2 \leq 0.0013000000035390258:\\
\;\;\;\;\mathsf{fma}\left(ux, maxCos \cdot zi, \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right), xi \cdot \sqrt{1 + \left(1 - ux\right) \cdot \left(maxCos \cdot \left(\left(ux \cdot ux\right) \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)}, uy \cdot \left(2 \cdot \left(\pi \cdot yi\right)\right)\right)\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 5.6 |
|---|
| Cost | 13961 |
|---|
\[\begin{array}{l}
\mathbf{if}\;yi \leq -4.0000000781659255 \cdot 10^{-25} \lor \neg \left(yi \leq 2.149999968058475 \cdot 10^{-25}\right):\\
\;\;\;\;\mathsf{fma}\left(ux, maxCos \cdot zi, \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right), xi \cdot \sqrt{1 + \left(1 - ux\right) \cdot \left(maxCos \cdot \left(\left(ux \cdot ux\right) \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)}, maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 5.6 |
|---|
| Cost | 13961 |
|---|
\[\begin{array}{l}
\mathbf{if}\;yi \leq -4.0000000781659255 \cdot 10^{-25} \lor \neg \left(yi \leq 2.149999968058475 \cdot 10^{-25}\right):\\
\;\;\;\;\mathsf{fma}\left(ux, maxCos \cdot zi, \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right), xi \cdot \sqrt{1 + \left(1 - ux\right) \cdot \left(maxCos \cdot \left(\left(ux \cdot ux\right) \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)}, \left(\left(1 - ux\right) \cdot maxCos\right) \cdot \left(ux \cdot zi\right)\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 5.6 |
|---|
| Cost | 13833 |
|---|
\[\begin{array}{l}
\mathbf{if}\;yi \leq -4.0000000781659255 \cdot 10^{-25} \lor \neg \left(yi \leq 2.149999968058475 \cdot 10^{-25}\right):\\
\;\;\;\;\mathsf{fma}\left(ux, maxCos \cdot zi, \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\cos \left(\left(uy \cdot 2\right) \cdot \pi\right), xi \cdot \sqrt{1 + \left(maxCos \cdot \left(maxCos \cdot \left(ux \cdot ux\right)\right)\right) \cdot \left(ux + -1\right)}, maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right)\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 6.8 |
|---|
| Cost | 10560 |
|---|
\[\mathsf{fma}\left(ux, maxCos \cdot zi, \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right) \cdot \left(ux + -1\right)\right)} \cdot \left(xi + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right)\right)
\]
| Alternative 14 |
|---|
| Error | 13.9 |
|---|
| Cost | 6784 |
|---|
\[maxCos \cdot \left(ux \cdot zi\right) + xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)
\]
| Alternative 15 |
|---|
| Error | 15.3 |
|---|
| Cost | 6592 |
|---|
\[xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)
\]
| Alternative 16 |
|---|
| Error | 28.1 |
|---|
| Cost | 160 |
|---|
\[maxCos \cdot \left(ux \cdot zi\right)
\]
| Alternative 17 |
|---|
| Error | 28.1 |
|---|
| Cost | 160 |
|---|
\[ux \cdot \left(maxCos \cdot zi\right)
\]