UniformSampleCone 2

Percentage Accurate: 98.9% → 98.9%
Time: 47.2s
Alternatives: 29
Speedup: 1.0×

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 29 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: 98.9% 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: 98.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := ux \cdot \left(1 - ux\right)\\
t_1 := 2 \cdot \left(\pi \cdot uy\right)\\
\mathsf{fma}\left(zi \cdot t\_0, maxCos, {\left(1 + t\_0 \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)}^{0.5} \cdot \left(xi \cdot \cos t\_1 + yi \cdot \sin t\_1\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 99.1%

    \[\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.1%

    \[\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. Applied egg-rr99.1%

    \[\leadsto \color{blue}{\mathsf{fma}\left(zi \cdot \left(ux \cdot \left(1 - ux\right)\right), maxCos, {\left(1 + \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right) \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)}^{0.5} \cdot \left(\sin \left(2 \cdot \left(\pi \cdot uy\right)\right) \cdot yi + \cos \left(2 \cdot \left(\pi \cdot uy\right)\right) \cdot xi\right)\right)} \]
  5. Final simplification99.1%

    \[\leadsto \mathsf{fma}\left(zi \cdot \left(ux \cdot \left(1 - ux\right)\right), maxCos, {\left(1 + \left(ux \cdot \left(1 - ux\right)\right) \cdot \left(maxCos \cdot \left(ux \cdot \left(maxCos \cdot \left(ux + -1\right)\right)\right)\right)\right)}^{0.5} \cdot \left(xi \cdot \cos \left(2 \cdot \left(\pi \cdot uy\right)\right) + yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right)\right)\right) \]
  6. Add Preprocessing

Alternative 2: 98.9% 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(yi \cdot \sin t\_0 + xi \cdot \cos t\_0\right) + zi \cdot \left(ux \cdot \left(ux \cdot \left(\frac{maxCos}{ux} - maxCos\right)\right)\right) \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))))))))
     (+ (* yi (sin t_0)) (* xi (cos t_0))))
    (* zi (* ux (* ux (- (/ maxCos ux) maxCos)))))))
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)))))))) * ((yi * sinf(t_0)) + (xi * cosf(t_0)))) + (zi * (ux * (ux * ((maxCos / ux) - maxCos))));
}
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(yi * sin(t_0)) + Float32(xi * cos(t_0)))) + Float32(zi * Float32(ux * Float32(ux * Float32(Float32(maxCos / ux) - maxCos)))))
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))))))))) * ((yi * sin(t_0)) + (xi * cos(t_0)))) + (zi * (ux * (ux * ((maxCos / ux) - maxCos))));
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(yi \cdot \sin t\_0 + xi \cdot \cos t\_0\right) + zi \cdot \left(ux \cdot \left(ux \cdot \left(\frac{maxCos}{ux} - maxCos\right)\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 99.1%

    \[\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.1%

    \[\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 inf

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

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

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

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

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

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

      \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{sqrt.f32}\left(\mathsf{+.f32}\left(1, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(maxCos, \mathsf{+.f32}\left(ux, -1\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{sin.f32}\left(\mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(2, \mathsf{PI.f32}\left(\right)\right)\right)\right), yi\right), \mathsf{*.f32}\left(\mathsf{cos.f32}\left(\mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(2, \mathsf{PI.f32}\left(\right)\right)\right)\right), xi\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(ux, \left(\frac{maxCos}{ux} + \left(\mathsf{neg}\left(maxCos\right)\right)\right)\right)\right), zi\right)\right) \]
    7. unsub-negN/A

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

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

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

    \[\leadsto \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) + \color{blue}{\left(ux \cdot \left(ux \cdot \left(\frac{maxCos}{ux} - maxCos\right)\right)\right)} \cdot zi \]
  7. Final simplification99.1%

    \[\leadsto \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(yi \cdot \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) + xi \cdot \cos \left(uy \cdot \left(2 \cdot \pi\right)\right)\right) + zi \cdot \left(ux \cdot \left(ux \cdot \left(\frac{maxCos}{ux} - maxCos\right)\right)\right) \]
  8. Add Preprocessing

Alternative 3: 98.9% 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(yi \cdot \sin t\_0 + xi \cdot \cos t\_0\right) + zi \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \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))))))))
     (+ (* yi (sin t_0)) (* xi (cos t_0))))
    (* zi (* ux (* (- 1.0 ux) maxCos))))))
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)))))))) * ((yi * sinf(t_0)) + (xi * cosf(t_0)))) + (zi * (ux * ((1.0f - ux) * maxCos)));
}
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(yi * sin(t_0)) + Float32(xi * cos(t_0)))) + Float32(zi * Float32(ux * Float32(Float32(Float32(1.0) - ux) * maxCos))))
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))))))))) * ((yi * sin(t_0)) + (xi * cos(t_0)))) + (zi * (ux * ((single(1.0) - ux) * maxCos)));
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(yi \cdot \sin t\_0 + xi \cdot \cos t\_0\right) + zi \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 99.1%

    \[\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.1%

    \[\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. Final simplification99.1%

    \[\leadsto \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(yi \cdot \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) + xi \cdot \cos \left(uy \cdot \left(2 \cdot \pi\right)\right)\right) + zi \cdot \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \]
  5. Add Preprocessing

Alternative 4: 98.7% accurate, 1.4× speedup?

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

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

    \[\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.1%

    \[\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. Applied egg-rr99.1%

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

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

      \[\leadsto \mathsf{fma}\left(zi \cdot \left(ux \cdot \left(1 - ux\right)\right), maxCos, \color{blue}{1} \cdot \left(\sin \left(2 \cdot \left(\pi \cdot uy\right)\right) \cdot yi + \cos \left(2 \cdot \left(\pi \cdot uy\right)\right) \cdot xi\right)\right) \]
    2. Final simplification99.0%

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

    Alternative 5: 98.7% accurate, 2.0× speedup?

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

      \[\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.1%

      \[\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.9%

      \[\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. Final simplification98.9%

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

    Alternative 6: 94.6% accurate, 3.1× speedup?

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

      \[\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.1%

      \[\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.9%

      \[\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 + {uy}^{2} \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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. Step-by-step derivation
      1. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left({uy}^{2} \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\right)\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. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left({uy}^{2}\right), \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\right)\right)\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. unpow2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(uy \cdot uy\right), \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\right)\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) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\right)\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) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \left({\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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. unpow2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      10. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      11. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \left(\left(\frac{2}{3} \cdot {uy}^{2}\right) \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      13. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\left(\frac{2}{3} \cdot {uy}^{2}\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\frac{2}{3}, \left({uy}^{2}\right)\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      15. unpow2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\frac{2}{3}, \left(uy \cdot uy\right)\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\frac{2}{3}, \mathsf{*.f32}\left(uy, uy\right)\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      17. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\frac{2}{3}, \mathsf{*.f32}\left(uy, uy\right)\right), \mathsf{*.f32}\left(xi, \left({\mathsf{PI}\left(\right)}^{4}\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) \]
      18. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\frac{2}{3}, \mathsf{*.f32}\left(uy, uy\right)\right), \mathsf{*.f32}\left(xi, \mathsf{pow.f32}\left(\mathsf{PI}\left(\right), 4\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) \]
    9. Simplified96.5%

      \[\leadsto \color{blue}{\left(xi + \left(uy \cdot uy\right) \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + \left(0.6666666666666666 \cdot \left(uy \cdot uy\right)\right) \cdot \left(xi \cdot {\pi}^{4}\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. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{+.f32}\left(\left(\left(uy \cdot uy\right) \cdot \left(-2 \cdot \left(xi \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) + \left(\frac{2}{3} \cdot \left(uy \cdot uy\right)\right) \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\right)\right) + xi\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. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(\left(uy \cdot uy\right) \cdot \left(-2 \cdot \left(xi \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) + \left(\frac{2}{3} \cdot \left(uy \cdot uy\right)\right) \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\right)\right)\right), xi\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) \]
    11. Applied egg-rr96.5%

      \[\leadsto \color{blue}{\left(uy \cdot \left(uy \cdot \left(xi \cdot \left(\left(\pi \cdot \pi\right) \cdot -2\right) + xi \cdot \left(\left(\pi \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right) \cdot \left(uy \cdot \left(uy \cdot 0.6666666666666666\right)\right)\right)\right)\right) + xi\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) \]
    12. Final simplification96.5%

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

    Alternative 7: 94.7% accurate, 3.1× speedup?

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

      \[\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.1%

      \[\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.9%

      \[\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 + {uy}^{2} \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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. Step-by-step derivation
      1. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left({uy}^{2} \cdot \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\right)\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. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left({uy}^{2}\right), \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\right)\right)\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. unpow2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(uy \cdot uy\right), \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\right)\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) \]
      4. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\right)\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) \]
      5. +-lowering-+.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\left(-2 \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      6. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      7. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \left({\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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. unpow2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      9. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      10. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      11. PI-lowering-PI.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \left(\frac{2}{3} \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \left(\left(\frac{2}{3} \cdot {uy}^{2}\right) \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      13. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\left(\frac{2}{3} \cdot {uy}^{2}\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      14. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\frac{2}{3}, \left({uy}^{2}\right)\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      15. unpow2N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\frac{2}{3}, \left(uy \cdot uy\right)\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\frac{2}{3}, \mathsf{*.f32}\left(uy, uy\right)\right), \left(xi \cdot {\mathsf{PI}\left(\right)}^{4}\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) \]
      17. *-lowering-*.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\frac{2}{3}, \mathsf{*.f32}\left(uy, uy\right)\right), \mathsf{*.f32}\left(xi, \left({\mathsf{PI}\left(\right)}^{4}\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) \]
      18. pow-lowering-pow.f32N/A

        \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(uy, uy\right), \mathsf{+.f32}\left(\mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{PI.f32}\left(\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(\frac{2}{3}, \mathsf{*.f32}\left(uy, uy\right)\right), \mathsf{*.f32}\left(xi, \mathsf{pow.f32}\left(\mathsf{PI}\left(\right), 4\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) \]
    9. Simplified96.5%

      \[\leadsto \color{blue}{\left(xi + \left(uy \cdot uy\right) \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + \left(0.6666666666666666 \cdot \left(uy \cdot uy\right)\right) \cdot \left(xi \cdot {\pi}^{4}\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. Applied egg-rr96.5%

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

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

    Alternative 8: 92.4% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;uy \leq 0.011420000344514847:\\ \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + -1.3333333333333333 \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(uy \cdot yi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right) + xi \cdot \left(1 + uy \cdot \left(-2 \cdot \left(uy \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right) + maxCos \cdot \left(zi \cdot ux\right)\\ \end{array} \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
     :precision binary32
     (if (<= uy 0.011420000344514847)
       (+
        (+ xi (* (* ux maxCos) (* zi (- 1.0 ux))))
        (*
         uy
         (+
          (* 2.0 (* PI yi))
          (*
           uy
           (+
            (* -2.0 (* xi (* PI PI)))
            (* -1.3333333333333333 (* (* PI (* PI PI)) (* uy yi))))))))
       (+
        (+
         (* yi (sin (* 2.0 (* PI uy))))
         (* xi (+ 1.0 (* uy (* -2.0 (* uy (* PI PI)))))))
        (* maxCos (* zi ux)))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	float tmp;
    	if (uy <= 0.011420000344514847f) {
    		tmp = (xi + ((ux * maxCos) * (zi * (1.0f - ux)))) + (uy * ((2.0f * (((float) M_PI) * yi)) + (uy * ((-2.0f * (xi * (((float) M_PI) * ((float) M_PI)))) + (-1.3333333333333333f * ((((float) M_PI) * (((float) M_PI) * ((float) M_PI))) * (uy * yi)))))));
    	} else {
    		tmp = ((yi * sinf((2.0f * (((float) M_PI) * uy)))) + (xi * (1.0f + (uy * (-2.0f * (uy * (((float) M_PI) * ((float) M_PI)))))))) + (maxCos * (zi * ux));
    	}
    	return tmp;
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	tmp = Float32(0.0)
    	if (uy <= Float32(0.011420000344514847))
    		tmp = Float32(Float32(xi + Float32(Float32(ux * maxCos) * Float32(zi * Float32(Float32(1.0) - ux)))) + 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(-1.3333333333333333) * Float32(Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi))) * Float32(uy * yi))))))));
    	else
    		tmp = Float32(Float32(Float32(yi * sin(Float32(Float32(2.0) * Float32(Float32(pi) * uy)))) + Float32(xi * Float32(Float32(1.0) + Float32(uy * Float32(Float32(-2.0) * Float32(uy * Float32(Float32(pi) * Float32(pi)))))))) + Float32(maxCos * Float32(zi * ux)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(xi, yi, zi, ux, uy, maxCos)
    	tmp = single(0.0);
    	if (uy <= single(0.011420000344514847))
    		tmp = (xi + ((ux * maxCos) * (zi * (single(1.0) - ux)))) + (uy * ((single(2.0) * (single(pi) * yi)) + (uy * ((single(-2.0) * (xi * (single(pi) * single(pi)))) + (single(-1.3333333333333333) * ((single(pi) * (single(pi) * single(pi))) * (uy * yi)))))));
    	else
    		tmp = ((yi * sin((single(2.0) * (single(pi) * uy)))) + (xi * (single(1.0) + (uy * (single(-2.0) * (uy * (single(pi) * single(pi)))))))) + (maxCos * (zi * ux));
    	end
    	tmp_2 = tmp;
    end
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;uy \leq 0.011420000344514847:\\
    \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + -1.3333333333333333 \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(uy \cdot yi\right)\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right) + xi \cdot \left(1 + uy \cdot \left(-2 \cdot \left(uy \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right) + maxCos \cdot \left(zi \cdot ux\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if uy < 0.0114200003

      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 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. +-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) + 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) \]
        3. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right), \left(\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)\right)\right) \]
        4. associate-*r*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
        5. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
        6. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\right)\right)\right), \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) \]
        8. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\right)\right)\right), \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) \]
        9. --lowering--.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \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) \]
        10. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \mathsf{*.f32}\left(uy, \color{blue}{\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) \]
        11. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\left(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. Simplified99.1%

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

      if 0.0114200003 < uy

      1. Initial program 98.2%

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

        \[\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. Simplified95.6%

        \[\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. Taylor expanded in uy around 0

        \[\leadsto \mathsf{+.f32}\left(\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(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI.f32}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
      8. Step-by-step derivation
        1. *-lft-identityN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(1 \cdot xi + -2 \cdot \left({uy}^{2} \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(1 \cdot xi + -2 \cdot \left({uy}^{2} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot xi\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        3. associate-*r*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(1 \cdot xi + -2 \cdot \left(\left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot xi\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        4. associate-*l*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\left(1 \cdot xi + \left(-2 \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot xi\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        5. distribute-rgt-inN/A

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

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

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \left(-2 \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \left(\left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot -2\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        9. associate-*r*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \left({uy}^{2} \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot -2\right)\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        10. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \left({uy}^{2} \cdot \left(-2 \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        11. unpow2N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \left(\left(uy \cdot uy\right) \cdot \left(-2 \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        12. associate-*l*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \left(uy \cdot \left(uy \cdot \left(-2 \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        13. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \left(uy \cdot \left(uy \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot -2\right)\right)\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        14. associate-*l*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \left(uy \cdot \left(\left(uy \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot -2\right)\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        15. *-commutativeN/A

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

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

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

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(uy, \left({\mathsf{PI}\left(\right)}^{2}\right)\right)\right)\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        19. unpow2N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(uy, \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        20. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\mathsf{*.f32}\left(xi, \mathsf{+.f32}\left(1, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(-2, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(\mathsf{PI}\left(\right), \mathsf{PI}\left(\right)\right)\right)\right)\right)\right)\right), \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
      9. Simplified76.9%

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

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

    Alternative 9: 92.8% accurate, 3.5× speedup?

    \[\begin{array}{l} \\ \left(yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right) + zi \cdot \left(\left(ux \cdot \left(1 - ux\right)\right) \cdot maxCos\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 (* PI uy)))) (* zi (* (* ux (- 1.0 ux)) maxCos)))
      (+ 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 * (((float) M_PI) * uy)))) + (zi * ((ux * (1.0f - ux)) * maxCos))) + (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(Float32(pi) * uy)))) + Float32(zi * Float32(Float32(ux * Float32(Float32(1.0) - ux)) * maxCos))) + 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) * (single(pi) * uy)))) + (zi * ((ux * (single(1.0) - ux)) * maxCos))) + (xi + ((single(-2.0) * (uy * uy)) * (xi * (single(pi) * single(pi)))));
    end
    
    \begin{array}{l}
    
    \\
    \left(yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right) + zi \cdot \left(\left(ux \cdot \left(1 - ux\right)\right) \cdot maxCos\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.1%

      \[\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.1%

      \[\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.9%

      \[\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.f3294.8%

        \[\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. Simplified94.8%

      \[\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 simplification94.8%

      \[\leadsto \left(yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right) + zi \cdot \left(\left(ux \cdot \left(1 - ux\right)\right) \cdot maxCos\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 10: 91.5% accurate, 3.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;uy \leq 0.05000000074505806:\\ \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + -1.3333333333333333 \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(uy \cdot yi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;xi + \left(yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right) + zi \cdot \left(\left(ux \cdot \left(1 - ux\right)\right) \cdot maxCos\right)\right)\\ \end{array} \end{array} \]
    (FPCore (xi yi zi ux uy maxCos)
     :precision binary32
     (if (<= uy 0.05000000074505806)
       (+
        (+ xi (* (* ux maxCos) (* zi (- 1.0 ux))))
        (*
         uy
         (+
          (* 2.0 (* PI yi))
          (*
           uy
           (+
            (* -2.0 (* xi (* PI PI)))
            (* -1.3333333333333333 (* (* PI (* PI PI)) (* uy yi))))))))
       (+
        xi
        (+ (* yi (sin (* 2.0 (* PI uy)))) (* zi (* (* ux (- 1.0 ux)) maxCos))))))
    float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
    	float tmp;
    	if (uy <= 0.05000000074505806f) {
    		tmp = (xi + ((ux * maxCos) * (zi * (1.0f - ux)))) + (uy * ((2.0f * (((float) M_PI) * yi)) + (uy * ((-2.0f * (xi * (((float) M_PI) * ((float) M_PI)))) + (-1.3333333333333333f * ((((float) M_PI) * (((float) M_PI) * ((float) M_PI))) * (uy * yi)))))));
    	} else {
    		tmp = xi + ((yi * sinf((2.0f * (((float) M_PI) * uy)))) + (zi * ((ux * (1.0f - ux)) * maxCos)));
    	}
    	return tmp;
    }
    
    function code(xi, yi, zi, ux, uy, maxCos)
    	tmp = Float32(0.0)
    	if (uy <= Float32(0.05000000074505806))
    		tmp = Float32(Float32(xi + Float32(Float32(ux * maxCos) * Float32(zi * Float32(Float32(1.0) - ux)))) + 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(-1.3333333333333333) * Float32(Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi))) * Float32(uy * yi))))))));
    	else
    		tmp = Float32(xi + Float32(Float32(yi * sin(Float32(Float32(2.0) * Float32(Float32(pi) * uy)))) + Float32(zi * Float32(Float32(ux * Float32(Float32(1.0) - ux)) * maxCos))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(xi, yi, zi, ux, uy, maxCos)
    	tmp = single(0.0);
    	if (uy <= single(0.05000000074505806))
    		tmp = (xi + ((ux * maxCos) * (zi * (single(1.0) - ux)))) + (uy * ((single(2.0) * (single(pi) * yi)) + (uy * ((single(-2.0) * (xi * (single(pi) * single(pi)))) + (single(-1.3333333333333333) * ((single(pi) * (single(pi) * single(pi))) * (uy * yi)))))));
    	else
    		tmp = xi + ((yi * sin((single(2.0) * (single(pi) * uy)))) + (zi * ((ux * (single(1.0) - ux)) * maxCos)));
    	end
    	tmp_2 = tmp;
    end
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;uy \leq 0.05000000074505806:\\
    \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + -1.3333333333333333 \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(uy \cdot yi\right)\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;xi + \left(yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right) + zi \cdot \left(\left(ux \cdot \left(1 - ux\right)\right) \cdot maxCos\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if uy < 0.0500000007

      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.1%

        \[\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. +-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) + 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) \]
        3. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right), \left(\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)\right)\right) \]
        4. associate-*r*N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
        5. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
        6. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\right)\right)\right), \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) \]
        8. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\right)\right)\right), \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) \]
        9. --lowering--.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \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) \]
        10. *-lowering-*.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \mathsf{*.f32}\left(uy, \color{blue}{\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) \]
        11. +-lowering-+.f32N/A

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\left(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. Simplified97.9%

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

      if 0.0500000007 < uy

      1. Initial program 98.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. Simplified98.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. Simplified97.9%

        \[\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. Simplified71.5%

          \[\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.05000000074505806:\\ \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + -1.3333333333333333 \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(uy \cdot yi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;xi + \left(yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right) + zi \cdot \left(\left(ux \cdot \left(1 - ux\right)\right) \cdot maxCos\right)\right)\\ \end{array} \]
      11. Add Preprocessing

      Alternative 11: 91.3% accurate, 3.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;uy \leq 0.05000000074505806:\\ \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + -1.3333333333333333 \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(uy \cdot yi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;maxCos \cdot \left(zi \cdot ux\right) + \left(xi + yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right)\right)\\ \end{array} \end{array} \]
      (FPCore (xi yi zi ux uy maxCos)
       :precision binary32
       (if (<= uy 0.05000000074505806)
         (+
          (+ xi (* (* ux maxCos) (* zi (- 1.0 ux))))
          (*
           uy
           (+
            (* 2.0 (* PI yi))
            (*
             uy
             (+
              (* -2.0 (* xi (* PI PI)))
              (* -1.3333333333333333 (* (* PI (* PI PI)) (* uy yi))))))))
         (+ (* maxCos (* zi ux)) (+ xi (* yi (sin (* 2.0 (* PI uy))))))))
      float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
      	float tmp;
      	if (uy <= 0.05000000074505806f) {
      		tmp = (xi + ((ux * maxCos) * (zi * (1.0f - ux)))) + (uy * ((2.0f * (((float) M_PI) * yi)) + (uy * ((-2.0f * (xi * (((float) M_PI) * ((float) M_PI)))) + (-1.3333333333333333f * ((((float) M_PI) * (((float) M_PI) * ((float) M_PI))) * (uy * yi)))))));
      	} else {
      		tmp = (maxCos * (zi * ux)) + (xi + (yi * sinf((2.0f * (((float) M_PI) * uy)))));
      	}
      	return tmp;
      }
      
      function code(xi, yi, zi, ux, uy, maxCos)
      	tmp = Float32(0.0)
      	if (uy <= Float32(0.05000000074505806))
      		tmp = Float32(Float32(xi + Float32(Float32(ux * maxCos) * Float32(zi * Float32(Float32(1.0) - ux)))) + 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(-1.3333333333333333) * Float32(Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi))) * Float32(uy * yi))))))));
      	else
      		tmp = Float32(Float32(maxCos * Float32(zi * ux)) + Float32(xi + Float32(yi * sin(Float32(Float32(2.0) * Float32(Float32(pi) * uy))))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(xi, yi, zi, ux, uy, maxCos)
      	tmp = single(0.0);
      	if (uy <= single(0.05000000074505806))
      		tmp = (xi + ((ux * maxCos) * (zi * (single(1.0) - ux)))) + (uy * ((single(2.0) * (single(pi) * yi)) + (uy * ((single(-2.0) * (xi * (single(pi) * single(pi)))) + (single(-1.3333333333333333) * ((single(pi) * (single(pi) * single(pi))) * (uy * yi)))))));
      	else
      		tmp = (maxCos * (zi * ux)) + (xi + (yi * sin((single(2.0) * (single(pi) * uy)))));
      	end
      	tmp_2 = tmp;
      end
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;uy \leq 0.05000000074505806:\\
      \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + -1.3333333333333333 \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(uy \cdot yi\right)\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;maxCos \cdot \left(zi \cdot ux\right) + \left(xi + yi \cdot \sin \left(2 \cdot \left(\pi \cdot uy\right)\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if uy < 0.0500000007

        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.1%

          \[\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. +-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) + 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) \]
          3. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right), \left(\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)\right)\right) \]
          4. associate-*r*N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
          5. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
          6. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\right)\right)\right), \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) \]
          8. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\right)\right)\right), \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) \]
          9. --lowering--.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \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) \]
          10. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \mathsf{*.f32}\left(uy, \color{blue}{\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) \]
          11. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\left(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. Simplified97.9%

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

        if 0.0500000007 < uy

        1. Initial program 98.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. Simplified98.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. Simplified95.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. Taylor expanded in uy around 0

          \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(\color{blue}{xi}, \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)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        8. Step-by-step derivation
          1. Simplified69.9%

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

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

        Alternative 12: 90.9% accurate, 3.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;uy \leq 0.08749999850988388:\\ \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + -1.3333333333333333 \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(uy \cdot yi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;maxCos \cdot \left(zi \cdot ux\right) + yi \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right)\\ \end{array} \end{array} \]
        (FPCore (xi yi zi ux uy maxCos)
         :precision binary32
         (if (<= uy 0.08749999850988388)
           (+
            (+ xi (* (* ux maxCos) (* zi (- 1.0 ux))))
            (*
             uy
             (+
              (* 2.0 (* PI yi))
              (*
               uy
               (+
                (* -2.0 (* xi (* PI PI)))
                (* -1.3333333333333333 (* (* PI (* PI PI)) (* uy yi))))))))
           (+ (* maxCos (* zi ux)) (* yi (sin (* PI (* 2.0 uy)))))))
        float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
        	float tmp;
        	if (uy <= 0.08749999850988388f) {
        		tmp = (xi + ((ux * maxCos) * (zi * (1.0f - ux)))) + (uy * ((2.0f * (((float) M_PI) * yi)) + (uy * ((-2.0f * (xi * (((float) M_PI) * ((float) M_PI)))) + (-1.3333333333333333f * ((((float) M_PI) * (((float) M_PI) * ((float) M_PI))) * (uy * yi)))))));
        	} else {
        		tmp = (maxCos * (zi * ux)) + (yi * sinf((((float) M_PI) * (2.0f * uy))));
        	}
        	return tmp;
        }
        
        function code(xi, yi, zi, ux, uy, maxCos)
        	tmp = Float32(0.0)
        	if (uy <= Float32(0.08749999850988388))
        		tmp = Float32(Float32(xi + Float32(Float32(ux * maxCos) * Float32(zi * Float32(Float32(1.0) - ux)))) + 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(-1.3333333333333333) * Float32(Float32(Float32(pi) * Float32(Float32(pi) * Float32(pi))) * Float32(uy * yi))))))));
        	else
        		tmp = Float32(Float32(maxCos * Float32(zi * ux)) + Float32(yi * sin(Float32(Float32(pi) * Float32(Float32(2.0) * uy)))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(xi, yi, zi, ux, uy, maxCos)
        	tmp = single(0.0);
        	if (uy <= single(0.08749999850988388))
        		tmp = (xi + ((ux * maxCos) * (zi * (single(1.0) - ux)))) + (uy * ((single(2.0) * (single(pi) * yi)) + (uy * ((single(-2.0) * (xi * (single(pi) * single(pi)))) + (single(-1.3333333333333333) * ((single(pi) * (single(pi) * single(pi))) * (uy * yi)))))));
        	else
        		tmp = (maxCos * (zi * ux)) + (yi * sin((single(pi) * (single(2.0) * uy))));
        	end
        	tmp_2 = tmp;
        end
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;uy \leq 0.08749999850988388:\\
        \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(-2 \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + -1.3333333333333333 \cdot \left(\left(\pi \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(uy \cdot yi\right)\right)\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;maxCos \cdot \left(zi \cdot ux\right) + yi \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if uy < 0.0874999985

          1. Initial program 99.2%

            \[\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.1%

            \[\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. +-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) + 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) \]
            3. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right), \left(\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)\right)\right) \]
            4. associate-*r*N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
            5. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
            6. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\right)\right)\right), \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) \]
            8. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\right)\right)\right), \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) \]
            9. --lowering--.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \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) \]
            10. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \mathsf{*.f32}\left(uy, \color{blue}{\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) \]
            11. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\left(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. Simplified96.9%

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

          if 0.0874999985 < uy

          1. Initial program 97.9%

            \[\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.9%

            \[\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. Simplified94.6%

            \[\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. Taylor expanded in xi around 0

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

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

              \[\leadsto \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 zi\right)\right)}\right) \]
            3. *-lowering-*.f32N/A

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

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

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

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

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

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

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

              \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(2, uy\right)\right)\right)\right), \mathsf{*.f32}\left(maxCos, \color{blue}{\left(ux \cdot zi\right)}\right)\right) \]
            11. *-lowering-*.f3265.2%

              \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), \mathsf{*.f32}\left(2, uy\right)\right)\right)\right), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \color{blue}{zi}\right)\right)\right) \]
          9. Simplified65.2%

            \[\leadsto \color{blue}{yi \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right) + maxCos \cdot \left(ux \cdot zi\right)} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification92.8%

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

        Alternative 13: 88.2% accurate, 11.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;uy \leq 0.0006600000197067857:\\ \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + yi \cdot \left(\pi \cdot \left(2 \cdot uy\right) + \frac{\left(\pi \cdot \pi\right) \cdot \left(-2 \cdot \left(xi \cdot \left(uy \cdot uy\right)\right)\right)}{yi}\right)\\ \mathbf{else}:\\ \;\;\;\;maxCos \cdot \left(zi \cdot ux\right) + \left(xi + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(xi \cdot -2\right) + \left(\pi \cdot \left(yi \cdot \left(\pi \cdot \pi\right)\right)\right) \cdot \left(uy \cdot -1.3333333333333333\right)\right)\right)\right)\\ \end{array} \end{array} \]
        (FPCore (xi yi zi ux uy maxCos)
         :precision binary32
         (if (<= uy 0.0006600000197067857)
           (+
            (+ xi (* (* ux maxCos) (* zi (- 1.0 ux))))
            (*
             yi
             (+ (* PI (* 2.0 uy)) (/ (* (* PI PI) (* -2.0 (* xi (* uy uy)))) yi))))
           (+
            (* maxCos (* zi ux))
            (+
             xi
             (*
              uy
              (+
               (* 2.0 (* PI yi))
               (*
                uy
                (+
                 (* (* PI PI) (* xi -2.0))
                 (* (* PI (* yi (* PI PI))) (* uy -1.3333333333333333))))))))))
        float code(float xi, float yi, float zi, float ux, float uy, float maxCos) {
        	float tmp;
        	if (uy <= 0.0006600000197067857f) {
        		tmp = (xi + ((ux * maxCos) * (zi * (1.0f - ux)))) + (yi * ((((float) M_PI) * (2.0f * uy)) + (((((float) M_PI) * ((float) M_PI)) * (-2.0f * (xi * (uy * uy)))) / yi)));
        	} else {
        		tmp = (maxCos * (zi * ux)) + (xi + (uy * ((2.0f * (((float) M_PI) * yi)) + (uy * (((((float) M_PI) * ((float) M_PI)) * (xi * -2.0f)) + ((((float) M_PI) * (yi * (((float) M_PI) * ((float) M_PI)))) * (uy * -1.3333333333333333f)))))));
        	}
        	return tmp;
        }
        
        function code(xi, yi, zi, ux, uy, maxCos)
        	tmp = Float32(0.0)
        	if (uy <= Float32(0.0006600000197067857))
        		tmp = Float32(Float32(xi + Float32(Float32(ux * maxCos) * Float32(zi * Float32(Float32(1.0) - ux)))) + Float32(yi * Float32(Float32(Float32(pi) * Float32(Float32(2.0) * uy)) + Float32(Float32(Float32(Float32(pi) * Float32(pi)) * Float32(Float32(-2.0) * Float32(xi * Float32(uy * uy)))) / yi))));
        	else
        		tmp = Float32(Float32(maxCos * Float32(zi * ux)) + Float32(xi + Float32(uy * Float32(Float32(Float32(2.0) * Float32(Float32(pi) * yi)) + Float32(uy * Float32(Float32(Float32(Float32(pi) * Float32(pi)) * Float32(xi * Float32(-2.0))) + Float32(Float32(Float32(pi) * Float32(yi * Float32(Float32(pi) * Float32(pi)))) * Float32(uy * Float32(-1.3333333333333333)))))))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(xi, yi, zi, ux, uy, maxCos)
        	tmp = single(0.0);
        	if (uy <= single(0.0006600000197067857))
        		tmp = (xi + ((ux * maxCos) * (zi * (single(1.0) - ux)))) + (yi * ((single(pi) * (single(2.0) * uy)) + (((single(pi) * single(pi)) * (single(-2.0) * (xi * (uy * uy)))) / yi)));
        	else
        		tmp = (maxCos * (zi * ux)) + (xi + (uy * ((single(2.0) * (single(pi) * yi)) + (uy * (((single(pi) * single(pi)) * (xi * single(-2.0))) + ((single(pi) * (yi * (single(pi) * single(pi)))) * (uy * single(-1.3333333333333333))))))));
        	end
        	tmp_2 = tmp;
        end
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;uy \leq 0.0006600000197067857:\\
        \;\;\;\;\left(xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + yi \cdot \left(\pi \cdot \left(2 \cdot uy\right) + \frac{\left(\pi \cdot \pi\right) \cdot \left(-2 \cdot \left(xi \cdot \left(uy \cdot uy\right)\right)\right)}{yi}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;maxCos \cdot \left(zi \cdot ux\right) + \left(xi + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(xi \cdot -2\right) + \left(\pi \cdot \left(yi \cdot \left(\pi \cdot \pi\right)\right)\right) \cdot \left(uy \cdot -1.3333333333333333\right)\right)\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if uy < 6.6000002e-4

          1. Initial program 99.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. Simplified99.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. Simplified99.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 \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. 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(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
            2. +-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(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) \]
            3. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\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) \]
            4. associate-*r*N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\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) \]
            5. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
            6. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\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) \]
            8. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\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) \]
            9. --lowering--.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            10. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            11. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          9. Simplified98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 6.6000002e-4 < uy

          1. Initial program 98.2%

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

            \[\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. Taylor expanded in uy around 0

            \[\leadsto \mathsf{+.f32}\left(\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)}, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
          8. Step-by-step derivation
            1. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \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), \mathsf{*.f32}\left(\color{blue}{maxCos}, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
            2. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(uy, \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), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
            3. +-lowering-+.f32N/A

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

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\mathsf{*.f32}\left(2, \left(yi \cdot \mathsf{PI}\left(\right)\right)\right), \left(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), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\mathsf{*.f32}\left(2, \left(\mathsf{PI}\left(\right) \cdot yi\right)\right), \left(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), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
            6. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\mathsf{PI}\left(\right), yi\right)\right), \left(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), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
            7. PI-lowering-PI.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), yi\right)\right), \left(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), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
            8. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), yi\right)\right), \mathsf{*.f32}\left(uy, \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), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
            9. +-lowering-+.f32N/A

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

            \[\leadsto \color{blue}{\left(xi + uy \cdot \left(2 \cdot \left(\pi \cdot yi\right) + uy \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(xi \cdot -2\right) + \left(\pi \cdot \left(\left(\pi \cdot \pi\right) \cdot yi\right)\right) \cdot \left(uy \cdot -1.3333333333333333\right)\right)\right)\right)} + maxCos \cdot \left(ux \cdot zi\right) \]
        3. Recombined 2 regimes into one program.
        4. Final simplification89.2%

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

        Alternative 14: 89.1% accurate, 11.2× speedup?

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

          \[\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.1%

          \[\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.9%

          \[\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. +-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) + 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) \]
          3. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right)\right), \left(\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)\right)\right) \]
          4. associate-*r*N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
          5. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
          6. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right)\right), \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) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\right)\right)\right), \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) \]
          8. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\right)\right)\right), \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) \]
          9. --lowering--.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \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) \]
          10. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \mathsf{*.f32}\left(uy, \color{blue}{\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) \]
          11. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right), \mathsf{*.f32}\left(uy, \mathsf{+.f32}\left(\left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{\left(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. Simplified89.6%

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

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

        Alternative 15: 85.5% accurate, 14.0× speedup?

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

          \[\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.1%

          \[\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.9%

          \[\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. 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(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
          2. +-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(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) \]
          3. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\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) \]
          4. associate-*r*N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\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) \]
          5. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
          6. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\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) \]
          8. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\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) \]
          9. --lowering--.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          10. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          11. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
        9. Simplified85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 16: 85.5% accurate, 14.9× speedup?

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

          \[\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.1%

          \[\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.9%

          \[\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. 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(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
          2. +-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(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) \]
          3. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\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) \]
          4. associate-*r*N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\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) \]
          5. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
          6. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\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) \]
          8. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\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) \]
          9. --lowering--.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          10. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          11. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
        9. Simplified85.9%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(xi + ux \cdot \left(maxCos \cdot zi - maxCos \cdot \left(ux \cdot zi\right)\right)\right)} + uy \cdot \left(\left(-2 \cdot uy\right) \cdot \left(xi \cdot \left(\pi \cdot \pi\right)\right) + 2 \cdot \left(\pi \cdot yi\right)\right) \]
        13. Final simplification85.9%

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

        Alternative 17: 85.5% accurate, 15.9× speedup?

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

          \[\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.1%

          \[\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.9%

          \[\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. 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(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
          2. +-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(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) \]
          3. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\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) \]
          4. associate-*r*N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\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) \]
          5. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
          6. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\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) \]
          8. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\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) \]
          9. --lowering--.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          10. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          11. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
        9. Simplified85.9%

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

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

        Alternative 18: 61.1% accurate, 18.4× speedup?

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

          1. Initial program 98.8%

            \[\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.8%

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

            \[\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. 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(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
            2. +-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(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) \]
            3. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\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) \]
            4. associate-*r*N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\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) \]
            5. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
            6. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\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) \]
            8. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\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) \]
            9. --lowering--.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            10. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            11. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          9. Simplified82.5%

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

            \[\leadsto \color{blue}{{ux}^{2} \cdot \left(-1 \cdot \left(maxCos \cdot zi\right) + -1 \cdot \frac{-1 \cdot \left(maxCos \cdot zi\right) + -1 \cdot \frac{xi + 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)}{ux}}{ux}\right)} \]
          11. Simplified82.1%

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

            \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, ux\right), \color{blue}{\left(2 \cdot \frac{uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)}{{ux}^{2}}\right)}\right) \]
          13. Step-by-step derivation
            1. associate-*r/N/A

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

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

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

              \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, ux\right), \left(\frac{uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)}{{ux}^{2}}\right)\right) \]
            5. /-lowering-/.f32N/A

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, ux\right), \mathsf{/.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(yi, \mathsf{PI}\left(\right)\right)\right)\right), \left({ux}^{2}\right)\right)\right) \]
            12. PI-lowering-PI.f32N/A

              \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, ux\right), \mathsf{/.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(yi, \mathsf{PI.f32}\left(\right)\right)\right)\right), \left({ux}^{2}\right)\right)\right) \]
            13. unpow2N/A

              \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, ux\right), \mathsf{/.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(yi, \mathsf{PI.f32}\left(\right)\right)\right)\right), \left(ux \cdot \color{blue}{ux}\right)\right)\right) \]
            14. *-lowering-*.f3256.4%

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

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

          if -3.99999993e-13 < yi < 1.00000001e-10

          1. Initial program 99.2%

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

            \[\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 \mathsf{+.f32}\left(\color{blue}{\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)}, \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
          5. Step-by-step derivation
            1. +-lowering-+.f32N/A

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

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

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            4. *-lowering-*.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            5. *-lowering-*.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            6. PI-lowering-PI.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            7. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \color{blue}{\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)}\right), zi\right)\right) \]
            8. sin-lowering-sin.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), \color{blue}{maxCos}\right)\right), zi\right)\right) \]
            9. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            10. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            11. PI-lowering-PI.f3299.0%

              \[\leadsto \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), \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)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
          6. Simplified99.0%

            \[\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)} + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi \]
          7. Taylor expanded in uy around 0

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

              \[\leadsto maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{xi} \]
            2. +-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}{xi}\right) \]
            3. associate-*r*N/A

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

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

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

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

              \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right), \left(1 - ux\right)\right), xi\right) \]
            8. --lowering--.f3268.2%

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

            \[\leadsto \color{blue}{\left(maxCos \cdot \left(ux \cdot zi\right)\right) \cdot \left(1 - ux\right) + xi} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification64.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;yi \leq -3.99999992980668 \cdot 10^{-13}:\\ \;\;\;\;\left(ux \cdot ux\right) \cdot \frac{2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)}{ux \cdot ux}\\ \mathbf{elif}\;yi \leq 1.000000013351432 \cdot 10^{-10}:\\ \;\;\;\;xi + \left(1 - ux\right) \cdot \left(maxCos \cdot \left(zi \cdot ux\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(ux \cdot ux\right) \cdot \frac{2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)}{ux \cdot ux}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 19: 83.0% accurate, 18.4× speedup?

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

          \[\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.1%

          \[\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. Simplified95.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. Taylor expanded in uy around 0

          \[\leadsto \mathsf{+.f32}\left(\color{blue}{\left(xi + 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)}, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
        8. Step-by-step derivation
          1. +-lowering-+.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \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), \mathsf{*.f32}\left(\color{blue}{maxCos}, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
          2. *-lowering-*.f32N/A

            \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(uy, \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), \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right)\right) \]
          3. +-lowering-+.f32N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 20: 61.1% accurate, 21.9× speedup?

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

          1. Initial program 98.8%

            \[\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.8%

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

            \[\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. 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(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
            2. +-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(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) \]
            3. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\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) \]
            4. associate-*r*N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\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) \]
            5. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
            6. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\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) \]
            8. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\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) \]
            9. --lowering--.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            10. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            11. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          9. Simplified82.5%

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), yi\right)\right)\right) \]
          12. Simplified56.4%

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

          if -3.99999993e-13 < yi < 1.00000001e-10

          1. Initial program 99.2%

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

            \[\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 \mathsf{+.f32}\left(\color{blue}{\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)}, \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
          5. Step-by-step derivation
            1. +-lowering-+.f32N/A

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

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

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            4. *-lowering-*.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            5. *-lowering-*.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            6. PI-lowering-PI.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            7. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \color{blue}{\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)}\right), zi\right)\right) \]
            8. sin-lowering-sin.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), \color{blue}{maxCos}\right)\right), zi\right)\right) \]
            9. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            10. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            11. PI-lowering-PI.f3299.0%

              \[\leadsto \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), \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)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
          6. Simplified99.0%

            \[\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)} + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi \]
          7. Taylor expanded in uy around 0

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

              \[\leadsto maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \color{blue}{xi} \]
            2. +-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}{xi}\right) \]
            3. associate-*r*N/A

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

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

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

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

              \[\leadsto \mathsf{+.f32}\left(\mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right), \left(1 - ux\right)\right), xi\right) \]
            8. --lowering--.f3268.2%

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

            \[\leadsto \color{blue}{\left(maxCos \cdot \left(ux \cdot zi\right)\right) \cdot \left(1 - ux\right) + xi} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification64.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;yi \leq -3.99999992980668 \cdot 10^{-13}:\\ \;\;\;\;2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\\ \mathbf{elif}\;yi \leq 1.000000013351432 \cdot 10^{-10}:\\ \;\;\;\;xi + \left(1 - ux\right) \cdot \left(maxCos \cdot \left(zi \cdot ux\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 21: 61.1% accurate, 21.9× speedup?

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

          1. Initial program 98.8%

            \[\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.8%

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

            \[\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. 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(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
            2. +-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(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) \]
            3. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\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) \]
            4. associate-*r*N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\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) \]
            5. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
            6. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\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) \]
            8. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\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) \]
            9. --lowering--.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            10. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            11. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          9. Simplified82.5%

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), yi\right)\right)\right) \]
          12. Simplified56.4%

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

          if -3.99999993e-13 < yi < 1.00000001e-10

          1. Initial program 99.2%

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

            \[\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 \mathsf{+.f32}\left(\color{blue}{\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)}, \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
          5. Step-by-step derivation
            1. +-lowering-+.f32N/A

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

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

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            4. *-lowering-*.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            5. *-lowering-*.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            6. PI-lowering-PI.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            7. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \color{blue}{\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)}\right), zi\right)\right) \]
            8. sin-lowering-sin.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), \color{blue}{maxCos}\right)\right), zi\right)\right) \]
            9. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            10. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            11. PI-lowering-PI.f3299.0%

              \[\leadsto \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), \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)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
          6. Simplified99.0%

            \[\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)} + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi \]
          7. Taylor expanded in uy around 0

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

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

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

          Alternative 22: 61.1% accurate, 21.9× speedup?

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

            1. Initial program 98.8%

              \[\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.8%

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

              \[\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. 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(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
              2. +-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(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) \]
              3. +-lowering-+.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\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) \]
              4. associate-*r*N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\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) \]
              5. *-lowering-*.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
              6. *-lowering-*.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
              7. *-commutativeN/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\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) \]
              8. *-lowering-*.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\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) \]
              9. --lowering--.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
              10. *-lowering-*.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
              11. +-lowering-+.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            9. Simplified82.5%

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), yi\right)\right)\right) \]
            12. Simplified56.4%

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

            if -3.99999993e-13 < yi < 1.00000001e-10

            1. Initial program 99.2%

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

              \[\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.1%

              \[\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 + maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\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)\right)}\right) \]
              2. associate-*r*N/A

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

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

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

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

                \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), \color{blue}{zi}\right)\right)\right) \]
              7. --lowering--.f3268.1%

                \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\right)\right)\right) \]
            9. Simplified68.1%

              \[\leadsto \color{blue}{xi + \left(maxCos \cdot ux\right) \cdot \left(\left(1 - ux\right) \cdot zi\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification64.4%

            \[\leadsto \begin{array}{l} \mathbf{if}\;yi \leq -3.99999992980668 \cdot 10^{-13}:\\ \;\;\;\;2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\\ \mathbf{elif}\;yi \leq 1.000000013351432 \cdot 10^{-10}:\\ \;\;\;\;xi + \left(ux \cdot maxCos\right) \cdot \left(zi \cdot \left(1 - ux\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 23: 81.3% accurate, 24.3× speedup?

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

            \[\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.1%

            \[\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 \mathsf{+.f32}\left(\color{blue}{\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)}, \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
          5. Step-by-step derivation
            1. +-lowering-+.f32N/A

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

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

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            4. *-lowering-*.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            5. *-lowering-*.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            6. PI-lowering-PI.f32N/A

              \[\leadsto \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), \left(yi \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            7. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \color{blue}{\mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)}\right), zi\right)\right) \]
            8. sin-lowering-sin.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), \color{blue}{maxCos}\right)\right), zi\right)\right) \]
            9. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            10. *-lowering-*.f32N/A

              \[\leadsto \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), \mathsf{*.f32}\left(yi, \mathsf{sin.f32}\left(\mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{PI}\left(\right)\right)\right)\right)\right)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
            11. PI-lowering-PI.f3298.9%

              \[\leadsto \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), \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)\right), \mathsf{*.f32}\left(\mathsf{*.f32}\left(ux, \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), maxCos\right)\right), zi\right)\right) \]
          6. Simplified98.9%

            \[\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)} + \left(ux \cdot \left(\left(1 - ux\right) \cdot maxCos\right)\right) \cdot zi \]
          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(\left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) \cdot 2 + xi\right) \]
            5. associate-*r*N/A

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

              \[\leadsto maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) + \left(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) + xi\right) \]
            7. +-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(uy \cdot \left(2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right) + xi\right)}\right) \]
            8. associate-*r*N/A

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

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

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

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

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

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

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

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

          Alternative 24: 81.3% accurate, 24.3× speedup?

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

            \[\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.1%

            \[\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.9%

            \[\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. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(xi, \color{blue}{\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)}\right) \]
            2. +-commutativeN/A

              \[\leadsto \mathsf{+.f32}\left(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)\right) \]
            3. +-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(2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right)\right) \]
            4. 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}{2} \cdot \left(uy \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(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\right)\right), \left(\color{blue}{2} \cdot \left(uy \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), \left(zi \cdot \left(1 - ux\right)\right)\right), \left(2 \cdot \left(uy \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)\right) \]
            7. *-commutativeN/A

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

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

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

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

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

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

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

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

          Alternative 25: 59.4% accurate, 27.0× speedup?

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

            1. Initial program 98.8%

              \[\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.8%

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

              \[\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. 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(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
              2. +-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(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) \]
              3. +-lowering-+.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\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) \]
              4. associate-*r*N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\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) \]
              5. *-lowering-*.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
              6. *-lowering-*.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
              7. *-commutativeN/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\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) \]
              8. *-lowering-*.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\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) \]
              9. --lowering--.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
              10. *-lowering-*.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
              11. +-lowering-+.f32N/A

                \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            9. Simplified82.5%

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), yi\right)\right)\right) \]
            12. Simplified56.4%

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

            if -3.99999993e-13 < yi < 1.00000001e-10

            1. Initial program 99.2%

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

              \[\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. Simplified94.3%

              \[\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. Taylor expanded in uy around 0

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

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

                \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(maxCos, \color{blue}{\left(ux \cdot zi\right)}\right)\right) \]
              3. *-lowering-*.f3265.4%

                \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \color{blue}{zi}\right)\right)\right) \]
            9. Simplified65.4%

              \[\leadsto \color{blue}{xi + maxCos \cdot \left(ux \cdot zi\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification62.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;yi \leq -3.99999992980668 \cdot 10^{-13}:\\ \;\;\;\;2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\\ \mathbf{elif}\;yi \leq 1.000000013351432 \cdot 10^{-10}:\\ \;\;\;\;xi + maxCos \cdot \left(zi \cdot ux\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(uy \cdot \left(\pi \cdot yi\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 26: 78.8% accurate, 30.7× speedup?

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

            \[\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.1%

            \[\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. Simplified95.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. 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 zi\right)\right)} \]
          8. Step-by-step derivation
            1. +-lowering-+.f32N/A

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

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

              \[\leadsto \mathsf{+.f32}\left(xi, \mathsf{+.f32}\left(\left(maxCos \cdot \left(ux \cdot zi\right)\right), \color{blue}{\left(2 \cdot \left(uy \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(maxCos, \left(ux \cdot zi\right)\right), \left(\color{blue}{2} \cdot \left(uy \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(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right), \left(2 \cdot \left(uy \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(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right), \mathsf{*.f32}\left(2, \color{blue}{\left(uy \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(maxCos, \mathsf{*.f32}\left(ux, zi\right)\right), \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \color{blue}{\left(yi \cdot \mathsf{PI}\left(\right)\right)}\right)\right)\right)\right) \]
            8. *-commutativeN/A

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

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

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

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

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

          Alternative 27: 32.7% accurate, 65.9× speedup?

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

            \[\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.1%

            \[\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.9%

            \[\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. 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(uy \cdot \left(xi \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + 2 \cdot \left(yi \cdot \mathsf{PI}\left(\right)\right)\right)} \]
            2. +-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(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) \]
            3. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\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) \]
            4. associate-*r*N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \left(\left(maxCos \cdot ux\right) \cdot \left(zi \cdot \left(1 - ux\right)\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) \]
            5. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\left(maxCos \cdot ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
            6. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(zi \cdot \left(1 - ux\right)\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) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \left(\left(1 - ux\right) \cdot zi\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) \]
            8. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\left(1 - ux\right), zi\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) \]
            9. --lowering--.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            10. *-lowering-*.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
            11. +-lowering-+.f32N/A

              \[\leadsto \mathsf{+.f32}\left(\mathsf{+.f32}\left(xi, \mathsf{*.f32}\left(\mathsf{*.f32}\left(maxCos, ux\right), \mathsf{*.f32}\left(\mathsf{\_.f32}\left(1, ux\right), zi\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) \]
          9. Simplified85.9%

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f32}\left(2, \mathsf{*.f32}\left(uy, \mathsf{*.f32}\left(\mathsf{PI.f32}\left(\right), yi\right)\right)\right) \]
          12. Simplified29.9%

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

          Alternative 28: 11.7% accurate, 92.2× speedup?

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

            \[\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.1%

            \[\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}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
          5. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) \cdot \color{blue}{maxCos} \]
            2. associate-*r*N/A

              \[\leadsto \left(\left(ux \cdot zi\right) \cdot \left(1 - ux\right)\right) \cdot maxCos \]
            3. *-commutativeN/A

              \[\leadsto \left(\left(zi \cdot ux\right) \cdot \left(1 - ux\right)\right) \cdot maxCos \]
            4. associate-*l*N/A

              \[\leadsto \left(zi \cdot \left(ux \cdot \left(1 - ux\right)\right)\right) \cdot maxCos \]
            5. associate-*r*N/A

              \[\leadsto zi \cdot \color{blue}{\left(\left(ux \cdot \left(1 - ux\right)\right) \cdot maxCos\right)} \]
            6. *-commutativeN/A

              \[\leadsto zi \cdot \left(maxCos \cdot \color{blue}{\left(ux \cdot \left(1 - ux\right)\right)}\right) \]
            7. *-lowering-*.f32N/A

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

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

              \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \color{blue}{\left(1 - ux\right)}\right)\right)\right) \]
            10. --lowering--.f3214.5%

              \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, \color{blue}{ux}\right)\right)\right)\right) \]
          6. Simplified14.5%

            \[\leadsto \color{blue}{zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)} \]
          7. Taylor expanded in ux around 0

            \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
          8. Step-by-step derivation
            1. *-lowering-*.f32N/A

              \[\leadsto \mathsf{*.f32}\left(maxCos, \color{blue}{\left(ux \cdot zi\right)}\right) \]
            2. *-lowering-*.f3212.7%

              \[\leadsto \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \color{blue}{zi}\right)\right) \]
          9. Simplified12.7%

            \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
          10. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto maxCos \cdot \left(zi \cdot \color{blue}{ux}\right) \]
            2. associate-*r*N/A

              \[\leadsto \left(maxCos \cdot zi\right) \cdot \color{blue}{ux} \]
            3. *-commutativeN/A

              \[\leadsto \left(zi \cdot maxCos\right) \cdot ux \]
            4. *-lowering-*.f32N/A

              \[\leadsto \mathsf{*.f32}\left(\left(zi \cdot maxCos\right), \color{blue}{ux}\right) \]
            5. *-lowering-*.f3212.7%

              \[\leadsto \mathsf{*.f32}\left(\mathsf{*.f32}\left(zi, maxCos\right), ux\right) \]
          11. Applied egg-rr12.7%

            \[\leadsto \color{blue}{\left(zi \cdot maxCos\right) \cdot ux} \]
          12. Final simplification12.7%

            \[\leadsto ux \cdot \left(zi \cdot maxCos\right) \]
          13. Add Preprocessing

          Alternative 29: 11.7% accurate, 92.2× speedup?

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

            \[\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.1%

            \[\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}{maxCos \cdot \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right)} \]
          5. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(ux \cdot \left(zi \cdot \left(1 - ux\right)\right)\right) \cdot \color{blue}{maxCos} \]
            2. associate-*r*N/A

              \[\leadsto \left(\left(ux \cdot zi\right) \cdot \left(1 - ux\right)\right) \cdot maxCos \]
            3. *-commutativeN/A

              \[\leadsto \left(\left(zi \cdot ux\right) \cdot \left(1 - ux\right)\right) \cdot maxCos \]
            4. associate-*l*N/A

              \[\leadsto \left(zi \cdot \left(ux \cdot \left(1 - ux\right)\right)\right) \cdot maxCos \]
            5. associate-*r*N/A

              \[\leadsto zi \cdot \color{blue}{\left(\left(ux \cdot \left(1 - ux\right)\right) \cdot maxCos\right)} \]
            6. *-commutativeN/A

              \[\leadsto zi \cdot \left(maxCos \cdot \color{blue}{\left(ux \cdot \left(1 - ux\right)\right)}\right) \]
            7. *-lowering-*.f32N/A

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

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

              \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \color{blue}{\left(1 - ux\right)}\right)\right)\right) \]
            10. --lowering--.f3214.5%

              \[\leadsto \mathsf{*.f32}\left(zi, \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \mathsf{\_.f32}\left(1, \color{blue}{ux}\right)\right)\right)\right) \]
          6. Simplified14.5%

            \[\leadsto \color{blue}{zi \cdot \left(maxCos \cdot \left(ux \cdot \left(1 - ux\right)\right)\right)} \]
          7. Taylor expanded in ux around 0

            \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
          8. Step-by-step derivation
            1. *-lowering-*.f32N/A

              \[\leadsto \mathsf{*.f32}\left(maxCos, \color{blue}{\left(ux \cdot zi\right)}\right) \]
            2. *-lowering-*.f3212.7%

              \[\leadsto \mathsf{*.f32}\left(maxCos, \mathsf{*.f32}\left(ux, \color{blue}{zi}\right)\right) \]
          9. Simplified12.7%

            \[\leadsto \color{blue}{maxCos \cdot \left(ux \cdot zi\right)} \]
          10. Final simplification12.7%

            \[\leadsto maxCos \cdot \left(zi \cdot ux\right) \]
          11. Add Preprocessing

          Reproduce

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