ab-angle->ABCF A

Percentage Accurate: 79.5% → 79.4%
Time: 16.9s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 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 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ {\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) (PI))))
   (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
\begin{array}{l}

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

Alternative 1: 79.4% accurate, 0.5× speedup?

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

\\
{\left(a \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{\frac{180}{angle}}\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\frac{180}{{\mathsf{PI}\left(\right)}^{0.6666666666666666}}\right)}^{-1} \cdot {\left(\frac{\frac{1}{angle}}{\sqrt[3]{\mathsf{PI}\left(\right)}}\right)}^{-1}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.5% accurate, 0.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 5: 79.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 79.4% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \sin \left(\frac{\mathsf{PI}\left(\right) \cdot 0.005555555555555556}{\frac{1}{angle}}\right)\right)}^{2} + {\left(b \cdot \color{blue}{1}\right)}^{2} \]
    2. Final simplification76.5%

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

    Alternative 7: 79.4% accurate, 1.4× speedup?

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

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

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

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

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

      Alternative 8: 77.1% accurate, 1.6× speedup?

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

        1. Initial program 87.2%

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

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

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

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

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

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

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

        if 2e8 < (/.f64 angle #s(literal 180 binary64))

        1. Initial program 54.8%

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot a\right), \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
        4. Taylor expanded in angle around 0

          \[\leadsto \mathsf{fma}\left(\sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot a\right), \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \color{blue}{1}\right) \]
        5. Step-by-step derivation
          1. Applied rewrites54.9%

            \[\leadsto \mathsf{fma}\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot a\right), \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \color{blue}{1}\right) \]
        6. Recombined 2 regimes into one program.
        7. Final simplification75.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 200000000:\\ \;\;\;\;\mathsf{fma}\left({\left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a \cdot a\right), \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right), b \cdot b\right)\\ \end{array} \]
        8. Add Preprocessing

        Alternative 9: 77.1% accurate, 1.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\\ t_1 := 0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\\ t_2 := \sin t\_0\\ \mathbf{if}\;\frac{angle}{180} \leq 200000000:\\ \;\;\;\;\mathsf{fma}\left(t\_1, t\_1, b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_2 \cdot \left(a \cdot a\right), t\_2, b \cdot b\right)\\ \end{array} \end{array} \]
        (FPCore (a b angle)
         :precision binary64
         (let* ((t_0 (* (PI) (* angle 0.005555555555555556)))
                (t_1 (* 0.005555555555555556 (* a (* (PI) angle))))
                (t_2 (sin t_0)))
           (if (<= (/ angle 180.0) 200000000.0)
             (fma t_1 t_1 (* b (* b (+ 0.5 (* 0.5 (cos (* 2.0 t_0)))))))
             (fma (* t_2 (* a a)) t_2 (* b b)))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\\
        t_1 := 0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\\
        t_2 := \sin t\_0\\
        \mathbf{if}\;\frac{angle}{180} \leq 200000000:\\
        \;\;\;\;\mathsf{fma}\left(t\_1, t\_1, b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right)\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(t\_2 \cdot \left(a \cdot a\right), t\_2, b \cdot b\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 angle #s(literal 180 binary64)) < 2e8

          1. Initial program 87.2%

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(0.005555555555555556 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right), 0.005555555555555556 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right), b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)} \]

          if 2e8 < (/.f64 angle #s(literal 180 binary64))

          1. Initial program 54.8%

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot a\right), \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
          4. Taylor expanded in angle around 0

            \[\leadsto \mathsf{fma}\left(\sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot a\right), \sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \color{blue}{1}\right) \]
          5. Step-by-step derivation
            1. Applied rewrites54.9%

              \[\leadsto \mathsf{fma}\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot a\right), \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \color{blue}{1}\right) \]
          6. Recombined 2 regimes into one program.
          7. Final simplification75.3%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 200000000:\\ \;\;\;\;\mathsf{fma}\left(0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right), 0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right), b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(a \cdot a\right), \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right), b \cdot b\right)\\ \end{array} \]
          8. Add Preprocessing

          Alternative 10: 67.4% accurate, 2.0× speedup?

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

            1. Initial program 78.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 3.5000000000000001e-15 < a

            1. Initial program 74.0%

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(0.005555555555555556 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right), 0.005555555555555556 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right), b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification65.0%

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

          Alternative 11: 67.4% accurate, 2.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\\ t_1 := 0.005555555555555556 \cdot \left(a \cdot t\_0\right)\\ \mathbf{if}\;a \leq 3.5 \cdot 10^{-15}:\\ \;\;\;\;\left(b \cdot b\right) \cdot {\cos \left(0.005555555555555556 \cdot t\_0\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, t\_1, b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* (PI) angle)) (t_1 (* 0.005555555555555556 (* a t_0))))
             (if (<= a 3.5e-15)
               (* (* b b) (pow (cos (* 0.005555555555555556 t_0)) 2.0))
               (fma
                t_1
                t_1
                (*
                 b
                 (*
                  b
                  (+
                   0.5
                   (* 0.5 (cos (* 2.0 (* (PI) (* angle 0.005555555555555556))))))))))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \mathsf{PI}\left(\right) \cdot angle\\
          t_1 := 0.005555555555555556 \cdot \left(a \cdot t\_0\right)\\
          \mathbf{if}\;a \leq 3.5 \cdot 10^{-15}:\\
          \;\;\;\;\left(b \cdot b\right) \cdot {\cos \left(0.005555555555555556 \cdot t\_0\right)}^{2}\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(t\_1, t\_1, b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if a < 3.5000000000000001e-15

            1. Initial program 78.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 3.5000000000000001e-15 < a

            1. Initial program 74.0%

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(0.005555555555555556 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right), 0.005555555555555556 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right), b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification65.0%

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

          Alternative 12: 67.4% accurate, 2.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\\ \mathbf{if}\;a \leq 3.5 \cdot 10^{-15}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, t\_0, b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* 0.005555555555555556 (* a (* (PI) angle)))))
             (if (<= a 3.5e-15)
               (* (* b b) (fma 0.5 (cos (* angle (* (PI) 0.011111111111111112))) 0.5))
               (fma
                t_0
                t_0
                (*
                 b
                 (*
                  b
                  (+
                   0.5
                   (* 0.5 (cos (* 2.0 (* (PI) (* angle 0.005555555555555556))))))))))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := 0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\\
          \mathbf{if}\;a \leq 3.5 \cdot 10^{-15}:\\
          \;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(t\_0, t\_0, b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if a < 3.5000000000000001e-15

            1. Initial program 78.8%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Applied rewrites73.7%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot a\right), \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
            4. Taylor expanded in a around 0

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

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

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

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

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

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

                \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{\cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, \frac{1}{2}\right) \]
              7. *-commutativeN/A

                \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{90}\right)}, \frac{1}{2}\right) \]
              8. associate-*l*N/A

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

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

                \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{90}\right)}\right), \frac{1}{2}\right) \]
              11. lower-PI.f6462.9

                \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.011111111111111112\right)\right), 0.5\right) \]
            6. Applied rewrites62.9%

              \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)} \]

            if 3.5000000000000001e-15 < a

            1. Initial program 74.0%

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(0.005555555555555556 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right), 0.005555555555555556 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right), b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification65.0%

            \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 3.5 \cdot 10^{-15}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right), 0.005555555555555556 \cdot \left(a \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right), b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 13: 67.4% accurate, 3.3× speedup?

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

            1. Initial program 78.8%

              \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
            2. Add Preprocessing
            3. Applied rewrites73.7%

              \[\leadsto \color{blue}{\mathsf{fma}\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot a\right), \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
            4. Taylor expanded in a around 0

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

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

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

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

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

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

                \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{\cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, \frac{1}{2}\right) \]
              7. *-commutativeN/A

                \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{90}\right)}, \frac{1}{2}\right) \]
              8. associate-*l*N/A

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

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

                \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{90}\right)}\right), \frac{1}{2}\right) \]
              11. lower-PI.f6462.9

                \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.011111111111111112\right)\right), 0.5\right) \]
            6. Applied rewrites62.9%

              \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)} \]

            if 3.5000000000000001e-15 < a

            1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 3.5 \cdot 10^{-15}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({\left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), b \cdot b\right)\\ \end{array} \]
            11. Add Preprocessing

            Alternative 14: 63.0% accurate, 3.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\ \mathbf{if}\;a \leq 2.6 \cdot 10^{+127}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot t\_0\right)\\ \end{array} \end{array} \]
            (FPCore (a b angle)
             :precision binary64
             (let* ((t_0 (* angle (* a 0.005555555555555556))))
               (if (<= a 2.6e+127)
                 (* (* b b) (fma 0.5 (cos (* angle (* (PI) 0.011111111111111112))) 0.5))
                 (* t_0 (* (* (PI) (PI)) t_0)))))
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\
            \mathbf{if}\;a \leq 2.6 \cdot 10^{+127}:\\
            \;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot t\_0\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < 2.6000000000000002e127

              1. Initial program 75.8%

                \[{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \]
              2. Add Preprocessing
              3. Applied rewrites71.5%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a \cdot a\right), \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
              4. Taylor expanded in a around 0

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

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

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

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

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

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

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{\cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}, \frac{1}{2}\right) \]
                7. *-commutativeN/A

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{90}\right)}, \frac{1}{2}\right) \]
                8. associate-*l*N/A

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

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

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \cos \left(angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{1}{90}\right)}\right), \frac{1}{2}\right) \]
                11. lower-PI.f6460.5

                  \[\leadsto \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.011111111111111112\right)\right), 0.5\right) \]
              6. Applied rewrites60.5%

                \[\leadsto \color{blue}{\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)} \]

              if 2.6000000000000002e127 < a

              1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right)\right) \]
                17. lower-*.f64N/A

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

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \]
                19. lower-PI.f6464.8

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \]
              10. Applied rewrites64.8%

                \[\leadsto \color{blue}{\left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} \]
              11. Step-by-step derivation
                1. lift-*.f64N/A

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

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(a \cdot a\right)} \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \]
                3. lift-PI.f64N/A

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \]
                4. lift-PI.f64N/A

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{32400}\right)\right) \]
                5. lift-*.f64N/A

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right)\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)}\right) \]
                7. lift-*.f64N/A

                  \[\leadsto \left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right)} \]
                8. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \cdot \left(angle \cdot angle\right)} \]
                9. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right)} \cdot \left(angle \cdot angle\right) \]
                10. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(a \cdot a\right)\right)} \cdot \left(angle \cdot angle\right) \]
              12. Applied rewrites75.1%

                \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)\right) \cdot \left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification62.5%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.6 \cdot 10^{+127}:\\ \;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot 0.011111111111111112\right)\right), 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 15: 63.0% accurate, 10.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\ \mathbf{if}\;a \leq 2.6 \cdot 10^{+127}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot t\_0\right)\\ \end{array} \end{array} \]
            (FPCore (a b angle)
             :precision binary64
             (let* ((t_0 (* angle (* a 0.005555555555555556))))
               (if (<= a 2.6e+127) (* b b) (* t_0 (* (* (PI) (PI)) t_0)))))
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := angle \cdot \left(a \cdot 0.005555555555555556\right)\\
            \mathbf{if}\;a \leq 2.6 \cdot 10^{+127}:\\
            \;\;\;\;b \cdot b\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0 \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot t\_0\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < 2.6000000000000002e127

              1. Initial program 75.8%

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

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

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

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

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

              if 2.6000000000000002e127 < a

              1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right)\right) \]
                17. lower-*.f64N/A

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

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \]
                19. lower-PI.f6464.8

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \]
              10. Applied rewrites64.8%

                \[\leadsto \color{blue}{\left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)} \]
              11. Step-by-step derivation
                1. lift-*.f64N/A

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

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(a \cdot a\right)} \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \]
                3. lift-PI.f64N/A

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \]
                4. lift-PI.f64N/A

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \frac{1}{32400}\right)\right) \]
                5. lift-*.f64N/A

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right)\right) \]
                6. lift-*.f64N/A

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)}\right) \]
                7. lift-*.f64N/A

                  \[\leadsto \left(angle \cdot angle\right) \cdot \color{blue}{\left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right)} \]
                8. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \cdot \left(angle \cdot angle\right)} \]
                9. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right)} \cdot \left(angle \cdot angle\right) \]
                10. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right) \cdot \left(a \cdot a\right)\right)} \cdot \left(angle \cdot angle\right) \]
              12. Applied rewrites75.1%

                \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)\right) \cdot \left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification62.2%

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

            Alternative 16: 63.0% accurate, 12.1× speedup?

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

              1. Initial program 75.8%

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

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

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

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

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

              if 3.0000000000000002e127 < a

              1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{32400}\right)\right) \]
                17. lower-*.f64N/A

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

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{1}{32400}\right)\right) \]
                19. lower-PI.f6464.8

                  \[\leadsto \left(angle \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \]
              10. Applied rewrites64.8%

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

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

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

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

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

                  \[\leadsto \frac{1}{32400} \cdot \left(\left(a \cdot a\right) \cdot \left(\left(angle \cdot angle\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}\right)\right) \]
                5. unswap-sqrN/A

                  \[\leadsto \frac{1}{32400} \cdot \left(\left(a \cdot a\right) \cdot \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \]
                6. unswap-sqrN/A

                  \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
                7. lower-*.f64N/A

                  \[\leadsto \frac{1}{32400} \cdot \color{blue}{\left(\left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
                8. lower-*.f64N/A

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

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

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

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

                  \[\leadsto \frac{1}{32400} \cdot \left(\left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(a \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)\right) \]
                13. lower-PI.f6475.0

                  \[\leadsto 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(a \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right) \]
              13. Applied rewrites75.0%

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

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

            Alternative 17: 57.4% accurate, 74.7× speedup?

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

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

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

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

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

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

            Reproduce

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