UniformSampleCone 2

Percentage Accurate: 99.0% → 99.0%
Time: 17.5s
Alternatives: 14
Speedup: 1.3×

Specification

?
\[\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)\]
\[\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 \pi\\ \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 (* (* (- 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))))
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)) + (t_0 * zi);
}
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(t_0 * 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)) + (t_0 * zi);
end
\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 \pi\\
\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:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.0% accurate, 1.0× speedup?

\[\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 \pi\\ \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 (* (* (- 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))))
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)) + (t_0 * zi);
}
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(t_0 * 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)) + (t_0 * zi);
end
\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 \pi\\
\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}

Alternative 1: 99.0% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := uy \cdot \left(2 \cdot \pi\right)\\ \sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin t\_0 \cdot yi + \cos t\_0 \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi \end{array} \end{array} \]
(FPCore (xi yi zi ux uy maxCos)
 :precision binary32
 (let* ((t_0 (* uy (* 2.0 PI))))
   (+
    (*
     (sqrt
      (+ 1.0 (* (- 1.0 ux) (* ux (* maxCos (* ux (* maxCos (+ ux -1.0))))))))
     (+ (* (sin t_0) yi) (* (cos t_0) xi)))
    (* (* ux (* (- 1.0 ux) maxCos)) 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 (sqrtf((1.0f + ((1.0f - ux) * (ux * (maxCos * (ux * (maxCos * (ux + -1.0f)))))))) * ((sinf(t_0) * yi) + (cosf(t_0) * xi))) + ((ux * ((1.0f - ux) * maxCos)) * zi);
}
function code(xi, yi, zi, ux, uy, maxCos)
	t_0 = Float32(uy * Float32(Float32(2.0) * Float32(pi)))
	return Float32(Float32(sqrt(Float32(Float32(1.0) + Float32(Float32(Float32(1.0) - ux) * Float32(ux * Float32(maxCos * Float32(ux * Float32(maxCos * Float32(ux + Float32(-1.0))))))))) * Float32(Float32(sin(t_0) * yi) + Float32(cos(t_0) * xi))) + Float32(Float32(ux * Float32(Float32(Float32(1.0) - ux) * maxCos)) * zi))
end
function tmp = code(xi, yi, zi, ux, uy, maxCos)
	t_0 = uy * (single(2.0) * single(pi));
	tmp = (sqrt((single(1.0) + ((single(1.0) - ux) * (ux * (maxCos * (ux * (maxCos * (ux + single(-1.0))))))))) * ((sin(t_0) * yi) + (cos(t_0) * xi))) + ((ux * ((single(1.0) - ux) * maxCos)) * zi);
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := uy \cdot \left(2 \cdot \pi\right)\\
\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin t\_0 \cdot yi + \cos t\_0 \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi
\end{array}
\end{array}
Derivation
  1. Initial program 99.0%

    \[\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 \]
  2. Simplified99.0%

    \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
  3. Add Preprocessing
  4. Add Preprocessing

Alternative 2: 98.7% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 2 \cdot \left(uy \cdot \pi\right)\\ xi \cdot \cos t\_0 + \left(yi \cdot \sin t\_0 + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) \end{array} \end{array} \]
(FPCore (xi yi zi ux uy maxCos)
 :precision binary32
 (let* ((t_0 (* 2.0 (* uy PI))))
   (+
    (* xi (cos t_0))
    (+ (* yi (sin t_0)) (* zi (* maxCos (* ux (- 1.0 ux))))))))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
	float t_0 = 2.0f * (uy * ((float) M_PI));
	return (xi * cosf(t_0)) + ((yi * sinf(t_0)) + (zi * (maxCos * (ux * (1.0f - ux)))));
}
function code(xi, yi, zi, ux, uy, maxCos)
	t_0 = Float32(Float32(2.0) * Float32(uy * Float32(pi)))
	return Float32(Float32(xi * cos(t_0)) + Float32(Float32(yi * sin(t_0)) + Float32(zi * Float32(maxCos * Float32(ux * Float32(Float32(1.0) - ux))))))
end
function tmp = code(xi, yi, zi, ux, uy, maxCos)
	t_0 = single(2.0) * (uy * single(pi));
	tmp = (xi * cos(t_0)) + ((yi * sin(t_0)) + (zi * (maxCos * (ux * (single(1.0) - ux)))));
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 2 \cdot \left(uy \cdot \pi\right)\\
xi \cdot \cos t\_0 + \left(yi \cdot \sin t\_0 + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 99.0%

    \[\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 \]
  2. Simplified99.0%

    \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
  3. Add Preprocessing
  4. Taylor expanded in maxCos around 0

    \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
    2. associate-+l+N/A

      \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
    3. +-lowering-+.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
    5. cos-lowering-cos.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
    8. PI-lowering-PI.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
    9. +-lowering-+.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
  6. Simplified99.0%

    \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
  7. Add Preprocessing

Alternative 3: 95.9% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 2 \cdot \left(uy \cdot \pi\right)\\ \left(xi \cdot \cos t\_0 + yi \cdot \sin t\_0\right) + maxCos \cdot \left(ux \cdot zi\right) \end{array} \end{array} \]
(FPCore (xi yi zi ux uy maxCos)
 :precision binary32
 (let* ((t_0 (* 2.0 (* uy PI))))
   (+ (+ (* xi (cos t_0)) (* yi (sin t_0))) (* maxCos (* ux zi)))))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
	float t_0 = 2.0f * (uy * ((float) M_PI));
	return ((xi * cosf(t_0)) + (yi * sinf(t_0))) + (maxCos * (ux * zi));
}
function code(xi, yi, zi, ux, uy, maxCos)
	t_0 = Float32(Float32(2.0) * Float32(uy * Float32(pi)))
	return Float32(Float32(Float32(xi * cos(t_0)) + Float32(yi * sin(t_0))) + Float32(maxCos * Float32(ux * zi)))
end
function tmp = code(xi, yi, zi, ux, uy, maxCos)
	t_0 = single(2.0) * (uy * single(pi));
	tmp = ((xi * cos(t_0)) + (yi * sin(t_0))) + (maxCos * (ux * zi));
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 2 \cdot \left(uy \cdot \pi\right)\\
\left(xi \cdot \cos t\_0 + yi \cdot \sin t\_0\right) + maxCos \cdot \left(ux \cdot zi\right)
\end{array}
\end{array}
Derivation
  1. Initial program 99.0%

    \[\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 \]
  2. Simplified99.0%

    \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
  3. Add Preprocessing
  4. Taylor expanded in ux around 0

    \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot zi\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
    2. associate-*r*N/A

      \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \left(maxCos \cdot ux\right) \cdot \color{blue}{zi} \]
    3. *-commutativeN/A

      \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \left(ux \cdot maxCos\right) \cdot zi \]
    4. associate-*r*N/A

      \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + ux \cdot \color{blue}{\left(maxCos \cdot zi\right)} \]
    5. +-lowering-+.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(ux \cdot \left(maxCos \cdot zi\right)\right)}\right) \]
  6. Simplified96.2%

    \[\leadsto \color{blue}{\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) + maxCos \cdot \left(ux \cdot zi\right)} \]
  7. Add Preprocessing

Alternative 4: 93.2% accurate, 3.5× speedup?

\[\begin{array}{l} \\ \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) + \left(xi + \left(-2 \cdot \left(uy \cdot uy\right)\right) \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) \end{array} \]
(FPCore (xi yi zi ux uy maxCos)
 :precision binary32
 (+
  (+ (* yi (sin (* 2.0 (* uy PI)))) (* zi (* maxCos (* ux (- 1.0 ux)))))
  (+ xi (* (* -2.0 (* uy uy)) (* xi (* PI PI))))))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
	return ((yi * sinf((2.0f * (uy * ((float) M_PI))))) + (zi * (maxCos * (ux * (1.0f - ux))))) + (xi + ((-2.0f * (uy * uy)) * (xi * (((float) M_PI) * ((float) M_PI)))));
}
function code(xi, yi, zi, ux, uy, maxCos)
	return Float32(Float32(Float32(yi * sin(Float32(Float32(2.0) * Float32(uy * Float32(pi))))) + Float32(zi * Float32(maxCos * Float32(ux * Float32(Float32(1.0) - ux))))) + Float32(xi + Float32(Float32(Float32(-2.0) * Float32(uy * uy)) * Float32(xi * Float32(Float32(pi) * Float32(pi))))))
end
function tmp = code(xi, yi, zi, ux, uy, maxCos)
	tmp = ((yi * sin((single(2.0) * (uy * single(pi))))) + (zi * (maxCos * (ux * (single(1.0) - ux))))) + (xi + ((single(-2.0) * (uy * uy)) * (xi * (single(pi) * single(pi)))));
end
\begin{array}{l}

\\
\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) + \left(xi + \left(-2 \cdot \left(uy \cdot uy\right)\right) \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right)
\end{array}
Derivation
  1. Initial program 99.0%

    \[\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 \]
  2. Simplified99.0%

    \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
  3. Add Preprocessing
  4. Taylor expanded in maxCos around 0

    \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
  5. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
    2. associate-+l+N/A

      \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
    3. +-lowering-+.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
    5. cos-lowering-cos.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
    8. PI-lowering-PI.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
    9. +-lowering-+.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
  6. Simplified99.0%

    \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
  7. Taylor expanded in uy around 0

    \[\leadsto \mathsf{+.f32}\left(\color{blue}{\left(xi + -2 \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)}, \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
  8. Step-by-step derivation
    1. +-lowering-+.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(-2 \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), \mathsf{+.f32}\left(\color{blue}{\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)}, \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    2. associate-*r*N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(-2 \cdot {uy}^{2}\right) \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \color{blue}{\mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)}\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    3. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(-2 \cdot {uy}^{2}\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \color{blue}{\mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)}\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    4. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(-2, \left({uy}^{2}\right)\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    5. unpow2N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(-2, \left(uy \cdot uy\right)\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    6. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(uy, uy\right)\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    7. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(uy, uy\right)\right), \mathsf{*.f32}\left(xi, \left({\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    8. unpow2N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(uy, uy\right)\right), \mathsf{*.f32}\left(xi, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    9. *-lowering-*.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(uy, uy\right)\right), \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    10. PI-lowering-PI.f32N/A

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(uy, uy\right)\right), \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    11. PI-lowering-PI.f3295.1%

      \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(uy, uy\right)\right), \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
  9. Simplified95.1%

    \[\leadsto \color{blue}{\left(xi + \left(-2 \cdot \left(uy \cdot uy\right)\right) \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right)} + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) \]
  10. Final simplification95.1%

    \[\leadsto \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) + \left(xi + \left(-2 \cdot \left(uy \cdot uy\right)\right) \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) \]
  11. Add Preprocessing

Alternative 5: 92.2% accurate, 3.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;uy \leq 0.04500000178813934:\\ \;\;\;\;\left(xi + maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right) + uy \cdot \left(uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) + yi \cdot \left(2 \cdot \pi + \left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;xi + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (xi yi zi ux uy maxCos)
 :precision binary32
 (if (<= uy 0.04500000178813934)
   (+
    (+ xi (* maxCos (* ux (* (- 1.0 ux) zi))))
    (*
     uy
     (+
      (* uy (* -2.0 (* xi (* PI PI))))
      (*
       yi
       (+
        (* 2.0 PI)
        (* (* (* uy uy) -1.3333333333333333) (* PI (* PI PI))))))))
   (+
    xi
    (+ (* yi (sin (* 2.0 (* uy PI)))) (* zi (* maxCos (* ux (- 1.0 ux))))))))
float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
	float tmp;
	if (uy <= 0.04500000178813934f) {
		tmp = (xi + (maxCos * (ux * ((1.0f - ux) * zi)))) + (uy * ((uy * (-2.0f * (xi * (((float) M_PI) * ((float) M_PI))))) + (yi * ((2.0f * ((float) M_PI)) + (((uy * uy) * -1.3333333333333333f) * (((float) M_PI) * (((float) M_PI) * ((float) M_PI))))))));
	} else {
		tmp = xi + ((yi * sinf((2.0f * (uy * ((float) M_PI))))) + (zi * (maxCos * (ux * (1.0f - ux)))));
	}
	return tmp;
}
function code(xi, yi, zi, ux, uy, maxCos)
	tmp = Float32(0.0)
	if (uy <= Float32(0.04500000178813934))
		tmp = Float32(Float32(xi + Float32(maxCos * Float32(ux * Float32(Float32(Float32(1.0) - ux) * zi)))) + Float32(uy * Float32(Float32(uy * Float32(Float32(-2.0) * Float32(xi * Float32(Float32(pi) * Float32(pi))))) + Float32(yi * Float32(Float32(Float32(2.0) * Float32(pi)) + Float32(Float32(Float32(uy * uy) * Float32(-1.3333333333333333)) * Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi)))))))));
	else
		tmp = Float32(xi + Float32(Float32(yi * sin(Float32(Float32(2.0) * Float32(uy * Float32(pi))))) + Float32(zi * Float32(maxCos * Float32(ux * Float32(Float32(1.0) - ux))))));
	end
	return tmp
end
function tmp_2 = code(xi, yi, zi, ux, uy, maxCos)
	tmp = single(0.0);
	if (uy <= single(0.04500000178813934))
		tmp = (xi + (maxCos * (ux * ((single(1.0) - ux) * zi)))) + (uy * ((uy * (single(-2.0) * (xi * (single(pi) * single(pi))))) + (yi * ((single(2.0) * single(pi)) + (((uy * uy) * single(-1.3333333333333333)) * (single(pi) * (single(pi) * single(pi))))))));
	else
		tmp = xi + ((yi * sin((single(2.0) * (uy * single(pi))))) + (zi * (maxCos * (ux * (single(1.0) - ux)))));
	end
	tmp_2 = tmp;
end
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;uy \leq 0.04500000178813934:\\
\;\;\;\;\left(xi + maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right) + uy \cdot \left(uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) + yi \cdot \left(2 \cdot \pi + \left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;xi + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if uy < 0.0450000018

    1. Initial program 99.3%

      \[\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 \]
    2. Simplified99.3%

      \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
    3. Add Preprocessing
    4. Taylor expanded in maxCos around 0

      \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
      2. associate-+l+N/A

        \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
      3. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      5. cos-lowering-cos.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      8. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
    6. Simplified99.2%

      \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\color{blue}{2}, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      3. add-sqr-sqrtN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      4. unpow1/2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\color{blue}{uy}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI.f32}\left(\right)}\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\left({\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      9. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI}\left(\right), \frac{1}{2}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\color{blue}{2}, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      10. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(\left(2 \cdot uy\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\color{blue}{uy}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(2 \cdot \left(uy \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      13. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \left(uy \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI.f32}\left(\right)}\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      15. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{pow.f32}\left(\mathsf{PI}\left(\right), \frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      16. PI-lowering-PI.f3299.2%

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    8. Applied egg-rr99.2%

      \[\leadsto xi \cdot \cos \color{blue}{\left({\pi}^{0.5} \cdot \left(2 \cdot \left(uy \cdot {\pi}^{0.5}\right)\right)\right)} + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) \]
    9. Taylor expanded in uy around 0

      \[\leadsto \color{blue}{xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)} \]
    10. Simplified97.6%

      \[\leadsto \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi\right) + uy \cdot \left(uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) + yi \cdot \left(2 \cdot \pi + \left(-1.3333333333333333 \cdot \left(uy \cdot uy\right)\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)} \]

    if 0.0450000018 < uy

    1. Initial program 97.4%

      \[\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 \]
    2. Simplified97.5%

      \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
    3. Add Preprocessing
    4. Taylor expanded in maxCos around 0

      \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
      2. associate-+l+N/A

        \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
      3. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      5. cos-lowering-cos.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      8. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
    6. Simplified97.4%

      \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
    7. Taylor expanded in uy around 0

      \[\leadsto \mathsf{+.f32}\left(\color{blue}{xi}, \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    8. Step-by-step derivation
      1. Simplified69.1%

        \[\leadsto \color{blue}{xi} + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) \]
    9. Recombined 2 regimes into one program.
    10. Final simplification93.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;uy \leq 0.04500000178813934:\\ \;\;\;\;\left(xi + maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right) + uy \cdot \left(uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) + yi \cdot \left(2 \cdot \pi + \left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;xi + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)\\ \end{array} \]
    11. Add Preprocessing

    Alternative 6: 89.5% accurate, 11.2× speedup?

    \[\begin{array}{l} \\ \left(xi + maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right) + uy \cdot \left(uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) + yi \cdot \left(2 \cdot \pi + \left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right) \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
     :precision binary32
     (+
      (+ xi (* maxCos (* ux (* (- 1.0 ux) zi))))
      (*
       uy
       (+
        (* uy (* -2.0 (* xi (* PI PI))))
        (*
         yi
         (+ (* 2.0 PI) (* (* (* uy uy) -1.3333333333333333) (* PI (* PI PI)))))))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	return (xi + (maxCos * (ux * ((1.0f - ux) * zi)))) + (uy * ((uy * (-2.0f * (xi * (((float) M_PI) * ((float) M_PI))))) + (yi * ((2.0f * ((float) M_PI)) + (((uy * uy) * -1.3333333333333333f) * (((float) M_PI) * (((float) M_PI) * ((float) M_PI))))))));
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	return Float32(Float32(xi + Float32(maxCos * Float32(ux * Float32(Float32(Float32(1.0) - ux) * zi)))) + Float32(uy * Float32(Float32(uy * Float32(Float32(-2.0) * Float32(xi * Float32(Float32(pi) * Float32(pi))))) + Float32(yi * Float32(Float32(Float32(2.0) * Float32(pi)) + Float32(Float32(Float32(uy * uy) * Float32(-1.3333333333333333)) * Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi)))))))))
    end
    
    function tmp = code(xi, yi, zi, ux, uy, maxCos)
    	tmp = (xi + (maxCos * (ux * ((single(1.0) - ux) * zi)))) + (uy * ((uy * (single(-2.0) * (xi * (single(pi) * single(pi))))) + (yi * ((single(2.0) * single(pi)) + (((uy * uy) * single(-1.3333333333333333)) * (single(pi) * (single(pi) * single(pi))))))));
    end
    
    \begin{array}{l}
    
    \\
    \left(xi + maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right) + uy \cdot \left(uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) + yi \cdot \left(2 \cdot \pi + \left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\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 \]
    2. Simplified99.0%

      \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
    3. Add Preprocessing
    4. Taylor expanded in maxCos around 0

      \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
      2. associate-+l+N/A

        \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
      3. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      5. cos-lowering-cos.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      8. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
    6. Simplified99.0%

      \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\color{blue}{2}, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      3. add-sqr-sqrtN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      4. unpow1/2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\color{blue}{uy}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI.f32}\left(\right)}\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\left({\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      9. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI}\left(\right), \frac{1}{2}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\color{blue}{2}, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      10. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(\left(2 \cdot uy\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\color{blue}{uy}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(2 \cdot \left(uy \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      13. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \left(uy \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI.f32}\left(\right)}\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      15. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{pow.f32}\left(\mathsf{PI}\left(\right), \frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      16. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    8. Applied egg-rr99.0%

      \[\leadsto xi \cdot \cos \color{blue}{\left({\pi}^{0.5} \cdot \left(2 \cdot \left(uy \cdot {\pi}^{0.5}\right)\right)\right)} + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) \]
    9. Taylor expanded in uy around 0

      \[\leadsto \color{blue}{xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)} \]
    10. Simplified90.6%

      \[\leadsto \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi\right) + uy \cdot \left(uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) + yi \cdot \left(2 \cdot \pi + \left(-1.3333333333333333 \cdot \left(uy \cdot uy\right)\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)} \]
    11. Final simplification90.6%

      \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right) + uy \cdot \left(uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) + yi \cdot \left(2 \cdot \pi + \left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right) \]
    12. Add Preprocessing

    Alternative 7: 89.5% accurate, 11.2× speedup?

    \[\begin{array}{l} \\ \left(\left(1 - ux\right) \cdot zi\right) \cdot \left(ux \cdot maxCos\right) + \left(xi + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + \left(uy \cdot -1.3333333333333333\right) \cdot \left(yi \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\right) \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
     :precision binary32
     (+
      (* (* (- 1.0 ux) zi) (* ux maxCos))
      (+
       xi
       (*
        uy
        (+
         (* 2.0 (* PI yi))
         (*
          uy
          (+
           (* -2.0 (* xi (* PI PI)))
           (* (* uy -1.3333333333333333) (* yi (* PI (* PI PI)))))))))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	return (((1.0f - ux) * zi) * (ux * maxCos)) + (xi + (uy * ((2.0f * (((float) M_PI) * yi)) + (uy * ((-2.0f * (xi * (((float) M_PI) * ((float) M_PI)))) + ((uy * -1.3333333333333333f) * (yi * (((float) M_PI) * (((float) M_PI) * ((float) M_PI))))))))));
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	return Float32(Float32(Float32(Float32(Float32(1.0) - ux) * zi) * Float32(ux * maxCos)) + Float32(xi + Float32(uy * Float32(Float32(Float32(2.0) * Float32(Float32(pi) * yi)) + Float32(uy * Float32(Float32(Float32(-2.0) * Float32(xi * Float32(Float32(pi) * Float32(pi)))) + Float32(Float32(uy * Float32(-1.3333333333333333)) * Float32(yi * Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi)))))))))))
    end
    
    function tmp = code(xi, yi, zi, ux, uy, maxCos)
    	tmp = (((single(1.0) - ux) * zi) * (ux * maxCos)) + (xi + (uy * ((single(2.0) * (single(pi) * yi)) + (uy * ((single(-2.0) * (xi * (single(pi) * single(pi)))) + ((uy * single(-1.3333333333333333)) * (yi * (single(pi) * (single(pi) * single(pi))))))))));
    end
    
    \begin{array}{l}
    
    \\
    \left(\left(1 - ux\right) \cdot zi\right) \cdot \left(ux \cdot maxCos\right) + \left(xi + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + \left(uy \cdot -1.3333333333333333\right) \cdot \left(yi \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\right)
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\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 \]
    2. Simplified99.0%

      \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
    3. Add Preprocessing
    4. Taylor expanded in maxCos around 0

      \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
      2. associate-+l+N/A

        \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
      3. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      5. cos-lowering-cos.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      8. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
    6. Simplified99.0%

      \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
    7. Taylor expanded in uy around 0

      \[\leadsto \color{blue}{xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + \color{blue}{uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi\right) + \color{blue}{uy} \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right) \]
      3. associate-+l+N/A

        \[\leadsto maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{\left(xi + uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)} \]
      4. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \color{blue}{\left(xi + uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)}\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(\left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right), \left(\color{blue}{xi} + uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right), \left(\color{blue}{xi} + uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right), \left(xi + uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \left(1 - ux\right)\right)\right), \left(xi + uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)\right) \]
      9. --lowering--.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \left(xi + uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)\right) \]
      10. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \mathsf{+.f32}\left(xi, \color{blue}{\left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right) + uy \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{-4}{3} \cdot \left(uy \cdot \left(yi \cdot {\mathsf{PI}\left(\right)}^{3}\right)\right)\right)\right)\right)}\right)\right) \]
    9. Simplified90.5%

      \[\leadsto \color{blue}{\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right) + \left(xi + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + \left(-1.3333333333333333 \cdot uy\right) \cdot \left(yi \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\right)} \]
    10. Final simplification90.5%

      \[\leadsto \left(\left(1 - ux\right) \cdot zi\right) \cdot \left(ux \cdot maxCos\right) + \left(xi + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + \left(uy \cdot -1.3333333333333333\right) \cdot \left(yi \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\right) \]
    11. Add Preprocessing

    Alternative 8: 85.7% accurate, 15.9× speedup?

    \[\begin{array}{l} \\ xi + \left(\left(\left(1 - ux\right) \cdot zi\right) \cdot \left(ux \cdot maxCos\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + -2 \cdot \left(uy \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right) \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
     :precision binary32
     (+
      xi
      (+
       (* (* (- 1.0 ux) zi) (* ux maxCos))
       (* uy (+ (* 2.0 (* PI yi)) (* -2.0 (* uy (* xi (* PI PI)))))))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	return xi + ((((1.0f - ux) * zi) * (ux * maxCos)) + (uy * ((2.0f * (((float) M_PI) * yi)) + (-2.0f * (uy * (xi * (((float) M_PI) * ((float) M_PI))))))));
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	return Float32(xi + Float32(Float32(Float32(Float32(Float32(1.0) - ux) * zi) * Float32(ux * maxCos)) + Float32(uy * Float32(Float32(Float32(2.0) * Float32(Float32(pi) * yi)) + Float32(Float32(-2.0) * Float32(uy * Float32(xi * Float32(Float32(pi) * Float32(pi)))))))))
    end
    
    function tmp = code(xi, yi, zi, ux, uy, maxCos)
    	tmp = xi + ((((single(1.0) - ux) * zi) * (ux * maxCos)) + (uy * ((single(2.0) * (single(pi) * yi)) + (single(-2.0) * (uy * (xi * (single(pi) * single(pi))))))));
    end
    
    \begin{array}{l}
    
    \\
    xi + \left(\left(\left(1 - ux\right) \cdot zi\right) \cdot \left(ux \cdot maxCos\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + -2 \cdot \left(uy \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\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 \]
    2. Simplified99.0%

      \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
    3. Add Preprocessing
    4. Taylor expanded in maxCos around 0

      \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
      2. associate-+l+N/A

        \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
      3. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      5. cos-lowering-cos.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      8. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
    6. Simplified99.0%

      \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
    7. Taylor expanded in uy around 0

      \[\leadsto \color{blue}{xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(xi, \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right) \]
      2. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{+.f32}\left(\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \color{blue}{\left(uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{+.f32}\left(\left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right), \left(\color{blue}{uy} \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right), \left(\color{blue}{uy} \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right), \left(uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \left(1 - ux\right)\right)\right), \left(uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right) \]
      7. --lowering--.f32N/A

        \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \left(uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \mathsf{*.f32}\left(uy, \color{blue}{\left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)\right) \]
      9. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\left(-2 \cdot \left(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \color{blue}{\left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)\right)\right) \]
    9. Simplified87.0%

      \[\leadsto \color{blue}{xi + \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right) + uy \cdot \left(-2 \cdot \left(uy \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right) + 2 \cdot \left(\pi \cdot yi\right)\right)\right)} \]
    10. Final simplification87.0%

      \[\leadsto xi + \left(\left(\left(1 - ux\right) \cdot zi\right) \cdot \left(ux \cdot maxCos\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + -2 \cdot \left(uy \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right) \]
    11. Add Preprocessing

    Alternative 9: 81.7% accurate, 24.3× speedup?

    \[\begin{array}{l} \\ \left(xi + maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right) + 2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right) \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
     :precision binary32
     (+ (+ xi (* maxCos (* ux (* (- 1.0 ux) zi)))) (* 2.0 (* uy (* PI yi)))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	return (xi + (maxCos * (ux * ((1.0f - ux) * zi)))) + (2.0f * (uy * (((float) M_PI) * yi)));
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	return Float32(Float32(xi + Float32(maxCos * Float32(ux * Float32(Float32(Float32(1.0) - ux) * zi)))) + Float32(Float32(2.0) * Float32(uy * Float32(Float32(pi) * yi))))
    end
    
    function tmp = code(xi, yi, zi, ux, uy, maxCos)
    	tmp = (xi + (maxCos * (ux * ((single(1.0) - ux) * zi)))) + (single(2.0) * (uy * (single(pi) * yi)));
    end
    
    \begin{array}{l}
    
    \\
    \left(xi + maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right) + 2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\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 \]
    2. Simplified99.0%

      \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
    3. Add Preprocessing
    4. Taylor expanded in maxCos around 0

      \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
      2. associate-+l+N/A

        \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
      3. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      5. cos-lowering-cos.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      8. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
    6. Simplified99.0%

      \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\color{blue}{2}, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      3. add-sqr-sqrtN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      4. unpow1/2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\color{blue}{uy}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      5. unpow1/2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI.f32}\left(\right)}\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\left({\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      9. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI}\left(\right), \frac{1}{2}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\color{blue}{2}, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      10. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(\left(2 \cdot uy\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\color{blue}{uy}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(2 \cdot \left(uy \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      13. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \left(uy \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI.f32}\left(\right)}\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      15. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{pow.f32}\left(\mathsf{PI}\left(\right), \frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      16. PI-lowering-PI.f3299.0%

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
    8. Applied egg-rr99.0%

      \[\leadsto xi \cdot \cos \color{blue}{\left({\pi}^{0.5} \cdot \left(2 \cdot \left(uy \cdot {\pi}^{0.5}\right)\right)\right)} + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) \]
    9. Taylor expanded in uy around 0

      \[\leadsto \color{blue}{xi + \left(2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
    10. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
      2. associate-+r+N/A

        \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      3. *-commutativeN/A

        \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{2} \]
      4. associate-*r*N/A

        \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + uy \cdot \color{blue}{\left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)} \]
      5. *-commutativeN/A

        \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + uy \cdot \left(2 \cdot \color{blue}{\left(yi \cdot \mathsf{PI}\left(\right)\right)}\right) \]
      6. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \color{blue}{\left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi\right), \left(\color{blue}{uy} \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), xi\right), \left(\color{blue}{uy} \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \left(zi \cdot \left(1 - ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \left(1 - ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      12. --lowering--.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{2}\right)\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{2}\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(2 \cdot \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
      16. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{uy}\right)\right)\right) \]
    11. Simplified81.7%

      \[\leadsto \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi\right) + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \left(yi \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{uy}\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{uy}\right)\right)\right) \]
      3. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\left(yi \cdot \mathsf{PI}\left(\right)\right), \color{blue}{uy}\right)\right)\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{PI}\left(\right)\right), uy\right)\right)\right) \]
      5. PI-lowering-PI.f3281.7%

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{PI.f32}\left(\right)\right), uy\right)\right)\right) \]
    13. Applied egg-rr81.7%

      \[\leadsto \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi\right) + 2 \cdot \color{blue}{\left(\left(yi \cdot \pi\right) \cdot uy\right)} \]
    14. Final simplification81.7%

      \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot zi\right)\right)\right) + 2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right) \]
    15. Add Preprocessing

    Alternative 10: 81.7% accurate, 24.3× speedup?

    \[\begin{array}{l} \\ \left(\left(1 - ux\right) \cdot zi\right) \cdot \left(ux \cdot maxCos\right) + \left(xi + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right) \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
     :precision binary32
     (+ (* (* (- 1.0 ux) zi) (* ux maxCos)) (+ xi (* 2.0 (* PI (* uy yi))))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	return (((1.0f - ux) * zi) * (ux * maxCos)) + (xi + (2.0f * (((float) M_PI) * (uy * yi))));
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	return Float32(Float32(Float32(Float32(Float32(1.0) - ux) * zi) * Float32(ux * maxCos)) + Float32(xi + Float32(Float32(2.0) * Float32(Float32(pi) * Float32(uy * yi)))))
    end
    
    function tmp = code(xi, yi, zi, ux, uy, maxCos)
    	tmp = (((single(1.0) - ux) * zi) * (ux * maxCos)) + (xi + (single(2.0) * (single(pi) * (uy * yi))));
    end
    
    \begin{array}{l}
    
    \\
    \left(\left(1 - ux\right) \cdot zi\right) \cdot \left(ux \cdot maxCos\right) + \left(xi + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right)
    \end{array}
    
    Derivation
    1. Initial program 99.0%

      \[\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 \]
    2. Simplified99.0%

      \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
    3. Add Preprocessing
    4. Taylor expanded in maxCos around 0

      \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
      2. associate-+l+N/A

        \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
      3. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      5. cos-lowering-cos.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      8. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
      9. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
    6. Simplified99.0%

      \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
    7. Taylor expanded in uy around 0

      \[\leadsto \color{blue}{xi + \left(2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + \color{blue}{xi} \]
      2. +-commutativeN/A

        \[\leadsto \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + 2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right) + xi \]
      3. associate-+l+N/A

        \[\leadsto maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{\left(2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) + xi\right)} \]
      4. +-commutativeN/A

        \[\leadsto maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \color{blue}{\left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(\left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right), \left(\color{blue}{xi} + 2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right), \left(\color{blue}{xi} + 2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right), \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \left(1 - ux\right)\right)\right), \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      10. --lowering--.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \left(xi + 2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      11. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \mathsf{+.f32}\left(xi, \color{blue}{\left(2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right)\right) \]
      12. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)\right) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \left(\left(uy \cdot yi\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\left(uy \cdot yi\right), \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
      15. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, yi\right), \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
      16. PI-lowering-PI.f3281.7%

        \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right), \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, yi\right), \mathsf{PI.f32}\left(\right)\right)\right)\right)\right) \]
    9. Simplified81.7%

      \[\leadsto \color{blue}{\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right) + \left(xi + 2 \cdot \left(\left(uy \cdot yi\right) \cdot \pi\right)\right)} \]
    10. Final simplification81.7%

      \[\leadsto \left(\left(1 - ux\right) \cdot zi\right) \cdot \left(ux \cdot maxCos\right) + \left(xi + 2 \cdot \left(\pi \cdot \left(uy \cdot yi\right)\right)\right) \]
    11. Add Preprocessing

    Alternative 11: 54.6% accurate, 27.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := yi \cdot \left(\pi \cdot \left(uy \cdot 2\right)\right)\\ \mathbf{if}\;yi \leq -5.000000058430487 \cdot 10^{-8}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;yi \leq 4.999999873689376 \cdot 10^{-6}:\\ \;\;\;\;xi\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
     :precision binary32
     (let* ((t_0 (* yi (* PI (* uy 2.0)))))
       (if (<= yi -5.000000058430487e-8)
         t_0
         (if (<= yi 4.999999873689376e-6) xi t_0))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	float t_0 = yi * (((float) M_PI) * (uy * 2.0f));
    	float tmp;
    	if (yi <= -5.000000058430487e-8f) {
    		tmp = t_0;
    	} else if (yi <= 4.999999873689376e-6f) {
    		tmp = xi;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	t_0 = Float32(yi * Float32(Float32(pi) * Float32(uy * Float32(2.0))))
    	tmp = Float32(0.0)
    	if (yi <= Float32(-5.000000058430487e-8))
    		tmp = t_0;
    	elseif (yi <= Float32(4.999999873689376e-6))
    		tmp = xi;
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(xi, yi, zi, ux, uy, maxCos)
    	t_0 = yi * (single(pi) * (uy * single(2.0)));
    	tmp = single(0.0);
    	if (yi <= single(-5.000000058430487e-8))
    		tmp = t_0;
    	elseif (yi <= single(4.999999873689376e-6))
    		tmp = xi;
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := yi \cdot \left(\pi \cdot \left(uy \cdot 2\right)\right)\\
    \mathbf{if}\;yi \leq -5.000000058430487 \cdot 10^{-8}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;yi \leq 4.999999873689376 \cdot 10^{-6}:\\
    \;\;\;\;xi\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if yi < -5.00000006e-8 or 4.99999987e-6 < yi

      1. Initial program 98.3%

        \[\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 \]
      2. Simplified98.3%

        \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
      3. Add Preprocessing
      4. Taylor expanded in maxCos around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
      5. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
        2. associate-+l+N/A

          \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
        3. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
        4. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        5. cos-lowering-cos.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        6. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        8. PI-lowering-PI.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        9. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
      6. Simplified98.0%

        \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
      7. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\color{blue}{2}, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        3. add-sqr-sqrtN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        4. unpow1/2N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\color{blue}{uy}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        5. unpow1/2N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI.f32}\left(\right)}\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        6. associate-*l*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        8. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\left({\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        9. pow-lowering-pow.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI}\left(\right), \frac{1}{2}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\color{blue}{2}, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        10. PI-lowering-PI.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(\left(2 \cdot uy\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\color{blue}{uy}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        12. associate-*l*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(2 \cdot \left(uy \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        13. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \left(uy \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        14. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI.f32}\left(\right)}\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        15. pow-lowering-pow.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{pow.f32}\left(\mathsf{PI}\left(\right), \frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        16. PI-lowering-PI.f3298.0%

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      8. Applied egg-rr98.0%

        \[\leadsto xi \cdot \cos \color{blue}{\left({\pi}^{0.5} \cdot \left(2 \cdot \left(uy \cdot {\pi}^{0.5}\right)\right)\right)} + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) \]
      9. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{xi + \left(2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
      10. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
        2. associate-+r+N/A

          \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
        3. *-commutativeN/A

          \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{2} \]
        4. associate-*r*N/A

          \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + uy \cdot \color{blue}{\left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)} \]
        5. *-commutativeN/A

          \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + uy \cdot \left(2 \cdot \color{blue}{\left(yi \cdot \mathsf{PI}\left(\right)\right)}\right) \]
        6. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \color{blue}{\left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right) \]
        7. +-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi\right), \left(\color{blue}{uy} \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), xi\right), \left(\color{blue}{uy} \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        9. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        10. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \left(zi \cdot \left(1 - ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        11. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \left(1 - ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        12. --lowering--.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{2}\right)\right)\right) \]
        14. associate-*r*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{2}\right)\right) \]
        15. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(2 \cdot \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
        16. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
        17. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{uy}\right)\right)\right) \]
      11. Simplified76.1%

        \[\leadsto \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi\right) + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right)} \]
      12. Taylor expanded in yi around inf

        \[\leadsto \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      13. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{yi}\right)\right) \]
        2. associate-*r*N/A

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{yi}\right) \]
        3. associate-*l*N/A

          \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{yi} \]
        4. *-commutativeN/A

          \[\leadsto yi \cdot \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \]
        5. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(yi, \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
        6. associate-*r*N/A

          \[\leadsto \mathsf{*.f32}\left(yi, \left(\left(2 \cdot uy\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{*.f32}\left(yi, \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\left(2 \cdot uy\right)}\right)\right) \]
        8. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \color{blue}{\left(2 \cdot uy\right)}\right)\right) \]
        9. PI-lowering-PI.f32N/A

          \[\leadsto \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \left(\color{blue}{2} \cdot uy\right)\right)\right) \]
        10. *-lowering-*.f3261.2%

          \[\leadsto \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(2, \color{blue}{uy}\right)\right)\right) \]
      14. Simplified61.2%

        \[\leadsto \color{blue}{yi \cdot \left(\pi \cdot \left(2 \cdot uy\right)\right)} \]

      if -5.00000006e-8 < yi < 4.99999987e-6

      1. Initial program 99.3%

        \[\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 \]
      2. Simplified99.3%

        \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
      3. Add Preprocessing
      4. Taylor expanded in maxCos around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
      5. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
        2. associate-+l+N/A

          \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
        3. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
        4. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        5. cos-lowering-cos.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        6. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        8. PI-lowering-PI.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        9. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
      6. Simplified99.3%

        \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
      7. Taylor expanded in xi around inf

        \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      8. Step-by-step derivation
        1. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(xi, \color{blue}{\cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
        2. cos-lowering-cos.f32N/A

          \[\leadsto \mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        3. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        4. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        5. PI-lowering-PI.f3265.3%

          \[\leadsto \mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right) \]
      9. Simplified65.3%

        \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
      10. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{xi} \]
      11. Step-by-step derivation
        1. Simplified57.5%

          \[\leadsto \color{blue}{xi} \]
      12. Recombined 2 regimes into one program.
      13. Final simplification58.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;yi \leq -5.000000058430487 \cdot 10^{-8}:\\ \;\;\;\;yi \cdot \left(\pi \cdot \left(uy \cdot 2\right)\right)\\ \mathbf{elif}\;yi \leq 4.999999873689376 \cdot 10^{-6}:\\ \;\;\;\;xi\\ \mathbf{else}:\\ \;\;\;\;yi \cdot \left(\pi \cdot \left(uy \cdot 2\right)\right)\\ \end{array} \]
      14. Add Preprocessing

      Alternative 12: 79.2% accurate, 30.7× speedup?

      \[\begin{array}{l} \\ \left(xi + ux \cdot \left(maxCos \cdot zi\right)\right) + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right) \end{array} \]
      (FPCore (xi yi zi ux uy maxCos)
       :precision binary32
       (+ (+ xi (* ux (* maxCos zi))) (* 2.0 (* yi (* uy PI)))))
      float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
      	return (xi + (ux * (maxCos * zi))) + (2.0f * (yi * (uy * ((float) M_PI))));
      }
      
      function code(xi, yi, zi, ux, uy, maxCos)
      	return Float32(Float32(xi + Float32(ux * Float32(maxCos * zi))) + Float32(Float32(2.0) * Float32(yi * Float32(uy * Float32(pi)))))
      end
      
      function tmp = code(xi, yi, zi, ux, uy, maxCos)
      	tmp = (xi + (ux * (maxCos * zi))) + (single(2.0) * (yi * (uy * single(pi))));
      end
      
      \begin{array}{l}
      
      \\
      \left(xi + ux \cdot \left(maxCos \cdot zi\right)\right) + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right)
      \end{array}
      
      Derivation
      1. Initial program 99.0%

        \[\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 \]
      2. Simplified99.0%

        \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
      3. Add Preprocessing
      4. Taylor expanded in maxCos around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
      5. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
        2. associate-+l+N/A

          \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
        3. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
        4. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        5. cos-lowering-cos.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        6. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        8. PI-lowering-PI.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        9. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
      6. Simplified99.0%

        \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
      7. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(2 \cdot uy\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\color{blue}{2}, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        3. add-sqr-sqrtN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        4. unpow1/2N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\color{blue}{uy}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        5. unpow1/2N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(uy \cdot 2\right) \cdot \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI.f32}\left(\right)}\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        6. associate-*l*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(\left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left({\mathsf{PI}\left(\right)}^{\frac{1}{2}} \cdot \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        8. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\left({\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\color{blue}{\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)}\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        9. pow-lowering-pow.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI}\left(\right), \frac{1}{2}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\color{blue}{2}, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        10. PI-lowering-PI.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(\left(uy \cdot 2\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(\left(2 \cdot uy\right) \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\color{blue}{uy}, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        12. associate-*l*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \left(2 \cdot \left(uy \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        13. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \left(uy \cdot {\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \color{blue}{\mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)}\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        14. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \left({\mathsf{PI}\left(\right)}^{\frac{1}{2}}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI.f32}\left(\right)}\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        15. pow-lowering-pow.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{pow.f32}\left(\mathsf{PI}\left(\right), \frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
        16. PI-lowering-PI.f3299.0%

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(\mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{pow.f32}\left(\mathsf{PI.f32}\left(\right), \frac{1}{2}\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right)\right)\right) \]
      8. Applied egg-rr99.0%

        \[\leadsto xi \cdot \cos \color{blue}{\left({\pi}^{0.5} \cdot \left(2 \cdot \left(uy \cdot {\pi}^{0.5}\right)\right)\right)} + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right) \]
      9. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{xi + \left(2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
      10. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto xi + \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
        2. associate-+r+N/A

          \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + \color{blue}{2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
        3. *-commutativeN/A

          \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{2} \]
        4. associate-*r*N/A

          \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + uy \cdot \color{blue}{\left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)} \]
        5. *-commutativeN/A

          \[\leadsto \left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right) + uy \cdot \left(2 \cdot \color{blue}{\left(yi \cdot \mathsf{PI}\left(\right)\right)}\right) \]
        6. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\left(xi + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \color{blue}{\left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right) \]
        7. +-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi\right), \left(\color{blue}{uy} \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), xi\right), \left(\color{blue}{uy} \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        9. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        10. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \left(zi \cdot \left(1 - ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        11. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \left(1 - ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        12. --lowering--.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(uy \cdot \left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{2}\right)\right)\right) \]
        14. associate-*r*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{2}\right)\right) \]
        15. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \left(2 \cdot \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
        16. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
        17. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(zi, \mathsf{\_.f32}\left(1, ux\right)\right)\right)\right), xi\right), \mathsf{*.f32}\left(2, \left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{uy}\right)\right)\right) \]
      11. Simplified81.7%

        \[\leadsto \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + xi\right) + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right)} \]
      12. Taylor expanded in ux around 0

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\color{blue}{\left(maxCos \cdot \left(ux \cdot zi\right)\right)}, xi\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right) \]
      13. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(\left(ux \cdot zi\right) \cdot maxCos\right), xi\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right) \]
        2. associate-*r*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(ux \cdot \left(zi \cdot maxCos\right)\right), xi\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(ux \cdot \left(maxCos \cdot zi\right)\right), xi\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right) \]
        4. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(ux, \left(maxCos \cdot zi\right)\right), xi\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right) \]
        5. *-lowering-*.f3279.4%

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(maxCos, zi\right)\right), xi\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right) \]
      14. Simplified79.4%

        \[\leadsto \left(\color{blue}{ux \cdot \left(maxCos \cdot zi\right)} + xi\right) + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right) \]
      15. Final simplification79.4%

        \[\leadsto \left(xi + ux \cdot \left(maxCos \cdot zi\right)\right) + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right) \]
      16. Add Preprocessing

      Alternative 13: 74.6% accurate, 51.2× speedup?

      \[\begin{array}{l} \\ xi + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right) \end{array} \]
      (FPCore (xi yi zi ux uy maxCos)
       :precision binary32
       (+ xi (* 2.0 (* yi (* uy PI)))))
      float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
      	return xi + (2.0f * (yi * (uy * ((float) M_PI))));
      }
      
      function code(xi, yi, zi, ux, uy, maxCos)
      	return Float32(xi + Float32(Float32(2.0) * Float32(yi * Float32(uy * Float32(pi)))))
      end
      
      function tmp = code(xi, yi, zi, ux, uy, maxCos)
      	tmp = xi + (single(2.0) * (yi * (uy * single(pi))));
      end
      
      \begin{array}{l}
      
      \\
      xi + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right)
      \end{array}
      
      Derivation
      1. Initial program 99.0%

        \[\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 \]
      2. Simplified99.0%

        \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
      3. Add Preprocessing
      4. Taylor expanded in zi around inf

        \[\leadsto \color{blue}{zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right) + \frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi} \cdot \sqrt{1 + {maxCos}^{2} \cdot \left({ux}^{2} \cdot \left(\left(1 - ux\right) \cdot \left(ux - 1\right)\right)\right)}\right)} \]
      5. Simplified98.2%

        \[\leadsto \color{blue}{zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right) + \frac{\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)\right) \cdot \sqrt{1 + \left(maxCos \cdot maxCos\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(\left(1 - ux\right) \cdot \left(ux + -1\right)\right)\right)}}{zi}\right)} \]
      6. Taylor expanded in maxCos around 0

        \[\leadsto \color{blue}{zi \cdot \left(\frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi} + \frac{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi}\right)} \]
      7. Step-by-step derivation
        1. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(zi, \color{blue}{\left(\frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi} + \frac{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi}\right)}\right) \]
        2. +-lowering-+.f32N/A

          \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{+.f32}\left(\left(\frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi}\right), \color{blue}{\left(\frac{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi}\right)}\right)\right) \]
        3. /-lowering-/.f32N/A

          \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), zi\right), \left(\frac{\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}}{zi}\right)\right)\right) \]
        4. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), zi\right), \left(\frac{\color{blue}{yi} \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi}\right)\right)\right) \]
        5. cos-lowering-cos.f32N/A

          \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), zi\right), \left(\frac{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi}\right)\right)\right) \]
        6. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), zi\right), \left(\frac{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi}\right)\right)\right) \]
        7. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), zi\right), \left(\frac{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi}\right)\right)\right) \]
        8. PI-lowering-PI.f32N/A

          \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), zi\right), \left(\frac{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}{zi}\right)\right)\right) \]
        9. /-lowering-/.f32N/A

          \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{+.f32}\left(\mathsf{/.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), zi\right), \mathsf{/.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{zi}\right)\right)\right) \]
      8. Simplified89.0%

        \[\leadsto \color{blue}{zi \cdot \left(\frac{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)}{zi} + \frac{yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)}{zi}\right)} \]
      9. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{xi + 2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      10. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto xi + \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{2} \]
        2. associate-*r*N/A

          \[\leadsto xi + uy \cdot \color{blue}{\left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)} \]
        3. *-commutativeN/A

          \[\leadsto xi + uy \cdot \left(2 \cdot \color{blue}{\left(yi \cdot \mathsf{PI}\left(\right)\right)}\right) \]
        4. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(xi, \color{blue}{\left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(xi, \left(uy \cdot \left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{2}\right)\right)\right) \]
        6. associate-*r*N/A

          \[\leadsto \mathsf{+.f32}\left(xi, \left(\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{2}\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(xi, \left(2 \cdot \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
        8. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \color{blue}{\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \]
        9. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \left(\left(yi \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{uy}\right)\right)\right) \]
        10. associate-*l*N/A

          \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \left(yi \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot uy\right)}\right)\right)\right) \]
        11. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \left(yi \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
        12. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(yi, \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right)\right)\right) \]
        13. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(uy, \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)\right) \]
        14. PI-lowering-PI.f3273.4%

          \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(yi, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right) \]
      11. Simplified73.4%

        \[\leadsto \color{blue}{xi + 2 \cdot \left(yi \cdot \left(uy \cdot \pi\right)\right)} \]
      12. Add Preprocessing

      Alternative 14: 45.4% accurate, 461.0× speedup?

      \[\begin{array}{l} \\ xi \end{array} \]
      (FPCore (xi yi zi ux uy maxCos) :precision binary32 xi)
      float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
      	return 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 = xi
      end function
      
      function code(xi, yi, zi, ux, uy, maxCos)
      	return xi
      end
      
      function tmp = code(xi, yi, zi, ux, uy, maxCos)
      	tmp = xi;
      end
      
      \begin{array}{l}
      
      \\
      xi
      \end{array}
      
      Derivation
      1. Initial program 99.0%

        \[\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 \]
      2. Simplified99.0%

        \[\leadsto \color{blue}{\sqrt{1 + \left(1 - ux\right) \cdot \left(ux \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)} \cdot \left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot yi + \cos \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot xi\right) + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi} \]
      3. Add Preprocessing
      4. Taylor expanded in maxCos around 0

        \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
      5. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
        2. associate-+l+N/A

          \[\leadsto xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)} \]
        3. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\left(xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right) \]
        4. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\color{blue}{yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        5. cos-lowering-cos.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \color{blue}{\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        6. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        7. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)}\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        8. PI-lowering-PI.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right) \]
        9. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right), \color{blue}{\left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)}\right)\right) \]
      6. Simplified99.0%

        \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right) + \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) + zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)\right)} \]
      7. Taylor expanded in xi around inf

        \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      8. Step-by-step derivation
        1. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(xi, \color{blue}{\cos \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
        2. cos-lowering-cos.f32N/A

          \[\leadsto \mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        3. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        4. *-lowering-*.f32N/A

          \[\leadsto \mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right) \]
        5. PI-lowering-PI.f3253.2%

          \[\leadsto \mathsf{*.f32}\left(xi, \mathsf{cos.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right) \]
      9. Simplified53.2%

        \[\leadsto \color{blue}{xi \cdot \cos \left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
      10. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{xi} \]
      11. Step-by-step derivation
        1. Simplified47.0%

          \[\leadsto \color{blue}{xi} \]
        2. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2024145 
        (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)))