ab-angle->ABCF A

Percentage Accurate: 80.1% → 80.1%
Time: 8.1s
Alternatives: 19
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) (PI))))
   (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}

Sampling outcomes in binary64 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 19 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: 80.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) (PI))))
   (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}

Alternative 1: 80.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\mathsf{PI}\left(\right)}\\ {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{t\_0}{180}\right) \cdot t\_0\right)\right)}^{2} \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (sqrt (PI))))
   (+
    (pow (* a (sin (* (* 0.005555555555555556 angle) (PI)))) 2.0)
    (pow (* b (cos (* (* angle (/ t_0 180.0)) t_0))) 2.0))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
{\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{t\_0}{180}\right) \cdot t\_0\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 81.4%

    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
    2. lift-PI.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
    3. add-sqr-sqrtN/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)\right)}^{2} \]
    4. associate-*r*N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
    5. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
    6. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
    7. lift-PI.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
    8. lower-sqrt.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
    9. lift-PI.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right)\right)}^{2} \]
    10. lower-sqrt.f6481.5

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)\right)}^{2} \]
  4. Applied rewrites81.5%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
    2. lift-/.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\color{blue}{\frac{angle}{180}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
    3. associate-*l/N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\frac{angle \cdot \sqrt{\mathsf{PI}\left(\right)}}{180}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
    4. associate-/l*N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
    5. lower-*.f64N/A

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
    6. lower-/.f6481.5

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{180}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
  6. Applied rewrites81.5%

    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
  7. Taylor expanded in angle around 0

    \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
  8. Step-by-step derivation
    1. lower-*.f6481.5

      \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
  9. Applied rewrites81.5%

    \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
  10. Add Preprocessing

Alternative 2: 67.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ t_1 := {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}\\ t_2 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\\ t_3 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-99}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(-3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot a - b \cdot b\right)\right) \cdot t\_3\right) \cdot angle, -angle, b \cdot b\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+299}:\\ \;\;\;\;\mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, \left(t\_3 \cdot angle\right) \cdot angle - \frac{t\_2 \cdot t\_2}{b \cdot b}, 1\right) \cdot \left(b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot t\_3\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) (PI)))
        (t_1 (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0)))
        (t_2 (* (* (PI) angle) a))
        (t_3 (* (PI) (PI))))
   (if (<= t_1 2e-99)
     (fma
      (* (* (* (- 3.08641975308642e-5) (- (* a a) (* b b))) t_3) angle)
      (- angle)
      (* b b))
     (if (<= t_1 2e+299)
       (*
        (fma
         -3.08641975308642e-5
         (- (* (* t_3 angle) angle) (/ (* t_2 t_2) (* b b)))
         1.0)
        (* b b))
       (fma
        (* (* (* 3.08641975308642e-5 t_3) a) a)
        (* angle angle)
        (* b b))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
t_1 := {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}\\
t_2 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\\
t_3 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-99}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\left(-3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot a - b \cdot b\right)\right) \cdot t\_3\right) \cdot angle, -angle, b \cdot b\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;\mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, \left(t\_3 \cdot angle\right) \cdot angle - \frac{t\_2 \cdot t\_2}{b \cdot b}, 1\right) \cdot \left(b \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot t\_3\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) < 2e-99

    1. Initial program 79.8%

      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
      2. *-commutativeN/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
      3. lift-PI.f64N/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
      4. add-cube-cbrtN/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
      5. associate-*l*N/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
      6. lower-*.f64N/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
      7. pow2N/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
      8. lower-pow.f64N/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
      9. lift-PI.f64N/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
      10. lower-cbrt.f64N/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
      11. lower-*.f64N/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
      12. lift-PI.f64N/A

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
      13. lower-cbrt.f6479.9

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
    4. Applied rewrites79.9%

      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
    5. Taylor expanded in angle around 0

      \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
    7. Applied rewrites57.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
    8. Step-by-step derivation
      1. Applied rewrites73.6%

        \[\leadsto \mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a - b \cdot b\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(-angle\right), \color{blue}{-angle}, b \cdot b\right) \]

      if 2e-99 < (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) < 2.0000000000000001e299

      1. Initial program 67.2%

        \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
        2. *-commutativeN/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
        3. lift-PI.f64N/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
        4. add-cube-cbrtN/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
        5. associate-*l*N/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
        6. lower-*.f64N/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
        7. pow2N/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
        8. lower-pow.f64N/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
        9. lift-PI.f64N/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
        10. lower-cbrt.f64N/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
        11. lower-*.f64N/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
        12. lift-PI.f64N/A

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
        13. lower-cbrt.f6467.4

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
      4. Applied rewrites67.4%

        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
      5. Taylor expanded in angle around 0

        \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
      7. Applied rewrites39.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
      8. Taylor expanded in b around inf

        \[\leadsto {b}^{2} \cdot \color{blue}{\left(1 + \left(\frac{-1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \frac{{a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}{{b}^{2}}\right)\right)} \]
      9. Step-by-step derivation
        1. Applied rewrites47.0%

          \[\leadsto \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot angle - \frac{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}{b \cdot b}, 1\right) \cdot \color{blue}{\left(b \cdot b\right)} \]

        if 2.0000000000000001e299 < (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)))

        1. Initial program 100.0%

          \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
          2. *-commutativeN/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
          3. lift-PI.f64N/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
          4. add-cube-cbrtN/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
          5. associate-*l*N/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
          6. lower-*.f64N/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
          7. pow2N/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
          8. lower-pow.f64N/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
          9. lift-PI.f64N/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
          10. lower-cbrt.f64N/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
          11. lower-*.f64N/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
          12. lift-PI.f64N/A

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
          13. lower-cbrt.f64100.0

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
        4. Applied rewrites100.0%

          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
        5. Taylor expanded in angle around 0

          \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
          2. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
        7. Applied rewrites33.0%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
        8. Taylor expanded in a around inf

          \[\leadsto \mathsf{fma}\left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \color{blue}{angle} \cdot angle, b \cdot b\right) \]
        9. Step-by-step derivation
          1. Applied rewrites97.8%

            \[\leadsto \mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, \color{blue}{angle} \cdot angle, b \cdot b\right) \]
        10. Recombined 3 regimes into one program.
        11. Final simplification70.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \leq 2 \cdot 10^{-99}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(-3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot a - b \cdot b\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle, -angle, b \cdot b\right)\\ \mathbf{elif}\;{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \leq 2 \cdot 10^{+299}:\\ \;\;\;\;\mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot angle - \frac{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}{b \cdot b}, 1\right) \cdot \left(b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\ \end{array} \]
        12. Add Preprocessing

        Alternative 3: 73.8% accurate, 0.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ \mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 2 \cdot 10^{+299}:\\ \;\;\;\;{\left(\left(-a\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{-180}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\ \end{array} \end{array} \]
        (FPCore (a b angle)
         :precision binary64
         (let* ((t_0 (* (/ angle 180.0) (PI))))
           (if (<= (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0)) 2e+299)
             (+
              (pow (* (- a) (sin (/ (* (PI) angle) -180.0))) 2.0)
              (fma
               (* (* (* (* (* b b) (PI)) (PI)) -3.08641975308642e-5) angle)
               angle
               (* b b)))
             (fma
              (* (* (* 3.08641975308642e-5 (* (PI) (PI))) a) a)
              (* angle angle)
              (* b b)))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
        \mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 2 \cdot 10^{+299}:\\
        \;\;\;\;{\left(\left(-a\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{-180}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) < 2.0000000000000001e299

          1. Initial program 71.2%

            \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
            2. *-commutativeN/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
            3. lift-PI.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
            4. add-cube-cbrtN/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
            5. associate-*l*N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
            6. lower-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
            7. pow2N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            8. lower-pow.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            9. lift-PI.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            10. lower-cbrt.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            11. lower-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
            12. lift-PI.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            13. lower-cbrt.f6471.3

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
          4. Applied rewrites71.3%

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
          5. Taylor expanded in angle around 0

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\left(\frac{-1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}\right)} \]
          6. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\frac{-1}{32400} \cdot \color{blue}{\left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {angle}^{2}\right)} + {b}^{2}\right) \]
            2. associate-*r*N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2}\right) \]
            3. unpow2N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\left(angle \cdot angle\right)} + {b}^{2}\right) \]
            4. associate-*r*N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\color{blue}{\left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot angle\right) \cdot angle} + {b}^{2}\right) \]
            5. lower-fma.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot angle, angle, {b}^{2}\right)} \]
          7. Applied rewrites66.2%

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)} \]
          8. Step-by-step derivation
            1. lift-sin.f64N/A

              \[\leadsto {\left(a \cdot \color{blue}{\sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            2. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            3. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\frac{angle}{180}} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            4. lift-PI.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            5. lift-PI.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            6. *-commutativeN/A

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            7. associate-/l*N/A

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            8. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{\color{blue}{\mathsf{PI}\left(\right) \cdot angle}}{180}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            9. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            10. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)}\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            11. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{\color{blue}{\mathsf{PI}\left(\right) \cdot angle}}{180}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            12. *-commutativeN/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{\color{blue}{angle \cdot \mathsf{PI}\left(\right)}}{180}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            13. rem-square-sqrtN/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}}{180}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            14. lift-sqrt.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle \cdot \left(\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}{180}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            15. lift-sqrt.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)}{180}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            16. associate-*r*N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{\color{blue}{\left(angle \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}}}{180}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            17. associate-*l/N/A

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\frac{angle \cdot \sqrt{\mathsf{PI}\left(\right)}}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            18. associate-*r/N/A

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            19. lift-/.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\left(angle \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{180}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            20. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
            21. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-1}{32400}\right) \cdot angle, angle, b \cdot b\right) \]
          9. Applied rewrites66.3%

            \[\leadsto {\left(a \cdot \color{blue}{\left(-\sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{-180}\right)\right)}\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right) \]

          if 2.0000000000000001e299 < (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)))

          1. Initial program 100.0%

            \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
            2. *-commutativeN/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
            3. lift-PI.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
            4. add-cube-cbrtN/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
            5. associate-*l*N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
            6. lower-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
            7. pow2N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            8. lower-pow.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            9. lift-PI.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            10. lower-cbrt.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            11. lower-*.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
            12. lift-PI.f64N/A

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            13. lower-cbrt.f64100.0

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
          4. Applied rewrites100.0%

            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
          5. Taylor expanded in angle around 0

            \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
          6. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
            2. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
          7. Applied rewrites33.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
          8. Taylor expanded in a around inf

            \[\leadsto \mathsf{fma}\left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \color{blue}{angle} \cdot angle, b \cdot b\right) \]
          9. Step-by-step derivation
            1. Applied rewrites97.8%

              \[\leadsto \mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, \color{blue}{angle} \cdot angle, b \cdot b\right) \]
          10. Recombined 2 regimes into one program.
          11. Final simplification77.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \leq 2 \cdot 10^{+299}:\\ \;\;\;\;{\left(\left(-a\right) \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{-180}\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\ \end{array} \]
          12. Add Preprocessing

          Alternative 4: 73.8% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ t_1 := {\left(a \cdot \sin t\_0\right)}^{2}\\ \mathbf{if}\;t\_1 + {\left(b \cdot \cos t\_0\right)}^{2} \leq 2 \cdot 10^{+299}:\\ \;\;\;\;t\_1 + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* (/ angle 180.0) (PI))) (t_1 (pow (* a (sin t_0)) 2.0)))
             (if (<= (+ t_1 (pow (* b (cos t_0)) 2.0)) 2e+299)
               (+
                t_1
                (fma
                 (* (* (* (* (* b b) (PI)) (PI)) -3.08641975308642e-5) angle)
                 angle
                 (* b b)))
               (fma
                (* (* (* 3.08641975308642e-5 (* (PI) (PI))) a) a)
                (* angle angle)
                (* b b)))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
          t_1 := {\left(a \cdot \sin t\_0\right)}^{2}\\
          \mathbf{if}\;t\_1 + {\left(b \cdot \cos t\_0\right)}^{2} \leq 2 \cdot 10^{+299}:\\
          \;\;\;\;t\_1 + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) < 2.0000000000000001e299

            1. Initial program 71.2%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              2. *-commutativeN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
              3. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
              4. add-cube-cbrtN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
              5. associate-*l*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
              6. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
              7. pow2N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
              8. lower-pow.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
              9. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
              10. lower-cbrt.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
              11. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
              12. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
              13. lower-cbrt.f6471.3

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            4. Applied rewrites71.3%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
            5. Taylor expanded in angle around 0

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\left(\frac{-1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}\right)} \]
            6. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\frac{-1}{32400} \cdot \color{blue}{\left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {angle}^{2}\right)} + {b}^{2}\right) \]
              2. associate-*r*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2}\right) \]
              3. unpow2N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\left(angle \cdot angle\right)} + {b}^{2}\right) \]
              4. associate-*r*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\color{blue}{\left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot angle\right) \cdot angle} + {b}^{2}\right) \]
              5. lower-fma.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot angle, angle, {b}^{2}\right)} \]
            7. Applied rewrites66.2%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)} \]

            if 2.0000000000000001e299 < (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)))

            1. Initial program 100.0%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              2. *-commutativeN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
              3. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
              4. add-cube-cbrtN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
              5. associate-*l*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
              6. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
              7. pow2N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
              8. lower-pow.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
              9. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
              10. lower-cbrt.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
              11. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
              12. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
              13. lower-cbrt.f64100.0

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
            4. Applied rewrites100.0%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
            5. Taylor expanded in angle around 0

              \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
            6. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
            7. Applied rewrites33.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
            8. Taylor expanded in a around inf

              \[\leadsto \mathsf{fma}\left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \color{blue}{angle} \cdot angle, b \cdot b\right) \]
            9. Step-by-step derivation
              1. Applied rewrites97.8%

                \[\leadsto \mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, \color{blue}{angle} \cdot angle, b \cdot b\right) \]
            10. Recombined 2 regimes into one program.
            11. Final simplification77.5%

              \[\leadsto \begin{array}{l} \mathbf{if}\;{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \leq 2 \cdot 10^{+299}:\\ \;\;\;\;{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\ \end{array} \]
            12. Add Preprocessing

            Alternative 5: 80.1% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}^{2} \end{array} \]
            (FPCore (a b angle)
             :precision binary64
             (+
              (pow (* a (sin (* (* 0.005555555555555556 angle) (PI)))) 2.0)
              (pow (* b (sin (fma (PI) (/ angle 180.0) (/ (PI) 2.0)))) 2.0)))
            \begin{array}{l}
            
            \\
            {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}^{2}
            \end{array}
            
            Derivation
            1. Initial program 81.4%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              2. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              3. add-sqr-sqrtN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)\right)}^{2} \]
              4. associate-*r*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
              5. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
              6. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              7. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              8. lower-sqrt.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              9. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right)\right)}^{2} \]
              10. lower-sqrt.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)\right)}^{2} \]
            4. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              2. lift-/.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\color{blue}{\frac{angle}{180}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              3. associate-*l/N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\frac{angle \cdot \sqrt{\mathsf{PI}\left(\right)}}{180}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              4. associate-/l*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              5. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              6. lower-/.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{180}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            6. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            7. Taylor expanded in angle around 0

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            8. Step-by-step derivation
              1. lower-*.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            9. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            10. Step-by-step derivation
              1. lift-cos.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
              2. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
              3. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              4. associate-*l*N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(angle \cdot \left(\frac{\sqrt{\mathsf{PI}\left(\right)}}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}\right)}^{2} \]
              5. lift-/.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \left(\color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{180}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)}^{2} \]
              6. associate-*l/N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}}{180}}\right)\right)}^{2} \]
              7. lift-sqrt.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\color{blue}{\sqrt{\mathsf{PI}\left(\right)}} \cdot \sqrt{\mathsf{PI}\left(\right)}}{180}\right)\right)}^{2} \]
              8. lift-sqrt.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}}{180}\right)\right)}^{2} \]
              9. rem-square-sqrtN/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(angle \cdot \frac{\color{blue}{\mathsf{PI}\left(\right)}}{180}\right)\right)}^{2} \]
              10. associate-/l*N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle \cdot \mathsf{PI}\left(\right)}{180}\right)}\right)}^{2} \]
              11. associate-*l/N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              12. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              13. lift-/.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\frac{angle}{180}} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              14. sin-+PI/2-revN/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right)}^{2} \]
              15. lower-sin.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right)}^{2} \]
            11. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}\right)}^{2} \]
            12. Add Preprocessing

            Alternative 6: 80.1% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-0.005555555555555556, angle, 0.5\right)\right)\right)}^{2} \end{array} \]
            (FPCore (a b angle)
             :precision binary64
             (+
              (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0)
              (pow (* b (sin (* (PI) (fma -0.005555555555555556 angle 0.5)))) 2.0)))
            \begin{array}{l}
            
            \\
            {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-0.005555555555555556, angle, 0.5\right)\right)\right)}^{2}
            \end{array}
            
            Derivation
            1. Initial program 81.4%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-cos.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              2. cos-neg-revN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
              3. sin-+PI/2-revN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\left(\mathsf{neg}\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right)}^{2} \]
              4. lower-sin.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\left(\mathsf{neg}\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right)}^{2} \]
              5. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(\mathsf{neg}\left(\color{blue}{\frac{angle}{180} \cdot \mathsf{PI}\left(\right)}\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
              6. *-commutativeN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(\mathsf{neg}\left(\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{angle}{180}}\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
              7. distribute-lft-neg-inN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \cdot \frac{angle}{180}} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
              8. lower-fma.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{fma}\left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}\right)}^{2} \]
              9. lower-neg.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{-\mathsf{PI}\left(\right)}, \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}^{2} \]
              10. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(-\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\color{blue}{\mathsf{PI}\left(\right)}}{2}\right)\right)\right)}^{2} \]
              11. lower-/.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(-\mathsf{PI}\left(\right), \frac{angle}{180}, \color{blue}{\frac{\mathsf{PI}\left(\right)}{2}}\right)\right)\right)}^{2} \]
            4. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\mathsf{fma}\left(-\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}\right)}^{2} \]
            5. Taylor expanded in angle around 0

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
            6. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left(\frac{-1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)} + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              2. distribute-rgt-outN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{180} \cdot angle + \frac{1}{2}\right)\right)}\right)}^{2} \]
              3. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{180} \cdot angle + \frac{1}{2}\right)\right)}\right)}^{2} \]
              4. lower-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{-1}{180} \cdot angle + \frac{1}{2}\right)\right)\right)}^{2} \]
              5. lower-fma.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{fma}\left(-0.005555555555555556, angle, 0.5\right)}\right)\right)}^{2} \]
            7. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-0.005555555555555556, angle, 0.5\right)\right)}\right)}^{2} \]
            8. Add Preprocessing

            Alternative 7: 80.1% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\ {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \end{array} \end{array} \]
            (FPCore (a b angle)
             :precision binary64
             (let* ((t_0 (* (* 0.005555555555555556 angle) (PI))))
               (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\
            {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
            \end{array}
            \end{array}
            
            Derivation
            1. Initial program 81.4%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              2. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              3. add-sqr-sqrtN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)\right)}^{2} \]
              4. associate-*r*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
              5. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
              6. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              7. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              8. lower-sqrt.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              9. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right)\right)}^{2} \]
              10. lower-sqrt.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)\right)}^{2} \]
            4. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              2. lift-/.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\color{blue}{\frac{angle}{180}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              3. associate-*l/N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\frac{angle \cdot \sqrt{\mathsf{PI}\left(\right)}}{180}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              4. associate-/l*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              5. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              6. lower-/.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{180}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            6. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            7. Taylor expanded in angle around 0

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            8. Step-by-step derivation
              1. lower-*.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            9. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            10. Taylor expanded in angle around inf

              \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
            11. Step-by-step derivation
              1. metadata-evalN/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{180}\right)\right)} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}^{2} \]
              2. distribute-lft-neg-inN/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right)}^{2} \]
              3. lower-cos.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right)}^{2} \]
              4. distribute-lft-neg-inN/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\mathsf{neg}\left(\frac{-1}{180}\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
              5. metadata-evalN/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\frac{1}{180}} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}^{2} \]
              6. associate-*r*N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              7. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              8. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              9. lower-PI.f6481.4

                \[\leadsto {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            12. Applied rewrites81.4%

              \[\leadsto {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
            13. Add Preprocessing

            Alternative 8: 80.1% accurate, 1.4× speedup?

            \[\begin{array}{l} \\ {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2} \end{array} \]
            (FPCore (a b angle)
             :precision binary64
             (+
              (pow (* a (sin (* (* 0.005555555555555556 angle) (PI)))) 2.0)
              (pow (* b 1.0) 2.0)))
            \begin{array}{l}
            
            \\
            {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2}
            \end{array}
            
            Derivation
            1. Initial program 81.4%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
              2. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              3. add-sqr-sqrtN/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \color{blue}{\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)\right)}^{2} \]
              4. associate-*r*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
              5. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
              6. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              7. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              8. lower-sqrt.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              9. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\color{blue}{\mathsf{PI}\left(\right)}}\right)\right)}^{2} \]
              10. lower-sqrt.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right)\right)}^{2} \]
            4. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}^{2} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\frac{angle}{180} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              2. lift-/.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\color{blue}{\frac{angle}{180}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              3. associate-*l/N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\frac{angle \cdot \sqrt{\mathsf{PI}\left(\right)}}{180}} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              4. associate-/l*N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              5. lower-*.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
              6. lower-/.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \color{blue}{\frac{\sqrt{\mathsf{PI}\left(\right)}}{180}}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            6. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            7. Taylor expanded in angle around 0

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            8. Step-by-step derivation
              1. lower-*.f6481.5

                \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            9. Applied rewrites81.5%

              \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\left(0.005555555555555556 \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(angle \cdot \frac{\sqrt{\mathsf{PI}\left(\right)}}{180}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \]
            10. Taylor expanded in angle around 0

              \[\leadsto {\left(a \cdot \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
            11. Step-by-step derivation
              1. Applied rewrites81.3%

                \[\leadsto {\left(a \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
              2. Add Preprocessing

              Alternative 9: 65.1% accurate, 1.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 3.5 \cdot 10^{-156}:\\ \;\;\;\;b \cdot b\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{+153}:\\ \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot a\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \end{array} \]
              (FPCore (a b angle)
               :precision binary64
               (if (<= a 3.5e-156)
                 (* b b)
                 (if (<= a 4.2e+153)
                   (+
                    (* (* 3.08641975308642e-5 (* angle angle)) (* (* (* (PI) (PI)) a) a))
                    (pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0))
                   (* (pow (* (* (PI) angle) a) 2.0) 3.08641975308642e-5))))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;a \leq 3.5 \cdot 10^{-156}:\\
              \;\;\;\;b \cdot b\\
              
              \mathbf{elif}\;a \leq 4.2 \cdot 10^{+153}:\\
              \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot a\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\\
              
              \mathbf{else}:\\
              \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if a < 3.4999999999999999e-156

                1. Initial program 83.4%

                  \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                2. Add Preprocessing
                3. Taylor expanded in angle around 0

                  \[\leadsto \color{blue}{{b}^{2}} \]
                4. Step-by-step derivation
                  1. unpow2N/A

                    \[\leadsto \color{blue}{b \cdot b} \]
                  2. lower-*.f6460.4

                    \[\leadsto \color{blue}{b \cdot b} \]
                5. Applied rewrites60.4%

                  \[\leadsto \color{blue}{b \cdot b} \]

                if 3.4999999999999999e-156 < a < 4.20000000000000033e153

                1. Initial program 69.0%

                  \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                2. Add Preprocessing
                3. Taylor expanded in angle around 0

                  \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \frac{1}{32400} \cdot \left({a}^{2} \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {angle}^{2}\right)}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  2. associate-*r*N/A

                    \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left(\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {angle}^{2}\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  3. associate-*l*N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  4. *-commutativeN/A

                    \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  5. associate-*r*N/A

                    \[\leadsto \color{blue}{\left({angle}^{2} \cdot \frac{1}{32400}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  6. metadata-evalN/A

                    \[\leadsto \left({angle}^{2} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{32400}\right)\right)}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  7. distribute-rgt-neg-inN/A

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left({angle}^{2} \cdot \frac{-1}{32400}\right)\right)} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  8. *-commutativeN/A

                    \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{-1}{32400} \cdot {angle}^{2}}\right)\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  9. distribute-lft-neg-inN/A

                    \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{-1}{32400}\right)\right) \cdot {angle}^{2}\right)} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  10. metadata-evalN/A

                    \[\leadsto \left(\color{blue}{\frac{1}{32400}} \cdot {angle}^{2}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  11. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  12. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right)} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  13. unpow2N/A

                    \[\leadsto \left(\frac{1}{32400} \cdot \color{blue}{\left(angle \cdot angle\right)}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  14. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{32400} \cdot \color{blue}{\left(angle \cdot angle\right)}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  15. *-commutativeN/A

                    \[\leadsto \left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {a}^{2}\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  16. unpow2N/A

                    \[\leadsto \left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{\left(a \cdot a\right)}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  17. associate-*r*N/A

                    \[\leadsto \left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\left(\left({\mathsf{PI}\left(\right)}^{2} \cdot a\right) \cdot a\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  18. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\left(\left({\mathsf{PI}\left(\right)}^{2} \cdot a\right) \cdot a\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                5. Applied rewrites62.2%

                  \[\leadsto \color{blue}{\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot a\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]

                if 4.20000000000000033e153 < a

                1. Initial program 99.6%

                  \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                  2. *-commutativeN/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                  3. lift-PI.f64N/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                  4. add-cube-cbrtN/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                  5. associate-*l*N/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                  6. lower-*.f64N/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                  7. pow2N/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                  8. lower-pow.f64N/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                  9. lift-PI.f64N/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                  10. lower-cbrt.f64N/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                  11. lower-*.f64N/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                  12. lift-PI.f64N/A

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                  13. lower-cbrt.f6499.6

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                4. Applied rewrites99.6%

                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                5. Taylor expanded in angle around 0

                  \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                6. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                  2. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                7. Applied rewrites42.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                8. Taylor expanded in a around inf

                  \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                9. Step-by-step derivation
                  1. Applied rewrites63.5%

                    \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot angle\right)} \]
                  2. Step-by-step derivation
                    1. Applied rewrites86.9%

                      \[\leadsto \color{blue}{{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
                  3. Recombined 3 regimes into one program.
                  4. Final simplification63.9%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 3.5 \cdot 10^{-156}:\\ \;\;\;\;b \cdot b\\ \mathbf{elif}\;a \leq 4.2 \cdot 10^{+153}:\\ \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot a\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 10: 77.5% accurate, 1.7× speedup?

                  \[\begin{array}{l} \\ {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(\left(-b\right) \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right) \end{array} \]
                  (FPCore (a b angle)
                   :precision binary64
                   (+
                    (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0)
                    (fma
                     (* (* (* (* (* (- b) b) (PI)) (PI)) -3.08641975308642e-5) angle)
                     angle
                     (* b b))))
                  \begin{array}{l}
                  
                  \\
                  {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(\left(-b\right) \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)
                  \end{array}
                  
                  Derivation
                  1. Initial program 81.4%

                    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                    2. *-commutativeN/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                    3. lift-PI.f64N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    4. add-cube-cbrtN/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                    5. associate-*l*N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                    6. lower-*.f64N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                    7. pow2N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                    8. lower-pow.f64N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                    9. lift-PI.f64N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                    10. lower-cbrt.f64N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                    11. lower-*.f64N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                    12. lift-PI.f64N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                    13. lower-cbrt.f6481.5

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                  4. Applied rewrites81.5%

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                  5. Taylor expanded in angle around 0

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\left(\frac{-1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}\right)} \]
                  6. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\frac{-1}{32400} \cdot \color{blue}{\left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {angle}^{2}\right)} + {b}^{2}\right) \]
                    2. associate-*r*N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2}\right) \]
                    3. unpow2N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\left(angle \cdot angle\right)} + {b}^{2}\right) \]
                    4. associate-*r*N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\color{blue}{\left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot angle\right) \cdot angle} + {b}^{2}\right) \]
                    5. lower-fma.f64N/A

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot angle, angle, {b}^{2}\right)} \]
                  7. Applied rewrites47.8%

                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)} \]
                  8. Step-by-step derivation
                    1. Applied rewrites78.8%

                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\left(\left(\left(-b\right) \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right) \]
                    2. Add Preprocessing

                    Alternative 11: 64.5% accurate, 1.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ t_1 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ \mathbf{if}\;angle \leq 1.2 \cdot 10^{-21}:\\ \;\;\;\;{\left(a \cdot \sin t\_1\right)}^{2} + \mathsf{fma}\left(\left(t\_0 \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, 1\right) \cdot \left(b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \left(\left(t\_0 \cdot a\right) \cdot a\right) + {\left(b \cdot \cos t\_1\right)}^{2}\\ \end{array} \end{array} \]
                    (FPCore (a b angle)
                     :precision binary64
                     (let* ((t_0 (* (PI) (PI))) (t_1 (* (/ angle 180.0) (PI))))
                       (if (<= angle 1.2e-21)
                         (+
                          (pow (* a (sin t_1)) 2.0)
                          (* (fma (* (* t_0 -3.08641975308642e-5) angle) angle 1.0) (* b b)))
                         (+
                          (* (* 3.08641975308642e-5 (* angle angle)) (* (* t_0 a) a))
                          (pow (* b (cos t_1)) 2.0)))))
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
                    t_1 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
                    \mathbf{if}\;angle \leq 1.2 \cdot 10^{-21}:\\
                    \;\;\;\;{\left(a \cdot \sin t\_1\right)}^{2} + \mathsf{fma}\left(\left(t\_0 \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, 1\right) \cdot \left(b \cdot b\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \left(\left(t\_0 \cdot a\right) \cdot a\right) + {\left(b \cdot \cos t\_1\right)}^{2}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if angle < 1.2e-21

                      1. Initial program 86.9%

                        \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                      2. Add Preprocessing
                      3. Step-by-step derivation
                        1. lift-*.f64N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                        2. *-commutativeN/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                        3. lift-PI.f64N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                        4. add-cube-cbrtN/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                        5. associate-*l*N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                        6. lower-*.f64N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                        7. pow2N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                        8. lower-pow.f64N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                        9. lift-PI.f64N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                        10. lower-cbrt.f64N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                        11. lower-*.f64N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                        12. lift-PI.f64N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                        13. lower-cbrt.f6487.1

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                      4. Applied rewrites87.1%

                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                      5. Taylor expanded in angle around 0

                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\left(\frac{-1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}\right)} \]
                      6. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\frac{-1}{32400} \cdot \color{blue}{\left(\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {angle}^{2}\right)} + {b}^{2}\right) \]
                        2. associate-*r*N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2}\right) \]
                        3. unpow2N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot \color{blue}{\left(angle \cdot angle\right)} + {b}^{2}\right) \]
                        4. associate-*r*N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \left(\color{blue}{\left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot angle\right) \cdot angle} + {b}^{2}\right) \]
                        5. lower-fma.f64N/A

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot angle, angle, {b}^{2}\right)} \]
                      7. Applied rewrites57.8%

                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \color{blue}{\mathsf{fma}\left(\left(\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, b \cdot b\right)} \]
                      8. Taylor expanded in b around 0

                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot \color{blue}{\left(1 + \frac{-1}{32400} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                      9. Step-by-step derivation
                        1. Applied rewrites66.0%

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + \mathsf{fma}\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle, angle, 1\right) \cdot \color{blue}{\left(b \cdot b\right)} \]

                        if 1.2e-21 < angle

                        1. Initial program 65.9%

                          \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                        2. Add Preprocessing
                        3. Taylor expanded in angle around 0

                          \[\leadsto \color{blue}{\frac{1}{32400} \cdot \left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \frac{1}{32400} \cdot \left({a}^{2} \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {angle}^{2}\right)}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          2. associate-*r*N/A

                            \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left(\left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) \cdot {angle}^{2}\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          3. associate-*l*N/A

                            \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          4. *-commutativeN/A

                            \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          5. associate-*r*N/A

                            \[\leadsto \color{blue}{\left({angle}^{2} \cdot \frac{1}{32400}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          6. metadata-evalN/A

                            \[\leadsto \left({angle}^{2} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{32400}\right)\right)}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          7. distribute-rgt-neg-inN/A

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left({angle}^{2} \cdot \frac{-1}{32400}\right)\right)} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          8. *-commutativeN/A

                            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{-1}{32400} \cdot {angle}^{2}}\right)\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          9. distribute-lft-neg-inN/A

                            \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{-1}{32400}\right)\right) \cdot {angle}^{2}\right)} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          10. metadata-evalN/A

                            \[\leadsto \left(\color{blue}{\frac{1}{32400}} \cdot {angle}^{2}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          11. lower-*.f64N/A

                            \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          12. lower-*.f64N/A

                            \[\leadsto \color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right)} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          13. unpow2N/A

                            \[\leadsto \left(\frac{1}{32400} \cdot \color{blue}{\left(angle \cdot angle\right)}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          14. lower-*.f64N/A

                            \[\leadsto \left(\frac{1}{32400} \cdot \color{blue}{\left(angle \cdot angle\right)}\right) \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          15. *-commutativeN/A

                            \[\leadsto \left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\left({\mathsf{PI}\left(\right)}^{2} \cdot {a}^{2}\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          16. unpow2N/A

                            \[\leadsto \left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right) \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \color{blue}{\left(a \cdot a\right)}\right) + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          17. associate-*r*N/A

                            \[\leadsto \left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\left(\left({\mathsf{PI}\left(\right)}^{2} \cdot a\right) \cdot a\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          18. lower-*.f64N/A

                            \[\leadsto \left(\frac{1}{32400} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\left(\left({\mathsf{PI}\left(\right)}^{2} \cdot a\right) \cdot a\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                        5. Applied rewrites57.2%

                          \[\leadsto \color{blue}{\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot a\right)} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                      10. Recombined 2 regimes into one program.
                      11. Add Preprocessing

                      Alternative 12: 65.0% accurate, 2.0× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 2.1 \cdot 10^{-58}:\\ \;\;\;\;{\sin \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-0.005555555555555556, angle, 0.5\right)\right)}^{2} \cdot \left(b \cdot b\right)\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \end{array} \]
                      (FPCore (a b angle)
                       :precision binary64
                       (if (<= a 2.1e-58)
                         (* (pow (sin (* (PI) (fma -0.005555555555555556 angle 0.5))) 2.0) (* b b))
                         (if (<= a 1.35e+154)
                           (fma
                            (* (* (PI) (PI)) (* 3.08641975308642e-5 (* a a)))
                            (* angle angle)
                            (* b b))
                           (* (pow (* (* (PI) angle) a) 2.0) 3.08641975308642e-5))))
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;a \leq 2.1 \cdot 10^{-58}:\\
                      \;\;\;\;{\sin \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-0.005555555555555556, angle, 0.5\right)\right)}^{2} \cdot \left(b \cdot b\right)\\
                      
                      \mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\
                      \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if a < 2.09999999999999988e-58

                        1. Initial program 81.3%

                          \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                        2. Add Preprocessing
                        3. Step-by-step derivation
                          1. lift-cos.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                          2. cos-neg-revN/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
                          3. sin-+PI/2-revN/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\left(\mathsf{neg}\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right)}^{2} \]
                          4. lower-sin.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\left(\mathsf{neg}\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right)}^{2} \]
                          5. lift-*.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(\mathsf{neg}\left(\color{blue}{\frac{angle}{180} \cdot \mathsf{PI}\left(\right)}\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
                          6. *-commutativeN/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(\mathsf{neg}\left(\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{angle}{180}}\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
                          7. distribute-lft-neg-inN/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\color{blue}{\left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right) \cdot \frac{angle}{180}} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}^{2} \]
                          8. lower-fma.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \color{blue}{\left(\mathsf{fma}\left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}\right)}^{2} \]
                          9. lower-neg.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\color{blue}{-\mathsf{PI}\left(\right)}, \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}^{2} \]
                          10. lift-PI.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(-\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\color{blue}{\mathsf{PI}\left(\right)}}{2}\right)\right)\right)}^{2} \]
                          11. lower-/.f6481.4

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(-\mathsf{PI}\left(\right), \frac{angle}{180}, \color{blue}{\frac{\mathsf{PI}\left(\right)}{2}}\right)\right)\right)}^{2} \]
                        4. Applied rewrites81.4%

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\mathsf{fma}\left(-\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}\right)}^{2} \]
                        5. Taylor expanded in a around 0

                          \[\leadsto \color{blue}{{b}^{2} \cdot {\sin \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2}} \]
                        6. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{{\sin \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot {b}^{2}} \]
                          2. lower-*.f64N/A

                            \[\leadsto \color{blue}{{\sin \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot {b}^{2}} \]
                          3. lower-pow.f64N/A

                            \[\leadsto \color{blue}{{\sin \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2}} \cdot {b}^{2} \]
                          4. lower-sin.f64N/A

                            \[\leadsto {\color{blue}{\sin \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}}^{2} \cdot {b}^{2} \]
                          5. associate-*r*N/A

                            \[\leadsto {\sin \left(\color{blue}{\left(\frac{-1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)} + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot {b}^{2} \]
                          6. distribute-rgt-outN/A

                            \[\leadsto {\sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{180} \cdot angle + \frac{1}{2}\right)\right)}}^{2} \cdot {b}^{2} \]
                          7. lower-*.f64N/A

                            \[\leadsto {\sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \left(\frac{-1}{180} \cdot angle + \frac{1}{2}\right)\right)}}^{2} \cdot {b}^{2} \]
                          8. lower-PI.f64N/A

                            \[\leadsto {\sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{-1}{180} \cdot angle + \frac{1}{2}\right)\right)}^{2} \cdot {b}^{2} \]
                          9. lower-fma.f64N/A

                            \[\leadsto {\sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{180}, angle, \frac{1}{2}\right)}\right)}^{2} \cdot {b}^{2} \]
                          10. unpow2N/A

                            \[\leadsto {\sin \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\frac{-1}{180}, angle, \frac{1}{2}\right)\right)}^{2} \cdot \color{blue}{\left(b \cdot b\right)} \]
                          11. lower-*.f6460.4

                            \[\leadsto {\sin \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-0.005555555555555556, angle, 0.5\right)\right)}^{2} \cdot \color{blue}{\left(b \cdot b\right)} \]
                        7. Applied rewrites60.4%

                          \[\leadsto \color{blue}{{\sin \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-0.005555555555555556, angle, 0.5\right)\right)}^{2} \cdot \left(b \cdot b\right)} \]

                        if 2.09999999999999988e-58 < a < 1.35000000000000003e154

                        1. Initial program 70.4%

                          \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                        2. Add Preprocessing
                        3. Step-by-step derivation
                          1. lift-*.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                          2. *-commutativeN/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                          3. lift-PI.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                          4. add-cube-cbrtN/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                          5. associate-*l*N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                          6. lower-*.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                          7. pow2N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                          8. lower-pow.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                          9. lift-PI.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                          10. lower-cbrt.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                          11. lower-*.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                          12. lift-PI.f64N/A

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                          13. lower-cbrt.f6470.4

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                        4. Applied rewrites70.4%

                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                        5. Taylor expanded in angle around 0

                          \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                        6. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                          2. lower-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                        7. Applied rewrites30.2%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                        8. Taylor expanded in a around inf

                          \[\leadsto \mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\frac{1}{32400} \cdot {a}^{2}\right), angle \cdot angle, b \cdot b\right) \]
                        9. Step-by-step derivation
                          1. Applied rewrites62.9%

                            \[\leadsto \mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right) \]

                          if 1.35000000000000003e154 < a

                          1. Initial program 99.6%

                            \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                            2. *-commutativeN/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                            3. lift-PI.f64N/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                            4. add-cube-cbrtN/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                            5. associate-*l*N/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                            6. lower-*.f64N/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                            7. pow2N/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                            8. lower-pow.f64N/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                            9. lift-PI.f64N/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                            10. lower-cbrt.f64N/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                            11. lower-*.f64N/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                            12. lift-PI.f64N/A

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                            13. lower-cbrt.f6499.6

                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                          4. Applied rewrites99.6%

                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                          5. Taylor expanded in angle around 0

                            \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                          6. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                            2. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                          7. Applied rewrites42.8%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                          8. Taylor expanded in a around inf

                            \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                          9. Step-by-step derivation
                            1. Applied rewrites63.5%

                              \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot angle\right)} \]
                            2. Step-by-step derivation
                              1. Applied rewrites86.9%

                                \[\leadsto \color{blue}{{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
                            3. Recombined 3 regimes into one program.
                            4. Final simplification63.9%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.1 \cdot 10^{-58}:\\ \;\;\;\;{\sin \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-0.005555555555555556, angle, 0.5\right)\right)}^{2} \cdot \left(b \cdot b\right)\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 13: 65.0% accurate, 2.0× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 2.1 \cdot 10^{-58}:\\ \;\;\;\;{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot \left(b \cdot b\right)\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \end{array} \]
                            (FPCore (a b angle)
                             :precision binary64
                             (if (<= a 2.1e-58)
                               (* (pow (cos (* (* 0.005555555555555556 angle) (PI))) 2.0) (* b b))
                               (if (<= a 1.35e+154)
                                 (fma
                                  (* (* (PI) (PI)) (* 3.08641975308642e-5 (* a a)))
                                  (* angle angle)
                                  (* b b))
                                 (* (pow (* (* (PI) angle) a) 2.0) 3.08641975308642e-5))))
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;a \leq 2.1 \cdot 10^{-58}:\\
                            \;\;\;\;{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot \left(b \cdot b\right)\\
                            
                            \mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\
                            \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if a < 2.09999999999999988e-58

                              1. Initial program 81.3%

                                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                              2. Add Preprocessing
                              3. Taylor expanded in a around 0

                                \[\leadsto \color{blue}{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
                              4. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {b}^{2}} \]
                                2. lower-*.f64N/A

                                  \[\leadsto \color{blue}{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {b}^{2}} \]
                                3. lower-pow.f64N/A

                                  \[\leadsto \color{blue}{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \cdot {b}^{2} \]
                                4. *-commutativeN/A

                                  \[\leadsto {\cos \left(\frac{1}{180} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right)}^{2} \cdot {b}^{2} \]
                                5. associate-*r*N/A

                                  \[\leadsto {\cos \color{blue}{\left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}}^{2} \cdot {b}^{2} \]
                                6. lower-cos.f64N/A

                                  \[\leadsto {\color{blue}{\cos \left(\left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}}^{2} \cdot {b}^{2} \]
                                7. associate-*r*N/A

                                  \[\leadsto {\cos \color{blue}{\left(\frac{1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}}^{2} \cdot {b}^{2} \]
                                8. *-commutativeN/A

                                  \[\leadsto {\cos \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \cdot {b}^{2} \]
                                9. associate-*r*N/A

                                  \[\leadsto {\cos \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}}^{2} \cdot {b}^{2} \]
                                10. lower-*.f64N/A

                                  \[\leadsto {\cos \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}}^{2} \cdot {b}^{2} \]
                                11. lower-*.f64N/A

                                  \[\leadsto {\cos \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot {b}^{2} \]
                                12. lower-PI.f64N/A

                                  \[\leadsto {\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)}^{2} \cdot {b}^{2} \]
                                13. unpow2N/A

                                  \[\leadsto {\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot \color{blue}{\left(b \cdot b\right)} \]
                                14. lower-*.f6460.3

                                  \[\leadsto {\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot \color{blue}{\left(b \cdot b\right)} \]
                              5. Applied rewrites60.3%

                                \[\leadsto \color{blue}{{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot \left(b \cdot b\right)} \]

                              if 2.09999999999999988e-58 < a < 1.35000000000000003e154

                              1. Initial program 70.4%

                                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                                2. *-commutativeN/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                                3. lift-PI.f64N/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                4. add-cube-cbrtN/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                5. associate-*l*N/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                6. lower-*.f64N/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                7. pow2N/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                8. lower-pow.f64N/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                9. lift-PI.f64N/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                10. lower-cbrt.f64N/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                11. lower-*.f64N/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                                12. lift-PI.f64N/A

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                13. lower-cbrt.f6470.4

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                              4. Applied rewrites70.4%

                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                              5. Taylor expanded in angle around 0

                                \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                              6. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                                2. lower-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                              7. Applied rewrites30.2%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                              8. Taylor expanded in a around inf

                                \[\leadsto \mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\frac{1}{32400} \cdot {a}^{2}\right), angle \cdot angle, b \cdot b\right) \]
                              9. Step-by-step derivation
                                1. Applied rewrites62.9%

                                  \[\leadsto \mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right) \]

                                if 1.35000000000000003e154 < a

                                1. Initial program 99.6%

                                  \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. lift-*.f64N/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                                  2. *-commutativeN/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                                  3. lift-PI.f64N/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                  4. add-cube-cbrtN/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                  5. associate-*l*N/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                  6. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                  7. pow2N/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                  8. lower-pow.f64N/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                  9. lift-PI.f64N/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                  10. lower-cbrt.f64N/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                  11. lower-*.f64N/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                                  12. lift-PI.f64N/A

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                  13. lower-cbrt.f6499.6

                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                4. Applied rewrites99.6%

                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                5. Taylor expanded in angle around 0

                                  \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                                6. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                                  2. lower-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                                7. Applied rewrites42.8%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                                8. Taylor expanded in a around inf

                                  \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                                9. Step-by-step derivation
                                  1. Applied rewrites63.5%

                                    \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot angle\right)} \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites86.9%

                                      \[\leadsto \color{blue}{{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
                                  3. Recombined 3 regimes into one program.
                                  4. Final simplification63.8%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.1 \cdot 10^{-58}:\\ \;\;\;\;{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot \left(b \cdot b\right)\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \]
                                  5. Add Preprocessing

                                  Alternative 14: 65.1% accurate, 3.5× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 2.6 \cdot 10^{-58}:\\ \;\;\;\;b \cdot b\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \end{array} \]
                                  (FPCore (a b angle)
                                   :precision binary64
                                   (if (<= a 2.6e-58)
                                     (* b b)
                                     (if (<= a 1.35e+154)
                                       (fma
                                        (* (* (PI) (PI)) (* 3.08641975308642e-5 (* a a)))
                                        (* angle angle)
                                        (* b b))
                                       (* (pow (* (* (PI) angle) a) 2.0) 3.08641975308642e-5))))
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;a \leq 2.6 \cdot 10^{-58}:\\
                                  \;\;\;\;b \cdot b\\
                                  
                                  \mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\
                                  \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 3 regimes
                                  2. if a < 2.60000000000000007e-58

                                    1. Initial program 81.3%

                                      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in angle around 0

                                      \[\leadsto \color{blue}{{b}^{2}} \]
                                    4. Step-by-step derivation
                                      1. unpow2N/A

                                        \[\leadsto \color{blue}{b \cdot b} \]
                                      2. lower-*.f6460.6

                                        \[\leadsto \color{blue}{b \cdot b} \]
                                    5. Applied rewrites60.6%

                                      \[\leadsto \color{blue}{b \cdot b} \]

                                    if 2.60000000000000007e-58 < a < 1.35000000000000003e154

                                    1. Initial program 70.4%

                                      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                    2. Add Preprocessing
                                    3. Step-by-step derivation
                                      1. lift-*.f64N/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                                      2. *-commutativeN/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                                      3. lift-PI.f64N/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                      4. add-cube-cbrtN/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                      5. associate-*l*N/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                      6. lower-*.f64N/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                      7. pow2N/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                      8. lower-pow.f64N/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                      9. lift-PI.f64N/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                      10. lower-cbrt.f64N/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                      11. lower-*.f64N/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                                      12. lift-PI.f64N/A

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                      13. lower-cbrt.f6470.4

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                    4. Applied rewrites70.4%

                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                    5. Taylor expanded in angle around 0

                                      \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                                    6. Step-by-step derivation
                                      1. *-commutativeN/A

                                        \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                                      2. lower-fma.f64N/A

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                                    7. Applied rewrites30.2%

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                                    8. Taylor expanded in a around inf

                                      \[\leadsto \mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\frac{1}{32400} \cdot {a}^{2}\right), angle \cdot angle, b \cdot b\right) \]
                                    9. Step-by-step derivation
                                      1. Applied rewrites62.9%

                                        \[\leadsto \mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right) \]

                                      if 1.35000000000000003e154 < a

                                      1. Initial program 99.6%

                                        \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                      2. Add Preprocessing
                                      3. Step-by-step derivation
                                        1. lift-*.f64N/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                                        2. *-commutativeN/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                                        3. lift-PI.f64N/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                        4. add-cube-cbrtN/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                        5. associate-*l*N/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                        6. lower-*.f64N/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                        7. pow2N/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                        8. lower-pow.f64N/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                        9. lift-PI.f64N/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                        10. lower-cbrt.f64N/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                        11. lower-*.f64N/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                                        12. lift-PI.f64N/A

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                        13. lower-cbrt.f6499.6

                                          \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                      4. Applied rewrites99.6%

                                        \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                      5. Taylor expanded in angle around 0

                                        \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                                      6. Step-by-step derivation
                                        1. *-commutativeN/A

                                          \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                                        2. lower-fma.f64N/A

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                                      7. Applied rewrites42.8%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                                      8. Taylor expanded in a around inf

                                        \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                                      9. Step-by-step derivation
                                        1. Applied rewrites63.5%

                                          \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot angle\right)} \]
                                        2. Step-by-step derivation
                                          1. Applied rewrites86.9%

                                            \[\leadsto \color{blue}{{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}} \]
                                        3. Recombined 3 regimes into one program.
                                        4. Final simplification64.0%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.6 \cdot 10^{-58}:\\ \;\;\;\;b \cdot b\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \]
                                        5. Add Preprocessing

                                        Alternative 15: 62.9% accurate, 10.4× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 2.6 \cdot 10^{-58}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\ \end{array} \end{array} \]
                                        (FPCore (a b angle)
                                         :precision binary64
                                         (if (<= a 2.6e-58)
                                           (* b b)
                                           (fma
                                            (* (* (PI) (PI)) (* 3.08641975308642e-5 (* a a)))
                                            (* angle angle)
                                            (* b b))))
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;a \leq 2.6 \cdot 10^{-58}:\\
                                        \;\;\;\;b \cdot b\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if a < 2.60000000000000007e-58

                                          1. Initial program 81.3%

                                            \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                          2. Add Preprocessing
                                          3. Taylor expanded in angle around 0

                                            \[\leadsto \color{blue}{{b}^{2}} \]
                                          4. Step-by-step derivation
                                            1. unpow2N/A

                                              \[\leadsto \color{blue}{b \cdot b} \]
                                            2. lower-*.f6460.6

                                              \[\leadsto \color{blue}{b \cdot b} \]
                                          5. Applied rewrites60.6%

                                            \[\leadsto \color{blue}{b \cdot b} \]

                                          if 2.60000000000000007e-58 < a

                                          1. Initial program 81.7%

                                            \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                          2. Add Preprocessing
                                          3. Step-by-step derivation
                                            1. lift-*.f64N/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                                            2. *-commutativeN/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                                            3. lift-PI.f64N/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                            4. add-cube-cbrtN/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                            5. associate-*l*N/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                            6. lower-*.f64N/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                            7. pow2N/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                            8. lower-pow.f64N/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                            9. lift-PI.f64N/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                            10. lower-cbrt.f64N/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                            11. lower-*.f64N/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                                            12. lift-PI.f64N/A

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                            13. lower-cbrt.f6481.7

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                          4. Applied rewrites81.7%

                                            \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                          5. Taylor expanded in angle around 0

                                            \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                                          6. Step-by-step derivation
                                            1. *-commutativeN/A

                                              \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                                            2. lower-fma.f64N/A

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                                          7. Applied rewrites35.1%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                                          8. Taylor expanded in a around inf

                                            \[\leadsto \mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\frac{1}{32400} \cdot {a}^{2}\right), angle \cdot angle, b \cdot b\right) \]
                                          9. Step-by-step derivation
                                            1. Applied rewrites63.1%

                                              \[\leadsto \mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right) \]
                                          10. Recombined 2 regimes into one program.
                                          11. Final simplification61.3%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.6 \cdot 10^{-58}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), angle \cdot angle, b \cdot b\right)\\ \end{array} \]
                                          12. Add Preprocessing

                                          Alternative 16: 62.9% accurate, 10.4× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 2.6 \cdot 10^{-58}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\ \end{array} \end{array} \]
                                          (FPCore (a b angle)
                                           :precision binary64
                                           (if (<= a 2.6e-58)
                                             (* b b)
                                             (fma
                                              (* (* (* 3.08641975308642e-5 (* (PI) (PI))) a) a)
                                              (* angle angle)
                                              (* b b))))
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;a \leq 2.6 \cdot 10^{-58}:\\
                                          \;\;\;\;b \cdot b\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if a < 2.60000000000000007e-58

                                            1. Initial program 81.3%

                                              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in angle around 0

                                              \[\leadsto \color{blue}{{b}^{2}} \]
                                            4. Step-by-step derivation
                                              1. unpow2N/A

                                                \[\leadsto \color{blue}{b \cdot b} \]
                                              2. lower-*.f6460.6

                                                \[\leadsto \color{blue}{b \cdot b} \]
                                            5. Applied rewrites60.6%

                                              \[\leadsto \color{blue}{b \cdot b} \]

                                            if 2.60000000000000007e-58 < a

                                            1. Initial program 81.7%

                                              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                            2. Add Preprocessing
                                            3. Step-by-step derivation
                                              1. lift-*.f64N/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                                              2. *-commutativeN/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                                              3. lift-PI.f64N/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                              4. add-cube-cbrtN/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                              5. associate-*l*N/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                              6. lower-*.f64N/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                              7. pow2N/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                              8. lower-pow.f64N/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                              9. lift-PI.f64N/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                              10. lower-cbrt.f64N/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                              11. lower-*.f64N/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                                              12. lift-PI.f64N/A

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                              13. lower-cbrt.f6481.7

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                            4. Applied rewrites81.7%

                                              \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                            5. Taylor expanded in angle around 0

                                              \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                                            6. Step-by-step derivation
                                              1. *-commutativeN/A

                                                \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                                              2. lower-fma.f64N/A

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                                            7. Applied rewrites35.1%

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                                            8. Taylor expanded in a around inf

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), \color{blue}{angle} \cdot angle, b \cdot b\right) \]
                                            9. Step-by-step derivation
                                              1. Applied rewrites63.1%

                                                \[\leadsto \mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, \color{blue}{angle} \cdot angle, b \cdot b\right) \]
                                            10. Recombined 2 regimes into one program.
                                            11. Final simplification61.3%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.6 \cdot 10^{-58}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\ \end{array} \]
                                            12. Add Preprocessing

                                            Alternative 17: 62.1% accurate, 12.1× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 5.5 \cdot 10^{+162}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot angle\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\\ \end{array} \end{array} \]
                                            (FPCore (a b angle)
                                             :precision binary64
                                             (if (<= a 5.5e+162)
                                               (* b b)
                                               (* (* (* (* a a) 3.08641975308642e-5) angle) (* (* (PI) (PI)) angle))))
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;a \leq 5.5 \cdot 10^{+162}:\\
                                            \;\;\;\;b \cdot b\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\left(\left(\left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot angle\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if a < 5.49999999999999966e162

                                              1. Initial program 79.2%

                                                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                              2. Add Preprocessing
                                              3. Taylor expanded in angle around 0

                                                \[\leadsto \color{blue}{{b}^{2}} \]
                                              4. Step-by-step derivation
                                                1. unpow2N/A

                                                  \[\leadsto \color{blue}{b \cdot b} \]
                                                2. lower-*.f6459.1

                                                  \[\leadsto \color{blue}{b \cdot b} \]
                                              5. Applied rewrites59.1%

                                                \[\leadsto \color{blue}{b \cdot b} \]

                                              if 5.49999999999999966e162 < a

                                              1. Initial program 99.6%

                                                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                              2. Add Preprocessing
                                              3. Step-by-step derivation
                                                1. lift-*.f64N/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                                                2. *-commutativeN/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                                                3. lift-PI.f64N/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                                4. add-cube-cbrtN/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                                5. associate-*l*N/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                                6. lower-*.f64N/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                                7. pow2N/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                8. lower-pow.f64N/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                9. lift-PI.f64N/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                10. lower-cbrt.f64N/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                11. lower-*.f64N/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                                                12. lift-PI.f64N/A

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                13. lower-cbrt.f6499.6

                                                  \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                              4. Applied rewrites99.6%

                                                \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                              5. Taylor expanded in angle around 0

                                                \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                                              6. Step-by-step derivation
                                                1. *-commutativeN/A

                                                  \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                                                2. lower-fma.f64N/A

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                                              7. Applied rewrites44.4%

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                                              8. Taylor expanded in a around inf

                                                \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                                              9. Step-by-step derivation
                                                1. Applied rewrites65.8%

                                                  \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot angle\right)} \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites66.5%

                                                    \[\leadsto \left(\left(\left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot angle\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \color{blue}{angle}\right) \]
                                                3. Recombined 2 regimes into one program.
                                                4. Final simplification59.9%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5.5 \cdot 10^{+162}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot angle\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\\ \end{array} \]
                                                5. Add Preprocessing

                                                Alternative 18: 61.3% accurate, 12.1× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\\ \mathbf{if}\;a \leq 5.8 \cdot 10^{+162}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(t\_0 \cdot t\_0\right)\\ \end{array} \end{array} \]
                                                (FPCore (a b angle)
                                                 :precision binary64
                                                 (let* ((t_0 (* (PI) angle)))
                                                   (if (<= a 5.8e+162)
                                                     (* b b)
                                                     (* (* 3.08641975308642e-5 (* a a)) (* t_0 t_0)))))
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                t_0 := \mathsf{PI}\left(\right) \cdot angle\\
                                                \mathbf{if}\;a \leq 5.8 \cdot 10^{+162}:\\
                                                \;\;\;\;b \cdot b\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(t\_0 \cdot t\_0\right)\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if a < 5.80000000000000012e162

                                                  1. Initial program 79.2%

                                                    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in angle around 0

                                                    \[\leadsto \color{blue}{{b}^{2}} \]
                                                  4. Step-by-step derivation
                                                    1. unpow2N/A

                                                      \[\leadsto \color{blue}{b \cdot b} \]
                                                    2. lower-*.f6459.1

                                                      \[\leadsto \color{blue}{b \cdot b} \]
                                                  5. Applied rewrites59.1%

                                                    \[\leadsto \color{blue}{b \cdot b} \]

                                                  if 5.80000000000000012e162 < a

                                                  1. Initial program 99.6%

                                                    \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                                  2. Add Preprocessing
                                                  3. Step-by-step derivation
                                                    1. lift-*.f64N/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2} \]
                                                    2. *-commutativeN/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right)}^{2} \]
                                                    3. lift-PI.f64N/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                                    4. add-cube-cbrtN/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)} \cdot \frac{angle}{180}\right)\right)}^{2} \]
                                                    5. associate-*l*N/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                                    6. lower-*.f64N/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                                    7. pow2N/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                    8. lower-pow.f64N/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\color{blue}{{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2}} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                    9. lift-PI.f64N/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                    10. lower-cbrt.f64N/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                    11. lower-*.f64N/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \color{blue}{\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)}\right)\right)}^{2} \]
                                                    12. lift-PI.f64N/A

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                    13. lower-cbrt.f6499.6

                                                      \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\color{blue}{\sqrt[3]{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)\right)}^{2} \]
                                                  4. Applied rewrites99.6%

                                                    \[\leadsto {\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \frac{angle}{180}\right)\right)}\right)}^{2} \]
                                                  5. Taylor expanded in angle around 0

                                                    \[\leadsto \color{blue}{{angle}^{2} \cdot \left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {b}^{2}} \]
                                                  6. Step-by-step derivation
                                                    1. *-commutativeN/A

                                                      \[\leadsto \color{blue}{\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) \cdot {angle}^{2}} + {b}^{2} \]
                                                    2. lower-fma.f64N/A

                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {b}^{2}\right)} \]
                                                  7. Applied rewrites44.4%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, a \cdot a, -3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right), angle \cdot angle, b \cdot b\right)} \]
                                                  8. Taylor expanded in a around inf

                                                    \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left({a}^{2} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)} \]
                                                  9. Step-by-step derivation
                                                    1. Applied rewrites65.8%

                                                      \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot angle\right)} \]
                                                    2. Step-by-step derivation
                                                      1. Applied rewrites65.8%

                                                        \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{angle}\right)\right) \]
                                                    3. Recombined 2 regimes into one program.
                                                    4. Final simplification59.8%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5.8 \cdot 10^{+162}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\\ \end{array} \]
                                                    5. Add Preprocessing

                                                    Alternative 19: 57.4% accurate, 74.7× speedup?

                                                    \[\begin{array}{l} \\ b \cdot b \end{array} \]
                                                    (FPCore (a b angle) :precision binary64 (* b b))
                                                    double code(double a, double b, double angle) {
                                                    	return b * b;
                                                    }
                                                    
                                                    module fmin_fmax_functions
                                                        implicit none
                                                        private
                                                        public fmax
                                                        public fmin
                                                    
                                                        interface fmax
                                                            module procedure fmax88
                                                            module procedure fmax44
                                                            module procedure fmax84
                                                            module procedure fmax48
                                                        end interface
                                                        interface fmin
                                                            module procedure fmin88
                                                            module procedure fmin44
                                                            module procedure fmin84
                                                            module procedure fmin48
                                                        end interface
                                                    contains
                                                        real(8) function fmax88(x, y) result (res)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                        end function
                                                        real(4) function fmax44(x, y) result (res)
                                                            real(4), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmax84(x, y) result(res)
                                                            real(8), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmax48(x, y) result(res)
                                                            real(4), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin88(x, y) result (res)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                        end function
                                                        real(4) function fmin44(x, y) result (res)
                                                            real(4), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin84(x, y) result(res)
                                                            real(8), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin48(x, y) result(res)
                                                            real(4), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                        end function
                                                    end module
                                                    
                                                    real(8) function code(a, b, angle)
                                                    use fmin_fmax_functions
                                                        real(8), intent (in) :: a
                                                        real(8), intent (in) :: b
                                                        real(8), intent (in) :: angle
                                                        code = b * b
                                                    end function
                                                    
                                                    public static double code(double a, double b, double angle) {
                                                    	return b * b;
                                                    }
                                                    
                                                    def code(a, b, angle):
                                                    	return b * b
                                                    
                                                    function code(a, b, angle)
                                                    	return Float64(b * b)
                                                    end
                                                    
                                                    function tmp = code(a, b, angle)
                                                    	tmp = b * b;
                                                    end
                                                    
                                                    code[a_, b_, angle_] := N[(b * b), $MachinePrecision]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    b \cdot b
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Initial program 81.4%

                                                      \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in angle around 0

                                                      \[\leadsto \color{blue}{{b}^{2}} \]
                                                    4. Step-by-step derivation
                                                      1. unpow2N/A

                                                        \[\leadsto \color{blue}{b \cdot b} \]
                                                      2. lower-*.f6456.5

                                                        \[\leadsto \color{blue}{b \cdot b} \]
                                                    5. Applied rewrites56.5%

                                                      \[\leadsto \color{blue}{b \cdot b} \]
                                                    6. Final simplification56.5%

                                                      \[\leadsto b \cdot b \]
                                                    7. Add Preprocessing

                                                    Reproduce

                                                    ?
                                                    herbie shell --seed 2025017 
                                                    (FPCore (a b angle)
                                                      :name "ab-angle->ABCF A"
                                                      :precision binary64
                                                      (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0)))