\[\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(1 - ux\right) \cdot maxCos\\
t_1 := uy \cdot \left(2 \cdot \pi\right)\\
t_2 := \sqrt{1 + \left(ux \cdot t_0\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)}\\
\mathsf{fma}\left(\cos t_1 \cdot t_2, xi, \sin t_1 \cdot \left(t_2 \cdot yi\right)\right) + t_0 \cdot \left(ux \cdot zi\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 (* (- 1.0 ux) maxCos))
(t_1 (* uy (* 2.0 PI)))
(t_2 (sqrt (+ 1.0 (* (* ux t_0) (* ux (* maxCos (+ ux -1.0))))))))
(+ (fma (* (cos t_1) t_2) xi (* (sin t_1) (* t_2 yi))) (* t_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 = (1.0f - ux) * maxCos;
float t_1 = uy * (2.0f * ((float) M_PI));
float t_2 = sqrtf((1.0f + ((ux * t_0) * (ux * (maxCos * (ux + -1.0f))))));
return fmaf((cosf(t_1) * t_2), xi, (sinf(t_1) * (t_2 * yi))) + (t_0 * (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(Float32(1.0) - ux) * maxCos)
t_1 = Float32(uy * Float32(Float32(2.0) * Float32(pi)))
t_2 = sqrt(Float32(Float32(1.0) + Float32(Float32(ux * t_0) * Float32(ux * Float32(maxCos * Float32(ux + Float32(-1.0)))))))
return Float32(fma(Float32(cos(t_1) * t_2), xi, Float32(sin(t_1) * Float32(t_2 * yi))) + Float32(t_0 * Float32(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(1 - ux\right) \cdot maxCos\\
t_1 := uy \cdot \left(2 \cdot \pi\right)\\
t_2 := \sqrt{1 + \left(ux \cdot t_0\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)}\\
\mathsf{fma}\left(\cos t_1 \cdot t_2, xi, \sin t_1 \cdot \left(t_2 \cdot yi\right)\right) + t_0 \cdot \left(ux \cdot zi\right)
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 1.08% |
|---|
| 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(\left(1 - ux\right) \cdot \left(\left(ux \cdot maxCos\right) \cdot \left(ux \cdot maxCos\right)\right)\right) \cdot \left(ux + -1\right)} \cdot \left(\cos t_0 \cdot xi + \sin t_0 \cdot yi\right)\right)
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.16% |
|---|
| Cost | 20416 |
|---|
\[\begin{array}{l}
t_0 := ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\\
\left(xi \cdot \left(\cos \left(\pi \cdot \left(uy \cdot 2\right)\right) \cdot \sqrt{1 + \left(1 + \left(-1 - {t_0}^{2}\right)\right)}\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) + t_0 \cdot zi
\end{array}
\]
| Alternative 3 |
|---|
| Error | 1.16% |
|---|
| Cost | 17312 |
|---|
\[\begin{array}{l}
t_0 := ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\\
t_0 \cdot zi + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + xi \cdot \left(\sqrt{1 + t_0 \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)} \cdot \cos \left(\pi \cdot \left(uy \cdot 2\right)\right)\right)\right)
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.29% |
|---|
| Cost | 17056 |
|---|
\[\left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + xi \cdot \left(\cos \left(\pi \cdot \left(uy \cdot 2\right)\right) \cdot \sqrt{1 - \left(maxCos \cdot maxCos\right) \cdot \left(ux \cdot ux\right)}\right)\right)
\]
| Alternative 5 |
|---|
| Error | 9.84% |
|---|
| Cost | 14112 |
|---|
\[\begin{array}{l}
t_0 := ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\\
t_0 \cdot zi + \left(xi \cdot \left(\sqrt{1 + t_0 \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)} \cdot \cos \left(\pi \cdot \left(uy \cdot 2\right)\right)\right) + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right)
\end{array}
\]
| Alternative 6 |
|---|
| Error | 9.82% |
|---|
| Cost | 14112 |
|---|
\[\begin{array}{l}
t_0 := ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\\
t_0 \cdot zi + \left(xi \cdot \left(\sqrt{1 + t_0 \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)} \cdot \cos \left(\pi \cdot \left(uy \cdot 2\right)\right)\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right)\right)\right)
\end{array}
\]
| Alternative 7 |
|---|
| Error | 9.96% |
|---|
| Cost | 13856 |
|---|
\[\left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi + \left(xi \cdot \left(\cos \left(\pi \cdot \left(uy \cdot 2\right)\right) \cdot \sqrt{1 - \left(maxCos \cdot maxCos\right) \cdot \left(ux \cdot ux\right)}\right) + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right)
\]
| Alternative 8 |
|---|
| Error | 41.11% |
|---|
| Cost | 13824 |
|---|
\[\mathsf{fma}\left(\cos \left(\pi \cdot \left(uy \cdot 2\right)\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)
\]
| Alternative 9 |
|---|
| Error | 41.11% |
|---|
| Cost | 13824 |
|---|
\[\mathsf{fma}\left(\cos \left(\pi \cdot \left(uy \cdot 2\right)\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(zi \cdot \left(ux - ux \cdot ux\right)\right)\right)
\]
| Alternative 10 |
|---|
| Error | 41.2% |
|---|
| Cost | 13696 |
|---|
\[\mathsf{fma}\left(\cos \left(\pi \cdot \left(uy \cdot 2\right)\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)
\]
| Alternative 11 |
|---|
| Error | 48.59% |
|---|
| Cost | 7392 |
|---|
\[\mathsf{fma}\left(1, 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 \frac{ux \cdot zi}{\frac{1}{1 - ux}}\right)
\]
| Alternative 12 |
|---|
| Error | 48.58% |
|---|
| Cost | 7328 |
|---|
\[\mathsf{fma}\left(1, 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)
\]
| Alternative 13 |
|---|
| Error | 48.57% |
|---|
| Cost | 7328 |
|---|
\[\mathsf{fma}\left(1, 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(\left(1 - ux\right) \cdot \left(ux \cdot zi\right)\right)\right)
\]
| Alternative 14 |
|---|
| Error | 48.66% |
|---|
| Cost | 7200 |
|---|
\[\mathsf{fma}\left(1, xi \cdot \sqrt{1 - \left(maxCos \cdot maxCos\right) \cdot \left(ux \cdot ux\right)}, maxCos \cdot \left(ux \cdot zi\right) - maxCos \cdot \left(ux \cdot \left(ux \cdot zi\right)\right)\right)
\]
| Alternative 15 |
|---|
| Error | 48.66% |
|---|
| Cost | 7072 |
|---|
\[\mathsf{fma}\left(1, xi \cdot \sqrt{1 - \left(maxCos \cdot maxCos\right) \cdot \left(ux \cdot ux\right)}, maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right)
\]
| Alternative 16 |
|---|
| Error | 48.66% |
|---|
| Cost | 7072 |
|---|
\[\mathsf{fma}\left(1, xi \cdot \sqrt{1 - \left(maxCos \cdot maxCos\right) \cdot \left(ux \cdot ux\right)}, maxCos \cdot \left(ux \cdot \left(zi - ux \cdot zi\right)\right)\right)
\]
| Alternative 17 |
|---|
| Error | 48.66% |
|---|
| Cost | 7072 |
|---|
\[\mathsf{fma}\left(1, xi \cdot \sqrt{1 - \left(maxCos \cdot maxCos\right) \cdot \left(ux \cdot ux\right)}, \left(1 - ux\right) \cdot \left(maxCos \cdot \left(ux \cdot zi\right)\right)\right)
\]
| Alternative 18 |
|---|
| Error | 50.77% |
|---|
| Cost | 6944 |
|---|
\[\mathsf{fma}\left(1, xi \cdot \sqrt{1 - \left(maxCos \cdot maxCos\right) \cdot \left(ux \cdot ux\right)}, maxCos \cdot \left(ux \cdot zi\right)\right)
\]