\[\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(\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 \pi\\
\left(\left(\cos t_2 \cdot t_1\right) \cdot xi + \left(\sin t_2 \cdot t_1\right) \cdot yi\right) + \left(ux \cdot \left(maxCos - maxCos \cdot ux\right)\right) \cdot zi
\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) 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))
(* (* ux (- maxCos (* maxCos 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) * ux;
float t_1 = sqrtf((1.0f - (t_0 * t_0)));
float t_2 = (uy * 2.0f) * ((float) M_PI);
return (((cosf(t_2) * t_1) * xi) + ((sinf(t_2) * t_1) * yi)) + ((ux * (maxCos - (maxCos * 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(Float32(1.0) - ux) * maxCos) * ux)
t_1 = sqrt(Float32(Float32(1.0) - Float32(t_0 * t_0)))
t_2 = Float32(Float32(uy * Float32(2.0)) * Float32(pi))
return Float32(Float32(Float32(Float32(cos(t_2) * t_1) * xi) + Float32(Float32(sin(t_2) * t_1) * yi)) + Float32(Float32(ux * Float32(maxCos - Float32(maxCos * ux))) * zi))
end
function tmp = code(xi, yi, zi, ux, uy, maxCos)
tmp = (((cos(((uy * single(2.0)) * single(pi))) * sqrt((single(1.0) - ((((single(1.0) - ux) * maxCos) * ux) * (((single(1.0) - ux) * maxCos) * ux))))) * xi) + ((sin(((uy * single(2.0)) * single(pi))) * sqrt((single(1.0) - ((((single(1.0) - ux) * maxCos) * ux) * (((single(1.0) - ux) * maxCos) * ux))))) * yi)) + ((((single(1.0) - ux) * maxCos) * ux) * zi);
end
↓
function tmp = code(xi, yi, zi, ux, uy, maxCos)
t_0 = ((single(1.0) - ux) * maxCos) * ux;
t_1 = sqrt((single(1.0) - (t_0 * t_0)));
t_2 = (uy * single(2.0)) * single(pi);
tmp = (((cos(t_2) * t_1) * xi) + ((sin(t_2) * t_1) * yi)) + ((ux * (maxCos - (maxCos * 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(\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 \pi\\
\left(\left(\cos t_2 \cdot t_1\right) \cdot xi + \left(\sin t_2 \cdot t_1\right) \cdot yi\right) + \left(ux \cdot \left(maxCos - maxCos \cdot ux\right)\right) \cdot zi
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.3 |
|---|
| Cost | 21088 |
|---|
\[\begin{array}{l}
t_0 := \left(uy \cdot 2\right) \cdot \pi\\
t_1 := \sqrt{1 - ux \cdot \left(maxCos \cdot \left(\left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot \left(1 - ux\right)\right)\right)}\\
\cos t_0 \cdot \left(t_1 \cdot xi\right) + \left(t_1 \cdot \left(\sin t_0 \cdot yi\right) + ux \cdot \left(\left(1 - ux\right) \cdot \left(zi \cdot maxCos\right)\right)\right)
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.3 |
|---|
| Cost | 17312 |
|---|
\[\begin{array}{l}
t_0 := uy \cdot \left(2 \cdot \pi\right)\\
t_1 := maxCos - ux \cdot maxCos\\
\sqrt{1 - ux \cdot \left(t_1 \cdot \left(ux \cdot t_1\right)\right)} \cdot \left(\sin t_0 \cdot yi + \cos t_0 \cdot xi\right) + \left(1 - ux\right) \cdot \left(zi \cdot \left(ux \cdot maxCos\right)\right)
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.4 |
|---|
| Cost | 17184 |
|---|
\[\begin{array}{l}
t_0 := uy \cdot \left(2 \cdot \pi\right)\\
\sqrt{1 - ux \cdot \left(\left(maxCos - ux \cdot maxCos\right) \cdot \left(maxCos \cdot ux\right)\right)} \cdot \left(\sin t_0 \cdot yi + \cos t_0 \cdot xi\right) + \left(1 - ux\right) \cdot \left(zi \cdot \left(ux \cdot maxCos\right)\right)
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.3 |
|---|
| Cost | 17056 |
|---|
\[\begin{array}{l}
t_0 := uy \cdot \left(2 \cdot \pi\right)\\
\sqrt{1 - ux \cdot \left(\left(maxCos - ux \cdot maxCos\right) \cdot \left(maxCos \cdot ux\right)\right)} \cdot \left(\sin t_0 \cdot yi + \cos t_0 \cdot xi\right) + ux \cdot \left(maxCos \cdot zi\right)
\end{array}
\]
| Alternative 5 |
|---|
| Error | 3.1 |
|---|
| Cost | 14112 |
|---|
\[\begin{array}{l}
t_0 := maxCos - ux \cdot maxCos\\
\sqrt{1 - ux \cdot \left(t_0 \cdot \left(ux \cdot t_0\right)\right)} \cdot \left(2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right) + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(1 - ux\right) \cdot \left(zi \cdot \left(ux \cdot maxCos\right)\right)
\end{array}
\]
| Alternative 6 |
|---|
| Error | 3.1 |
|---|
| Cost | 14112 |
|---|
\[\begin{array}{l}
t_0 := maxCos - ux \cdot maxCos\\
\sqrt{1 - ux \cdot \left(t_0 \cdot \left(ux \cdot t_0\right)\right)} \cdot \left(2 \cdot \left(\pi \cdot \left(yi \cdot uy\right)\right) + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(1 - ux\right) \cdot \left(zi \cdot \left(ux \cdot maxCos\right)\right)
\end{array}
\]
| Alternative 7 |
|---|
| Error | 3.2 |
|---|
| Cost | 13984 |
|---|
\[\sqrt{1 - ux \cdot \left(\left(maxCos - ux \cdot maxCos\right) \cdot \left(maxCos \cdot ux\right)\right)} \cdot \left(2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right) + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + maxCos \cdot \left(ux \cdot \left(zi - ux \cdot zi\right)\right)
\]
| Alternative 8 |
|---|
| Error | 3.2 |
|---|
| Cost | 13984 |
|---|
\[\sqrt{1 - ux \cdot \left(\left(maxCos - ux \cdot maxCos\right) \cdot \left(maxCos \cdot ux\right)\right)} \cdot \left(2 \cdot \left(yi \cdot \left(\pi \cdot uy\right)\right) + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + maxCos \cdot \left(ux \cdot \left(zi - ux \cdot zi\right)\right)
\]
| Alternative 9 |
|---|
| Error | 4.0 |
|---|
| Cost | 13856 |
|---|
\[\sqrt{1 - ux \cdot \left(\left(maxCos - ux \cdot maxCos\right) \cdot \left(maxCos \cdot ux\right)\right)} \cdot \left(2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right) + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + maxCos \cdot \left(ux \cdot zi\right)
\]
| Alternative 10 |
|---|
| Error | 4.0 |
|---|
| Cost | 13856 |
|---|
\[\sqrt{1 - ux \cdot \left(\left(maxCos - ux \cdot maxCos\right) \cdot \left(maxCos \cdot ux\right)\right)} \cdot \left(2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right) + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + ux \cdot \left(maxCos \cdot zi\right)
\]
| Alternative 11 |
|---|
| Error | 4.0 |
|---|
| Cost | 13856 |
|---|
\[\sqrt{1 - ux \cdot \left(\left(maxCos - ux \cdot maxCos\right) \cdot \left(maxCos \cdot ux\right)\right)} \cdot \left(2 \cdot \left(yi \cdot \left(\pi \cdot uy\right)\right) + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + ux \cdot \left(maxCos \cdot zi\right)
\]
| Alternative 12 |
|---|
| Error | 5.8 |
|---|
| Cost | 7520 |
|---|
\[\sqrt{1 - ux \cdot \left(\left(maxCos - ux \cdot maxCos\right) \cdot \left(maxCos \cdot ux\right)\right)} \cdot \left(2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right) + 1 \cdot xi\right) + ux \cdot \left(zi \cdot \left(maxCos + ux \cdot \left(-maxCos\right)\right)\right)
\]
| Alternative 13 |
|---|
| Error | 6.6 |
|---|
| Cost | 7360 |
|---|
\[\sqrt{1 - ux \cdot \left(\left(maxCos - ux \cdot maxCos\right) \cdot \left(maxCos \cdot ux\right)\right)} \cdot \left(2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right) + 1 \cdot xi\right) + maxCos \cdot \left(ux \cdot zi\right)
\]