UniformSampleCone, y

Percentage Accurate: 57.5% → 98.2%
Time: 17.6s
Alternatives: 16
Speedup: 4.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 16 alternatives:

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

Initial Program: 57.5% accurate, 1.0× speedup?

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

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

\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\left(\frac{2 - maxCos}{ux} + \left(1 - maxCos\right) \cdot \left(maxCos + -1\right)\right) - \frac{maxCos}{ux}\right)}
\end{array}
Derivation
  1. Initial program 57.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. 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(\left(1 - ux\right) + \color{blue}{ux \cdot maxCos}\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. associate-+l-N/A

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    7. lower-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    9. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{\left(ux \cdot ux\right) \cdot \left(-\left(\frac{maxCos - \left(1 + \left(1 - maxCos\right)\right)}{ux} + \left(1 - maxCos\right) \cdot \left(1 - maxCos\right)\right)\right)}} \]
  8. 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 ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{maxCos - \left(1 + \color{blue}{\left(1 - maxCos\right)}\right)}{ux} + \left(1 - maxCos\right) \cdot \left(1 - maxCos\right)\right)\right)\right)} \]
    2. lift-+.f32N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{maxCos}{ux} - \left(\frac{\color{blue}{2} - maxCos}{ux} - \left(1 - maxCos\right) \cdot \left(1 - maxCos\right)\right)\right)\right)\right)} \]
    16. lower--.f3298.4

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

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

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

Alternative 2: 98.2% accurate, 0.9× speedup?

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

\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\frac{\left(2 - maxCos\right) - maxCos}{ux} + \left(1 - maxCos\right) \cdot \left(maxCos + -1\right)\right)}
\end{array}
Derivation
  1. Initial program 57.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. 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(\left(1 - ux\right) + \color{blue}{ux \cdot maxCos}\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. associate-+l-N/A

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    7. lower-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    9. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{\left(ux \cdot ux\right) \cdot \left(-\left(\frac{maxCos - \left(1 + \left(1 - maxCos\right)\right)}{ux} + \left(1 - maxCos\right) \cdot \left(1 - maxCos\right)\right)\right)}} \]
  8. 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 ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{maxCos - \left(1 + \color{blue}{\left(1 - maxCos\right)}\right)}{ux} + \left(1 - maxCos\right) \cdot \left(1 - maxCos\right)\right)\right)\right)} \]
    2. lift-+.f32N/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.1% accurate, 1.0× speedup?

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

\\
ux \cdot \left(\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\frac{2 + maxCos \cdot -2}{ux} + \left(1 - maxCos\right) \cdot \left(maxCos + -1\right)}\right)
\end{array}
Derivation
  1. Initial program 57.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. 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(\left(1 - ux\right) + \color{blue}{ux \cdot maxCos}\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. associate-+l-N/A

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    7. lower-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    9. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto ux \cdot \left(\sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\color{blue}{\left(2 \cdot \frac{1}{ux} - 2 \cdot \frac{maxCos}{ux}\right) - {\left(1 - maxCos\right)}^{2}}}\right) \]
  10. Applied rewrites97.9%

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

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

Alternative 4: 90.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;uy \cdot 2 \leq 0.0025599999353289604:\\ \;\;\;\;\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\left(1 - maxCos\right) \cdot \left(maxCos + -1\right) + \frac{\left(1 + \left(1 - maxCos\right)\right) - maxCos}{ux}\right)}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}\\ \end{array} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (if (<= (* uy 2.0) 0.0025599999353289604)
   (*
    (* 2.0 (* uy (PI)))
    (sqrt
     (*
      (* ux ux)
      (+
       (* (- 1.0 maxCos) (+ maxCos -1.0))
       (/ (- (+ 1.0 (- 1.0 maxCos)) maxCos) ux)))))
   (* (sin (* (* uy 2.0) (PI))) (sqrt (* ux (+ 2.0 (* maxCos -2.0)))))))
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f32 uy #s(literal 2 binary32)) < 0.00255999994

    1. Initial program 58.2%

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      7. lower-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      9. metadata-evalN/A

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

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

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

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(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}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    6. Step-by-step derivation
      1. lower-*.f32N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{\color{blue}{maxCos - \left(1 + -1 \cdot \left(maxCos - 1\right)\right)}}{ux} - \left(1 + -1 \cdot maxCos\right) \cdot \left(maxCos - 1\right)\right)\right)\right)} \]
      10. mul-1-negN/A

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{maxCos - \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(maxCos - 1\right)\right)\right)}\right)}{ux} - \left(1 + -1 \cdot maxCos\right) \cdot \left(maxCos - 1\right)\right)\right)\right)} \]
      11. unsub-negN/A

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

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{maxCos - \color{blue}{\left(1 - \left(maxCos - 1\right)\right)}}{ux} - \left(1 + -1 \cdot maxCos\right) \cdot \left(maxCos - 1\right)\right)\right)\right)} \]
      13. sub-negN/A

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

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

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

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

    if 0.00255999994 < (*.f32 uy #s(literal 2 binary32))

    1. Initial program 54.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(\left(1 - ux\right) + \color{blue}{ux \cdot maxCos}\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      2. associate-+l-N/A

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      7. lower-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      9. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{\left(ux \cdot ux\right) \cdot \left(-\left(\frac{maxCos - \left(1 + \left(1 - maxCos\right)\right)}{ux} + \left(1 - maxCos\right) \cdot \left(1 - maxCos\right)\right)\right)}} \]
    8. 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)}} \]
    9. Step-by-step derivation
      1. lower-*.f32N/A

        \[\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)}} \]
      2. cancel-sign-sub-invN/A

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{ux \cdot \color{blue}{\left(2 + \left(\mathsf{neg}\left(2\right)\right) \cdot maxCos\right)}} \]
      4. metadata-evalN/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)} \]
      5. lower-*.f3276.6

        \[\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)} \]
    10. Applied rewrites76.6%

      \[\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)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.3%

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

Alternative 5: 92.3% accurate, 1.0× speedup?

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

\\
\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\frac{2}{ux} + -1\right)}
\end{array}
Derivation
  1. Initial program 57.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. 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(\left(1 - ux\right) + \color{blue}{ux \cdot maxCos}\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. associate-+l-N/A

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    7. lower-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    9. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{\left(2 \cdot \frac{1}{ux} - 1\right) \cdot {ux}^{2}}} \]
    3. sub-negN/A

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

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

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

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

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

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

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

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{\left(\frac{2}{ux} + -1\right) \cdot \left(ux \cdot ux\right)}} \]
  11. Final simplification93.7%

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

Alternative 6: 92.2% accurate, 1.1× speedup?

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

\\
\left(ux \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \sqrt{\frac{2}{ux} + -1}
\end{array}
Derivation
  1. Initial program 57.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. 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(\left(1 - ux\right) + \color{blue}{ux \cdot maxCos}\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. associate-+l-N/A

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    7. lower-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    9. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(ux \cdot \sin \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \frac{1}{ux} - 1}} \]
    8. sub-negN/A

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

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

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

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

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

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

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

Alternative 7: 89.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;uy \cdot 2 \leq 0.0025599999353289604:\\ \;\;\;\;\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\left(1 - maxCos\right) \cdot \left(maxCos + -1\right) + \frac{\left(1 + \left(1 - maxCos\right)\right) - maxCos}{ux}\right)}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{2 \cdot ux}\\ \end{array} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (if (<= (* uy 2.0) 0.0025599999353289604)
   (*
    (* 2.0 (* uy (PI)))
    (sqrt
     (*
      (* ux ux)
      (+
       (* (- 1.0 maxCos) (+ maxCos -1.0))
       (/ (- (+ 1.0 (- 1.0 maxCos)) maxCos) ux)))))
   (* (sin (* (* uy 2.0) (PI))) (sqrt (* 2.0 ux)))))
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f32 uy #s(literal 2 binary32)) < 0.00255999994

    1. Initial program 58.2%

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      7. lower-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      9. metadata-evalN/A

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

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

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

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(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}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    6. Step-by-step derivation
      1. lower-*.f32N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{\color{blue}{maxCos - \left(1 + -1 \cdot \left(maxCos - 1\right)\right)}}{ux} - \left(1 + -1 \cdot maxCos\right) \cdot \left(maxCos - 1\right)\right)\right)\right)} \]
      10. mul-1-negN/A

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{maxCos - \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(maxCos - 1\right)\right)\right)}\right)}{ux} - \left(1 + -1 \cdot maxCos\right) \cdot \left(maxCos - 1\right)\right)\right)\right)} \]
      11. unsub-negN/A

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

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{maxCos - \color{blue}{\left(1 - \left(maxCos - 1\right)\right)}}{ux} - \left(1 + -1 \cdot maxCos\right) \cdot \left(maxCos - 1\right)\right)\right)\right)} \]
      13. sub-negN/A

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

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

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

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

    if 0.00255999994 < (*.f32 uy #s(literal 2 binary32))

    1. Initial program 54.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. Taylor expanded in maxCos around inf

      \[\leadsto \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 \color{blue}{\left(maxCos \cdot \left(\left(ux + \frac{1}{maxCos}\right) - \frac{ux}{maxCos}\right)\right)}} \]
    4. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \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(maxCos \cdot \color{blue}{\left(ux + \left(\frac{1}{maxCos} - \frac{ux}{maxCos}\right)\right)}\right)} \]
      3. div-subN/A

        \[\leadsto \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(maxCos \cdot \left(ux + \color{blue}{\frac{1 - ux}{maxCos}}\right)\right)} \]
      4. lower-+.f32N/A

        \[\leadsto \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(maxCos \cdot \color{blue}{\left(ux + \frac{1 - ux}{maxCos}\right)}\right)} \]
      5. lower-/.f32N/A

        \[\leadsto \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(maxCos \cdot \left(ux + \color{blue}{\frac{1 - ux}{maxCos}}\right)\right)} \]
      6. lower--.f3256.5

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

      \[\leadsto \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 \color{blue}{\left(maxCos \cdot \left(ux + \frac{1 - ux}{maxCos}\right)\right)}} \]
    6. Taylor expanded in ux around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(ux \cdot maxCos\right) \cdot \left(\mathsf{neg}\left(\left(2 + \left(\mathsf{neg}\left(\frac{\color{blue}{2}}{maxCos}\right)\right)\right)\right)\right)} \]
      12. distribute-neg-fracN/A

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

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{ux \cdot 2}} \]
      2. lower-*.f3273.5

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\color{blue}{ux \cdot 2}} \]
    11. Applied rewrites73.5%

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

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

Alternative 8: 76.5% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 - ux\right) + ux \cdot maxCos\\ t_1 := 2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{if}\;t\_0 \leq 0.999809980392456:\\ \;\;\;\;t\_1 \cdot \sqrt{1 + t\_0 \cdot \left(\left(ux + -1\right) - ux \cdot maxCos\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}\\ \end{array} \end{array} \]
(FPCore (ux uy maxCos)
 :precision binary32
 (let* ((t_0 (+ (- 1.0 ux) (* ux maxCos))) (t_1 (* 2.0 (* uy (PI)))))
   (if (<= t_0 0.999809980392456)
     (* t_1 (sqrt (+ 1.0 (* t_0 (- (+ ux -1.0) (* ux maxCos))))))
     (* t_1 (sqrt (* ux (+ 2.0 (* maxCos -2.0))))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(1 - ux\right) + ux \cdot maxCos\\
t_1 := 2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{if}\;t\_0 \leq 0.999809980392456:\\
\;\;\;\;t\_1 \cdot \sqrt{1 + t\_0 \cdot \left(\left(ux + -1\right) - ux \cdot maxCos\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) < 0.99980998

    1. Initial program 88.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 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. lower-*.f32N/A

        \[\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)} \]
      2. lower-*.f32N/A

        \[\leadsto \left(2 \cdot \color{blue}{\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)} \]
      3. lower-PI.f3272.6

        \[\leadsto \left(2 \cdot \left(uy \cdot \color{blue}{\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)} \]
    5. Applied rewrites72.6%

      \[\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)} \]

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

    1. Initial program 34.3%

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      7. lower-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      9. metadata-evalN/A

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

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

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

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(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}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    6. Step-by-step derivation
      1. lower-*.f32N/A

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(1 - ux\right) + ux \cdot maxCos \leq 0.999809980392456:\\ \;\;\;\;\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(ux + -1\right) - ux \cdot maxCos\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 81.2% accurate, 2.2× speedup?

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

\\
\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\left(1 - maxCos\right) \cdot \left(maxCos + -1\right) + \frac{\left(1 + \left(1 - maxCos\right)\right) - maxCos}{ux}\right)}
\end{array}
Derivation
  1. Initial program 57.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. 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(\left(1 - ux\right) + \color{blue}{ux \cdot maxCos}\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. associate-+l-N/A

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    7. lower-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    9. metadata-evalN/A

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

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

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

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

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

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

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(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}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  6. Step-by-step derivation
    1. lower-*.f32N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{\color{blue}{maxCos - \left(1 + -1 \cdot \left(maxCos - 1\right)\right)}}{ux} - \left(1 + -1 \cdot maxCos\right) \cdot \left(maxCos - 1\right)\right)\right)\right)} \]
    10. mul-1-negN/A

      \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{maxCos - \left(1 + \color{blue}{\left(\mathsf{neg}\left(\left(maxCos - 1\right)\right)\right)}\right)}{ux} - \left(1 + -1 \cdot maxCos\right) \cdot \left(maxCos - 1\right)\right)\right)\right)} \]
    11. unsub-negN/A

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

      \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\left(ux \cdot ux\right) \cdot \left(\mathsf{neg}\left(\left(\frac{maxCos - \color{blue}{\left(1 - \left(maxCos - 1\right)\right)}}{ux} - \left(1 + -1 \cdot maxCos\right) \cdot \left(maxCos - 1\right)\right)\right)\right)} \]
    13. sub-negN/A

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

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

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

    \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\color{blue}{\left(ux \cdot ux\right) \cdot \left(-\left(\frac{maxCos - \left(1 - \left(maxCos + -1\right)\right)}{ux} - \left(1 - maxCos\right) \cdot \left(maxCos + -1\right)\right)\right)}} \]
  11. Final simplification79.2%

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

Alternative 10: 75.5% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
t_0 := 2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{if}\;\left(1 - ux\right) + ux \cdot maxCos \leq 0.9997699856758118:\\
\;\;\;\;t\_0 \cdot \sqrt{1 + \left(1 - ux\right) \cdot \left(\left(ux + -1\right) - ux \cdot maxCos\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) < 0.999769986

    1. Initial program 89.4%

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

      \[\leadsto \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 \color{blue}{\left(maxCos \cdot \left(\left(ux + \frac{1}{maxCos}\right) - \frac{ux}{maxCos}\right)\right)}} \]
    4. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \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(maxCos \cdot \color{blue}{\left(ux + \left(\frac{1}{maxCos} - \frac{ux}{maxCos}\right)\right)}\right)} \]
      3. div-subN/A

        \[\leadsto \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(maxCos \cdot \left(ux + \color{blue}{\frac{1 - ux}{maxCos}}\right)\right)} \]
      4. lower-+.f32N/A

        \[\leadsto \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(maxCos \cdot \color{blue}{\left(ux + \frac{1 - ux}{maxCos}\right)}\right)} \]
      5. lower-/.f32N/A

        \[\leadsto \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(maxCos \cdot \left(ux + \color{blue}{\frac{1 - ux}{maxCos}}\right)\right)} \]
      6. lower--.f3288.7

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

      \[\leadsto \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 \color{blue}{\left(maxCos \cdot \left(ux + \frac{1 - ux}{maxCos}\right)\right)}} \]
    6. 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(maxCos \cdot \left(ux + \frac{1 - ux}{maxCos}\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f32N/A

        \[\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(maxCos \cdot \left(ux + \frac{1 - ux}{maxCos}\right)\right)} \]
      2. lower-*.f32N/A

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

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

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

      \[\leadsto \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 \color{blue}{\left(1 - ux\right)}} \]
    10. Step-by-step derivation
      1. lower--.f3270.0

        \[\leadsto \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 \color{blue}{\left(1 - ux\right)}} \]
    11. Applied rewrites70.0%

      \[\leadsto \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 \color{blue}{\left(1 - ux\right)}} \]

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

    1. Initial program 35.3%

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      7. lower-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      9. metadata-evalN/A

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

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

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

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(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}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    6. Step-by-step derivation
      1. lower-*.f32N/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 81.1% accurate, 2.4× speedup?

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

\\
\sqrt{\frac{2 + maxCos \cdot -2}{ux} + \left(1 - maxCos\right) \cdot \left(maxCos + -1\right)} \cdot \left(2 \cdot \left(ux \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 57.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. 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(\left(1 - ux\right) + \color{blue}{ux \cdot maxCos}\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. associate-+l-N/A

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    7. lower-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    9. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(2 \cdot \left(ux \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \sqrt{\color{blue}{\left(2 \cdot \frac{1}{ux} - 2 \cdot \frac{maxCos}{ux}\right) - {\left(1 - maxCos\right)}^{2}}} \]
  10. Applied rewrites79.1%

    \[\leadsto \color{blue}{\left(2 \cdot \left(ux \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \sqrt{\frac{2 + -2 \cdot maxCos}{ux} - \left(1 - maxCos\right) \cdot \left(1 - maxCos\right)}} \]
  11. Final simplification79.1%

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

Alternative 12: 75.4% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
t_0 := 2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\\
\mathbf{if}\;\left(1 - ux\right) + ux \cdot maxCos \leq 0.9997699856758118:\\
\;\;\;\;t\_0 \cdot \sqrt{1 + \left(1 - ux\right) \cdot \left(ux + -1\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f32 (-.f32 #s(literal 1 binary32) ux) (*.f32 ux maxCos)) < 0.999769986

    1. Initial program 89.4%

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

      \[\leadsto \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 \color{blue}{\left(maxCos \cdot \left(\left(ux + \frac{1}{maxCos}\right) - \frac{ux}{maxCos}\right)\right)}} \]
    4. Step-by-step derivation
      1. lower-*.f32N/A

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

        \[\leadsto \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(maxCos \cdot \color{blue}{\left(ux + \left(\frac{1}{maxCos} - \frac{ux}{maxCos}\right)\right)}\right)} \]
      3. div-subN/A

        \[\leadsto \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(maxCos \cdot \left(ux + \color{blue}{\frac{1 - ux}{maxCos}}\right)\right)} \]
      4. lower-+.f32N/A

        \[\leadsto \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(maxCos \cdot \color{blue}{\left(ux + \frac{1 - ux}{maxCos}\right)}\right)} \]
      5. lower-/.f32N/A

        \[\leadsto \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(maxCos \cdot \left(ux + \color{blue}{\frac{1 - ux}{maxCos}}\right)\right)} \]
      6. lower--.f3288.7

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

      \[\leadsto \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 \color{blue}{\left(maxCos \cdot \left(ux + \frac{1 - ux}{maxCos}\right)\right)}} \]
    6. 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(maxCos \cdot \left(ux + \frac{1 - ux}{maxCos}\right)\right)} \]
    7. Step-by-step derivation
      1. lower-*.f32N/A

        \[\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(maxCos \cdot \left(ux + \frac{1 - ux}{maxCos}\right)\right)} \]
      2. lower-*.f32N/A

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{1 - \left(1 - ux\right) \cdot \color{blue}{\left(1 - ux\right)}} \]
    11. Applied rewrites69.7%

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

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

    1. Initial program 35.3%

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

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

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

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

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      7. lower-+.f32N/A

        \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
      9. metadata-evalN/A

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

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

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

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

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(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}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    6. Step-by-step derivation
      1. lower-*.f32N/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 65.7% accurate, 4.0× speedup?

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

\\
\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{ux \cdot \left(2 + maxCos \cdot -2\right)}
\end{array}
Derivation
  1. Initial program 57.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. 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(\left(1 - ux\right) + \color{blue}{ux \cdot maxCos}\right) \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    2. associate-+l-N/A

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

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

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

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\color{blue}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    7. lower-+.f32N/A

      \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \frac{1}{\frac{\color{blue}{1 + \left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(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 - \frac{1}{\frac{1 + \color{blue}{\left(ux - ux \cdot maxCos\right)}}{1 \cdot 1 - \left(ux - ux \cdot maxCos\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
    9. metadata-evalN/A

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

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

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

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

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

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

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

    \[\leadsto \sin \left(\left(uy \cdot 2\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{1 - \color{blue}{\frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(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}{\left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \sqrt{1 - \frac{1}{\frac{1 + \left(ux - ux \cdot maxCos\right)}{1 + \left(ux \cdot \left(-1 + maxCos\right)\right) \cdot \left(ux - ux \cdot maxCos\right)}} \cdot \left(\left(1 - ux\right) + ux \cdot maxCos\right)} \]
  6. Step-by-step derivation
    1. lower-*.f32N/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 63.0% accurate, 4.0× speedup?

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

\\
2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{-2 \cdot \mathsf{fma}\left(ux, maxCos, -ux\right)}\right)
\end{array}
Derivation
  1. Initial program 57.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 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)}^{2}}\right)} \]
  4. Step-by-step derivation
    1. lower-*.f32N/A

      \[\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)}^{2}}\right)} \]
    2. 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)}^{2}}\right)} \]
    3. lower-*.f32N/A

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

      \[\leadsto 2 \cdot \left(\left(uy \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{1 - {\left(\left(1 + maxCos \cdot ux\right) - ux\right)}^{2}}\right) \]
    5. lower-sqrt.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)}^{2}}}\right) \]
    6. sub-negN/A

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

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

      \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(1 + maxCos \cdot ux\right) - ux\right) \cdot \left(\left(1 + maxCos \cdot ux\right) - ux\right)}\right)\right) + 1}\right) \]
    9. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{-2 \cdot \mathsf{fma}\left(ux, maxCos, \color{blue}{\mathsf{neg}\left(ux\right)}\right)}\right) \]
    8. lower-neg.f3262.5

      \[\leadsto 2 \cdot \left(\left(uy \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{-2 \cdot \mathsf{fma}\left(ux, maxCos, \color{blue}{-ux}\right)}\right) \]
  8. Applied rewrites-0.0%

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

Alternative 15: 30.8% accurate, 6.0× speedup?

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

\\
\left(uy \cdot \sqrt{ux}\right) \cdot \left(2 \cdot \mathsf{PI}\left(\right)\right)
\end{array}
Derivation
  1. Initial program 57.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{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \color{blue}{1}} \]
  4. Step-by-step derivation
    1. Applied rewrites26.2%

      \[\leadsto \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 \color{blue}{1}} \]
    2. Taylor expanded in uy around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\mathsf{neg}\left(maxCos\right)}, ux\right)} \]
      20. lower-neg.f3230.4

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

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

      \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\sqrt{ux}} \]
    6. Step-by-step derivation
      1. lower-sqrt.f3230.5

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\sqrt{ux}} \]
    7. Applied rewrites30.5%

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{ux} \cdot \left(\color{blue}{\left(uy \cdot \mathsf{PI}\left(\right)\right)} \cdot 2\right) \]
      9. associate-*l*N/A

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

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

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

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

        \[\leadsto \color{blue}{\left(\sqrt{ux} \cdot uy\right)} \cdot \left(2 \cdot \mathsf{PI}\left(\right)\right) \]
      14. lower-*.f3230.5

        \[\leadsto \left(\sqrt{ux} \cdot uy\right) \cdot \color{blue}{\left(2 \cdot \mathsf{PI}\left(\right)\right)} \]
    9. Applied rewrites30.5%

      \[\leadsto \color{blue}{\left(\sqrt{ux} \cdot uy\right) \cdot \left(2 \cdot \mathsf{PI}\left(\right)\right)} \]
    10. Final simplification30.5%

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

    Alternative 16: 30.8% accurate, 6.0× speedup?

    \[\begin{array}{l} \\ \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{ux} \end{array} \]
    (FPCore (ux uy maxCos) :precision binary32 (* (* 2.0 (* uy (PI))) (sqrt ux)))
    \begin{array}{l}
    
    \\
    \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{ux}
    \end{array}
    
    Derivation
    1. Initial program 57.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{1 - \left(\left(1 - ux\right) + ux \cdot maxCos\right) \cdot \color{blue}{1}} \]
    4. Step-by-step derivation
      1. Applied rewrites26.2%

        \[\leadsto \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 \color{blue}{1}} \]
      2. Taylor expanded in uy around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sqrt{\mathsf{fma}\left(ux, \color{blue}{\mathsf{neg}\left(maxCos\right)}, ux\right)} \]
        20. lower-neg.f3230.4

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

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

        \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\sqrt{ux}} \]
      6. Step-by-step derivation
        1. lower-sqrt.f3230.5

          \[\leadsto \left(2 \cdot \left(uy \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \color{blue}{\sqrt{ux}} \]
      7. Applied rewrites30.5%

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

      Reproduce

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