ab-angle->ABCF C

Percentage Accurate: 79.5% → 79.4%
Time: 16.1s
Alternatives: 15
Speedup: 1.0×

Specification

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

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin 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 15 alternatives:

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

Initial Program: 79.5% accurate, 1.0× speedup?

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

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

Alternative 1: 79.4% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.4% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

      \[\leadsto {\left(a \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} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    5. sqr-neg-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \left(\left(\frac{angle}{180} \cdot \left(-\sqrt{\mathsf{PI}\left(\right)}\right)\right) \cdot \left(-\sqrt{\mathsf{PI}\left(\right)}\right)\right)\right)}^{2} + {\left(b \cdot \color{blue}{\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}\right)}^{2} \]
  8. Final simplification79.8%

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

Alternative 4: 79.5% accurate, 1.0× speedup?

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

\\
{\left(a \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.5% accurate, 1.0× speedup?

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

\\
{\left(a \cdot \cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot angle}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 79.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left({\cos \left(\mathsf{fma}\left(-0.005555555555555556, \mathsf{PI}\left(\right) \cdot angle, \mathsf{PI}\left(\right)\right)\right)}^{2}, a \cdot a, {\left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot b\right)}^{2}\right) \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (fma
  (pow (cos (fma -0.005555555555555556 (* (PI) angle) (PI))) 2.0)
  (* a a)
  (pow (* (sin (* (* 0.005555555555555556 (PI)) angle)) b) 2.0)))
\begin{array}{l}

\\
\mathsf{fma}\left({\cos \left(\mathsf{fma}\left(-0.005555555555555556, \mathsf{PI}\left(\right) \cdot angle, \mathsf{PI}\left(\right)\right)\right)}^{2}, a \cdot a, {\left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot b\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 79.8%

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

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

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

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

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

      \[\leadsto {\left(e^{2}\right)}^{\log \color{blue}{\left({\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{1}\right)}} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    6. pow-to-expN/A

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

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

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

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

      \[\leadsto {\left(e^{2}\right)}^{\color{blue}{\log \left(e^{\log \left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot 1}\right)}} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. pow-to-expN/A

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

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

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

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

      \[\leadsto {\left(e^{2}\right)}^{\log \color{blue}{\left(\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot a\right)}} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    16. lower-*.f6441.6

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(e^{\left(-1 \cdot \log \left(\frac{-1}{a}\right)\right) \cdot 2}, e^{\log \left(-1 \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot 2}, {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
  7. Applied rewrites69.3%

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

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

    Alternative 7: 79.4% accurate, 1.3× speedup?

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

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

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

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

      Alternative 8: 64.3% accurate, 1.7× speedup?

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

        1. Initial program 84.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\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, 1\right) \cdot \color{blue}{\left(a \cdot a\right)} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
        5. Applied rewrites69.4%

          \[\leadsto \color{blue}{\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, 1\right) \cdot \left(a \cdot a\right)} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]

        if 3.00000000000000008e-58 < angle < 5.3999999999999999e201

        1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + \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 b\right) \cdot b\right)} \]

        if 5.3999999999999999e201 < angle

        1. Initial program 65.4%

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

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

            \[\leadsto \color{blue}{a \cdot a} \]
          2. lower-*.f6460.1

            \[\leadsto \color{blue}{a \cdot a} \]
        5. Applied rewrites60.1%

          \[\leadsto \color{blue}{a \cdot a} \]
      3. Recombined 3 regimes into one program.
      4. Add Preprocessing

      Alternative 9: 57.5% accurate, 1.9× speedup?

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

        1. Initial program 75.6%

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

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

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

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

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

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

          if 26 < a

          1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + {b}^{2} \cdot \color{blue}{0} \]
            5. mul0-rgt89.8

              \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + \color{blue}{0} \]
          9. Applied rewrites89.8%

            \[\leadsto {\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} + \color{blue}{0} \]
        7. Recombined 2 regimes into one program.
        8. Add Preprocessing

        Alternative 10: 57.5% accurate, 2.0× speedup?

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

          1. Initial program 75.6%

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

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

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

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

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

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

            if 26 < a

            1. Initial program 93.3%

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

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

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

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

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

                \[\leadsto {\left(e^{2}\right)}^{\log \color{blue}{\left({\left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{1}\right)}} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
              6. pow-to-expN/A

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

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

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

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

                \[\leadsto {\left(e^{2}\right)}^{\color{blue}{\log \left(e^{\log \left(a \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot 1}\right)}} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
              11. pow-to-expN/A

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

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

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

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

                \[\leadsto {\left(e^{2}\right)}^{\log \color{blue}{\left(\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot a\right)}} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
              16. lower-*.f6475.9

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\frac{-1}{a}\right)}^{-2}, {\cos \left(\mathsf{fma}\left(-0.005555555555555556, \mathsf{PI}\left(\right) \cdot angle, \mathsf{PI}\left(\right)\right)\right)}^{2}, {\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}^{2} \cdot \left(b \cdot b\right)\right)} \]
            8. Taylor expanded in a around inf

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

                \[\leadsto {\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)}^{2} \cdot \color{blue}{\left(a \cdot a\right)} \]
            10. Recombined 2 regimes into one program.
            11. Add Preprocessing

            Alternative 11: 57.7% accurate, 8.5× speedup?

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

              1. Initial program 76.3%

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

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

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

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

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

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

                if 1.3500000000000001e121 < a

                1. Initial program 96.3%

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

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

                    \[\leadsto \color{blue}{a \cdot a} \]
                  2. lower-*.f6496.2

                    \[\leadsto \color{blue}{a \cdot a} \]
                5. Applied rewrites96.2%

                  \[\leadsto \color{blue}{a \cdot a} \]
              7. Recombined 2 regimes into one program.
              8. Add Preprocessing

              Alternative 12: 61.6% accurate, 9.1× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;angle \leq 1.2 \cdot 10^{-176} \lor \neg \left(angle \leq 5.4 \cdot 10^{+201}\right):\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, a \cdot a\right)\\ \end{array} \end{array} \]
              (FPCore (a b angle)
               :precision binary64
               (if (or (<= angle 1.2e-176) (not (<= angle 5.4e+201)))
                 (* a a)
                 (fma
                  (* (* (* 3.08641975308642e-5 (* b b)) (PI)) (PI))
                  (* angle angle)
                  (* a a))))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;angle \leq 1.2 \cdot 10^{-176} \lor \neg \left(angle \leq 5.4 \cdot 10^{+201}\right):\\
              \;\;\;\;a \cdot a\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, a \cdot a\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if angle < 1.20000000000000003e-176 or 5.3999999999999999e201 < angle

                1. Initial program 80.7%

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

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

                    \[\leadsto \color{blue}{a \cdot a} \]
                  2. lower-*.f6464.0

                    \[\leadsto \color{blue}{a \cdot a} \]
                5. Applied rewrites64.0%

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

                if 1.20000000000000003e-176 < angle < 5.3999999999999999e201

                1. Initial program 77.4%

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

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

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

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 1.2 \cdot 10^{-176} \lor \neg \left(angle \leq 5.4 \cdot 10^{+201}\right):\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, a \cdot a\right)\\ \end{array} \]
                10. Add Preprocessing

                Alternative 13: 57.7% accurate, 9.1× speedup?

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

                  1. Initial program 76.3%

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

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

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

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

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

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

                    if 1.3500000000000001e121 < a

                    1. Initial program 96.3%

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

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

                        \[\leadsto \color{blue}{a \cdot a} \]
                      2. lower-*.f6496.2

                        \[\leadsto \color{blue}{a \cdot a} \]
                    5. Applied rewrites96.2%

                      \[\leadsto \color{blue}{a \cdot a} \]
                  7. Recombined 2 regimes into one program.
                  8. Add Preprocessing

                  Alternative 14: 50.7% accurate, 12.1× speedup?

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

                    1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

                        if 8.49999999999999976e-157 < a

                        1. Initial program 87.0%

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

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

                            \[\leadsto \color{blue}{a \cdot a} \]
                          2. lower-*.f6476.3

                            \[\leadsto \color{blue}{a \cdot a} \]
                        5. Applied rewrites76.3%

                          \[\leadsto \color{blue}{a \cdot a} \]
                      4. Recombined 2 regimes into one program.
                      5. Add Preprocessing

                      Alternative 15: 56.3% accurate, 74.7× speedup?

                      \[\begin{array}{l} \\ a \cdot a \end{array} \]
                      (FPCore (a b angle) :precision binary64 (* a a))
                      double code(double a, double b, double angle) {
                      	return a * a;
                      }
                      
                      real(8) function code(a, b, angle)
                          real(8), intent (in) :: a
                          real(8), intent (in) :: b
                          real(8), intent (in) :: angle
                          code = a * a
                      end function
                      
                      public static double code(double a, double b, double angle) {
                      	return a * a;
                      }
                      
                      def code(a, b, angle):
                      	return a * a
                      
                      function code(a, b, angle)
                      	return Float64(a * a)
                      end
                      
                      function tmp = code(a, b, angle)
                      	tmp = a * a;
                      end
                      
                      code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      a \cdot a
                      \end{array}
                      
                      Derivation
                      1. Initial program 79.8%

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

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

                          \[\leadsto \color{blue}{a \cdot a} \]
                        2. lower-*.f6460.8

                          \[\leadsto \color{blue}{a \cdot a} \]
                      5. Applied rewrites60.8%

                        \[\leadsto \color{blue}{a \cdot a} \]
                      6. Add Preprocessing

                      Reproduce

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