ab-angle->ABCF C

Percentage Accurate: 79.7% → 79.6%
Time: 14.0s
Alternatives: 14
Speedup: 1.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

Alternative 1: 79.6% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left({\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot a, a, {\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right)} \]
  6. Final simplification82.3%

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

Alternative 6: 79.7% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 79.6% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot a} + {\left(e^{2}\right)}^{\log \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)} \]
    7. Applied rewrites47.4%

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

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

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

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

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

    Alternative 8: 56.4% accurate, 2.0× speedup?

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

      1. Initial program 79.7%

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

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

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

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

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

        \[\leadsto \color{blue}{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
      7. Step-by-step derivation
        1. exp-to-powN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto {\left(\color{blue}{b} \cdot e^{\log \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}^{2} \]
        11. rem-exp-logN/A

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

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

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

      if 5.99999999999999983e-168 < a

      1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right), e^{\mathsf{fma}\left(\color{blue}{\log b}, 2, \log \sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}, {\left(\cos \left(\frac{angle \cdot \mathsf{PI}\left(\right)}{-180}\right) \cdot a\right)}^{2}\right) \]
        10. lower-log.f6427.6

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right), e^{\log angle + \left(\log \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) + 2 \cdot \log b\right)}, {a}^{2}\right)} \]
      9. Applied rewrites79.3%

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

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

    Alternative 9: 71.0% accurate, 3.6× speedup?

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

      1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 8.3999999999999997e126 < b

      1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

        Alternative 10: 61.8% accurate, 6.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{-167}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+198}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a\\ \end{array} \end{array} \]
        (FPCore (a b angle)
         :precision binary64
         (if (<= (/ angle 180.0) 5e-167)
           (* a a)
           (if (<= (/ angle 180.0) 4e+198)
             (fma
              (* (* (* (* (PI) (PI)) 3.08641975308642e-5) b) b)
              (* angle angle)
              (* a a))
             (* a a))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{-167}:\\
        \;\;\;\;a \cdot a\\
        
        \mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+198}:\\
        \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;a \cdot a\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000002e-167 or 4.00000000000000007e198 < (/.f64 angle #s(literal 180 binary64))

          1. Initial program 83.3%

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

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

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

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

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

          if 5.0000000000000002e-167 < (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000007e198

          1. Initial program 79.8%

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

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

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

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

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

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

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

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

          Alternative 11: 70.1% accurate, 10.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot 0.005555555555555556\\ \mathsf{fma}\left(t\_0 \cdot angle, \left(\left(b \cdot b\right) \cdot angle\right) \cdot t\_0, a \cdot a\right) \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* (PI) 0.005555555555555556)))
             (fma (* t_0 angle) (* (* (* b b) angle) t_0) (* a a))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \mathsf{PI}\left(\right) \cdot 0.005555555555555556\\
          \mathsf{fma}\left(t\_0 \cdot angle, \left(\left(b \cdot b\right) \cdot angle\right) \cdot t\_0, a \cdot a\right)
          \end{array}
          \end{array}
          
          Derivation
          1. Initial program 82.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(angle \cdot \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right), e^{\log angle + \left(\log \left(\frac{1}{180} \cdot \mathsf{PI}\left(\right)\right) + 2 \cdot \log b\right)}, {a}^{2}\right)} \]
          9. Applied rewrites72.8%

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle, \left(angle \cdot \left(b \cdot b\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right), a \cdot a\right)} \]
          10. Final simplification72.8%

            \[\leadsto \mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle, \left(\left(b \cdot b\right) \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right), a \cdot a\right) \]
          11. Add Preprocessing

          Alternative 12: 61.6% accurate, 12.1× speedup?

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

            1. Initial program 80.6%

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

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

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

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

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

            if 1.80000000000000014e128 < b

            1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

              Alternative 13: 60.5% accurate, 12.1× speedup?

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

                1. Initial program 80.3%

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

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

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

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

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

                if 5.49999999999999997e187 < b

                1. Initial program 99.6%

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

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

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

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

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

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

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

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

                Alternative 14: 56.9% accurate, 74.7× speedup?

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

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

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

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

                    \[\leadsto \color{blue}{a \cdot a} \]
                5. Applied rewrites59.4%

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

                Reproduce

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