\[\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 := uy \cdot \left(2 \cdot \pi\right)\\
t_1 := \sqrt{1 + ux \cdot \left(ux \cdot \left(\left(maxCos \cdot maxCos\right) \cdot \left(\left(1 - ux\right) \cdot \left(ux + -1\right)\right)\right)\right)}\\
\mathsf{fma}\left(\left(1 - ux\right) \cdot maxCos, ux \cdot zi, \mathsf{fma}\left(\cos t_0 \cdot t_1, xi, t_1 \cdot \left(\sin t_0 \cdot yi\right)\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)))
(t_1
(sqrt
(+
1.0
(* ux (* ux (* (* maxCos maxCos) (* (- 1.0 ux) (+ ux -1.0)))))))))
(fma
(* (- 1.0 ux) maxCos)
(* ux zi)
(fma (* (cos t_0) t_1) xi (* t_1 (* (sin t_0) yi))))))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));
float t_1 = sqrtf((1.0f + (ux * (ux * ((maxCos * maxCos) * ((1.0f - ux) * (ux + -1.0f)))))));
return fmaf(((1.0f - ux) * maxCos), (ux * zi), fmaf((cosf(t_0) * t_1), xi, (t_1 * (sinf(t_0) * yi))));
}
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(uy * Float32(Float32(2.0) * Float32(pi)))
t_1 = sqrt(Float32(Float32(1.0) + Float32(ux * Float32(ux * Float32(Float32(maxCos * maxCos) * Float32(Float32(Float32(1.0) - ux) * Float32(ux + Float32(-1.0))))))))
return fma(Float32(Float32(Float32(1.0) - ux) * maxCos), Float32(ux * zi), fma(Float32(cos(t_0) * t_1), xi, Float32(t_1 * Float32(sin(t_0) * yi))))
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 := uy \cdot \left(2 \cdot \pi\right)\\
t_1 := \sqrt{1 + ux \cdot \left(ux \cdot \left(\left(maxCos \cdot maxCos\right) \cdot \left(\left(1 - ux\right) \cdot \left(ux + -1\right)\right)\right)\right)}\\
\mathsf{fma}\left(\left(1 - ux\right) \cdot maxCos, ux \cdot zi, \mathsf{fma}\left(\cos t_0 \cdot t_1, xi, t_1 \cdot \left(\sin t_0 \cdot yi\right)\right)\right)
\end{array}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 98.9% |
|---|
| Cost | 26912 |
|---|
\[\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 + ux \cdot \left(ux \cdot \left(maxCos \cdot \left(maxCos \cdot \left(\left(1 - ux\right) \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin t_0 \cdot yi + xi \cdot \cos \log \left(1 + \mathsf{expm1}\left(t_0\right)\right)\right)\right)
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 98.9% |
|---|
| 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 + ux \cdot \left(ux \cdot \left(maxCos \cdot \left(maxCos \cdot \left(\left(1 - ux\right) \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin t_0 \cdot yi + \cos t_0 \cdot xi\right)\right)
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 98.8% |
|---|
| Cost | 20192 |
|---|
\[\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), \left(\sin t_0 \cdot yi + \cos t_0 \cdot xi\right) \cdot \sqrt{1 - ux \cdot \left(ux \cdot \left(maxCos \cdot maxCos\right)\right)}\right)
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 98.8% |
|---|
| Cost | 17312 |
|---|
\[\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 - t_0 \cdot t_0}\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) + zi \cdot t_0
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 90.3% |
|---|
| Cost | 17248 |
|---|
\[\mathsf{fma}\left(ux, \left(1 - ux\right) \cdot \left(maxCos \cdot zi\right), \sqrt{1 + ux \cdot \left(ux \cdot \left(maxCos \cdot \left(maxCos \cdot \left(\left(1 - ux\right) \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi + 2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\right)\right)
\]
| Alternative 6 |
|---|
| Accuracy | 90.2% |
|---|
| Cost | 17184 |
|---|
\[\mathsf{fma}\left(ux, \left(1 - ux\right) \cdot \left(maxCos \cdot zi\right), \left(\cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi + 2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\right) \cdot \sqrt{1 + ux \cdot \left(ux \cdot \left(maxCos \cdot \left(maxCos \cdot \left(-1 - ux \cdot -2\right)\right)\right)\right)}\right)
\]
| Alternative 7 |
|---|
| Accuracy | 90.2% |
|---|
| Cost | 16992 |
|---|
\[\mathsf{fma}\left(ux, \left(1 - ux\right) \cdot \left(maxCos \cdot zi\right), \sqrt{1 - ux \cdot \left(ux \cdot \left(maxCos \cdot maxCos\right)\right)} \cdot \left(\cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right)\right)
\]
| Alternative 8 |
|---|
| Accuracy | 90.2% |
|---|
| Cost | 16992 |
|---|
\[\mathsf{fma}\left(ux, \left(1 - ux\right) \cdot \left(maxCos \cdot zi\right), \sqrt{1 - ux \cdot \left(ux \cdot \left(maxCos \cdot maxCos\right)\right)} \cdot \left(\cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi + 2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\right)\right)
\]
| Alternative 9 |
|---|
| Accuracy | 81.6% |
|---|
| Cost | 10432 |
|---|
\[\mathsf{fma}\left(ux, \left(1 - ux\right) \cdot \left(maxCos \cdot zi\right), \sqrt{1 - ux \cdot \left(ux \cdot \left(maxCos \cdot maxCos\right)\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\right)\right)
\]
| Alternative 10 |
|---|
| Accuracy | 81.6% |
|---|
| Cost | 10432 |
|---|
\[\mathsf{fma}\left(ux, maxCos \cdot \left(zi - ux \cdot zi\right), \sqrt{1 - ux \cdot \left(ux \cdot \left(maxCos \cdot maxCos\right)\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\right)\right)
\]
| Alternative 11 |
|---|
| Accuracy | 78.8% |
|---|
| Cost | 10304 |
|---|
\[\mathsf{fma}\left(ux, maxCos \cdot zi, \sqrt{1 - ux \cdot \left(ux \cdot \left(maxCos \cdot maxCos\right)\right)} \cdot \left(xi + 2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\right)\right)
\]