UniformSampleCone, y

Percentage Accurate: 57.5% → 98.3%
Time: 13.4s
Alternatives: 9
Speedup: 1.5×

Specification

?
\[\left(\left(2.328306437 \cdot 10^{-10} \leq ux \land ux \leq 1\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(1 - ux\right) + ux \cdot maxCos\\ \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - t_0 \cdot t_0} \end{array} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (let* ((t_0 (+ (- 1.0 ux) (* ux maxCos))))
   (* (sin (* (* uy 2.0) PI)) (sqrt (- 1.0 (* t_0 t_0))))))
float code(float ux, float uy, float maxCos) {
	float t_0 = (1.0f - ux) + (ux * maxCos);
	return sinf(((uy * 2.0f) * ((float) M_PI))) * sqrtf((1.0f - (t_0 * t_0)));
}
function code(ux, uy, maxCos)
	t_0 = Float32(Float32(Float32(1.0) - ux) + Float32(ux * maxCos))
	return Float32(sin(Float32(Float32(uy * Float32(2.0)) * Float32(pi))) * sqrt(Float32(Float32(1.0) - Float32(t_0 * t_0))))
end
function tmp = code(ux, uy, maxCos)
	t_0 = (single(1.0) - ux) + (ux * maxCos);
	tmp = sin(((uy * single(2.0)) * single(pi))) * sqrt((single(1.0) - (t_0 * t_0)));
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(1 - ux\right) + ux \cdot maxCos\\
\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - t_0 \cdot t_0}
\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 9 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: 57.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \left(1 - ux\right) + ux \cdot maxCos\\
\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - t_0 \cdot t_0}
\end{array}
\end{array}

Alternative 1: 98.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := 2 \cdot \left(uy \cdot \pi\right)\\
t_1 := 2 + t_0\\
\sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{t_0 \cdot t_1}{t_1}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 55.5%

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. associate-*l*55.5%

      \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. sub-neg55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
    3. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
    4. distribute-rgt-neg-in55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
    5. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
    6. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    7. associate-+r-55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    8. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    9. neg-sub055.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
    10. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
    11. associate-+r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
    12. associate--r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
    13. neg-sub055.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
    14. +-commutative55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
    15. sub-neg55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
    16. fma-def55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
  3. Simplified55.4%

    \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
  4. Taylor expanded in ux around 0 98.4%

    \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right) + ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
  5. Step-by-step derivation
    1. +-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)}} \]
    2. fma-def98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)}} \]
    3. +-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(-1 \cdot \left(maxCos - 1\right) + 1\right)} - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    4. mul-1-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(-\left(maxCos - 1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    5. sub-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\color{blue}{\left(maxCos + \left(-1\right)\right)}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    6. metadata-eval98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\left(maxCos + \color{blue}{-1}\right)\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    7. distribute-neg-in98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(\left(-maxCos\right) + \left(--1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    8. metadata-eval98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(\left(-maxCos\right) + \color{blue}{1}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    9. +-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(1 + \left(-maxCos\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    10. mul-1-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(1 + \color{blue}{-1 \cdot maxCos}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    11. associate--l+98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 + -1 \cdot maxCos\right) + \left(1 - maxCos\right)}, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    12. mul-1-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 + \color{blue}{\left(-maxCos\right)}\right) + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    13. sub-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 - maxCos\right)} + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    14. sub-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \color{blue}{\left(maxCos + \left(-1\right)\right)} \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    15. metadata-eval98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + \color{blue}{-1}\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    16. *-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}\right)} \]
    17. unpow298.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)\right)} \]
  6. Simplified98.4%

    \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}} \]
  7. Step-by-step derivation
    1. pow198.4%

      \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1}} \]
    2. count-298.4%

      \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{2 \cdot \left(1 - maxCos\right)}, \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1} \]
    3. associate-*l*98.4%

      \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}\right)}\right)}^{1} \]
  8. Applied egg-rr98.4%

    \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}\right)}^{1}} \]
  9. Step-by-step derivation
    1. unpow198.4%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
  10. Simplified98.4%

    \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
  11. Taylor expanded in uy around inf 98.4%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(1 - maxCos\right) \cdot ux\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
  12. Step-by-step derivation
    1. *-commutative98.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right)} + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    2. *-commutative98.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    3. unpow298.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    4. associate-*r*98.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    5. associate-*r*98.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \color{blue}{\left(\left(maxCos - 1\right) \cdot ux\right) \cdot \left(ux \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    6. distribute-rgt-out98.4%

      \[\leadsto \sqrt{\color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right) \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    7. *-commutative98.4%

      \[\leadsto \sqrt{\color{blue}{\left(\left(1 - maxCos\right) \cdot ux\right)} \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    8. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + \color{blue}{ux \cdot \left(maxCos - 1\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    9. sub-neg98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \color{blue}{\left(maxCos + \left(-1\right)\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    10. metadata-eval98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + \color{blue}{-1}\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    11. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(uy \cdot \pi\right) \cdot 2\right)} \]
    12. associate-*r*98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(uy \cdot \left(\pi \cdot 2\right)\right)} \]
    13. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(\pi \cdot 2\right) \cdot uy\right)} \]
    14. associate-*l*98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
  13. Simplified98.4%

    \[\leadsto \color{blue}{\sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
  14. Step-by-step derivation
    1. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(2 \cdot uy\right) \cdot \pi\right)} \]
    2. associate-*r*98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
    3. expm1-log1p-u98.3%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)\right)\right)} \]
    4. expm1-def60.7%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} - 1\right)} \]
    5. flip--60.5%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\frac{e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} \cdot e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} - 1 \cdot 1}{e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} + 1}\right)} \]
    6. log1p-udef60.5%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{e^{\color{blue}{\log \left(1 + 2 \cdot \left(uy \cdot \pi\right)\right)}} \cdot e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} - 1 \cdot 1}{e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} + 1}\right) \]
    7. add-exp-log60.5%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\color{blue}{\left(1 + 2 \cdot \left(uy \cdot \pi\right)\right)} \cdot e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} - 1 \cdot 1}{e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} + 1}\right) \]
    8. *-commutative60.5%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(1 + 2 \cdot \color{blue}{\left(\pi \cdot uy\right)}\right) \cdot e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} - 1 \cdot 1}{e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} + 1}\right) \]
    9. log1p-udef60.5%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) \cdot e^{\color{blue}{\log \left(1 + 2 \cdot \left(uy \cdot \pi\right)\right)}} - 1 \cdot 1}{e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} + 1}\right) \]
    10. add-exp-log60.5%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) \cdot \color{blue}{\left(1 + 2 \cdot \left(uy \cdot \pi\right)\right)} - 1 \cdot 1}{e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} + 1}\right) \]
    11. *-commutative60.5%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) \cdot \left(1 + 2 \cdot \color{blue}{\left(\pi \cdot uy\right)}\right) - 1 \cdot 1}{e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} + 1}\right) \]
    12. metadata-eval60.5%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) \cdot \left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) - \color{blue}{1}}{e^{\mathsf{log1p}\left(2 \cdot \left(uy \cdot \pi\right)\right)} + 1}\right) \]
  15. Applied egg-rr60.5%

    \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\frac{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) \cdot \left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) - 1}{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1}\right)} \]
  16. Step-by-step derivation
    1. difference-of-sqr-160.8%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\color{blue}{\left(\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1\right) \cdot \left(\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) - 1\right)}}{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1}\right) \]
    2. +-commutative60.8%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\color{blue}{\left(1 + \left(1 + 2 \cdot \left(\pi \cdot uy\right)\right)\right)} \cdot \left(\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) - 1\right)}{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1}\right) \]
    3. associate-+r+60.9%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\color{blue}{\left(\left(1 + 1\right) + 2 \cdot \left(\pi \cdot uy\right)\right)} \cdot \left(\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) - 1\right)}{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1}\right) \]
    4. metadata-eval60.9%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(\color{blue}{2} + 2 \cdot \left(\pi \cdot uy\right)\right) \cdot \left(\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) - 1\right)}{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1}\right) \]
    5. *-commutative60.9%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(2 + 2 \cdot \color{blue}{\left(uy \cdot \pi\right)}\right) \cdot \left(\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) - 1\right)}{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1}\right) \]
    6. +-commutative60.9%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(2 + 2 \cdot \left(uy \cdot \pi\right)\right) \cdot \left(\color{blue}{\left(2 \cdot \left(\pi \cdot uy\right) + 1\right)} - 1\right)}{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1}\right) \]
    7. associate--l+98.0%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(2 + 2 \cdot \left(uy \cdot \pi\right)\right) \cdot \color{blue}{\left(2 \cdot \left(\pi \cdot uy\right) + \left(1 - 1\right)\right)}}{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1}\right) \]
    8. *-commutative98.0%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(2 + 2 \cdot \left(uy \cdot \pi\right)\right) \cdot \left(2 \cdot \color{blue}{\left(uy \cdot \pi\right)} + \left(1 - 1\right)\right)}{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1}\right) \]
    9. metadata-eval98.0%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(2 + 2 \cdot \left(uy \cdot \pi\right)\right) \cdot \left(2 \cdot \left(uy \cdot \pi\right) + \color{blue}{0}\right)}{\left(1 + 2 \cdot \left(\pi \cdot uy\right)\right) + 1}\right) \]
    10. +-commutative98.0%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(2 + 2 \cdot \left(uy \cdot \pi\right)\right) \cdot \left(2 \cdot \left(uy \cdot \pi\right) + 0\right)}{\color{blue}{1 + \left(1 + 2 \cdot \left(\pi \cdot uy\right)\right)}}\right) \]
    11. associate-+r+98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(2 + 2 \cdot \left(uy \cdot \pi\right)\right) \cdot \left(2 \cdot \left(uy \cdot \pi\right) + 0\right)}{\color{blue}{\left(1 + 1\right) + 2 \cdot \left(\pi \cdot uy\right)}}\right) \]
    12. metadata-eval98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(2 + 2 \cdot \left(uy \cdot \pi\right)\right) \cdot \left(2 \cdot \left(uy \cdot \pi\right) + 0\right)}{\color{blue}{2} + 2 \cdot \left(\pi \cdot uy\right)}\right) \]
    13. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(2 + 2 \cdot \left(uy \cdot \pi\right)\right) \cdot \left(2 \cdot \left(uy \cdot \pi\right) + 0\right)}{2 + 2 \cdot \color{blue}{\left(uy \cdot \pi\right)}}\right) \]
  17. Simplified98.4%

    \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\frac{\left(2 + 2 \cdot \left(uy \cdot \pi\right)\right) \cdot \left(2 \cdot \left(uy \cdot \pi\right) + 0\right)}{2 + 2 \cdot \left(uy \cdot \pi\right)}\right)} \]
  18. Final simplification98.4%

    \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\frac{\left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \left(2 + 2 \cdot \left(uy \cdot \pi\right)\right)}{2 + 2 \cdot \left(uy \cdot \pi\right)}\right) \]

Alternative 2: 98.3% accurate, 1.0× speedup?

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

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

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. associate-*l*55.5%

      \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. sub-neg55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
    3. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
    4. distribute-rgt-neg-in55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
    5. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
    6. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    7. associate-+r-55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    8. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    9. neg-sub055.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
    10. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
    11. associate-+r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
    12. associate--r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
    13. neg-sub055.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
    14. +-commutative55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
    15. sub-neg55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
    16. fma-def55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
  3. Simplified55.4%

    \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
  4. Taylor expanded in ux around 0 98.4%

    \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right) + ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
  5. Step-by-step derivation
    1. +-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)}} \]
    2. fma-def98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)}} \]
    3. +-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(-1 \cdot \left(maxCos - 1\right) + 1\right)} - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    4. mul-1-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(-\left(maxCos - 1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    5. sub-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\color{blue}{\left(maxCos + \left(-1\right)\right)}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    6. metadata-eval98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\left(maxCos + \color{blue}{-1}\right)\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    7. distribute-neg-in98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(\left(-maxCos\right) + \left(--1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    8. metadata-eval98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(\left(-maxCos\right) + \color{blue}{1}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    9. +-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(1 + \left(-maxCos\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    10. mul-1-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(1 + \color{blue}{-1 \cdot maxCos}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    11. associate--l+98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 + -1 \cdot maxCos\right) + \left(1 - maxCos\right)}, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    12. mul-1-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 + \color{blue}{\left(-maxCos\right)}\right) + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    13. sub-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 - maxCos\right)} + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    14. sub-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \color{blue}{\left(maxCos + \left(-1\right)\right)} \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    15. metadata-eval98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + \color{blue}{-1}\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    16. *-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}\right)} \]
    17. unpow298.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)\right)} \]
  6. Simplified98.4%

    \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}} \]
  7. Step-by-step derivation
    1. pow198.4%

      \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1}} \]
    2. count-298.4%

      \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{2 \cdot \left(1 - maxCos\right)}, \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1} \]
    3. associate-*l*98.4%

      \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}\right)}\right)}^{1} \]
  8. Applied egg-rr98.4%

    \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}\right)}^{1}} \]
  9. Step-by-step derivation
    1. unpow198.4%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
  10. Simplified98.4%

    \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
  11. Taylor expanded in uy around inf 98.4%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(1 - maxCos\right) \cdot ux\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
  12. Step-by-step derivation
    1. *-commutative98.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right)} + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    2. *-commutative98.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    3. unpow298.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    4. associate-*r*98.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    5. associate-*r*98.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \color{blue}{\left(\left(maxCos - 1\right) \cdot ux\right) \cdot \left(ux \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    6. distribute-rgt-out98.4%

      \[\leadsto \sqrt{\color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right) \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    7. *-commutative98.4%

      \[\leadsto \sqrt{\color{blue}{\left(\left(1 - maxCos\right) \cdot ux\right)} \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    8. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + \color{blue}{ux \cdot \left(maxCos - 1\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    9. sub-neg98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \color{blue}{\left(maxCos + \left(-1\right)\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    10. metadata-eval98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + \color{blue}{-1}\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    11. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(uy \cdot \pi\right) \cdot 2\right)} \]
    12. associate-*r*98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(uy \cdot \left(\pi \cdot 2\right)\right)} \]
    13. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(\pi \cdot 2\right) \cdot uy\right)} \]
    14. associate-*l*98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
  13. Simplified98.4%

    \[\leadsto \color{blue}{\sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
  14. Final simplification98.4%

    \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \]

Alternative 3: 95.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;2 \cdot uy \leq 0.0003000000142492354:\\
\;\;\;\;2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{\left(1 - maxCos\right) \cdot \left(ux \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(2 - ux\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f32 uy 2) < 3.00000014e-4

    1. Initial program 55.0%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. associate-*l*55.0%

        \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      2. sub-neg55.0%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
      3. +-commutative55.0%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
      4. distribute-rgt-neg-in55.0%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
      5. fma-def54.9%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
      6. +-commutative54.9%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      7. associate-+r-55.1%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      8. fma-def55.1%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      9. neg-sub055.1%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
      10. +-commutative55.1%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
      11. associate-+r-54.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
      12. associate--r-54.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
      13. neg-sub054.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
      14. +-commutative54.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
      15. sub-neg54.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
      16. fma-def54.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
    3. Simplified54.8%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
    4. Taylor expanded in ux around 0 98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right) + ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
    5. Step-by-step derivation
      1. +-commutative98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)}} \]
      2. fma-def98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)}} \]
      3. +-commutative98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(-1 \cdot \left(maxCos - 1\right) + 1\right)} - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      4. mul-1-neg98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(-\left(maxCos - 1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      5. sub-neg98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\color{blue}{\left(maxCos + \left(-1\right)\right)}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      6. metadata-eval98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\left(maxCos + \color{blue}{-1}\right)\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      7. distribute-neg-in98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(\left(-maxCos\right) + \left(--1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      8. metadata-eval98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(\left(-maxCos\right) + \color{blue}{1}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      9. +-commutative98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(1 + \left(-maxCos\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      10. mul-1-neg98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(1 + \color{blue}{-1 \cdot maxCos}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      11. associate--l+98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 + -1 \cdot maxCos\right) + \left(1 - maxCos\right)}, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      12. mul-1-neg98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 + \color{blue}{\left(-maxCos\right)}\right) + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      13. sub-neg98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 - maxCos\right)} + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      14. sub-neg98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \color{blue}{\left(maxCos + \left(-1\right)\right)} \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      15. metadata-eval98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + \color{blue}{-1}\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      16. *-commutative98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}\right)} \]
      17. unpow298.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)\right)} \]
    6. Simplified98.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}} \]
    7. Step-by-step derivation
      1. pow198.5%

        \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1}} \]
      2. count-298.5%

        \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{2 \cdot \left(1 - maxCos\right)}, \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1} \]
      3. associate-*l*98.5%

        \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}\right)}\right)}^{1} \]
    8. Applied egg-rr98.5%

      \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}\right)}^{1}} \]
    9. Step-by-step derivation
      1. unpow198.5%

        \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
    10. Simplified98.5%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
    11. Taylor expanded in uy around inf 98.5%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(1 - maxCos\right) \cdot ux\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutative98.5%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right)} + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      2. *-commutative98.5%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      3. unpow298.5%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      4. associate-*r*98.5%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      5. associate-*r*98.5%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \color{blue}{\left(\left(maxCos - 1\right) \cdot ux\right) \cdot \left(ux \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      6. distribute-rgt-out98.6%

        \[\leadsto \sqrt{\color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right) \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      7. *-commutative98.6%

        \[\leadsto \sqrt{\color{blue}{\left(\left(1 - maxCos\right) \cdot ux\right)} \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      8. *-commutative98.6%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + \color{blue}{ux \cdot \left(maxCos - 1\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      9. sub-neg98.6%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \color{blue}{\left(maxCos + \left(-1\right)\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      10. metadata-eval98.6%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + \color{blue}{-1}\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      11. *-commutative98.6%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(uy \cdot \pi\right) \cdot 2\right)} \]
      12. associate-*r*98.6%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(uy \cdot \left(\pi \cdot 2\right)\right)} \]
      13. *-commutative98.6%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(\pi \cdot 2\right) \cdot uy\right)} \]
      14. associate-*l*98.6%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
    13. Simplified98.6%

      \[\leadsto \color{blue}{\sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
    14. Taylor expanded in uy around 0 98.5%

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

    if 3.00000014e-4 < (*.f32 uy 2)

    1. Initial program 56.2%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. associate-*l*56.2%

        \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      2. sub-neg56.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
      3. +-commutative56.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
      4. distribute-rgt-neg-in56.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
      5. fma-def56.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
      6. +-commutative56.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      7. associate-+r-56.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      8. fma-def56.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      9. neg-sub056.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
      10. +-commutative56.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
      11. associate-+r-56.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
      12. associate--r-56.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
      13. neg-sub056.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
      14. +-commutative56.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
      15. sub-neg56.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
      16. fma-def56.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
    3. Simplified56.3%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
    4. Taylor expanded in ux around 0 98.3%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right) + ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
    5. Step-by-step derivation
      1. +-commutative98.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)}} \]
      2. fma-def98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)}} \]
      3. +-commutative98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(-1 \cdot \left(maxCos - 1\right) + 1\right)} - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      4. mul-1-neg98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(-\left(maxCos - 1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      5. sub-neg98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\color{blue}{\left(maxCos + \left(-1\right)\right)}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      6. metadata-eval98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\left(maxCos + \color{blue}{-1}\right)\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      7. distribute-neg-in98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(\left(-maxCos\right) + \left(--1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      8. metadata-eval98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(\left(-maxCos\right) + \color{blue}{1}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      9. +-commutative98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(1 + \left(-maxCos\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      10. mul-1-neg98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(1 + \color{blue}{-1 \cdot maxCos}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      11. associate--l+98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 + -1 \cdot maxCos\right) + \left(1 - maxCos\right)}, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      12. mul-1-neg98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 + \color{blue}{\left(-maxCos\right)}\right) + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      13. sub-neg98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 - maxCos\right)} + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      14. sub-neg98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \color{blue}{\left(maxCos + \left(-1\right)\right)} \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      15. metadata-eval98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + \color{blue}{-1}\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      16. *-commutative98.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}\right)} \]
      17. unpow298.2%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)\right)} \]
    6. Simplified98.2%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}} \]
    7. Step-by-step derivation
      1. pow198.2%

        \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1}} \]
      2. count-298.2%

        \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{2 \cdot \left(1 - maxCos\right)}, \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1} \]
      3. associate-*l*98.2%

        \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}\right)}\right)}^{1} \]
    8. Applied egg-rr98.2%

      \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}\right)}^{1}} \]
    9. Step-by-step derivation
      1. unpow198.2%

        \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
    10. Simplified98.2%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
    11. Taylor expanded in uy around inf 98.2%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(1 - maxCos\right) \cdot ux\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutative98.2%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right)} + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      2. *-commutative98.2%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      3. unpow298.2%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      4. associate-*r*98.2%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      5. associate-*r*98.2%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \color{blue}{\left(\left(maxCos - 1\right) \cdot ux\right) \cdot \left(ux \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      6. distribute-rgt-out98.2%

        \[\leadsto \sqrt{\color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right) \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      7. *-commutative98.2%

        \[\leadsto \sqrt{\color{blue}{\left(\left(1 - maxCos\right) \cdot ux\right)} \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      8. *-commutative98.2%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + \color{blue}{ux \cdot \left(maxCos - 1\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      9. sub-neg98.2%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \color{blue}{\left(maxCos + \left(-1\right)\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      10. metadata-eval98.2%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + \color{blue}{-1}\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      11. *-commutative98.2%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(uy \cdot \pi\right) \cdot 2\right)} \]
      12. associate-*r*98.2%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(uy \cdot \left(\pi \cdot 2\right)\right)} \]
      13. *-commutative98.2%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(\pi \cdot 2\right) \cdot uy\right)} \]
      14. associate-*l*98.2%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
    13. Simplified98.2%

      \[\leadsto \color{blue}{\sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
    14. Taylor expanded in maxCos around 0 94.8%

      \[\leadsto \sqrt{\color{blue}{\left(-1 \cdot ux + 2\right) \cdot ux}} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \]
    15. Step-by-step derivation
      1. *-commutative94.8%

        \[\leadsto \sqrt{\color{blue}{ux \cdot \left(-1 \cdot ux + 2\right)}} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \]
      2. +-commutative94.8%

        \[\leadsto \sqrt{ux \cdot \color{blue}{\left(2 + -1 \cdot ux\right)}} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \]
      3. mul-1-neg94.8%

        \[\leadsto \sqrt{ux \cdot \left(2 + \color{blue}{\left(-ux\right)}\right)} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \]
      4. unsub-neg94.8%

        \[\leadsto \sqrt{ux \cdot \color{blue}{\left(2 - ux\right)}} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \]
    16. Simplified94.8%

      \[\leadsto \sqrt{\color{blue}{ux \cdot \left(2 - ux\right)}} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;2 \cdot uy \leq 0.0003000000142492354:\\ \;\;\;\;2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{\left(1 - maxCos\right) \cdot \left(ux \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(2 - ux\right)}\\ \end{array} \]

Alternative 4: 89.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;2 \cdot uy \leq 0.010999999940395355:\\
\;\;\;\;2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{\left(1 - maxCos\right) \cdot \left(ux \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f32 uy 2) < 0.0109999999

    1. Initial program 57.4%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. associate-*l*57.4%

        \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      2. sub-neg57.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
      3. +-commutative57.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
      4. distribute-rgt-neg-in57.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
      5. fma-def57.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
      6. +-commutative57.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      7. associate-+r-57.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      8. fma-def57.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      9. neg-sub057.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
      10. +-commutative57.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
      11. associate-+r-57.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
      12. associate--r-57.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
      13. neg-sub057.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
      14. +-commutative57.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
      15. sub-neg57.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
      16. fma-def57.3%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
    3. Simplified57.3%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
    4. Taylor expanded in ux around 0 98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right) + ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
    5. Step-by-step derivation
      1. +-commutative98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)}} \]
      2. fma-def98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)}} \]
      3. +-commutative98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(-1 \cdot \left(maxCos - 1\right) + 1\right)} - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      4. mul-1-neg98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(-\left(maxCos - 1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      5. sub-neg98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\color{blue}{\left(maxCos + \left(-1\right)\right)}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      6. metadata-eval98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\left(maxCos + \color{blue}{-1}\right)\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      7. distribute-neg-in98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(\left(-maxCos\right) + \left(--1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      8. metadata-eval98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(\left(-maxCos\right) + \color{blue}{1}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      9. +-commutative98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(1 + \left(-maxCos\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      10. mul-1-neg98.4%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(1 + \color{blue}{-1 \cdot maxCos}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      11. associate--l+98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 + -1 \cdot maxCos\right) + \left(1 - maxCos\right)}, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      12. mul-1-neg98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 + \color{blue}{\left(-maxCos\right)}\right) + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      13. sub-neg98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 - maxCos\right)} + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      14. sub-neg98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \color{blue}{\left(maxCos + \left(-1\right)\right)} \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      15. metadata-eval98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + \color{blue}{-1}\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
      16. *-commutative98.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}\right)} \]
      17. unpow298.5%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)\right)} \]
    6. Simplified98.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}} \]
    7. Step-by-step derivation
      1. pow198.5%

        \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1}} \]
      2. count-298.5%

        \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{2 \cdot \left(1 - maxCos\right)}, \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1} \]
      3. associate-*l*98.5%

        \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}\right)}\right)}^{1} \]
    8. Applied egg-rr98.5%

      \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}\right)}^{1}} \]
    9. Step-by-step derivation
      1. unpow198.5%

        \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
    10. Simplified98.5%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
    11. Taylor expanded in uy around inf 98.5%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(1 - maxCos\right) \cdot ux\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
    12. Step-by-step derivation
      1. *-commutative98.5%

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right)} + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      2. *-commutative98.5%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      3. unpow298.5%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      4. associate-*r*98.5%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      5. associate-*r*98.5%

        \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \color{blue}{\left(\left(maxCos - 1\right) \cdot ux\right) \cdot \left(ux \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      6. distribute-rgt-out98.5%

        \[\leadsto \sqrt{\color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right) \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      7. *-commutative98.5%

        \[\leadsto \sqrt{\color{blue}{\left(\left(1 - maxCos\right) \cdot ux\right)} \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      8. *-commutative98.5%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + \color{blue}{ux \cdot \left(maxCos - 1\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      9. sub-neg98.5%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \color{blue}{\left(maxCos + \left(-1\right)\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      10. metadata-eval98.5%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + \color{blue}{-1}\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
      11. *-commutative98.5%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(uy \cdot \pi\right) \cdot 2\right)} \]
      12. associate-*r*98.5%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(uy \cdot \left(\pi \cdot 2\right)\right)} \]
      13. *-commutative98.5%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(\pi \cdot 2\right) \cdot uy\right)} \]
      14. associate-*l*98.5%

        \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
    13. Simplified98.5%

      \[\leadsto \color{blue}{\sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
    14. Taylor expanded in uy around 0 94.8%

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

    if 0.0109999999 < (*.f32 uy 2)

    1. Initial program 49.5%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Taylor expanded in ux around 0 39.8%

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \color{blue}{\left(1 + \left(2 \cdot maxCos - 2\right) \cdot ux\right)}} \]
    3. Taylor expanded in maxCos around 0 77.2%

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{2 \cdot ux}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;2 \cdot uy \leq 0.010999999940395355:\\ \;\;\;\;2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{\left(1 - maxCos\right) \cdot \left(ux \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot 2}\\ \end{array} \]

Alternative 5: 81.6% accurate, 1.5× speedup?

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

\\
2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{\left(1 - maxCos\right) \cdot \left(ux \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)\right)}\right)
\end{array}
Derivation
  1. Initial program 55.5%

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. associate-*l*55.5%

      \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. sub-neg55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
    3. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
    4. distribute-rgt-neg-in55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
    5. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
    6. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    7. associate-+r-55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    8. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    9. neg-sub055.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
    10. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
    11. associate-+r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
    12. associate--r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
    13. neg-sub055.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
    14. +-commutative55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
    15. sub-neg55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
    16. fma-def55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
  3. Simplified55.4%

    \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
  4. Taylor expanded in ux around 0 98.4%

    \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right) + ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
  5. Step-by-step derivation
    1. +-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)}} \]
    2. fma-def98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)}} \]
    3. +-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(-1 \cdot \left(maxCos - 1\right) + 1\right)} - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    4. mul-1-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(-\left(maxCos - 1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    5. sub-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\color{blue}{\left(maxCos + \left(-1\right)\right)}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    6. metadata-eval98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(-\left(maxCos + \color{blue}{-1}\right)\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    7. distribute-neg-in98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(\left(-maxCos\right) + \left(--1\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    8. metadata-eval98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(\left(-maxCos\right) + \color{blue}{1}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    9. +-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\color{blue}{\left(1 + \left(-maxCos\right)\right)} + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    10. mul-1-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(\left(1 + \color{blue}{-1 \cdot maxCos}\right) + 1\right) - maxCos, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    11. associate--l+98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 + -1 \cdot maxCos\right) + \left(1 - maxCos\right)}, \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    12. mul-1-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 + \color{blue}{\left(-maxCos\right)}\right) + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    13. sub-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\left(1 - maxCos\right)} + \left(1 - maxCos\right), \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    14. sub-neg98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \color{blue}{\left(maxCos + \left(-1\right)\right)} \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    15. metadata-eval98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + \color{blue}{-1}\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)\right)} \]
    16. *-commutative98.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}\right)} \]
    17. unpow298.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)\right)} \]
  6. Simplified98.4%

    \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}} \]
  7. Step-by-step derivation
    1. pow198.4%

      \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \left(1 - maxCos\right) + \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1}} \]
    2. count-298.4%

      \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{2 \cdot \left(1 - maxCos\right)}, \left(maxCos + -1\right) \cdot \left(\left(ux \cdot ux\right) \cdot \left(1 - maxCos\right)\right)\right)}\right)}^{1} \]
    3. associate-*l*98.4%

      \[\leadsto {\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}\right)}\right)}^{1} \]
  8. Applied egg-rr98.4%

    \[\leadsto \color{blue}{{\left(\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}\right)}^{1}} \]
  9. Step-by-step derivation
    1. unpow198.4%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
  10. Simplified98.4%

    \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, 2 \cdot \left(1 - maxCos\right), \left(maxCos + -1\right) \cdot \left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)\right)}} \]
  11. Taylor expanded in uy around inf 98.4%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(1 - maxCos\right) \cdot ux\right) + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
  12. Step-by-step derivation
    1. *-commutative98.4%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right)} + \left(maxCos - 1\right) \cdot \left(\left(1 - maxCos\right) \cdot {ux}^{2}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    2. *-commutative98.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left({ux}^{2} \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    3. unpow298.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \left(\color{blue}{\left(ux \cdot ux\right)} \cdot \left(1 - maxCos\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    4. associate-*r*98.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(maxCos - 1\right) \cdot \color{blue}{\left(ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    5. associate-*r*98.4%

      \[\leadsto \sqrt{2 \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \color{blue}{\left(\left(maxCos - 1\right) \cdot ux\right) \cdot \left(ux \cdot \left(1 - maxCos\right)\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    6. distribute-rgt-out98.4%

      \[\leadsto \sqrt{\color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right) \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)}} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    7. *-commutative98.4%

      \[\leadsto \sqrt{\color{blue}{\left(\left(1 - maxCos\right) \cdot ux\right)} \cdot \left(2 + \left(maxCos - 1\right) \cdot ux\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    8. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + \color{blue}{ux \cdot \left(maxCos - 1\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    9. sub-neg98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \color{blue}{\left(maxCos + \left(-1\right)\right)}\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    10. metadata-eval98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + \color{blue}{-1}\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \]
    11. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(uy \cdot \pi\right) \cdot 2\right)} \]
    12. associate-*r*98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(uy \cdot \left(\pi \cdot 2\right)\right)} \]
    13. *-commutative98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\left(\pi \cdot 2\right) \cdot uy\right)} \]
    14. associate-*l*98.4%

      \[\leadsto \sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
  13. Simplified98.4%

    \[\leadsto \color{blue}{\sqrt{\left(\left(1 - maxCos\right) \cdot ux\right) \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)} \cdot \sin \left(\pi \cdot \left(2 \cdot uy\right)\right)} \]
  14. Taylor expanded in uy around 0 80.9%

    \[\leadsto \color{blue}{2 \cdot \left(\sqrt{\left(1 - maxCos\right) \cdot \left(\left(2 + \left(maxCos - 1\right) \cdot ux\right) \cdot ux\right)} \cdot \left(uy \cdot \pi\right)\right)} \]
  15. Final simplification80.9%

    \[\leadsto 2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{\left(1 - maxCos\right) \cdot \left(ux \cdot \left(2 + ux \cdot \left(maxCos + -1\right)\right)\right)}\right) \]

Alternative 6: 75.6% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;ux \leq 0.00039000000106170774:\\
\;\;\;\;\left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{1 + \left(ux + -1\right) \cdot \left(1 - ux\right)}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if ux < 3.90000001e-4

    1. Initial program 34.8%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. associate-*l*34.8%

        \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      2. sub-neg34.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
      3. +-commutative34.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
      4. distribute-rgt-neg-in34.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
      5. fma-def34.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
      6. +-commutative34.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      7. associate-+r-34.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      8. fma-def34.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      9. neg-sub034.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
      10. +-commutative34.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
      11. associate-+r-34.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
      12. associate--r-34.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
      13. neg-sub034.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
      14. +-commutative34.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
      15. sub-neg34.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
      16. fma-def34.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
    3. Simplified34.6%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
    4. Taylor expanded in ux around 0 92.9%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
    5. Taylor expanded in uy around 0 77.3%

      \[\leadsto \color{blue}{2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}\right)} \]
    6. Step-by-step derivation
      1. associate-*r*77.3%

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
      2. associate-*r*77.3%

        \[\leadsto \color{blue}{\left(\left(2 \cdot uy\right) \cdot \pi\right)} \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)} \]
      3. *-commutative77.3%

        \[\leadsto \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right)} \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)} \]
      4. neg-mul-177.3%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \color{blue}{\left(-\left(maxCos - 1\right)\right)}\right) - maxCos\right)} \]
      5. sub-neg77.3%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \left(-\color{blue}{\left(maxCos + \left(-1\right)\right)}\right)\right) - maxCos\right)} \]
      6. metadata-eval77.3%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \left(-\left(maxCos + \color{blue}{-1}\right)\right)\right) - maxCos\right)} \]
      7. associate-+r-77.4%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \color{blue}{\left(1 + \left(\left(-\left(maxCos + -1\right)\right) - maxCos\right)\right)}} \]
      8. associate-+r-77.3%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \color{blue}{\left(\left(1 + \left(-\left(maxCos + -1\right)\right)\right) - maxCos\right)}} \]
      9. distribute-neg-in77.3%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \color{blue}{\left(\left(-maxCos\right) + \left(--1\right)\right)}\right) - maxCos\right)} \]
      10. metadata-eval77.3%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \left(\left(-maxCos\right) + \color{blue}{1}\right)\right) - maxCos\right)} \]
      11. associate-+r+77.3%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\color{blue}{\left(\left(1 + \left(-maxCos\right)\right) + 1\right)} - maxCos\right)} \]
      12. +-commutative77.3%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(\color{blue}{\left(\left(-maxCos\right) + 1\right)} + 1\right) - maxCos\right)} \]
      13. associate-+l+77.3%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\color{blue}{\left(\left(-maxCos\right) + \left(1 + 1\right)\right)} - maxCos\right)} \]
      14. metadata-eval77.3%

        \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(\left(-maxCos\right) + \color{blue}{2}\right) - maxCos\right)} \]
    7. Simplified77.3%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(\left(-maxCos\right) + 2\right) - maxCos\right)}} \]
    8. Taylor expanded in maxCos around 0 77.4%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \color{blue}{\left(-2 \cdot maxCos + 2\right)}} \]

    if 3.90000001e-4 < ux

    1. Initial program 90.6%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. associate-*l*90.6%

        \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      2. sub-neg90.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
      3. +-commutative90.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
      4. distribute-rgt-neg-in90.6%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
      5. fma-def90.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
      6. +-commutative90.8%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      7. associate-+r-91.0%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      8. fma-def91.0%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
      9. neg-sub091.0%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
      10. +-commutative91.0%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
      11. associate-+r-90.7%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
      12. associate--r-90.7%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
      13. neg-sub090.7%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
      14. +-commutative90.7%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
      15. sub-neg90.7%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
      16. fma-def90.7%

        \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
    3. Simplified90.7%

      \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
    4. Taylor expanded in uy around 0 75.4%

      \[\leadsto \color{blue}{2 \cdot \left(\sqrt{1 + \left(ux - \left(1 + maxCos \cdot ux\right)\right) \cdot \left(\left(1 + maxCos \cdot ux\right) - ux\right)} \cdot \left(uy \cdot \pi\right)\right)} \]
    5. Taylor expanded in maxCos around 0 69.9%

      \[\leadsto 2 \cdot \color{blue}{\left(\left(uy \cdot \pi\right) \cdot \sqrt{1 + \left(ux - 1\right) \cdot \left(1 - ux\right)}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;ux \leq 0.00039000000106170774:\\ \;\;\;\;\left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{1 + \left(ux + -1\right) \cdot \left(1 - ux\right)}\right)\\ \end{array} \]

Alternative 7: 66.0% accurate, 1.5× speedup?

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

\\
\left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}
\end{array}
Derivation
  1. Initial program 55.5%

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. associate-*l*55.5%

      \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. sub-neg55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
    3. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
    4. distribute-rgt-neg-in55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
    5. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
    6. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    7. associate-+r-55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    8. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    9. neg-sub055.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
    10. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
    11. associate-+r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
    12. associate--r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
    13. neg-sub055.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
    14. +-commutative55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
    15. sub-neg55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
    16. fma-def55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
  3. Simplified55.4%

    \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
  4. Taylor expanded in ux around 0 77.2%

    \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
  5. Taylor expanded in uy around 0 66.0%

    \[\leadsto \color{blue}{2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}\right)} \]
  6. Step-by-step derivation
    1. associate-*r*66.0%

      \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
    2. associate-*r*66.0%

      \[\leadsto \color{blue}{\left(\left(2 \cdot uy\right) \cdot \pi\right)} \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)} \]
    3. *-commutative66.0%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right)} \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)} \]
    4. neg-mul-166.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \color{blue}{\left(-\left(maxCos - 1\right)\right)}\right) - maxCos\right)} \]
    5. sub-neg66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \left(-\color{blue}{\left(maxCos + \left(-1\right)\right)}\right)\right) - maxCos\right)} \]
    6. metadata-eval66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \left(-\left(maxCos + \color{blue}{-1}\right)\right)\right) - maxCos\right)} \]
    7. associate-+r-66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \color{blue}{\left(1 + \left(\left(-\left(maxCos + -1\right)\right) - maxCos\right)\right)}} \]
    8. associate-+r-66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \color{blue}{\left(\left(1 + \left(-\left(maxCos + -1\right)\right)\right) - maxCos\right)}} \]
    9. distribute-neg-in66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \color{blue}{\left(\left(-maxCos\right) + \left(--1\right)\right)}\right) - maxCos\right)} \]
    10. metadata-eval66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \left(\left(-maxCos\right) + \color{blue}{1}\right)\right) - maxCos\right)} \]
    11. associate-+r+66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\color{blue}{\left(\left(1 + \left(-maxCos\right)\right) + 1\right)} - maxCos\right)} \]
    12. +-commutative66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(\color{blue}{\left(\left(-maxCos\right) + 1\right)} + 1\right) - maxCos\right)} \]
    13. associate-+l+66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\color{blue}{\left(\left(-maxCos\right) + \left(1 + 1\right)\right)} - maxCos\right)} \]
    14. metadata-eval66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(\left(-maxCos\right) + \color{blue}{2}\right) - maxCos\right)} \]
  7. Simplified66.0%

    \[\leadsto \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(\left(-maxCos\right) + 2\right) - maxCos\right)}} \]
  8. Taylor expanded in maxCos around 0 66.0%

    \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \color{blue}{\left(-2 \cdot maxCos + 2\right)}} \]
  9. Final simplification66.0%

    \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)} \]

Alternative 8: 63.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot 2} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (* (* PI (* 2.0 uy)) (sqrt (* ux 2.0))))
float code(float ux, float uy, float maxCos) {
	return (((float) M_PI) * (2.0f * uy)) * sqrtf((ux * 2.0f));
}
function code(ux, uy, maxCos)
	return Float32(Float32(Float32(pi) * Float32(Float32(2.0) * uy)) * sqrt(Float32(ux * Float32(2.0))))
end
function tmp = code(ux, uy, maxCos)
	tmp = (single(pi) * (single(2.0) * uy)) * sqrt((ux * single(2.0)));
end
\begin{array}{l}

\\
\left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot 2}
\end{array}
Derivation
  1. Initial program 55.5%

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. associate-*l*55.5%

      \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. sub-neg55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
    3. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
    4. distribute-rgt-neg-in55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
    5. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
    6. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    7. associate-+r-55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    8. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    9. neg-sub055.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
    10. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
    11. associate-+r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
    12. associate--r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
    13. neg-sub055.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
    14. +-commutative55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
    15. sub-neg55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
    16. fma-def55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
  3. Simplified55.4%

    \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
  4. Taylor expanded in ux around 0 77.2%

    \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
  5. Taylor expanded in uy around 0 66.0%

    \[\leadsto \color{blue}{2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}\right)} \]
  6. Step-by-step derivation
    1. associate-*r*66.0%

      \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)}} \]
    2. associate-*r*66.0%

      \[\leadsto \color{blue}{\left(\left(2 \cdot uy\right) \cdot \pi\right)} \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)} \]
    3. *-commutative66.0%

      \[\leadsto \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right)} \cdot \sqrt{ux \cdot \left(\left(1 + -1 \cdot \left(maxCos - 1\right)\right) - maxCos\right)} \]
    4. neg-mul-166.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \color{blue}{\left(-\left(maxCos - 1\right)\right)}\right) - maxCos\right)} \]
    5. sub-neg66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \left(-\color{blue}{\left(maxCos + \left(-1\right)\right)}\right)\right) - maxCos\right)} \]
    6. metadata-eval66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \left(-\left(maxCos + \color{blue}{-1}\right)\right)\right) - maxCos\right)} \]
    7. associate-+r-66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \color{blue}{\left(1 + \left(\left(-\left(maxCos + -1\right)\right) - maxCos\right)\right)}} \]
    8. associate-+r-66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \color{blue}{\left(\left(1 + \left(-\left(maxCos + -1\right)\right)\right) - maxCos\right)}} \]
    9. distribute-neg-in66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \color{blue}{\left(\left(-maxCos\right) + \left(--1\right)\right)}\right) - maxCos\right)} \]
    10. metadata-eval66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(1 + \left(\left(-maxCos\right) + \color{blue}{1}\right)\right) - maxCos\right)} \]
    11. associate-+r+66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\color{blue}{\left(\left(1 + \left(-maxCos\right)\right) + 1\right)} - maxCos\right)} \]
    12. +-commutative66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(\color{blue}{\left(\left(-maxCos\right) + 1\right)} + 1\right) - maxCos\right)} \]
    13. associate-+l+66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\color{blue}{\left(\left(-maxCos\right) + \left(1 + 1\right)\right)} - maxCos\right)} \]
    14. metadata-eval66.0%

      \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(\left(-maxCos\right) + \color{blue}{2}\right) - maxCos\right)} \]
  7. Simplified66.0%

    \[\leadsto \color{blue}{\left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \left(\left(\left(-maxCos\right) + 2\right) - maxCos\right)}} \]
  8. Taylor expanded in maxCos around 0 62.7%

    \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot \color{blue}{2}} \]
  9. Final simplification62.7%

    \[\leadsto \left(\pi \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{ux \cdot 2} \]

Alternative 9: 7.1% accurate, 1.6× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{0}\right) \end{array} \]
(FPCore (ux uy maxCos) :precision binary32 (* 2.0 (* (* uy PI) (sqrt 0.0))))
float code(float ux, float uy, float maxCos) {
	return 2.0f * ((uy * ((float) M_PI)) * sqrtf(0.0f));
}
function code(ux, uy, maxCos)
	return Float32(Float32(2.0) * Float32(Float32(uy * Float32(pi)) * sqrt(Float32(0.0))))
end
function tmp = code(ux, uy, maxCos)
	tmp = single(2.0) * ((uy * single(pi)) * sqrt(single(0.0)));
end
\begin{array}{l}

\\
2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{0}\right)
\end{array}
Derivation
  1. Initial program 55.5%

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. associate-*l*55.5%

      \[\leadsto \sin \color{blue}{\left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. sub-neg55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{1 + \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)}} \]
    3. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)\right) + 1}} \]
    4. distribute-rgt-neg-in55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(-\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)} + 1} \]
    5. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left(\left(1 - ux\right) + ux \cdot maxCos, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)}} \]
    6. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{ux \cdot maxCos + \left(1 - ux\right)}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    7. associate-+r-55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\left(ux \cdot maxCos + 1\right) - ux}, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    8. fma-def55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)} - ux, -\left(\left(1 - ux\right) + ux \cdot maxCos\right), 1\right)} \]
    9. neg-sub055.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{0 - \left(\left(1 - ux\right) + ux \cdot maxCos\right)}, 1\right)} \]
    10. +-commutative55.5%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(ux \cdot maxCos + \left(1 - ux\right)\right)}, 1\right)} \]
    11. associate-+r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, 0 - \color{blue}{\left(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
    12. associate--r-55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
    13. neg-sub055.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
    14. +-commutative55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
    15. sub-neg55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, \color{blue}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
    16. fma-def55.4%

      \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
  3. Simplified55.4%

    \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux, ux - \mathsf{fma}\left(ux, maxCos, 1\right), 1\right)}} \]
  4. Taylor expanded in uy around 0 48.6%

    \[\leadsto \color{blue}{2 \cdot \left(\sqrt{1 + \left(ux - \left(1 + maxCos \cdot ux\right)\right) \cdot \left(\left(1 + maxCos \cdot ux\right) - ux\right)} \cdot \left(uy \cdot \pi\right)\right)} \]
  5. Taylor expanded in ux around 0 7.1%

    \[\leadsto 2 \cdot \left(\sqrt{1 + \color{blue}{-1}} \cdot \left(uy \cdot \pi\right)\right) \]
  6. Final simplification7.1%

    \[\leadsto 2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{0}\right) \]

Reproduce

?
herbie shell --seed 2023213 
(FPCore (ux uy maxCos)
  :name "UniformSampleCone, y"
  :precision binary32
  :pre (and (and (and (<= 2.328306437e-10 ux) (<= ux 1.0)) (and (<= 2.328306437e-10 uy) (<= uy 1.0))) (and (<= 0.0 maxCos) (<= maxCos 1.0)))
  (* (sin (* (* uy 2.0) PI)) (sqrt (- 1.0 (* (+ (- 1.0 ux) (* ux maxCos)) (+ (- 1.0 ux) (* ux maxCos)))))))