UniformSampleCone, y

Percentage Accurate: 57.5% → 98.3%
Time: 11.5s
Alternatives: 22
Speedup: 5.0×

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} 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} \]
(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}
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}

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 22 alternatives:

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

Initial Program: 57.5% accurate, 1.0× speedup?

\[\begin{array}{l} 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} \]
(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}
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}

Alternative 1: 98.3% accurate, 0.9× speedup?

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

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
    2. lift-*.f32N/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    4. sqr-neg-revN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
    5. difference-of-squaresN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
    6. +-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
    7. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
    8. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
    9. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
    10. sub-negateN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
    11. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
    12. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    13. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
    14. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    15. lower-*.f32N/A

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}} \]
  4. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}} \]
    2. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right)} \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    3. --rgt-identityN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right)} \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    4. lift--.f32N/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \color{blue}{\left(\left(maxCos \cdot ux - -1\right) + \left(\mathsf{neg}\left(\left(ux - 1\right)\right)\right)\right)}} \]
    6. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(maxCos \cdot ux - -1\right) + \left(\mathsf{neg}\left(\color{blue}{\left(ux - 1\right)}\right)\right)\right)} \]
    7. sub-negate-revN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(maxCos \cdot ux - -1\right) + \color{blue}{\left(1 - ux\right)}\right)} \]
    8. distribute-rgt-inN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(maxCos \cdot ux - -1\right) \cdot \left(ux - maxCos \cdot ux\right) + \left(1 - ux\right) \cdot \left(ux - maxCos \cdot ux\right)}} \]
    9. lower-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(maxCos \cdot ux - -1\right) \cdot \left(ux - maxCos \cdot ux\right) + \left(1 - ux\right) \cdot \left(ux - maxCos \cdot ux\right)}} \]
    10. lower-*.f32N/A

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

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

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

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos \cdot ux - -1\right) \cdot \color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right)} + \left(1 - ux\right) \cdot \left(ux - maxCos \cdot ux\right)} \]
  7. Step-by-step derivation
    1. lower-*.f32N/A

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

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

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(maxCos \cdot ux - -1\right) \cdot \left(ux \cdot \left(1 - maxCos\right)\right) + \left(1 - ux\right) \cdot \color{blue}{\left(ux \cdot \left(1 - maxCos\right)\right)}} \]
  10. Step-by-step derivation
    1. lower-*.f32N/A

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

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

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

Alternative 2: 98.3% accurate, 1.0× speedup?

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

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
    2. lift-*.f32N/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    4. sqr-neg-revN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
    5. difference-of-squaresN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
    6. +-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
    7. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
    8. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
    9. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
    10. sub-negateN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
    11. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
    12. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    13. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
    14. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    15. lower-*.f32N/A

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

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\color{blue}{ux \cdot \left(1 - maxCos\right)} - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
  5. Step-by-step derivation
    1. lower-*.f32N/A

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

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\color{blue}{ux \cdot \left(1 - maxCos\right)} - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
  7. Add Preprocessing

Alternative 3: 98.3% accurate, 1.0× speedup?

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

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
    2. lift-*.f32N/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    4. sqr-neg-revN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
    5. difference-of-squaresN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
    6. +-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
    7. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
    8. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
    9. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
    10. sub-negateN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
    11. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
    12. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    13. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
    14. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    15. lower-*.f32N/A

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}} \]
  4. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}} \]
    2. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right)} \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    3. --rgt-identityN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right)} \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    4. *-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right) \cdot \left(ux - maxCos \cdot ux\right)}} \]
    5. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \cdot \left(ux - maxCos \cdot ux\right)} \]
    6. sub-negate-revN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\left(ux - 1\right) - \left(maxCos \cdot ux - -1\right)\right)\right)\right)} \cdot \left(ux - maxCos \cdot ux\right)} \]
    7. distribute-lft-neg-outN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\mathsf{neg}\left(\left(\left(ux - 1\right) - \left(maxCos \cdot ux - -1\right)\right) \cdot \left(ux - maxCos \cdot ux\right)\right)}} \]
    8. lower-neg.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{-\left(\left(ux - 1\right) - \left(maxCos \cdot ux - -1\right)\right) \cdot \left(ux - maxCos \cdot ux\right)}} \]
    9. lower-*.f32N/A

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

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

Alternative 4: 98.3% accurate, 1.0× speedup?

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

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
    2. lift-*.f32N/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    4. sqr-neg-revN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
    5. difference-of-squaresN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
    6. +-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
    7. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
    8. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
    9. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
    10. sub-negateN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
    11. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
    12. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    13. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
    14. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    15. lower-*.f32N/A

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

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

    \[\leadsto \color{blue}{\sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}} \]
  5. Step-by-step derivation
    1. lower-*.f32N/A

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

      \[\leadsto \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}} \]
    3. lower-*.f32N/A

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

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

      \[\leadsto \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{\left(ux - maxCos \cdot \color{blue}{ux}\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)} \]
    6. lower-sqrt.f32N/A

      \[\leadsto \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)} \]
    7. lower-*.f32N/A

      \[\leadsto \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)} \]
    8. lower--.f32N/A

      \[\leadsto \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)} \]
    9. lower-*.f32N/A

      \[\leadsto \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)} \]
    10. lower--.f32N/A

      \[\leadsto \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)} \]
    11. lower-+.f32N/A

      \[\leadsto \sin \left(2 \cdot \left(uy \cdot \pi\right)\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)} \]
    12. lower-*.f3298.3%

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

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

Alternative 5: 98.3% accurate, 1.1× speedup?

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

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
    2. lift-*.f32N/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    4. sqr-neg-revN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
    5. difference-of-squaresN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
    6. +-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
    7. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
    8. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
    9. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
    10. sub-negateN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
    11. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
    12. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    13. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
    14. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    15. lower-*.f32N/A

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}} \]
  4. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}} \]
    2. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right)} \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    3. --rgt-identityN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right)} \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    4. lift--.f32N/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \color{blue}{\left(\left(maxCos \cdot ux - -1\right) + \left(\mathsf{neg}\left(\left(ux - 1\right)\right)\right)\right)}} \]
    6. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(maxCos \cdot ux - -1\right) + \left(\mathsf{neg}\left(\color{blue}{\left(ux - 1\right)}\right)\right)\right)} \]
    7. sub-negate-revN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(maxCos \cdot ux - -1\right) + \color{blue}{\left(1 - ux\right)}\right)} \]
    8. distribute-rgt-inN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(maxCos \cdot ux - -1\right) \cdot \left(ux - maxCos \cdot ux\right) + \left(1 - ux\right) \cdot \left(ux - maxCos \cdot ux\right)}} \]
    9. lower-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(maxCos \cdot ux - -1\right) \cdot \left(ux - maxCos \cdot ux\right) + \left(1 - ux\right) \cdot \left(ux - maxCos \cdot ux\right)}} \]
    10. lower-*.f32N/A

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

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

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

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

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

Alternative 6: 97.1% accurate, 1.1× speedup?

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

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


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

    1. Initial program 57.5%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{\left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2 \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. lower-PI.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      9. lower-PI.f3289.1%

        \[\leadsto \left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    6. Applied rewrites89.1%

      \[\leadsto \color{blue}{\left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    7. Step-by-step derivation
      1. lift-+.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \color{blue}{2 \cdot \pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      2. sum-to-multN/A

        \[\leadsto \left(uy \cdot \left(\left(1 + \frac{2 \cdot \pi}{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right) \cdot \color{blue}{\left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-unsound-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(1 + \frac{2 \cdot \pi}{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right) \cdot \color{blue}{\left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    8. Applied rewrites88.9%

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

    if 0.0149999997 < uy

    1. Initial program 57.5%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}} \]
    4. Step-by-step derivation
      1. lift-*.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}} \]
      2. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(ux - maxCos \cdot ux\right) - 0\right)} \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. --rgt-identityN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right)} \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. lift--.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \color{blue}{\left(\left(maxCos \cdot ux - -1\right) + \left(\mathsf{neg}\left(\left(ux - 1\right)\right)\right)\right)}} \]
      6. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(maxCos \cdot ux - -1\right) + \left(\mathsf{neg}\left(\color{blue}{\left(ux - 1\right)}\right)\right)\right)} \]
      7. sub-negate-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(maxCos \cdot ux - -1\right) + \color{blue}{\left(1 - ux\right)}\right)} \]
      8. distribute-rgt-inN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(maxCos \cdot ux - -1\right) \cdot \left(ux - maxCos \cdot ux\right) + \left(1 - ux\right) \cdot \left(ux - maxCos \cdot ux\right)}} \]
      9. lower-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(maxCos \cdot ux - -1\right) \cdot \left(ux - maxCos \cdot ux\right) + \left(1 - ux\right) \cdot \left(ux - maxCos \cdot ux\right)}} \]
      10. lower-*.f32N/A

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{ux + ux \cdot \left(1 - ux\right)}} \]
    7. Step-by-step derivation
      1. lower-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{ux + \color{blue}{ux \cdot \left(1 - ux\right)}} \]
      2. lower-*.f32N/A

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

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

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

Alternative 7: 97.1% accurate, 1.1× speedup?

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

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


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

    1. Initial program 57.5%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{\left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2 \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. lower-PI.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      9. lower-PI.f3289.1%

        \[\leadsto \left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    6. Applied rewrites89.1%

      \[\leadsto \color{blue}{\left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    7. Step-by-step derivation
      1. lift-+.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \color{blue}{2 \cdot \pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      2. sum-to-multN/A

        \[\leadsto \left(uy \cdot \left(\left(1 + \frac{2 \cdot \pi}{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right) \cdot \color{blue}{\left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-unsound-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(1 + \frac{2 \cdot \pi}{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right) \cdot \color{blue}{\left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    8. Applied rewrites88.9%

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

    if 0.0149999997 < uy

    1. Initial program 57.5%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{ux \cdot \left(2 - ux\right)}} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

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

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

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

Alternative 8: 97.0% accurate, 1.1× speedup?

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

    \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  2. Step-by-step derivation
    1. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
    2. lift-*.f32N/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    4. sqr-neg-revN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
    5. difference-of-squaresN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
    6. +-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
    7. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
    8. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
    9. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
    10. sub-negateN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
    11. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
    12. associate-+l-N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    13. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
    14. lift-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
    15. lower-*.f32N/A

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

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

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

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

    Alternative 9: 97.0% accurate, 1.1× speedup?

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

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \color{blue}{\left(2 - ux\right)}} \]
    7. Add Preprocessing

    Alternative 10: 93.7% accurate, 1.1× speedup?

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

      1. Initial program 57.5%

        \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      2. Step-by-step derivation
        1. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
        2. lift-*.f32N/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        4. sqr-neg-revN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
        5. difference-of-squaresN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
        6. +-commutativeN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
        7. lift-+.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
        8. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
        9. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
        10. sub-negateN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
        11. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
        12. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
        13. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
        14. lift-+.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
        15. lower-*.f32N/A

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

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

        \[\leadsto \color{blue}{\left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. Step-by-step derivation
        1. lower-*.f32N/A

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

          \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2 \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
        3. lower-*.f32N/A

          \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
        4. lower-*.f32N/A

          \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
        5. lower-pow.f32N/A

          \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
        6. lower-pow.f32N/A

          \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
        7. lower-PI.f32N/A

          \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
        8. lower-*.f32N/A

          \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
        9. lower-PI.f3289.1%

          \[\leadsto \left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. Applied rewrites89.1%

        \[\leadsto \color{blue}{\left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. Step-by-step derivation
        1. lift-+.f32N/A

          \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \color{blue}{2 \cdot \pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
        2. sum-to-multN/A

          \[\leadsto \left(uy \cdot \left(\left(1 + \frac{2 \cdot \pi}{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right) \cdot \color{blue}{\left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
        3. lower-unsound-*.f32N/A

          \[\leadsto \left(uy \cdot \left(\left(1 + \frac{2 \cdot \pi}{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right) \cdot \color{blue}{\left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. Applied rewrites88.9%

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

      if 0.0320000015 < uy

      1. Initial program 57.5%

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{ux \cdot \left(2 - 2 \cdot maxCos\right)}} \]
      3. Step-by-step derivation
        1. lower-*.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{ux \cdot \color{blue}{\left(2 - 2 \cdot maxCos\right)}} \]
        2. lower--.f32N/A

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{2 \cdot \color{blue}{ux}} \]
      6. Step-by-step derivation
        1. lower-*.f3273.0%

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{2 \cdot ux} \]
      7. Applied rewrites73.0%

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

    Alternative 11: 89.1% accurate, 1.3× speedup?

    \[\begin{array}{l} t_0 := \left(\left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\\ \left(uy \cdot \left(\left(1 + \frac{\pi + \pi}{t\_0}\right) \cdot t\_0\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \end{array} \]
    (FPCore (ux uy maxCos)
      :precision binary32
      (let* ((t_0 (* (* (* (* uy uy) -1.3333333333333333) PI) (* PI PI))))
      (*
       (* uy (* (+ 1.0 (/ (+ PI PI) t_0)) t_0))
       (sqrt
        (*
         (- (- ux (* maxCos ux)) 0.0)
         (- (- (* maxCos ux) -1.0) (- ux 1.0)))))))
    float code(float ux, float uy, float maxCos) {
    	float t_0 = (((uy * uy) * -1.3333333333333333f) * ((float) M_PI)) * (((float) M_PI) * ((float) M_PI));
    	return (uy * ((1.0f + ((((float) M_PI) + ((float) M_PI)) / t_0)) * t_0)) * sqrtf((((ux - (maxCos * ux)) - 0.0f) * (((maxCos * ux) - -1.0f) - (ux - 1.0f))));
    }
    
    function code(ux, uy, maxCos)
    	t_0 = Float32(Float32(Float32(Float32(uy * uy) * Float32(-1.3333333333333333)) * Float32(pi)) * Float32(Float32(pi) * Float32(pi)))
    	return Float32(Float32(uy * Float32(Float32(Float32(1.0) + Float32(Float32(Float32(pi) + Float32(pi)) / t_0)) * t_0)) * sqrt(Float32(Float32(Float32(ux - Float32(maxCos * ux)) - Float32(0.0)) * Float32(Float32(Float32(maxCos * ux) - Float32(-1.0)) - Float32(ux - Float32(1.0))))))
    end
    
    function tmp = code(ux, uy, maxCos)
    	t_0 = (((uy * uy) * single(-1.3333333333333333)) * single(pi)) * (single(pi) * single(pi));
    	tmp = (uy * ((single(1.0) + ((single(pi) + single(pi)) / t_0)) * t_0)) * sqrt((((ux - (maxCos * ux)) - single(0.0)) * (((maxCos * ux) - single(-1.0)) - (ux - single(1.0)))));
    end
    
    \begin{array}{l}
    t_0 := \left(\left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\\
    \left(uy \cdot \left(\left(1 + \frac{\pi + \pi}{t\_0}\right) \cdot t\_0\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}
    \end{array}
    
    Derivation
    1. Initial program 57.5%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{\left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2 \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. lower-PI.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      9. lower-PI.f3289.1%

        \[\leadsto \left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    6. Applied rewrites89.1%

      \[\leadsto \color{blue}{\left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    7. Step-by-step derivation
      1. lift-+.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \color{blue}{2 \cdot \pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      2. sum-to-multN/A

        \[\leadsto \left(uy \cdot \left(\left(1 + \frac{2 \cdot \pi}{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right) \cdot \color{blue}{\left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-unsound-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(1 + \frac{2 \cdot \pi}{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right) \cdot \color{blue}{\left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    8. Applied rewrites88.9%

      \[\leadsto \left(uy \cdot \left(\left(1 + \frac{\pi + \pi}{\left(\left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)}\right) \cdot \color{blue}{\left(\left(\left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    9. Add Preprocessing

    Alternative 12: 89.1% accurate, 1.5× speedup?

    \[\left(uy \cdot \left(\left(1 + \frac{\left(\left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)}{\pi + \pi}\right) \cdot \left(\pi + \pi\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    (FPCore (ux uy maxCos)
      :precision binary32
      (*
     (*
      uy
      (*
       (+
        1.0
        (/
         (* (* (* (* uy uy) -1.3333333333333333) PI) (* PI PI))
         (+ PI PI)))
       (+ PI PI)))
     (sqrt
      (*
       (- (- ux (* maxCos ux)) 0.0)
       (- (- (* maxCos ux) -1.0) (- ux 1.0))))))
    float code(float ux, float uy, float maxCos) {
    	return (uy * ((1.0f + (((((uy * uy) * -1.3333333333333333f) * ((float) M_PI)) * (((float) M_PI) * ((float) M_PI))) / (((float) M_PI) + ((float) M_PI)))) * (((float) M_PI) + ((float) M_PI)))) * sqrtf((((ux - (maxCos * ux)) - 0.0f) * (((maxCos * ux) - -1.0f) - (ux - 1.0f))));
    }
    
    function code(ux, uy, maxCos)
    	return Float32(Float32(uy * Float32(Float32(Float32(1.0) + Float32(Float32(Float32(Float32(Float32(uy * uy) * Float32(-1.3333333333333333)) * Float32(pi)) * Float32(Float32(pi) * Float32(pi))) / Float32(Float32(pi) + Float32(pi)))) * Float32(Float32(pi) + Float32(pi)))) * sqrt(Float32(Float32(Float32(ux - Float32(maxCos * ux)) - Float32(0.0)) * Float32(Float32(Float32(maxCos * ux) - Float32(-1.0)) - Float32(ux - Float32(1.0))))))
    end
    
    function tmp = code(ux, uy, maxCos)
    	tmp = (uy * ((single(1.0) + (((((uy * uy) * single(-1.3333333333333333)) * single(pi)) * (single(pi) * single(pi))) / (single(pi) + single(pi)))) * (single(pi) + single(pi)))) * sqrt((((ux - (maxCos * ux)) - single(0.0)) * (((maxCos * ux) - single(-1.0)) - (ux - single(1.0)))));
    end
    
    \left(uy \cdot \left(\left(1 + \frac{\left(\left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)}{\pi + \pi}\right) \cdot \left(\pi + \pi\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}
    
    Derivation
    1. Initial program 57.5%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{\left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2 \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. lower-PI.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      9. lower-PI.f3289.1%

        \[\leadsto \left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    6. Applied rewrites89.1%

      \[\leadsto \color{blue}{\left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    7. Step-by-step derivation
      1. lift-+.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \color{blue}{2 \cdot \pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(uy \cdot \left(2 \cdot \pi + \color{blue}{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. sum-to-multN/A

        \[\leadsto \left(uy \cdot \left(\left(1 + \frac{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}{2 \cdot \pi}\right) \cdot \color{blue}{\left(2 \cdot \pi\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. lower-unsound-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(1 + \frac{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}{2 \cdot \pi}\right) \cdot \color{blue}{\left(2 \cdot \pi\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    8. Applied rewrites89.1%

      \[\leadsto \left(uy \cdot \left(\left(1 + \frac{\left(\left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)}{\pi + \pi}\right) \cdot \color{blue}{\left(\pi + \pi\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    9. Add Preprocessing

    Alternative 13: 89.1% accurate, 1.9× speedup?

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

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{\left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2 \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. lower-PI.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      9. lower-PI.f3289.1%

        \[\leadsto \left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    6. Applied rewrites89.1%

      \[\leadsto \color{blue}{\left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    7. Step-by-step derivation
      1. lift-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \color{blue}{2} \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(uy \cdot \left(\left({uy}^{2} \cdot {\pi}^{3}\right) \cdot \frac{-4}{3} + \color{blue}{2} \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lift-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left({uy}^{2} \cdot {\pi}^{3}\right) \cdot \frac{-4}{3} + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. associate-*l*N/A

        \[\leadsto \left(uy \cdot \left({uy}^{2} \cdot \left({\pi}^{3} \cdot \frac{-4}{3}\right) + \color{blue}{2} \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left({uy}^{2} \cdot \left({\pi}^{3} \cdot \frac{-4}{3}\right) + \color{blue}{2} \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. lift-pow.f32N/A

        \[\leadsto \left(uy \cdot \left({uy}^{2} \cdot \left({\pi}^{3} \cdot \frac{-4}{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. unpow2N/A

        \[\leadsto \left(uy \cdot \left(\left(uy \cdot uy\right) \cdot \left({\pi}^{3} \cdot \frac{-4}{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(uy \cdot uy\right) \cdot \left({\pi}^{3} \cdot \frac{-4}{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      9. lower-*.f3289.1%

        \[\leadsto \left(uy \cdot \left(\left(uy \cdot uy\right) \cdot \left({\pi}^{3} \cdot -1.3333333333333333\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      10. lift-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(uy \cdot uy\right) \cdot \left({\pi}^{3} \cdot \frac{-4}{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      11. unpow3N/A

        \[\leadsto \left(uy \cdot \left(\left(uy \cdot uy\right) \cdot \left(\left(\left(\pi \cdot \pi\right) \cdot \pi\right) \cdot \frac{-4}{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      12. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(uy \cdot uy\right) \cdot \left(\left(\left(\pi \cdot \pi\right) \cdot \pi\right) \cdot \frac{-4}{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      13. lower-*.f3289.1%

        \[\leadsto \left(uy \cdot \left(\left(uy \cdot uy\right) \cdot \left(\left(\left(\pi \cdot \pi\right) \cdot \pi\right) \cdot -1.3333333333333333\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    8. Applied rewrites89.1%

      \[\leadsto \left(uy \cdot \left(\left(uy \cdot uy\right) \cdot \left(\left(\left(\pi \cdot \pi\right) \cdot \pi\right) \cdot -1.3333333333333333\right) + \color{blue}{2} \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    9. Add Preprocessing

    Alternative 14: 89.1% accurate, 1.9× speedup?

    \[\left(uy \cdot \left(\left(\pi + \pi\right) - 1.3333333333333333 \cdot \left(\left(\left(uy \cdot uy\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    (FPCore (ux uy maxCos)
      :precision binary32
      (*
     (*
      uy
      (- (+ PI PI) (* 1.3333333333333333 (* (* (* uy uy) PI) (* PI PI)))))
     (sqrt
      (*
       (- (- ux (* maxCos ux)) 0.0)
       (- (- (* maxCos ux) -1.0) (- ux 1.0))))))
    float code(float ux, float uy, float maxCos) {
    	return (uy * ((((float) M_PI) + ((float) M_PI)) - (1.3333333333333333f * (((uy * uy) * ((float) M_PI)) * (((float) M_PI) * ((float) M_PI)))))) * sqrtf((((ux - (maxCos * ux)) - 0.0f) * (((maxCos * ux) - -1.0f) - (ux - 1.0f))));
    }
    
    function code(ux, uy, maxCos)
    	return Float32(Float32(uy * Float32(Float32(Float32(pi) + Float32(pi)) - Float32(Float32(1.3333333333333333) * Float32(Float32(Float32(uy * uy) * Float32(pi)) * Float32(Float32(pi) * Float32(pi)))))) * sqrt(Float32(Float32(Float32(ux - Float32(maxCos * ux)) - Float32(0.0)) * Float32(Float32(Float32(maxCos * ux) - Float32(-1.0)) - Float32(ux - Float32(1.0))))))
    end
    
    function tmp = code(ux, uy, maxCos)
    	tmp = (uy * ((single(pi) + single(pi)) - (single(1.3333333333333333) * (((uy * uy) * single(pi)) * (single(pi) * single(pi)))))) * sqrt((((ux - (maxCos * ux)) - single(0.0)) * (((maxCos * ux) - single(-1.0)) - (ux - single(1.0)))));
    end
    
    \left(uy \cdot \left(\left(\pi + \pi\right) - 1.3333333333333333 \cdot \left(\left(\left(uy \cdot uy\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}
    
    Derivation
    1. Initial program 57.5%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{\left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2 \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. lower-PI.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      9. lower-PI.f3289.1%

        \[\leadsto \left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    6. Applied rewrites89.1%

      \[\leadsto \color{blue}{\left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    7. Step-by-step derivation
      1. lift-+.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \color{blue}{2 \cdot \pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto \left(uy \cdot \left(2 \cdot \pi + \color{blue}{\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lift-*.f32N/A

        \[\leadsto \left(uy \cdot \left(2 \cdot \pi + \frac{-4}{3} \cdot \color{blue}{\left({uy}^{2} \cdot {\pi}^{3}\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. fp-cancel-sign-sub-invN/A

        \[\leadsto \left(uy \cdot \left(2 \cdot \pi - \color{blue}{\left(\mathsf{neg}\left(\frac{-4}{3}\right)\right) \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower--.f32N/A

        \[\leadsto \left(uy \cdot \left(2 \cdot \pi - \color{blue}{\left(\mathsf{neg}\left(\frac{-4}{3}\right)\right) \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. lift-*.f32N/A

        \[\leadsto \left(uy \cdot \left(2 \cdot \pi - \color{blue}{\left(\mathsf{neg}\left(\frac{-4}{3}\right)\right)} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. count-2-revN/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \color{blue}{\left(\mathsf{neg}\left(\frac{-4}{3}\right)\right)} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. lower-+.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \color{blue}{\left(\mathsf{neg}\left(\frac{-4}{3}\right)\right)} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      9. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \left(\mathsf{neg}\left(\frac{-4}{3}\right)\right) \cdot \color{blue}{\left({uy}^{2} \cdot {\pi}^{3}\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      10. metadata-eval89.1%

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - 1.3333333333333333 \cdot \left(\color{blue}{{uy}^{2}} \cdot {\pi}^{3}\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      11. lift-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left({uy}^{2} \cdot \color{blue}{{\pi}^{3}}\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      12. lift-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{\color{blue}{3}}\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      13. cube-multN/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left({uy}^{2} \cdot \left(\pi \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right)\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      14. associate-*r*N/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left({uy}^{2} \cdot \pi\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      15. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left({uy}^{2} \cdot \pi\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      16. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left({uy}^{2} \cdot \pi\right) \cdot \left(\color{blue}{\pi} \cdot \pi\right)\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      17. lift-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left({uy}^{2} \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      18. unpow2N/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left(\left(uy \cdot uy\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      19. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left(\left(uy \cdot uy\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      20. lower-*.f3289.1%

        \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - 1.3333333333333333 \cdot \left(\left(\left(uy \cdot uy\right) \cdot \pi\right) \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    8. Applied rewrites89.1%

      \[\leadsto \left(uy \cdot \left(\left(\pi + \pi\right) - \color{blue}{1.3333333333333333 \cdot \left(\left(\left(uy \cdot uy\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    9. Add Preprocessing

    Alternative 15: 89.1% accurate, 1.9× speedup?

    \[\left(uy \cdot \left(\left(\left(\left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right) + \pi\right) + \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    (FPCore (ux uy maxCos)
      :precision binary32
      (*
     (*
      uy
      (+
       (+ (* (* (* (* uy uy) -1.3333333333333333) PI) (* PI PI)) PI)
       PI))
     (sqrt
      (*
       (- (- ux (* maxCos ux)) 0.0)
       (- (- (* maxCos ux) -1.0) (- ux 1.0))))))
    float code(float ux, float uy, float maxCos) {
    	return (uy * ((((((uy * uy) * -1.3333333333333333f) * ((float) M_PI)) * (((float) M_PI) * ((float) M_PI))) + ((float) M_PI)) + ((float) M_PI))) * sqrtf((((ux - (maxCos * ux)) - 0.0f) * (((maxCos * ux) - -1.0f) - (ux - 1.0f))));
    }
    
    function code(ux, uy, maxCos)
    	return Float32(Float32(uy * Float32(Float32(Float32(Float32(Float32(Float32(uy * uy) * Float32(-1.3333333333333333)) * Float32(pi)) * Float32(Float32(pi) * Float32(pi))) + Float32(pi)) + Float32(pi))) * sqrt(Float32(Float32(Float32(ux - Float32(maxCos * ux)) - Float32(0.0)) * Float32(Float32(Float32(maxCos * ux) - Float32(-1.0)) - Float32(ux - Float32(1.0))))))
    end
    
    function tmp = code(ux, uy, maxCos)
    	tmp = (uy * ((((((uy * uy) * single(-1.3333333333333333)) * single(pi)) * (single(pi) * single(pi))) + single(pi)) + single(pi))) * sqrt((((ux - (maxCos * ux)) - single(0.0)) * (((maxCos * ux) - single(-1.0)) - (ux - single(1.0)))));
    end
    
    \left(uy \cdot \left(\left(\left(\left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right) + \pi\right) + \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)}
    
    Derivation
    1. Initial program 57.5%

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{\left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2 \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. lower-PI.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      9. lower-PI.f3289.1%

        \[\leadsto \left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    6. Applied rewrites89.1%

      \[\leadsto \color{blue}{\left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    7. Step-by-step derivation
      1. lift-+.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \color{blue}{2 \cdot \pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      2. lift-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. count-2-revN/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \left(\pi + \color{blue}{\pi}\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. associate-+r+N/A

        \[\leadsto \left(uy \cdot \left(\left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \pi\right) + \color{blue}{\pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower-+.f32N/A

        \[\leadsto \left(uy \cdot \left(\left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + \pi\right) + \color{blue}{\pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    8. Applied rewrites89.1%

      \[\leadsto \left(uy \cdot \left(\left(\left(\left(\left(uy \cdot uy\right) \cdot -1.3333333333333333\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right) + \pi\right) + \color{blue}{\pi}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    9. Add Preprocessing

    Alternative 16: 88.9% accurate, 2.1× speedup?

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

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{\left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2 \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      3. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      4. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      5. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      6. lower-pow.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      7. lower-PI.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      8. lower-*.f32N/A

        \[\leadsto \left(uy \cdot \left(\frac{-4}{3} \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
      9. lower-PI.f3289.1%

        \[\leadsto \left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right) \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    6. Applied rewrites89.1%

      \[\leadsto \color{blue}{\left(uy \cdot \left(-1.3333333333333333 \cdot \left({uy}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right)\right)} \cdot \sqrt{\left(\left(ux - maxCos \cdot ux\right) - 0\right) \cdot \left(\left(maxCos \cdot ux - -1\right) - \left(ux - 1\right)\right)} \]
    7. Applied rewrites89.1%

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

    Alternative 17: 81.4% accurate, 3.3× speedup?

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

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

        \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
      2. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)}\right) \]
      3. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
      4. lower-PI.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
      5. lower-sqrt.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      6. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      7. lower--.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      8. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      9. lower--.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      10. lower-+.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      11. lower-*.f3281.4%

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
    6. Applied rewrites81.4%

      \[\leadsto \color{blue}{2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
    7. Step-by-step derivation
      1. lift-*.f32N/A

        \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
      2. lift-*.f32N/A

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

        \[\leadsto \left(2 \cdot uy\right) \cdot \color{blue}{\left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)} \]
      4. *-commutativeN/A

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

        \[\leadsto \left(uy \cdot 2\right) \cdot \left(\color{blue}{\pi} \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right) \]
      6. lift-*.f32N/A

        \[\leadsto \left(uy \cdot 2\right) \cdot \left(\pi \cdot \color{blue}{\sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right) \]
      7. *-commutativeN/A

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

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right) \cdot \color{blue}{\pi} \]
      9. lower-*.f32N/A

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

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

    Alternative 18: 81.4% accurate, 3.3× speedup?

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

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

        \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
      2. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)}\right) \]
      3. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
      4. lower-PI.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
      5. lower-sqrt.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      6. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      7. lower--.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      8. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      9. lower--.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      10. lower-+.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      11. lower-*.f3281.4%

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
    6. Applied rewrites81.4%

      \[\leadsto \color{blue}{2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
    7. Step-by-step derivation
      1. lift-*.f32N/A

        \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
      2. lift-*.f32N/A

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

        \[\leadsto \left(2 \cdot uy\right) \cdot \color{blue}{\left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)} \]
      4. *-commutativeN/A

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

        \[\leadsto \left(uy \cdot 2\right) \cdot \left(\color{blue}{\pi} \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right) \]
      6. lift-*.f32N/A

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

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \color{blue}{\sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}} \]
      8. lift-*.f32N/A

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}} \]
      9. lift-*.f32N/A

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)} \]
      10. lift--.f32N/A

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)} \]
      11. sub-negate-revN/A

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(ux - \left(2 + maxCos \cdot ux\right)\right)\right)\right)} \]
      12. lift-+.f32N/A

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(ux - \left(2 + maxCos \cdot ux\right)\right)\right)\right)} \]
      13. +-commutativeN/A

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(ux - \left(maxCos \cdot ux + 2\right)\right)\right)\right)} \]
      14. associate--l-N/A

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\left(ux - maxCos \cdot ux\right) - 2\right)\right)\right)} \]
      15. lift--.f32N/A

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\left(ux - maxCos \cdot ux\right) - 2\right)\right)\right)} \]
      16. lift--.f32N/A

        \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\left(ux - maxCos \cdot ux\right) - 2\right)\right)\right)} \]
    8. Applied rewrites81.4%

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

    Alternative 19: 80.6% accurate, 3.7× speedup?

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

      \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
      2. lift-*.f32N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. sqr-neg-revN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
      5. difference-of-squaresN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
      6. +-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
      7. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
      8. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
      9. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
      10. sub-negateN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
      11. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
      12. associate-+l-N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      13. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
      14. lift-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
      15. lower-*.f32N/A

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

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

      \[\leadsto \color{blue}{2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
    5. Step-by-step derivation
      1. lower-*.f32N/A

        \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
      2. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)}\right) \]
      3. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
      4. lower-PI.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
      5. lower-sqrt.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      6. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      7. lower--.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      8. lower-*.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      9. lower--.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      10. lower-+.f32N/A

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      11. lower-*.f3281.4%

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
    6. Applied rewrites81.4%

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

      \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(2 - ux\right)}\right)\right) \]
    8. Step-by-step derivation
      1. Applied rewrites80.6%

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

      Alternative 20: 77.0% accurate, 4.9× speedup?

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

        \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      2. Step-by-step derivation
        1. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
        2. lift-*.f32N/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        4. sqr-neg-revN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
        5. difference-of-squaresN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
        6. +-commutativeN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
        7. lift-+.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
        8. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
        9. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
        10. sub-negateN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
        11. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
        12. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
        13. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
        14. lift-+.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
        15. lower-*.f32N/A

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

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

        \[\leadsto \color{blue}{2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
      5. Step-by-step derivation
        1. lower-*.f32N/A

          \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
        2. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)}\right) \]
        3. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
        4. lower-PI.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
        5. lower-sqrt.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        6. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        7. lower--.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        8. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        9. lower--.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        10. lower-+.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        11. lower-*.f3281.4%

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      6. Applied rewrites81.4%

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

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
      8. Step-by-step derivation
        1. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
        2. lower--.f3277.0%

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
      9. Applied rewrites77.0%

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
      10. Step-by-step derivation
        1. lift-*.f32N/A

          \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right)} \]
        2. lift-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \color{blue}{\left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)}\right) \]
        3. associate-*r*N/A

          \[\leadsto \left(2 \cdot uy\right) \cdot \color{blue}{\left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)} \]
        4. *-commutativeN/A

          \[\leadsto \left(uy \cdot 2\right) \cdot \left(\color{blue}{\pi} \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right) \]
        5. lift-*.f32N/A

          \[\leadsto \left(uy \cdot 2\right) \cdot \left(\color{blue}{\pi} \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right) \]
        6. lift-*.f32N/A

          \[\leadsto \left(uy \cdot 2\right) \cdot \left(\pi \cdot \color{blue}{\sqrt{ux \cdot \left(2 - ux\right)}}\right) \]
        7. *-commutativeN/A

          \[\leadsto \left(uy \cdot 2\right) \cdot \left(\sqrt{ux \cdot \left(2 - ux\right)} \cdot \color{blue}{\pi}\right) \]
        8. associate-*r*N/A

          \[\leadsto \left(\left(uy \cdot 2\right) \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right) \cdot \color{blue}{\pi} \]
        9. lower-*.f32N/A

          \[\leadsto \left(\left(uy \cdot 2\right) \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right) \cdot \color{blue}{\pi} \]
      11. Applied rewrites77.0%

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

      Alternative 21: 77.0% accurate, 4.9× speedup?

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

        \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      2. Step-by-step derivation
        1. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
        2. lift-*.f32N/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        4. sqr-neg-revN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
        5. difference-of-squaresN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
        6. +-commutativeN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
        7. lift-+.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
        8. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
        9. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
        10. sub-negateN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
        11. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
        12. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
        13. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
        14. lift-+.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
        15. lower-*.f32N/A

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

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

        \[\leadsto \color{blue}{2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
      5. Step-by-step derivation
        1. lower-*.f32N/A

          \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
        2. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)}\right) \]
        3. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
        4. lower-PI.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
        5. lower-sqrt.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        6. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        7. lower--.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        8. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        9. lower--.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        10. lower-+.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        11. lower-*.f3281.4%

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      6. Applied rewrites81.4%

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

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
      8. Step-by-step derivation
        1. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
        2. lower--.f3277.0%

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
      9. Applied rewrites77.0%

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
      10. Step-by-step derivation
        1. lift-*.f32N/A

          \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right)} \]
        2. lift-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \color{blue}{\left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)}\right) \]
        3. associate-*r*N/A

          \[\leadsto \left(2 \cdot uy\right) \cdot \color{blue}{\left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)} \]
        4. *-commutativeN/A

          \[\leadsto \left(uy \cdot 2\right) \cdot \left(\color{blue}{\pi} \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right) \]
        5. lift-*.f32N/A

          \[\leadsto \left(uy \cdot 2\right) \cdot \left(\color{blue}{\pi} \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right) \]
        6. lift-*.f32N/A

          \[\leadsto \left(uy \cdot 2\right) \cdot \left(\pi \cdot \color{blue}{\sqrt{ux \cdot \left(2 - ux\right)}}\right) \]
        7. associate-*r*N/A

          \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \color{blue}{\sqrt{ux \cdot \left(2 - ux\right)}} \]
        8. lift-*.f32N/A

          \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{ux \cdot \left(2 - ux\right)}} \]
        9. lower-*.f3277.0%

          \[\leadsto \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \color{blue}{\sqrt{ux \cdot \left(2 - ux\right)}} \]
      11. Applied rewrites77.0%

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

      Alternative 22: 63.3% accurate, 5.0× speedup?

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

        \[\sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      2. Step-by-step derivation
        1. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)}} \]
        2. lift-*.f32N/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{1 \cdot 1} - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        4. sqr-neg-revN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{1 \cdot 1 - \color{blue}{\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)}} \]
        5. difference-of-squaresN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(1 + \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)}} \]
        6. +-commutativeN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\color{blue}{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right)} \cdot \left(1 - \left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right)\right)} \]
        7. lift-+.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)}\right)\right)\right)} \]
        8. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)\right)\right)\right)} \]
        9. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \left(\mathsf{neg}\left(\color{blue}{\left(1 - \left(ux - ux \cdot maxCos\right)\right)}\right)\right)\right)} \]
        10. sub-negateN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(1 - \color{blue}{\left(\left(ux - ux \cdot maxCos\right) - 1\right)}\right)} \]
        11. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \color{blue}{\left(\left(1 - \left(ux - ux \cdot maxCos\right)\right) + 1\right)}} \]
        12. associate-+l-N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
        13. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right) + 1\right)} \]
        14. lift-+.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \pi\right) \cdot \sqrt{\left(\left(\mathsf{neg}\left(\left(\left(1 - ux\right) + ux \cdot maxCos\right)\right)\right) + 1\right) \cdot \left(\color{blue}{\left(\left(1 - ux\right) + ux \cdot maxCos\right)} + 1\right)} \]
        15. lower-*.f32N/A

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

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

        \[\leadsto \color{blue}{2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
      5. Step-by-step derivation
        1. lower-*.f32N/A

          \[\leadsto 2 \cdot \color{blue}{\left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right)} \]
        2. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)}\right) \]
        3. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
        4. lower-PI.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\color{blue}{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}}\right)\right) \]
        5. lower-sqrt.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        6. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        7. lower--.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        8. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        9. lower--.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        10. lower-+.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
        11. lower-*.f3281.4%

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{\left(ux - maxCos \cdot ux\right) \cdot \left(\left(2 + maxCos \cdot ux\right) - ux\right)}\right)\right) \]
      6. Applied rewrites81.4%

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

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
      8. Step-by-step derivation
        1. lower-*.f32N/A

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
        2. lower--.f3277.0%

          \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
      9. Applied rewrites77.0%

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot \left(2 - ux\right)}\right)\right) \]
      10. Taylor expanded in ux around 0

        \[\leadsto 2 \cdot \left(uy \cdot \left(\pi \cdot \sqrt{ux \cdot 2}\right)\right) \]
      11. Step-by-step derivation
        1. Applied rewrites63.3%

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

        Reproduce

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