UniformSampleCone, y

Percentage Accurate: 58.2% → 98.7%
Time: 22.2s
Alternatives: 15
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 15 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: 58.2% 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.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := ux \cdot \mathsf{fma}\left(maxCos, -2, 2\right) - ux \cdot \left(ux \cdot {\left(1 - maxCos\right)}^{2}\right)\\ t_1 := \sin \left(uy \cdot \left(2 \cdot \pi\right)\right)\\ \sqrt[3]{\left(\sin \left(uy \cdot \left(2 \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)\right) \cdot \sqrt{t_0}\right) \cdot \left(t_0 \cdot \left(t_1 \cdot t_1\right)\right)} \end{array} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (let* ((t_0
         (-
          (* ux (fma maxCos -2.0 2.0))
          (* ux (* ux (pow (- 1.0 maxCos) 2.0)))))
        (t_1 (sin (* uy (* 2.0 PI)))))
   (cbrt
    (*
     (* (sin (* uy (* 2.0 (* (cbrt PI) (* (cbrt PI) (cbrt PI)))))) (sqrt t_0))
     (* t_0 (* t_1 t_1))))))
float code(float ux, float uy, float maxCos) {
	float t_0 = (ux * fmaf(maxCos, -2.0f, 2.0f)) - (ux * (ux * powf((1.0f - maxCos), 2.0f)));
	float t_1 = sinf((uy * (2.0f * ((float) M_PI))));
	return cbrtf(((sinf((uy * (2.0f * (cbrtf(((float) M_PI)) * (cbrtf(((float) M_PI)) * cbrtf(((float) M_PI))))))) * sqrtf(t_0)) * (t_0 * (t_1 * t_1))));
}
function code(ux, uy, maxCos)
	t_0 = Float32(Float32(ux * fma(maxCos, Float32(-2.0), Float32(2.0))) - Float32(ux * Float32(ux * (Float32(Float32(1.0) - maxCos) ^ Float32(2.0)))))
	t_1 = sin(Float32(uy * Float32(Float32(2.0) * Float32(pi))))
	return cbrt(Float32(Float32(sin(Float32(uy * Float32(Float32(2.0) * Float32(cbrt(Float32(pi)) * Float32(cbrt(Float32(pi)) * cbrt(Float32(pi))))))) * sqrt(t_0)) * Float32(t_0 * Float32(t_1 * t_1))))
end
\begin{array}{l}

\\
\begin{array}{l}
t_0 := ux \cdot \mathsf{fma}\left(maxCos, -2, 2\right) - ux \cdot \left(ux \cdot {\left(1 - maxCos\right)}^{2}\right)\\
t_1 := \sin \left(uy \cdot \left(2 \cdot \pi\right)\right)\\
\sqrt[3]{\left(\sin \left(uy \cdot \left(2 \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)\right) \cdot \sqrt{t_0}\right) \cdot \left(t_0 \cdot \left(t_1 \cdot t_1\right)\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 98.4% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(uy \cdot \left(2 \cdot \pi\right)\right)\\ t_1 := ux \cdot \mathsf{fma}\left(maxCos, -2, 2\right) - ux \cdot \left(ux \cdot {\left(1 - maxCos\right)}^{2}\right)\\ \sqrt[3]{\left(t_1 \cdot \left(t_0 \cdot t_0\right)\right) \cdot \left(\sqrt{t_1} \cdot t_0\right)} \end{array} \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (let* ((t_0 (sin (* uy (* 2.0 PI))))
            (t_1
             (-
              (* ux (fma maxCos -2.0 2.0))
              (* ux (* ux (pow (- 1.0 maxCos) 2.0))))))
       (cbrt (* (* t_1 (* t_0 t_0)) (* (sqrt t_1) t_0)))))
    float code(float ux, float uy, float maxCos) {
    	float t_0 = sinf((uy * (2.0f * ((float) M_PI))));
    	float t_1 = (ux * fmaf(maxCos, -2.0f, 2.0f)) - (ux * (ux * powf((1.0f - maxCos), 2.0f)));
    	return cbrtf(((t_1 * (t_0 * t_0)) * (sqrtf(t_1) * t_0)));
    }
    
    function code(ux, uy, maxCos)
    	t_0 = sin(Float32(uy * Float32(Float32(2.0) * Float32(pi))))
    	t_1 = Float32(Float32(ux * fma(maxCos, Float32(-2.0), Float32(2.0))) - Float32(ux * Float32(ux * (Float32(Float32(1.0) - maxCos) ^ Float32(2.0)))))
    	return cbrt(Float32(Float32(t_1 * Float32(t_0 * t_0)) * Float32(sqrt(t_1) * t_0)))
    end
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \sin \left(uy \cdot \left(2 \cdot \pi\right)\right)\\
    t_1 := ux \cdot \mathsf{fma}\left(maxCos, -2, 2\right) - ux \cdot \left(ux \cdot {\left(1 - maxCos\right)}^{2}\right)\\
    \sqrt[3]{\left(t_1 \cdot \left(t_0 \cdot t_0\right)\right) \cdot \left(\sqrt{t_1} \cdot t_0\right)}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 98.4% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := ux \cdot \mathsf{fma}\left(-2, maxCos, 2\right) - {\left(1 - maxCos\right)}^{2} \cdot \left(ux \cdot ux\right)\\ \sqrt[3]{\sqrt{t_0} \cdot \left(t_0 \cdot {\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}^{3}\right)} \end{array} \end{array} \]
      (FPCore (ux uy maxCos)
       :precision binary32
       (let* ((t_0
               (-
                (* ux (fma -2.0 maxCos 2.0))
                (* (pow (- 1.0 maxCos) 2.0) (* ux ux)))))
         (cbrt (* (sqrt t_0) (* t_0 (pow (sin (* uy (* 2.0 PI))) 3.0))))))
      float code(float ux, float uy, float maxCos) {
      	float t_0 = (ux * fmaf(-2.0f, maxCos, 2.0f)) - (powf((1.0f - maxCos), 2.0f) * (ux * ux));
      	return cbrtf((sqrtf(t_0) * (t_0 * powf(sinf((uy * (2.0f * ((float) M_PI)))), 3.0f))));
      }
      
      function code(ux, uy, maxCos)
      	t_0 = Float32(Float32(ux * fma(Float32(-2.0), maxCos, Float32(2.0))) - Float32((Float32(Float32(1.0) - maxCos) ^ Float32(2.0)) * Float32(ux * ux)))
      	return cbrt(Float32(sqrt(t_0) * Float32(t_0 * (sin(Float32(uy * Float32(Float32(2.0) * Float32(pi)))) ^ Float32(3.0)))))
      end
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := ux \cdot \mathsf{fma}\left(-2, maxCos, 2\right) - {\left(1 - maxCos\right)}^{2} \cdot \left(ux \cdot ux\right)\\
      \sqrt[3]{\sqrt{t_0} \cdot \left(t_0 \cdot {\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}^{3}\right)}
      \end{array}
      \end{array}
      
      Derivation
      1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 4: 98.3% accurate, 0.4× speedup?

        \[\begin{array}{l} \\ \sin \left(\sqrt[3]{{\left(uy \cdot 2\right)}^{3} \cdot {\pi}^{3}}\right) \cdot \sqrt{\left(1 - maxCos\right) \cdot \left({ux}^{2} \cdot \left(maxCos + -1\right)\right) + ux \cdot \left(\left(1 + \left(1 - maxCos\right)\right) - maxCos\right)} \end{array} \]
        (FPCore (ux uy maxCos)
         :precision binary32
         (*
          (sin (cbrt (* (pow (* uy 2.0) 3.0) (pow PI 3.0))))
          (sqrt
           (+
            (* (- 1.0 maxCos) (* (pow ux 2.0) (+ maxCos -1.0)))
            (* ux (- (+ 1.0 (- 1.0 maxCos)) maxCos))))))
        float code(float ux, float uy, float maxCos) {
        	return sinf(cbrtf((powf((uy * 2.0f), 3.0f) * powf(((float) M_PI), 3.0f)))) * sqrtf((((1.0f - maxCos) * (powf(ux, 2.0f) * (maxCos + -1.0f))) + (ux * ((1.0f + (1.0f - maxCos)) - maxCos))));
        }
        
        function code(ux, uy, maxCos)
        	return Float32(sin(cbrt(Float32((Float32(uy * Float32(2.0)) ^ Float32(3.0)) * (Float32(pi) ^ Float32(3.0))))) * sqrt(Float32(Float32(Float32(Float32(1.0) - maxCos) * Float32((ux ^ Float32(2.0)) * Float32(maxCos + Float32(-1.0)))) + Float32(ux * Float32(Float32(Float32(1.0) + Float32(Float32(1.0) - maxCos)) - maxCos)))))
        end
        
        \begin{array}{l}
        
        \\
        \sin \left(\sqrt[3]{{\left(uy \cdot 2\right)}^{3} \cdot {\pi}^{3}}\right) \cdot \sqrt{\left(1 - maxCos\right) \cdot \left({ux}^{2} \cdot \left(maxCos + -1\right)\right) + ux \cdot \left(\left(1 + \left(1 - maxCos\right)\right) - maxCos\right)}
        \end{array}
        
        Derivation
        1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

            \[\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.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(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
          12. associate--r-56.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}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
          13. neg-sub056.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}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
          14. +-commutative56.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}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
          15. sub-neg56.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}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
          16. fma-def56.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, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
        3. Simplified56.1%

          \[\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. associate-*r*98.3%

            \[\leadsto \sin \color{blue}{\left(\left(uy \cdot 2\right) \cdot \pi\right)} \cdot \sqrt{\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)} \]
          2. add-cbrt-cube98.2%

            \[\leadsto \sin \left(\color{blue}{\sqrt[3]{\left(\left(uy \cdot 2\right) \cdot \left(uy \cdot 2\right)\right) \cdot \left(uy \cdot 2\right)}} \cdot \pi\right) \cdot \sqrt{\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)} \]
          3. add-cbrt-cube98.2%

            \[\leadsto \sin \left(\sqrt[3]{\left(\left(uy \cdot 2\right) \cdot \left(uy \cdot 2\right)\right) \cdot \left(uy \cdot 2\right)} \cdot \color{blue}{\sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}}\right) \cdot \sqrt{\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)} \]
          4. cbrt-unprod98.2%

            \[\leadsto \sin \color{blue}{\left(\sqrt[3]{\left(\left(\left(uy \cdot 2\right) \cdot \left(uy \cdot 2\right)\right) \cdot \left(uy \cdot 2\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}\right)} \cdot \sqrt{\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. pow398.3%

            \[\leadsto \sin \left(\sqrt[3]{\color{blue}{{\left(uy \cdot 2\right)}^{3}} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}\right) \cdot \sqrt{\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)} \]
          6. pow398.3%

            \[\leadsto \sin \left(\sqrt[3]{{\left(uy \cdot 2\right)}^{3} \cdot \color{blue}{{\pi}^{3}}}\right) \cdot \sqrt{\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)} \]
        6. Applied egg-rr98.3%

          \[\leadsto \sin \color{blue}{\left(\sqrt[3]{{\left(uy \cdot 2\right)}^{3} \cdot {\pi}^{3}}\right)} \cdot \sqrt{\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)} \]
        7. Final simplification98.3%

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

        Alternative 5: 98.3% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot {\left(\mathsf{fma}\left(maxCos + -1, \left(1 - maxCos\right) \cdot \left(ux \cdot ux\right), ux \cdot \left(\left(1 + \left(1 - maxCos\right)\right) - maxCos\right)\right)\right)}^{0.5} \end{array} \]
        (FPCore (ux uy maxCos)
         :precision binary32
         (*
          (sin (* uy (* 2.0 PI)))
          (pow
           (fma
            (+ maxCos -1.0)
            (* (- 1.0 maxCos) (* ux ux))
            (* ux (- (+ 1.0 (- 1.0 maxCos)) maxCos)))
           0.5)))
        float code(float ux, float uy, float maxCos) {
        	return sinf((uy * (2.0f * ((float) M_PI)))) * powf(fmaf((maxCos + -1.0f), ((1.0f - maxCos) * (ux * ux)), (ux * ((1.0f + (1.0f - maxCos)) - maxCos))), 0.5f);
        }
        
        function code(ux, uy, maxCos)
        	return Float32(sin(Float32(uy * Float32(Float32(2.0) * Float32(pi)))) * (fma(Float32(maxCos + Float32(-1.0)), Float32(Float32(Float32(1.0) - maxCos) * Float32(ux * ux)), Float32(ux * Float32(Float32(Float32(1.0) + Float32(Float32(1.0) - maxCos)) - maxCos))) ^ Float32(0.5)))
        end
        
        \begin{array}{l}
        
        \\
        \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot {\left(\mathsf{fma}\left(maxCos + -1, \left(1 - maxCos\right) \cdot \left(ux \cdot ux\right), ux \cdot \left(\left(1 + \left(1 - maxCos\right)\right) - maxCos\right)\right)\right)}^{0.5}
        \end{array}
        
        Derivation
        1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

            \[\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.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(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
          12. associate--r-56.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}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
          13. neg-sub056.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}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
          14. +-commutative56.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}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
          15. sub-neg56.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}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
          16. fma-def56.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, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
        3. Simplified56.1%

          \[\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. pow1/298.3%

            \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \color{blue}{{\left(\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)\right)}^{0.5}} \]
          2. fma-def98.3%

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

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

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

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

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

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

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

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

          \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot {\left(\mathsf{fma}\left(maxCos + -1, \left(1 - maxCos\right) \cdot \left(ux \cdot ux\right), ux \cdot \left(\left(1 + \left(1 - maxCos\right)\right) - maxCos\right)\right)\right)}^{0.5} \]

        Alternative 6: 98.3% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(maxCos + -1, ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right), ux \cdot \left(\left(1 + \left(1 - maxCos\right)\right) - maxCos\right)\right)} \end{array} \]
        (FPCore (ux uy maxCos)
         :precision binary32
         (*
          (sin (* uy (* 2.0 PI)))
          (sqrt
           (fma
            (+ maxCos -1.0)
            (* ux (* ux (- 1.0 maxCos)))
            (* ux (- (+ 1.0 (- 1.0 maxCos)) maxCos))))))
        float code(float ux, float uy, float maxCos) {
        	return sinf((uy * (2.0f * ((float) M_PI)))) * sqrtf(fmaf((maxCos + -1.0f), (ux * (ux * (1.0f - maxCos))), (ux * ((1.0f + (1.0f - maxCos)) - maxCos))));
        }
        
        function code(ux, uy, maxCos)
        	return Float32(sin(Float32(uy * Float32(Float32(2.0) * Float32(pi)))) * sqrt(fma(Float32(maxCos + Float32(-1.0)), Float32(ux * Float32(ux * Float32(Float32(1.0) - maxCos))), Float32(ux * Float32(Float32(Float32(1.0) + Float32(Float32(1.0) - maxCos)) - maxCos)))))
        end
        
        \begin{array}{l}
        
        \\
        \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\mathsf{fma}\left(maxCos + -1, ux \cdot \left(ux \cdot \left(1 - maxCos\right)\right), ux \cdot \left(\left(1 + \left(1 - maxCos\right)\right) - maxCos\right)\right)}
        \end{array}
        
        Derivation
        1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

            \[\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.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(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
          12. associate--r-56.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}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
          13. neg-sub056.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}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
          14. +-commutative56.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}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
          15. sub-neg56.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}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
          16. fma-def56.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, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
        3. Simplified56.1%

          \[\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. add-sqr-sqrt94.7%

            \[\leadsto \color{blue}{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)} \cdot \sqrt{\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)} \]
          2. pow294.7%

            \[\leadsto \color{blue}{{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)}^{2}} \cdot \sqrt{\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)} \]
        6. Applied egg-rr94.7%

          \[\leadsto \color{blue}{{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)}^{2}} \cdot \sqrt{\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)} \]
        7. Taylor expanded in uy around inf 98.3%

          \[\leadsto \color{blue}{\sqrt{\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)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)} \]
        8. Step-by-step derivation
          1. *-commutative98.3%

            \[\leadsto \color{blue}{\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{\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)}} \]
          2. *-commutative98.3%

            \[\leadsto \sin \color{blue}{\left(\left(uy \cdot \pi\right) \cdot 2\right)} \cdot \sqrt{\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)} \]
          3. associate-*r*98.3%

            \[\leadsto \sin \color{blue}{\left(uy \cdot \left(\pi \cdot 2\right)\right)} \cdot \sqrt{\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)} \]
          4. *-commutative98.3%

            \[\leadsto \sin \left(uy \cdot \color{blue}{\left(2 \cdot \pi\right)}\right) \cdot \sqrt{\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. fma-def98.3%

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

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

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

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

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

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

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

        Alternative 7: 98.3% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \sqrt{\mathsf{fma}\left(2 + maxCos \cdot -2, ux, \left(maxCos + -1\right) \cdot \left(\left(1 - maxCos\right) \cdot \left(ux \cdot ux\right)\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \end{array} \]
        (FPCore (ux uy maxCos)
         :precision binary32
         (*
          (sqrt
           (fma
            (+ 2.0 (* maxCos -2.0))
            ux
            (* (+ maxCos -1.0) (* (- 1.0 maxCos) (* ux ux)))))
          (sin (* 2.0 (* uy PI)))))
        float code(float ux, float uy, float maxCos) {
        	return sqrtf(fmaf((2.0f + (maxCos * -2.0f)), ux, ((maxCos + -1.0f) * ((1.0f - maxCos) * (ux * ux))))) * sinf((2.0f * (uy * ((float) M_PI))));
        }
        
        function code(ux, uy, maxCos)
        	return Float32(sqrt(fma(Float32(Float32(2.0) + Float32(maxCos * Float32(-2.0))), ux, Float32(Float32(maxCos + Float32(-1.0)) * Float32(Float32(Float32(1.0) - maxCos) * Float32(ux * ux))))) * sin(Float32(Float32(2.0) * Float32(uy * Float32(pi)))))
        end
        
        \begin{array}{l}
        
        \\
        \sqrt{\mathsf{fma}\left(2 + maxCos \cdot -2, ux, \left(maxCos + -1\right) \cdot \left(\left(1 - maxCos\right) \cdot \left(ux \cdot ux\right)\right)\right)} \cdot \sin \left(2 \cdot \left(uy \cdot \pi\right)\right)
        \end{array}
        
        Derivation
        1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

            \[\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.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(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
          12. associate--r-56.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}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
          13. neg-sub056.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}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
          14. +-commutative56.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}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
          15. sub-neg56.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}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
          16. fma-def56.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, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
        3. Simplified56.1%

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

            \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \color{blue}{\sqrt[3]{\left(\sqrt{\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)} \cdot \sqrt{\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)}\right) \cdot \sqrt{\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)}}} \]
        6. Applied egg-rr98.3%

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

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

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

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

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

          Alternative 8: 98.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(2 \cdot ux - \left(maxCos \cdot maxCos\right) \cdot \color{blue}{\left(ux \cdot ux\right)}\right) - maxCos \cdot \left(2 \cdot ux - 2 \cdot {ux}^{2}\right)\right) - {ux}^{2}} \]
            8. unswap-sqr98.2%

              \[\leadsto \sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(2 \cdot ux - \color{blue}{\left(maxCos \cdot ux\right) \cdot \left(maxCos \cdot ux\right)}\right) - maxCos \cdot \left(2 \cdot ux - 2 \cdot {ux}^{2}\right)\right) - {ux}^{2}} \]
            9. distribute-lft-out--98.2%

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

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

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

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

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

          Alternative 9: 86.1% accurate, 1.0× speedup?

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

            1. Initial program 57.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*57.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-neg57.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. +-commutative57.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-in57.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-def57.0%

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

                \[\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.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-def57.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-sub057.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. +-commutative57.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-56.9%

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

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

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

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

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

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

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

              \[\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. add-sqr-sqrt98.0%

                \[\leadsto \color{blue}{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)} \cdot \sqrt{\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)} \]
              2. pow298.0%

                \[\leadsto \color{blue}{{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)}^{2}} \cdot \sqrt{\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)} \]
            6. Applied egg-rr98.0%

              \[\leadsto \color{blue}{{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)}^{2}} \cdot \sqrt{\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)} \]
            7. Taylor expanded in uy around 0 96.9%

              \[\leadsto \color{blue}{2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{\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)}\right)} \]
            8. Step-by-step derivation
              1. associate-*l*97.0%

                \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\pi \cdot \sqrt{\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)}\right)\right)} \]
              2. fma-def97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 0.00100000005 < uy

            1. Initial program 53.9%

              \[\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*53.9%

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right) \cdot \sqrt{1 - \left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux\right) \cdot \left(\mathsf{fma}\left(ux, maxCos, 1\right) - ux\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}{\left(2 - 2 \cdot maxCos\right) \cdot ux}} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification88.4%

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

          Alternative 10: 92.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

              \[\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.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(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
            12. associate--r-56.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}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
            13. neg-sub056.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}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
            14. +-commutative56.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}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
            15. sub-neg56.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}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
            16. fma-def56.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, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
          3. Simplified56.1%

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

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

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

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

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

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

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

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

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

          Alternative 11: 85.0% accurate, 1.0× speedup?

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

            1. Initial program 57.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*57.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-neg57.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. +-commutative57.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-in57.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-def57.0%

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

                \[\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.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-def57.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-sub057.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. +-commutative57.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-56.9%

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

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

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

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

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

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

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

              \[\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. add-sqr-sqrt98.0%

                \[\leadsto \color{blue}{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)} \cdot \sqrt{\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)} \]
              2. pow298.0%

                \[\leadsto \color{blue}{{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)}^{2}} \cdot \sqrt{\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)} \]
            6. Applied egg-rr98.0%

              \[\leadsto \color{blue}{{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)}^{2}} \cdot \sqrt{\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)} \]
            7. Taylor expanded in uy around 0 96.9%

              \[\leadsto \color{blue}{2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{\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)}\right)} \]
            8. Step-by-step derivation
              1. associate-*l*97.0%

                \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\pi \cdot \sqrt{\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)}\right)\right)} \]
              2. fma-def97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 0.00100000005 < uy

            1. Initial program 53.9%

              \[\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*53.9%

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

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

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

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

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

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

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

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

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

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

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

          Alternative 12: 65.4% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

              \[\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.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(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
            12. associate--r-56.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}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
            13. neg-sub056.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}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
            14. +-commutative56.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}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
            15. sub-neg56.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}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
            16. fma-def56.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, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
          3. Simplified56.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\color{blue}{ux \cdot \left(2 - 2 \cdot maxCos\right)}}\right)\right) \]
            3. cancel-sign-sub-inv67.2%

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

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

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

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

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

          Alternative 13: 76.5% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

              \[\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.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(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
            12. associate--r-56.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}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
            13. neg-sub056.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}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
            14. +-commutative56.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}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
            15. sub-neg56.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}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
            16. fma-def56.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, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
          3. Simplified56.1%

            \[\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. add-sqr-sqrt94.7%

              \[\leadsto \color{blue}{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)} \cdot \sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)} \cdot \sqrt{\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)} \]
            2. pow294.7%

              \[\leadsto \color{blue}{{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)}^{2}} \cdot \sqrt{\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)} \]
          6. Applied egg-rr94.7%

            \[\leadsto \color{blue}{{\left(\sqrt{\sin \left(uy \cdot \left(2 \cdot \pi\right)\right)}\right)}^{2}} \cdot \sqrt{\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)} \]
          7. Taylor expanded in uy around 0 81.6%

            \[\leadsto \color{blue}{2 \cdot \left(\left(uy \cdot \pi\right) \cdot \sqrt{\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)}\right)} \]
          8. Step-by-step derivation
            1. associate-*l*81.6%

              \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\pi \cdot \sqrt{\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)}\right)\right)} \]
            2. fma-def81.6%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \left(uy \cdot \color{blue}{\left(\pi \cdot \sqrt{-1 \cdot {ux}^{2} + 2 \cdot ux}\right)}\right) \]
          11. Step-by-step derivation
            1. +-commutative78.9%

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

              \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{2 \cdot ux + \color{blue}{\left(-{ux}^{2}\right)}}\right)\right) \]
            3. unsub-neg78.9%

              \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\color{blue}{2 \cdot ux - {ux}^{2}}}\right)\right) \]
            4. unpow278.9%

              \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{2 \cdot ux - \color{blue}{ux \cdot ux}}\right)\right) \]
          12. Simplified78.9%

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

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

          Alternative 14: 62.6% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

              \[\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.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(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
            12. associate--r-56.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}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
            13. neg-sub056.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}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
            14. +-commutative56.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}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
            15. sub-neg56.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}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
            16. fma-def56.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, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
          3. Simplified56.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 15: 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 56.1%

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

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

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

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

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

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

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

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

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

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

              \[\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.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(\left(ux \cdot maxCos + 1\right) - ux\right)}, 1\right)} \]
            12. associate--r-56.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}{\left(0 - \left(ux \cdot maxCos + 1\right)\right) + ux}, 1\right)} \]
            13. neg-sub056.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}{\left(-\left(ux \cdot maxCos + 1\right)\right)} + ux, 1\right)} \]
            14. +-commutative56.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}{ux + \left(-\left(ux \cdot maxCos + 1\right)\right)}, 1\right)} \]
            15. sub-neg56.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}{ux - \left(ux \cdot maxCos + 1\right)}, 1\right)} \]
            16. fma-def56.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, ux - \color{blue}{\mathsf{fma}\left(ux, maxCos, 1\right)}, 1\right)} \]
          3. Simplified56.1%

            \[\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 49.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 2023238 
          (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)))))))