UniformSampleCone, y

Percentage Accurate: 57.4% → 98.4%
Time: 7.7s
Alternatives: 18
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} \\ \begin{array}{l} t_0 := \left(1 - ux\right) + ux \cdot maxCos\\ \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - t\_0 \cdot t\_0} \end{array} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (let* ((t_0 (+ (- 1.0 ux) (* ux maxCos))))
   (* (sin (* (* uy 2.0) (PI))) (sqrt (- 1.0 (* t_0 t_0))))))
\begin{array}{l}

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

Sampling outcomes in binary32 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 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.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 - ux\right) + ux \cdot maxCos\\ \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - t\_0 \cdot t\_0} \end{array} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (let* ((t_0 (+ (- 1.0 ux) (* ux maxCos))))
   (* (sin (* (* uy 2.0) (PI))) (sqrt (- 1.0 (* t_0 t_0))))))
\begin{array}{l}

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

Alternative 1: 98.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-{\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (*
  (sin (* (* uy 2.0) (PI)))
  (sqrt
   (*
    (-
     (fma (- (pow (- maxCos 1.0) 2.0)) ux (* (* 2.0 (/ 1.0 ux)) ux))
     (* maxCos 2.0))
    ux))))
\begin{array}{l}

\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-{\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux}
\end{array}
Derivation
  1. Initial program 61.7%

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 + -1 \cdot \left(ux \cdot {\left(maxCos - 1\right)}^{2}\right)\right) - 2 \cdot maxCos\right) \cdot ux} \]
    4. +-commutativeN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(-1 \cdot ux\right) \cdot {\left(maxCos - 1\right)}^{2} + 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    6. mul-1-negN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(\mathsf{neg}\left(ux\right), {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    8. lower-neg.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    9. lower-pow.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    10. lower--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    11. *-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    12. lower-*.f3298.6

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  5. Applied rewrites98.6%

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    3. lift-pow.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    4. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    5. lower-*.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    6. lower-/.f3298.6

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
  8. Applied rewrites98.6%

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
  9. Step-by-step derivation
    1. lift-*.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    2. lift-fma.f32N/A

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \left(-1 \cdot {\left(maxCos - 1\right)}^{2} + 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    5. lift-*.f32N/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \left(-1 \cdot {\left(maxCos - 1\right)}^{2} + 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    7. distribute-rgt-inN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-1 \cdot {\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \]
    9. lower-*.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-1 \cdot {\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \]
    10. lift-pow.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-1 \cdot {\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \]
    11. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-1 \cdot {\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \]
    12. lower-*.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-1 \cdot {\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \]
    13. lift-/.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-1 \cdot {\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \]
    14. lift-*.f3298.6

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-1 \cdot {\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \]
  10. Applied rewrites98.6%

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-1 \cdot {\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \]
  11. Final simplification98.6%

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-{\left(maxCos - 1\right)}^{2}, ux, \left(2 \cdot \frac{1}{ux}\right) \cdot ux\right) - maxCos \cdot 2\right) \cdot ux} \]
  12. Add Preprocessing

Alternative 2: 98.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (*
  (sin (* (* uy 2.0) (PI)))
  (sqrt
   (*
    (-
     (* ux (fma -1.0 (pow (- maxCos 1.0) 2.0) (* 2.0 (/ 1.0 ux))))
     (* maxCos 2.0))
    ux))))
\begin{array}{l}

\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux}
\end{array}
Derivation
  1. Initial program 61.7%

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 + -1 \cdot \left(ux \cdot {\left(maxCos - 1\right)}^{2}\right)\right) - 2 \cdot maxCos\right) \cdot ux} \]
    4. +-commutativeN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(-1 \cdot ux\right) \cdot {\left(maxCos - 1\right)}^{2} + 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    6. mul-1-negN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(\mathsf{neg}\left(ux\right), {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    8. lower-neg.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    9. lower-pow.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    10. lower--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    11. *-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    12. lower-*.f3298.6

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  5. Applied rewrites98.6%

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    3. lift-pow.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    4. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    5. lower-*.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
    6. lower-/.f3298.6

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
  8. Applied rewrites98.6%

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot \mathsf{fma}\left(-1, {\left(maxCos - 1\right)}^{2}, 2 \cdot \frac{1}{ux}\right) - maxCos \cdot 2\right) \cdot ux} \]
  9. Add Preprocessing

Alternative 3: 98.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (*
  (sin (* (* uy 2.0) (PI)))
  (sqrt
   (*
    (- (fma (- ux) (* (- maxCos 1.0) (- maxCos 1.0)) 2.0) (* maxCos 2.0))
    ux))))
\begin{array}{l}

\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux}
\end{array}
Derivation
  1. Initial program 61.7%

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 + -1 \cdot \left(ux \cdot {\left(maxCos - 1\right)}^{2}\right)\right) - 2 \cdot maxCos\right) \cdot ux} \]
    4. +-commutativeN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(-1 \cdot ux\right) \cdot {\left(maxCos - 1\right)}^{2} + 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    6. mul-1-negN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(\mathsf{neg}\left(ux\right), {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    8. lower-neg.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    9. lower-pow.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    10. lower--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    11. *-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    12. lower-*.f3298.6

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  5. Applied rewrites98.6%

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux}} \]
  6. Step-by-step derivation
    1. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    2. lift-pow.f32N/A

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    5. lift--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    6. lift--.f3298.6

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  7. Applied rewrites98.6%

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  8. Add Preprocessing

Alternative 4: 97.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1 - 2 \cdot maxCos, 2\right) - maxCos \cdot 2\right) \cdot ux} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (*
  (sin (* (* uy 2.0) (PI)))
  (sqrt (* (- (fma (- ux) (- 1.0 (* 2.0 maxCos)) 2.0) (* maxCos 2.0)) ux))))
\begin{array}{l}

\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1 - 2 \cdot maxCos, 2\right) - maxCos \cdot 2\right) \cdot ux}
\end{array}
Derivation
  1. Initial program 61.7%

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 + -1 \cdot \left(ux \cdot {\left(maxCos - 1\right)}^{2}\right)\right) - 2 \cdot maxCos\right) \cdot ux} \]
    4. +-commutativeN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(-1 \cdot ux\right) \cdot {\left(maxCos - 1\right)}^{2} + 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    6. mul-1-negN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(\mathsf{neg}\left(ux\right), {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    8. lower-neg.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    9. lower-pow.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    10. lower--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    11. *-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    12. lower-*.f3298.6

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  5. Applied rewrites98.6%

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1 + -2 \cdot maxCos, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  7. Step-by-step derivation
    1. fp-cancel-sign-sub-invN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1 - \left(\mathsf{neg}\left(-2\right)\right) \cdot maxCos, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    2. metadata-evalN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1 - 2 \cdot maxCos, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    3. lower--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1 - 2 \cdot maxCos, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    4. lower-*.f3297.8

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1 - 2 \cdot maxCos, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  8. Applied rewrites97.8%

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1 - 2 \cdot maxCos, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  9. Add Preprocessing

Alternative 5: 97.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 + \mathsf{fma}\left(-1, ux, maxCos \cdot \left(2 \cdot ux - 2\right)\right)\right) \cdot ux} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (*
  (sin (* (* uy 2.0) (PI)))
  (sqrt (* (+ 2.0 (fma -1.0 ux (* maxCos (- (* 2.0 ux) 2.0)))) ux))))
\begin{array}{l}

\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 + \mathsf{fma}\left(-1, ux, maxCos \cdot \left(2 \cdot ux - 2\right)\right)\right) \cdot ux}
\end{array}
Derivation
  1. Initial program 61.7%

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 + -1 \cdot \left(ux \cdot {\left(maxCos - 1\right)}^{2}\right)\right) - 2 \cdot maxCos\right) \cdot ux} \]
    4. +-commutativeN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(-1 \cdot ux\right) \cdot {\left(maxCos - 1\right)}^{2} + 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    6. mul-1-negN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(\mathsf{neg}\left(ux\right), {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    8. lower-neg.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    9. lower-pow.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    10. lower--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    11. *-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    12. lower-*.f3298.6

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  5. Applied rewrites98.6%

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

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 + \mathsf{fma}\left(-1, ux, maxCos \cdot \left(2 \cdot ux - 2\right)\right)\right) \cdot ux} \]
    5. lower-*.f3297.8

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 + \mathsf{fma}\left(-1, ux, maxCos \cdot \left(2 \cdot ux - 2\right)\right)\right) \cdot ux} \]
  8. Applied rewrites97.8%

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 + \mathsf{fma}\left(-1, ux, maxCos \cdot \left(2 \cdot ux - 2\right)\right)\right) \cdot ux} \]
  9. Add Preprocessing

Alternative 6: 97.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1, 2\right) - maxCos \cdot 2\right) \cdot ux} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (*
  (sin (* (* uy 2.0) (PI)))
  (sqrt (* (- (fma (- ux) 1.0 2.0) (* maxCos 2.0)) ux))))
\begin{array}{l}

\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1, 2\right) - maxCos \cdot 2\right) \cdot ux}
\end{array}
Derivation
  1. Initial program 61.7%

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 + -1 \cdot \left(ux \cdot {\left(maxCos - 1\right)}^{2}\right)\right) - 2 \cdot maxCos\right) \cdot ux} \]
    4. +-commutativeN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(-1 \cdot ux\right) \cdot {\left(maxCos - 1\right)}^{2} + 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    6. mul-1-negN/A

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(\mathsf{neg}\left(ux\right), {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    8. lower-neg.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    9. lower-pow.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    10. lower--.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
    11. *-commutativeN/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    12. lower-*.f3298.6

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  5. Applied rewrites98.6%

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
  7. Step-by-step derivation
    1. Applied rewrites96.4%

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, 1, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    2. Add Preprocessing

    Alternative 7: 90.7% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;uy \leq 0.003220000071451068:\\ \;\;\;\;\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux}\\ \end{array} \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (if (<= uy 0.003220000071451068)
       (*
        (* 2.0 (* uy (PI)))
        (sqrt
         (*
          (- (fma (- ux) (* (- maxCos 1.0) (- maxCos 1.0)) 2.0) (* maxCos 2.0))
          ux)))
       (* (sin (* (* uy 2.0) (PI))) (sqrt (* (fma -2.0 maxCos 2.0) ux)))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;uy \leq 0.003220000071451068:\\
    \;\;\;\;\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux}\\
    
    \mathbf{else}:\\
    \;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if uy < 0.00322000007

      1. Initial program 62.1%

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 + -1 \cdot \left(ux \cdot {\left(maxCos - 1\right)}^{2}\right)\right) - 2 \cdot maxCos\right) \cdot ux} \]
        4. +-commutativeN/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(-1 \cdot ux\right) \cdot {\left(maxCos - 1\right)}^{2} + 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        6. mul-1-negN/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(\mathsf{neg}\left(ux\right), {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        8. lower-neg.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        9. lower-pow.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        10. lower--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        11. *-commutativeN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        12. lower-*.f3298.7

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      5. Applied rewrites98.7%

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux}} \]
      6. Step-by-step derivation
        1. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        2. lift-pow.f32N/A

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        5. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        6. lift--.f3298.7

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      7. Applied rewrites98.7%

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      8. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      9. Step-by-step derivation
        1. lower-*.f32N/A

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

          \[\leadsto \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        3. lift-PI.f3296.1

          \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      10. Applied rewrites96.1%

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]

      if 0.00322000007 < uy

      1. Initial program 60.5%

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{ux \cdot \left(2 - 2 \cdot maxCos\right)}} \]
      4. Step-by-step derivation
        1. metadata-evalN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - \left(\mathsf{neg}\left(-2\right)\right) \cdot maxCos\right)} \]
        2. fp-cancel-sign-sub-invN/A

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(-2 \cdot maxCos + 2\right) \cdot ux} \]
        6. lower-fma.f3276.7

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos, 2\right) \cdot ux} \]
      5. Applied rewrites76.7%

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

    Alternative 8: 95.9% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;uy \leq 0.00019999999494757503:\\ \;\;\;\;\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 - ux\right) \cdot ux}\\ \end{array} \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (if (<= uy 0.00019999999494757503)
       (*
        (* 2.0 (* uy (PI)))
        (sqrt
         (*
          (- (fma (- ux) (* (- maxCos 1.0) (- maxCos 1.0)) 2.0) (* maxCos 2.0))
          ux)))
       (* (sin (* (* uy 2.0) (PI))) (sqrt (* (- 2.0 ux) ux)))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;uy \leq 0.00019999999494757503:\\
    \;\;\;\;\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux}\\
    
    \mathbf{else}:\\
    \;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 - ux\right) \cdot ux}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if uy < 1.99999995e-4

      1. Initial program 61.8%

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 + -1 \cdot \left(ux \cdot {\left(maxCos - 1\right)}^{2}\right)\right) - 2 \cdot maxCos\right) \cdot ux} \]
        4. +-commutativeN/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(-1 \cdot ux\right) \cdot {\left(maxCos - 1\right)}^{2} + 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        6. mul-1-negN/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(\mathsf{neg}\left(ux\right), {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        8. lower-neg.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        9. lower-pow.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        10. lower--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        11. *-commutativeN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        12. lower-*.f3298.7

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      5. Applied rewrites98.7%

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux}} \]
      6. Step-by-step derivation
        1. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        2. lift-pow.f32N/A

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        5. lift--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        6. lift--.f3298.7

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      7. Applied rewrites98.7%

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      8. Taylor expanded in uy around 0

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      9. Step-by-step derivation
        1. lower-*.f32N/A

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

          \[\leadsto \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        3. lift-PI.f3298.6

          \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      10. Applied rewrites98.6%

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]

      if 1.99999995e-4 < uy

      1. Initial program 61.5%

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 + -1 \cdot \left(ux \cdot {\left(maxCos - 1\right)}^{2}\right)\right) - 2 \cdot maxCos\right) \cdot ux} \]
        4. +-commutativeN/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(-1 \cdot ux\right) \cdot {\left(maxCos - 1\right)}^{2} + 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        6. mul-1-negN/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(\mathsf{neg}\left(ux\right), {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        8. lower-neg.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        9. lower-pow.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        10. lower--.f32N/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
        11. *-commutativeN/A

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
        12. lower-*.f3298.4

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      5. Applied rewrites98.4%

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 + -1 \cdot ux\right) \cdot ux} \]
        2. lower-*.f3291.1

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 + -1 \cdot ux\right) \cdot ux} \]
      8. Applied rewrites91.1%

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 + -1 \cdot ux\right) \cdot ux} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification95.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;uy \leq 0.00019999999494757503:\\ \;\;\;\;\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(2 - ux\right) \cdot ux}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 76.5% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := uy \cdot \mathsf{PI}\left(\right)\\ t_1 := \left(1 - ux\right) + ux \cdot maxCos\\ \mathbf{if}\;t\_1 \cdot t\_1 \leq 0.9996100068092346:\\ \;\;\;\;2 \cdot \left(t\_0 \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(1 + ux \cdot \left(maxCos - 1\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_0 \cdot \sqrt{maxCos \cdot \mathsf{fma}\left(-2, ux, 2 \cdot \frac{ux}{maxCos}\right)}\right)\\ \end{array} \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (let* ((t_0 (* uy (PI))) (t_1 (+ (- 1.0 ux) (* ux maxCos))))
       (if (<= (* t_1 t_1) 0.9996100068092346)
         (*
          2.0
          (*
           t_0
           (sqrt
            (-
             1.0
             (* (- (+ 1.0 (* maxCos ux)) ux) (+ 1.0 (* ux (- maxCos 1.0))))))))
         (* 2.0 (* t_0 (sqrt (* maxCos (fma -2.0 ux (* 2.0 (/ ux maxCos))))))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := uy \cdot \mathsf{PI}\left(\right)\\
    t_1 := \left(1 - ux\right) + ux \cdot maxCos\\
    \mathbf{if}\;t\_1 \cdot t\_1 \leq 0.9996100068092346:\\
    \;\;\;\;2 \cdot \left(t\_0 \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(1 + ux \cdot \left(maxCos - 1\right)\right)}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \left(t\_0 \cdot \sqrt{maxCos \cdot \mathsf{fma}\left(-2, ux, 2 \cdot \frac{ux}{maxCos}\right)}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f32 (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos))) < 0.999610007

      1. Initial program 89.6%

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

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

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{\color{blue}{1 - {ux}^{2}}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        7. unpow2N/A

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - ux \cdot ux}{\color{blue}{1 + ux}} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. Applied rewrites89.2%

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(maxCos \cdot ux + \frac{1}{1 + ux}\right) - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
      7. Applied rewrites76.3%

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

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(1 + ux \cdot \left(maxCos - 1\right)\right)}\right) \]
      9. Step-by-step derivation
        1. lower-+.f32N/A

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(1 + ux \cdot \left(maxCos - 1\right)\right)}\right) \]
        3. lift--.f3276.2

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(1 + ux \cdot \left(maxCos - 1\right)\right)}\right) \]
      10. Applied rewrites76.2%

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

      if 0.999610007 < (*.f32 (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)))

      1. Initial program 41.9%

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

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

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{\color{blue}{1 - {ux}^{2}}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        7. unpow2N/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - \color{blue}{ux \cdot ux}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        9. lower-+.f3242.0

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - ux \cdot ux}{\color{blue}{1 + ux}} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. Applied rewrites42.0%

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(maxCos \cdot ux + \frac{1}{1 + ux}\right) - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
      7. Applied rewrites39.3%

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
        3. lower-*.f3278.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      10. Applied rewrites78.0%

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      11. Taylor expanded in maxCos around inf

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{maxCos \cdot \left(-2 \cdot ux + 2 \cdot \frac{ux}{maxCos}\right)}\right) \]
      12. Step-by-step derivation
        1. lower-*.f32N/A

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{maxCos \cdot \mathsf{fma}\left(-2, ux, 2 \cdot \frac{ux}{maxCos}\right)}\right) \]
        4. lower-/.f3278.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{maxCos \cdot \mathsf{fma}\left(-2, ux, 2 \cdot \frac{ux}{maxCos}\right)}\right) \]
      13. Applied rewrites78.0%

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{maxCos \cdot \mathsf{fma}\left(-2, ux, 2 \cdot \frac{ux}{maxCos}\right)}\right) \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 10: 75.4% accurate, 1.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 - ux\right) + ux \cdot maxCos\\ \mathbf{if}\;t\_0 \cdot t\_0 \leq 0.9996100068092346:\\ \;\;\;\;\left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - t\_0 \cdot \left(1 - ux\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right)\\ \end{array} \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (let* ((t_0 (+ (- 1.0 ux) (* ux maxCos))))
       (if (<= (* t_0 t_0) 0.9996100068092346)
         (* (* (PI) (* 2.0 uy)) (sqrt (- 1.0 (* t_0 (- 1.0 ux)))))
         (* 2.0 (* (* uy (PI)) (sqrt (fma -2.0 (* maxCos ux) (* 2.0 ux))))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left(1 - ux\right) + ux \cdot maxCos\\
    \mathbf{if}\;t\_0 \cdot t\_0 \leq 0.9996100068092346:\\
    \;\;\;\;\left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - t\_0 \cdot \left(1 - ux\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f32 (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos))) < 0.999610007

      1. Initial program 89.6%

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

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

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

          \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot \color{blue}{uy}\right)\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      5. Applied rewrites76.2%

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

        \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \color{blue}{\left(1 - ux\right)}} \]
      7. Step-by-step derivation
        1. flip--N/A

          \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(1 - ux\right)} \]
        2. metadata-evalN/A

          \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(1 - ux\right)} \]
        3. lift--.f3272.0

          \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(1 - \color{blue}{ux}\right)} \]
      8. Applied rewrites72.0%

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

      if 0.999610007 < (*.f32 (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)))

      1. Initial program 41.9%

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

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

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{\color{blue}{1 - {ux}^{2}}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        7. unpow2N/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - \color{blue}{ux \cdot ux}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        9. lower-+.f3242.0

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - ux \cdot ux}{\color{blue}{1 + ux}} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. Applied rewrites42.0%

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(maxCos \cdot ux + \frac{1}{1 + ux}\right) - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
      7. Applied rewrites39.3%

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
        3. lower-*.f3278.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      10. Applied rewrites78.0%

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      11. Taylor expanded in maxCos around 0

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{-2 \cdot \left(maxCos \cdot ux\right) + 2 \cdot ux}\right) \]
      12. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
        2. lift-*.f32N/A

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
        3. lower-*.f3278.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
      13. Applied rewrites78.0%

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification75.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right) \leq 0.9996100068092346:\\ \;\;\;\;\left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(1 - ux\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 11: 75.4% accurate, 1.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := uy \cdot \mathsf{PI}\left(\right)\\ t_1 := \left(1 - ux\right) + ux \cdot maxCos\\ \mathbf{if}\;t\_1 \cdot t\_1 \leq 0.9996100068092346:\\ \;\;\;\;2 \cdot \left(t\_0 \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(1 - ux\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t\_0 \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right)\\ \end{array} \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (let* ((t_0 (* uy (PI))) (t_1 (+ (- 1.0 ux) (* ux maxCos))))
       (if (<= (* t_1 t_1) 0.9996100068092346)
         (* 2.0 (* t_0 (sqrt (- 1.0 (* (- (+ 1.0 (* maxCos ux)) ux) (- 1.0 ux))))))
         (* 2.0 (* t_0 (sqrt (fma -2.0 (* maxCos ux) (* 2.0 ux))))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := uy \cdot \mathsf{PI}\left(\right)\\
    t_1 := \left(1 - ux\right) + ux \cdot maxCos\\
    \mathbf{if}\;t\_1 \cdot t\_1 \leq 0.9996100068092346:\\
    \;\;\;\;2 \cdot \left(t\_0 \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(1 - ux\right)}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \left(t\_0 \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f32 (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos))) < 0.999610007

      1. Initial program 89.6%

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

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

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{\color{blue}{1 - {ux}^{2}}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        7. unpow2N/A

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - ux \cdot ux}{\color{blue}{1 + ux}} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. Applied rewrites89.2%

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(maxCos \cdot ux + \frac{1}{1 + ux}\right) - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
      7. Applied rewrites76.3%

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

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\frac{1}{1 + ux} - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
      9. Step-by-step derivation
        1. sub-divN/A

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \frac{1 - {ux}^{2}}{1 + ux}}\right) \]
        2. metadata-evalN/A

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \frac{1 \cdot 1 - ux \cdot ux}{1 + ux}}\right) \]
        4. flip--N/A

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(1 - ux\right)}\right) \]
        5. lower--.f3272.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(1 - ux\right)}\right) \]
      10. Applied rewrites72.0%

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

      if 0.999610007 < (*.f32 (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)))

      1. Initial program 41.9%

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

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

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{\color{blue}{1 - {ux}^{2}}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        7. unpow2N/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - \color{blue}{ux \cdot ux}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        9. lower-+.f3242.0

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - ux \cdot ux}{\color{blue}{1 + ux}} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. Applied rewrites42.0%

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(maxCos \cdot ux + \frac{1}{1 + ux}\right) - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
      7. Applied rewrites39.3%

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
        3. lower-*.f3278.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      10. Applied rewrites78.0%

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      11. Taylor expanded in maxCos around 0

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{-2 \cdot \left(maxCos \cdot ux\right) + 2 \cdot ux}\right) \]
      12. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
        2. lift-*.f32N/A

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
        3. lower-*.f3278.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
      13. Applied rewrites78.0%

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 12: 76.5% accurate, 2.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := uy \cdot \mathsf{PI}\left(\right)\\ t_1 := \mathsf{fma}\left(maxCos, ux, 1 - ux\right)\\ \mathbf{if}\;ux \leq 0.00019500000053085387:\\ \;\;\;\;2 \cdot \left(t\_0 \cdot \sqrt{maxCos \cdot \mathsf{fma}\left(-2, ux, 2 \cdot \frac{ux}{maxCos}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot t\_0\right) \cdot \sqrt{1 - t\_1 \cdot t\_1}\\ \end{array} \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (let* ((t_0 (* uy (PI))) (t_1 (fma maxCos ux (- 1.0 ux))))
       (if (<= ux 0.00019500000053085387)
         (* 2.0 (* t_0 (sqrt (* maxCos (fma -2.0 ux (* 2.0 (/ ux maxCos)))))))
         (* (* 2.0 t_0) (sqrt (- 1.0 (* t_1 t_1)))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := uy \cdot \mathsf{PI}\left(\right)\\
    t_1 := \mathsf{fma}\left(maxCos, ux, 1 - ux\right)\\
    \mathbf{if}\;ux \leq 0.00019500000053085387:\\
    \;\;\;\;2 \cdot \left(t\_0 \cdot \sqrt{maxCos \cdot \mathsf{fma}\left(-2, ux, 2 \cdot \frac{ux}{maxCos}\right)}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(2 \cdot t\_0\right) \cdot \sqrt{1 - t\_1 \cdot t\_1}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if ux < 1.95000001e-4

      1. Initial program 41.9%

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

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

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{\color{blue}{1 - {ux}^{2}}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        7. unpow2N/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - \color{blue}{ux \cdot ux}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        9. lower-+.f3242.0

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - ux \cdot ux}{\color{blue}{1 + ux}} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. Applied rewrites42.0%

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(maxCos \cdot ux + \frac{1}{1 + ux}\right) - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
      7. Applied rewrites39.3%

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
        3. lower-*.f3278.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      10. Applied rewrites78.0%

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      11. Taylor expanded in maxCos around inf

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{maxCos \cdot \left(-2 \cdot ux + 2 \cdot \frac{ux}{maxCos}\right)}\right) \]
      12. Step-by-step derivation
        1. lower-*.f32N/A

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{maxCos \cdot \mathsf{fma}\left(-2, ux, 2 \cdot \frac{ux}{maxCos}\right)}\right) \]
        4. lower-/.f3278.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{maxCos \cdot \mathsf{fma}\left(-2, ux, 2 \cdot \frac{ux}{maxCos}\right)}\right) \]
      13. Applied rewrites78.0%

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{maxCos \cdot \mathsf{fma}\left(-2, ux, 2 \cdot \frac{ux}{maxCos}\right)}\right) \]

      if 1.95000001e-4 < ux

      1. Initial program 89.6%

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\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)} \]
        2. lift--.f32N/A

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

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

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

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)} \]
        10. +-commutativeN/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \left(\color{blue}{ux \cdot maxCos} + \left(1 - ux\right)\right)} \]
        12. *-commutativeN/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \color{blue}{\mathsf{fma}\left(maxCos, ux, 1 - ux\right)}} \]
        14. lift--.f3289.6

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

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

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \mathsf{fma}\left(maxCos, ux, 1 - ux\right)} \]
      6. Step-by-step derivation
        1. lower-*.f32N/A

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

          \[\leadsto \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \mathsf{fma}\left(maxCos, ux, 1 - ux\right)} \]
        3. lift-PI.f3276.2

          \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \mathsf{fma}\left(maxCos, ux, 1 - ux\right)} \]
      7. Applied rewrites76.2%

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \mathsf{fma}\left(maxCos, ux, 1 - ux\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 13: 76.5% accurate, 2.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(maxCos, ux, 1 - ux\right)\\ t_1 := uy \cdot \mathsf{PI}\left(\right)\\ \mathbf{if}\;ux \leq 0.00019500000053085387:\\ \;\;\;\;2 \cdot \left(t\_1 \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot t\_1\right) \cdot \sqrt{1 - t\_0 \cdot t\_0}\\ \end{array} \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (let* ((t_0 (fma maxCos ux (- 1.0 ux))) (t_1 (* uy (PI))))
       (if (<= ux 0.00019500000053085387)
         (* 2.0 (* t_1 (sqrt (fma -2.0 (* maxCos ux) (* 2.0 ux)))))
         (* (* 2.0 t_1) (sqrt (- 1.0 (* t_0 t_0)))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \mathsf{fma}\left(maxCos, ux, 1 - ux\right)\\
    t_1 := uy \cdot \mathsf{PI}\left(\right)\\
    \mathbf{if}\;ux \leq 0.00019500000053085387:\\
    \;\;\;\;2 \cdot \left(t\_1 \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(2 \cdot t\_1\right) \cdot \sqrt{1 - t\_0 \cdot t\_0}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if ux < 1.95000001e-4

      1. Initial program 41.9%

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

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

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{\color{blue}{1 - {ux}^{2}}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        7. unpow2N/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - \color{blue}{ux \cdot ux}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        9. lower-+.f3242.0

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - ux \cdot ux}{\color{blue}{1 + ux}} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. Applied rewrites42.0%

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(maxCos \cdot ux + \frac{1}{1 + ux}\right) - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
      7. Applied rewrites39.3%

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

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

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

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
        3. lower-*.f3278.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      10. Applied rewrites78.0%

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      11. Taylor expanded in maxCos around 0

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{-2 \cdot \left(maxCos \cdot ux\right) + 2 \cdot ux}\right) \]
      12. Step-by-step derivation
        1. lower-fma.f32N/A

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
        2. lift-*.f32N/A

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
        3. lower-*.f3278.0

          \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
      13. Applied rewrites78.0%

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

      if 1.95000001e-4 < ux

      1. Initial program 89.6%

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\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)} \]
        2. lift--.f32N/A

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

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

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

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

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

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

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \left(\color{blue}{\left(1 - ux\right)} + ux \cdot maxCos\right)} \]
        10. +-commutativeN/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \left(\color{blue}{ux \cdot maxCos} + \left(1 - ux\right)\right)} \]
        12. *-commutativeN/A

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

          \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \color{blue}{\mathsf{fma}\left(maxCos, ux, 1 - ux\right)}} \]
        14. lift--.f3289.6

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

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

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \mathsf{fma}\left(maxCos, ux, 1 - ux\right)} \]
      6. Step-by-step derivation
        1. lower-*.f32N/A

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

          \[\leadsto \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \mathsf{fma}\left(maxCos, ux, 1 - ux\right)} \]
        3. lift-PI.f3276.2

          \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \mathsf{fma}\left(maxCos, ux, 1 - ux\right)} \]
      7. Applied rewrites76.2%

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \mathsf{fma}\left(maxCos, ux, 1 - ux\right) \cdot \mathsf{fma}\left(maxCos, ux, 1 - ux\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 14: 81.3% accurate, 2.7× speedup?

    \[\begin{array}{l} \\ \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (*
      (* 2.0 (* uy (PI)))
      (sqrt
       (*
        (- (fma (- ux) (* (- maxCos 1.0) (- maxCos 1.0)) 2.0) (* maxCos 2.0))
        ux))))
    \begin{array}{l}
    
    \\
    \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux}
    \end{array}
    
    Derivation
    1. Initial program 61.7%

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(2 + -1 \cdot \left(ux \cdot {\left(maxCos - 1\right)}^{2}\right)\right) - 2 \cdot maxCos\right) \cdot ux} \]
      4. +-commutativeN/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\left(\left(-1 \cdot ux\right) \cdot {\left(maxCos - 1\right)}^{2} + 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
      6. mul-1-negN/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(\mathsf{neg}\left(ux\right), {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
      8. lower-neg.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
      9. lower-pow.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
      10. lower--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - 2 \cdot maxCos\right) \cdot ux} \]
      11. *-commutativeN/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      12. lower-*.f3298.6

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    5. Applied rewrites98.6%

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux}} \]
    6. Step-by-step derivation
      1. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, {\left(maxCos - 1\right)}^{2}, 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      2. lift-pow.f32N/A

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      5. lift--.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      6. lift--.f3298.6

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    7. Applied rewrites98.6%

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    8. Taylor expanded in uy around 0

      \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    9. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \left(2 \cdot \left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
      3. lift-PI.f3282.4

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    10. Applied rewrites82.4%

      \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{\left(\mathsf{fma}\left(-ux, \left(maxCos - 1\right) \cdot \left(maxCos - 1\right), 2\right) - maxCos \cdot 2\right) \cdot ux} \]
    11. Add Preprocessing

    Alternative 15: 66.0% accurate, 3.7× speedup?

    \[\begin{array}{l} \\ 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (* 2.0 (* (* uy (PI)) (sqrt (fma -2.0 (* maxCos ux) (* 2.0 ux))))))
    \begin{array}{l}
    
    \\
    2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right)
    \end{array}
    
    Derivation
    1. Initial program 61.7%

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

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

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{\color{blue}{1 - {ux}^{2}}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      7. unpow2N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - \color{blue}{ux \cdot ux}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      9. lower-+.f3261.5

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - ux \cdot ux}{\color{blue}{1 + ux}} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    4. Applied rewrites61.5%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(maxCos \cdot ux + \frac{1}{1 + ux}\right) - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
    7. Applied rewrites54.6%

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

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

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

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      3. lower-*.f3264.9

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
    10. Applied rewrites64.9%

      \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
    11. Taylor expanded in maxCos around 0

      \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{-2 \cdot \left(maxCos \cdot ux\right) + 2 \cdot ux}\right) \]
    12. Step-by-step derivation
      1. lower-fma.f32N/A

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
      2. lift-*.f32N/A

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
      3. lower-*.f3264.9

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
    13. Applied rewrites64.9%

      \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{fma}\left(-2, maxCos \cdot ux, 2 \cdot ux\right)}\right) \]
    14. Add Preprocessing

    Alternative 16: 66.0% accurate, 4.0× speedup?

    \[\begin{array}{l} \\ 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (* 2.0 (* (* uy (PI)) (sqrt (* ux (- 2.0 (* 2.0 maxCos)))))))
    \begin{array}{l}
    
    \\
    2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right)
    \end{array}
    
    Derivation
    1. Initial program 61.7%

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

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

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{\color{blue}{1 - {ux}^{2}}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      7. unpow2N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - \color{blue}{ux \cdot ux}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      9. lower-+.f3261.5

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - ux \cdot ux}{\color{blue}{1 + ux}} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    4. Applied rewrites61.5%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(maxCos \cdot ux + \frac{1}{1 + ux}\right) - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
    7. Applied rewrites54.6%

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

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

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

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      3. lower-*.f3264.9

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
    10. Applied rewrites64.9%

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

    Alternative 17: 63.5% accurate, 5.0× speedup?

    \[\begin{array}{l} \\ 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot 2}\right) \end{array} \]
    (FPCore (ux uy maxCos)
     :precision binary32
     (* 2.0 (* (* uy (PI)) (sqrt (* ux 2.0)))))
    \begin{array}{l}
    
    \\
    2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot 2}\right)
    \end{array}
    
    Derivation
    1. Initial program 61.7%

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

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

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{\color{blue}{1 - {ux}^{2}}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      7. unpow2N/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - \color{blue}{ux \cdot ux}}{1 + ux} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      9. lower-+.f3261.5

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\frac{1 - ux \cdot ux}{\color{blue}{1 + ux}} + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    4. Applied rewrites61.5%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(maxCos \cdot ux + \frac{1}{1 + ux}\right) - \frac{{ux}^{2}}{1 + ux}\right)}\right) \]
    7. Applied rewrites54.6%

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

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

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

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
      3. lower-*.f3264.9

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
    10. Applied rewrites64.9%

      \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 - 2 \cdot maxCos\right)}\right) \]
    11. Taylor expanded in maxCos around 0

      \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot 2}\right) \]
    12. Step-by-step derivation
      1. Applied rewrites62.8%

        \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot 2}\right) \]
      2. Add Preprocessing

      Alternative 18: 7.1% accurate, 5.4× speedup?

      \[\begin{array}{l} \\ \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - 1} \end{array} \]
      (FPCore (ux uy maxCos)
       :precision binary32
       (* (* (PI) (* 2.0 uy)) (sqrt (- 1.0 1.0))))
      \begin{array}{l}
      
      \\
      \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - 1}
      \end{array}
      
      Derivation
      1. Initial program 61.7%

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

        \[\leadsto \color{blue}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      4. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

          \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot \color{blue}{uy}\right)\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
        7. lower-*.f3254.5

          \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot \color{blue}{uy}\right)\right) \cdot \sqrt{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      5. Applied rewrites54.5%

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

        \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - \color{blue}{1}} \]
      7. Step-by-step derivation
        1. flip--7.1

          \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - 1} \]
        2. metadata-eval7.1

          \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - 1} \]
      8. Applied rewrites7.1%

        \[\leadsto \left(\mathsf{PI}\left(\right) \cdot \left(2 \cdot uy\right)\right) \cdot \sqrt{1 - \color{blue}{1}} \]
      9. Add Preprocessing

      Reproduce

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