ab-angle->ABCF C

Percentage Accurate: 80.1% → 80.1%
Time: 14.5s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 80.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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: 80.1% 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 79.3%

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

      \[\leadsto {\left(a \cdot \cos \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.f6479.5

      \[\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 rewrites79.5%

    \[\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-/.f6479.5

      \[\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 rewrites79.5%

    \[\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-*.f6479.5

      \[\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 rewrites79.5%

    \[\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 simplification79.5%

    \[\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 2: 80.1% accurate, 1.0× speedup?

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

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

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

      \[\leadsto {\left(a \cdot \cos \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.f6479.5

      \[\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 rewrites79.5%

    \[\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-/.f6479.5

      \[\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 rewrites79.5%

    \[\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-*.f6479.5

      \[\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 rewrites79.5%

    \[\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. Step-by-step derivation
    1. lift-*.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(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)}^{2} \]
    2. lift-/.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(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)}^{2} \]
    3. associate-*r/N/A

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

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

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

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

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

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

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

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

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

Alternative 3: 80.1% 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(\left(angle \cdot 0.005555555555555556\right) \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 0.005555555555555556) (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(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}
\end{array}
Derivation
  1. Initial program 79.3%

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

      \[\leadsto {\left(a \cdot \cos \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.f6479.5

      \[\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 rewrites79.5%

    \[\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 rewrites79.4%

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

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

Alternative 4: 80.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\left(\cos \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot -0.005555555555555556\right) \cdot 2\right) \cdot 0.5 + 0.5\right) \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
  (* (+ (* (cos (* (* (* angle (PI)) -0.005555555555555556) 2.0)) 0.5) 0.5) a)
  a
  (pow (* (sin (* (* angle 0.005555555555555556) (PI))) b) 2.0)))
\begin{array}{l}

\\
\mathsf{fma}\left(\left(\cos \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot -0.005555555555555556\right) \cdot 2\right) \cdot 0.5 + 0.5\right) \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 79.3%

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

      \[\leadsto \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. lift-pow.f64N/A

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left({\cos \left(\frac{angle \cdot \mathsf{PI}\left(\right)}{-180}\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)} \]
  5. Step-by-step derivation
    1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 64.7% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.3 \cdot 10^{-41}:\\ \;\;\;\;{\cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)}^{2} \cdot \left(a \cdot a\right)\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+152}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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
 (if (<= b 1.3e-41)
   (* (pow (cos (* (* (PI) 0.005555555555555556) angle)) 2.0) (* a a))
   (if (<= b 1.1e+152)
     (fma
      (* (* (* (* b b) 3.08641975308642e-5) (PI)) (PI))
      (* angle angle)
      (* a a))
     (* (pow (* (* b (PI)) angle) 2.0) 3.08641975308642e-5))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.3 \cdot 10^{-41}:\\
\;\;\;\;{\cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)}^{2} \cdot \left(a \cdot a\right)\\

\mathbf{elif}\;b \leq 1.1 \cdot 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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 3 regimes
  2. if b < 1.3e-41

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3e-41 < b < 1.0999999999999999e152

    1. Initial program 68.1%

      \[{\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 \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 rewrites60.3%

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

      if 1.0999999999999999e152 < b

      1. Initial program 99.4%

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {a}^{2}\right)} \]
      5. Applied rewrites45.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 \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 rewrites55.7%

          \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)} \]
        2. Step-by-step derivation
          1. Applied rewrites86.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 3 regimes into one program.
        4. Final simplification66.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.3 \cdot 10^{-41}:\\ \;\;\;\;{\cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)}^{2} \cdot \left(a \cdot a\right)\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+152}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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 6: 64.7% accurate, 2.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.3 \cdot 10^{-41}:\\ \;\;\;\;{\cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot -0.005555555555555556\right)}^{2} \cdot \left(a \cdot a\right)\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+152}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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
         (if (<= b 1.3e-41)
           (* (pow (cos (* (* angle (PI)) -0.005555555555555556)) 2.0) (* a a))
           (if (<= b 1.1e+152)
             (fma
              (* (* (* (* b b) 3.08641975308642e-5) (PI)) (PI))
              (* angle angle)
              (* a a))
             (* (pow (* (* b (PI)) angle) 2.0) 3.08641975308642e-5))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;b \leq 1.3 \cdot 10^{-41}:\\
        \;\;\;\;{\cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot -0.005555555555555556\right)}^{2} \cdot \left(a \cdot a\right)\\
        
        \mathbf{elif}\;b \leq 1.1 \cdot 10^{+152}:\\
        \;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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 3 regimes
        2. if b < 1.3e-41

          1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{{\cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {a}^{2}} \]
            4. rem-exp-logN/A

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

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

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

              \[\leadsto \color{blue}{e^{\log \left({\cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) \cdot \log \mathsf{E}\left(\right)} \cdot {a}^{2}} \]
          7. Applied rewrites65.0%

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

          if 1.3e-41 < b < 1.0999999999999999e152

          1. Initial program 68.1%

            \[{\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 \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 rewrites60.3%

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

            if 1.0999999999999999e152 < b

            1. Initial program 99.4%

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {a}^{2}\right)} \]
            5. Applied rewrites45.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 \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 rewrites55.7%

                \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)} \]
              2. Step-by-step derivation
                1. Applied rewrites86.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 3 regimes into one program.
              4. Final simplification66.9%

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.3 \cdot 10^{-41}:\\ \;\;\;\;{\cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot -0.005555555555555556\right)}^{2} \cdot \left(a \cdot a\right)\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+152}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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 7: 80.1% accurate, 2.0× speedup?

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

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

                  \[\leadsto {\left(a \cdot \cos \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.f6479.5

                  \[\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 rewrites79.5%

                \[\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-/.f6479.5

                  \[\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 rewrites79.5%

                \[\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-*.f6479.5

                  \[\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 rewrites79.5%

                \[\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. Taylor expanded in angle around 0

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

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

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

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

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

              Alternative 8: 64.8% accurate, 3.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.3 \cdot 10^{-41}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+152}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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
               (if (<= b 1.3e-41)
                 (* a a)
                 (if (<= b 1.1e+152)
                   (fma
                    (* (* (* (* b b) 3.08641975308642e-5) (PI)) (PI))
                    (* angle angle)
                    (* a a))
                   (* (pow (* (* b (PI)) angle) 2.0) 3.08641975308642e-5))))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;b \leq 1.3 \cdot 10^{-41}:\\
              \;\;\;\;a \cdot a\\
              
              \mathbf{elif}\;b \leq 1.1 \cdot 10^{+152}:\\
              \;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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 3 regimes
              2. if b < 1.3e-41

                1. Initial program 78.0%

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

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

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

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

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

                if 1.3e-41 < b < 1.0999999999999999e152

                1. Initial program 68.1%

                  \[{\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 \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 rewrites60.3%

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

                  if 1.0999999999999999e152 < b

                  1. Initial program 99.4%

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {a}^{2}\right)} \]
                  5. Applied rewrites45.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 \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 rewrites55.7%

                      \[\leadsto \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \color{blue}{\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)} \]
                    2. Step-by-step derivation
                      1. Applied rewrites86.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 3 regimes into one program.
                    4. Final simplification66.7%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.3 \cdot 10^{-41}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+152}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, 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 9: 56.2% accurate, 8.3× speedup?

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

                      1. Initial program 78.0%

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

                        \[\leadsto \color{blue}{{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 rewrites48.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. Step-by-step derivation
                        1. Applied rewrites50.2%

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

                        if 4.00000000000000037e56 < a

                        1. Initial program 83.9%

                          \[{\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-*.f6484.2

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

                          \[\leadsto \color{blue}{a \cdot a} \]
                      7. Recombined 2 regimes into one program.
                      8. Final simplification57.6%

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

                      Alternative 10: 65.7% accurate, 10.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 4 \cdot 10^{+56}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle \cdot angle, a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a\\ \end{array} \end{array} \]
                      (FPCore (a b angle)
                       :precision binary64
                       (if (<= a 4e+56)
                         (fma
                          (* (* (* (* b b) 3.08641975308642e-5) (PI)) (PI))
                          (* angle angle)
                          (* a a))
                         (* a a)))
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;a \leq 4 \cdot 10^{+56}:\\
                      \;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), 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 a < 4.00000000000000037e56

                        1. Initial program 78.0%

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

                          \[\leadsto \color{blue}{{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 rewrites48.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 \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 rewrites61.5%

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

                          if 4.00000000000000037e56 < a

                          1. Initial program 83.9%

                            \[{\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-*.f6484.2

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

                            \[\leadsto \color{blue}{a \cdot a} \]
                        8. Recombined 2 regimes into one program.
                        9. Final simplification66.5%

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

                        Alternative 11: 61.2% accurate, 12.1× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.7 \cdot 10^{+153}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\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 1.7e+153)
                           (* a a)
                           (* (* (* (* b b) (PI)) (PI)) (* (* angle angle) 3.08641975308642e-5))))
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;b \leq 1.7 \cdot 10^{+153}:\\
                        \;\;\;\;a \cdot a\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\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 < 1.6999999999999999e153

                          1. Initial program 76.7%

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

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

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

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

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

                          if 1.6999999999999999e153 < b

                          1. Initial program 99.4%

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

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{32400} \cdot \left({a}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right) + \frac{1}{32400} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {angle}^{2}, {a}^{2}\right)} \]
                          5. Applied rewrites45.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 \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 rewrites55.7%

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

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

                          Alternative 12: 57.7% accurate, 74.7× speedup?

                          \[\begin{array}{l} \\ a \cdot a \end{array} \]
                          (FPCore (a b angle) :precision binary64 (* a a))
                          double code(double a, double b, double angle) {
                          	return a * a;
                          }
                          
                          real(8) function code(a, b, angle)
                              real(8), intent (in) :: a
                              real(8), intent (in) :: b
                              real(8), intent (in) :: angle
                              code = a * a
                          end function
                          
                          public static double code(double a, double b, double angle) {
                          	return a * a;
                          }
                          
                          def code(a, b, angle):
                          	return a * a
                          
                          function code(a, b, angle)
                          	return Float64(a * a)
                          end
                          
                          function tmp = code(a, b, angle)
                          	tmp = a * a;
                          end
                          
                          code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
                          
                          \begin{array}{l}
                          
                          \\
                          a \cdot a
                          \end{array}
                          
                          Derivation
                          1. Initial program 79.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-*.f6459.3

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

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

                          Reproduce

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