ab-angle->ABCF C

Percentage Accurate: 79.6% → 79.6%
Time: 10.8s
Alternatives: 11
Speedup: N/A×

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 11 alternatives:

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

Initial Program: 79.6% accurate, 1.0× speedup?

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

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

Alternative 1: 79.6% accurate, 0.6× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \cos \left(e^{\log \left(\mathsf{PI}\left(\right) \cdot angle\_m\right) - \log 180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\right)}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow (* a (cos (exp (- (log (* (PI) angle_m)) (log 180.0))))) 2.0)
  (pow (* b (sin (* (PI) (/ angle_m 180.0)))) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \cos \left(e^{\log \left(\mathsf{PI}\left(\right) \cdot angle\_m\right) - \log 180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(e^{\log \left(\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}\right) \cdot -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. rem-log-expN/A

      \[\leadsto {\left(a \cdot \cos \left(e^{\color{blue}{\log \left(e^{\log \left(\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}\right) \cdot -1}\right)}}\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(e^{\log \left(e^{\color{blue}{\log \left(\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}\right) \cdot -1}}\right)}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.6% accurate, 0.7× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ {\left(a \cdot \cos \left(e^{\log \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right)}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (+
  (pow (* a (cos (exp (log (* (* 0.005555555555555556 angle_m) (PI)))))) 2.0)
  (pow (* b (sin (* (PI) (* angle_m 0.005555555555555556)))) 2.0)))
\begin{array}{l}
angle_m = \left|angle\right|

\\
{\left(a \cdot \cos \left(e^{\log \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right)}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.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. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(a \cdot \cos \color{blue}{\left(e^{\log \left(\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}\right) \cdot -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. rem-log-expN/A

      \[\leadsto {\left(a \cdot \cos \left(e^{\color{blue}{\log \left(e^{\log \left(\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}\right) \cdot -1}\right)}}\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(e^{\log \left(e^{\color{blue}{\log \left(\frac{\frac{180}{angle}}{\mathsf{PI}\left(\right)}\right) \cdot -1}}\right)}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    3. lift-log.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \cos \left(e^{\log \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}\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} \]
    3. metadata-evalN/A

      \[\leadsto {\left(a \cdot \cos \left(e^{\log \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}\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} \]
    4. lower-*.f6438.1

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

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

Alternative 3: 64.4% accurate, 2.0× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 1.65 \cdot 10^{-43}:\\ \;\;\;\;{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right)}^{2} \cdot \left(a \cdot a\right)\\ \mathbf{elif}\;b \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle\_m \cdot angle\_m, a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\ \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (if (<= b 1.65e-43)
   (* (pow (cos (* -0.005555555555555556 (* (PI) angle_m))) 2.0) (* a a))
   (if (<= b 1.4e+154)
     (fma
      (* (* (* 3.08641975308642e-5 (* b b)) (PI)) (PI))
      (* angle_m angle_m)
      (* a a))
     (* (pow (* (* b (PI)) angle_m) 2.0) 3.08641975308642e-5))))
\begin{array}{l}
angle_m = \left|angle\right|

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

\mathbf{elif}\;b \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle\_m \cdot angle\_m, a \cdot a\right)\\

\mathbf{else}:\\
\;\;\;\;{\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 1.65000000000000008e-43

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{a}^{2} \cdot {\cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
    8. 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. lower-cos.f64N/A

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

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

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

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

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

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

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

      \[\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.65000000000000008e-43 < b < 1.4e154

    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 rewrites31.9%

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

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

        \[\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.4e154 < b

      1. Initial program 99.7%

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

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

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

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

        \[\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 a around 0

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

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

            \[\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. Add Preprocessing

        Alternative 4: 79.5% accurate, 2.0× speedup?

        \[\begin{array}{l} angle_m = \left|angle\right| \\ \mathsf{fma}\left(1 \cdot a, a, {\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right) \end{array} \]
        angle_m = (fabs.f64 angle)
        (FPCore (a b angle_m)
         :precision binary64
         (fma
          (* 1.0 a)
          a
          (pow (* (sin (* (* 0.005555555555555556 angle_m) (PI))) b) 2.0)))
        \begin{array}{l}
        angle_m = \left|angle\right|
        
        \\
        \mathsf{fma}\left(1 \cdot a, a, {\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right)
        \end{array}
        
        Derivation
        1. Initial program 77.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. associate-*r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{1} \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. Step-by-step derivation
          1. Applied rewrites77.4%

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

          Alternative 5: 64.5% accurate, 3.5× speedup?

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

            1. Initial program 74.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-*.f6455.2

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

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

            if 9.49999999999999924e-44 < b < 1.4e154

            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 rewrites31.9%

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

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

                \[\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.4e154 < b

              1. Initial program 99.7%

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

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

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

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

                \[\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 a around 0

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

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

                    \[\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. Add Preprocessing

                Alternative 6: 56.2% accurate, 4.9× speedup?

                \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \left(angle\_m \cdot b\right) \cdot \mathsf{PI}\left(\right)\\ \mathbf{if}\;a \leq 3 \cdot 10^{-68}:\\ \;\;\;\;\mathsf{fma}\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\_m\right) \cdot angle\_m, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), a \cdot a\right)\\ \mathbf{elif}\;a \leq 8 \cdot 10^{+152}:\\ \;\;\;\;\mathsf{fma}\left(t\_0 \cdot t\_0, \frac{3.08641975308642 \cdot 10^{-5}}{a \cdot a}, \mathsf{fma}\left(\left(\left(angle\_m \cdot angle\_m\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right), \mathsf{PI}\left(\right), 1\right)\right) \cdot \left(a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a\\ \end{array} \end{array} \]
                angle_m = (fabs.f64 angle)
                (FPCore (a b angle_m)
                 :precision binary64
                 (let* ((t_0 (* (* angle_m b) (PI))))
                   (if (<= a 3e-68)
                     (fma
                      (*
                       (*
                        (fma (* b b) 3.08641975308642e-5 (* (* a a) -3.08641975308642e-5))
                        angle_m)
                       angle_m)
                      (* (PI) (PI))
                      (* a a))
                     (if (<= a 8e+152)
                       (*
                        (fma
                         (* t_0 t_0)
                         (/ 3.08641975308642e-5 (* a a))
                         (fma (* (* (* angle_m angle_m) -3.08641975308642e-5) (PI)) (PI) 1.0))
                        (* a a))
                       (* a a)))))
                \begin{array}{l}
                angle_m = \left|angle\right|
                
                \\
                \begin{array}{l}
                t_0 := \left(angle\_m \cdot b\right) \cdot \mathsf{PI}\left(\right)\\
                \mathbf{if}\;a \leq 3 \cdot 10^{-68}:\\
                \;\;\;\;\mathsf{fma}\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\_m\right) \cdot angle\_m, \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), a \cdot a\right)\\
                
                \mathbf{elif}\;a \leq 8 \cdot 10^{+152}:\\
                \;\;\;\;\mathsf{fma}\left(t\_0 \cdot t\_0, \frac{3.08641975308642 \cdot 10^{-5}}{a \cdot a}, \mathsf{fma}\left(\left(\left(angle\_m \cdot angle\_m\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot \mathsf{PI}\left(\right), \mathsf{PI}\left(\right), 1\right)\right) \cdot \left(a \cdot a\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;a \cdot a\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if a < 3e-68

                  1. Initial program 74.2%

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

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

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

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

                      \[\leadsto \mathsf{fma}\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, \color{blue}{\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)}, a \cdot a\right) \]

                    if 3e-68 < a < 8.0000000000000004e152

                    1. Initial program 74.7%

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

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

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

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

                      \[\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 a around 0

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

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

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

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

                        if 8.0000000000000004e152 < a

                        1. Initial program 97.8%

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

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

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

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

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

                      Alternative 7: 66.8% accurate, 8.3× speedup?

                      \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 8 \cdot 10^{-146}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle\_m \cdot angle\_m, a \cdot a\right)\\ \end{array} \end{array} \]
                      angle_m = (fabs.f64 angle)
                      (FPCore (a b angle_m)
                       :precision binary64
                       (if (<= (/ angle_m 180.0) 8e-146)
                         (* a a)
                         (fma
                          (* (* (* 3.08641975308642e-5 (* b b)) (PI)) (PI))
                          (* angle_m angle_m)
                          (* a a))))
                      \begin{array}{l}
                      angle_m = \left|angle\right|
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\frac{angle\_m}{180} \leq 8 \cdot 10^{-146}:\\
                      \;\;\;\;a \cdot a\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), angle\_m \cdot angle\_m, a \cdot a\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (/.f64 angle #s(literal 180 binary64)) < 8.00000000000000021e-146

                        1. Initial program 80.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-*.f6455.6

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

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

                        if 8.00000000000000021e-146 < (/.f64 angle #s(literal 180 binary64))

                        1. Initial program 70.7%

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, 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 a around 0

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

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

                        Alternative 8: 61.4% accurate, 12.1× speedup?

                        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 6.6 \cdot 10^{+171}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\left(angle\_m \cdot angle\_m\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\\ \end{array} \end{array} \]
                        angle_m = (fabs.f64 angle)
                        (FPCore (a b angle_m)
                         :precision binary64
                         (if (<= b 6.6e+171)
                           (* a a)
                           (* (* (* (* (* angle_m angle_m) 3.08641975308642e-5) b) (* (PI) (PI))) b)))
                        \begin{array}{l}
                        angle_m = \left|angle\right|
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;b \leq 6.6 \cdot 10^{+171}:\\
                        \;\;\;\;a \cdot a\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\left(\left(\left(\left(angle\_m \cdot angle\_m\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if b < 6.59999999999999982e171

                          1. Initial program 74.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-*.f6454.8

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

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

                          if 6.59999999999999982e171 < b

                          1. Initial program 99.7%

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

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

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

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, 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 a around 0

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

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

                                \[\leadsto \left(\left(\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b \]
                            3. Recombined 2 regimes into one program.
                            4. Add Preprocessing

                            Alternative 9: 61.4% accurate, 12.1× speedup?

                            \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 6.6 \cdot 10^{+171}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(angle\_m \cdot angle\_m\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)\\ \end{array} \end{array} \]
                            angle_m = (fabs.f64 angle)
                            (FPCore (a b angle_m)
                             :precision binary64
                             (if (<= b 6.6e+171)
                               (* a a)
                               (* (* (* (* angle_m angle_m) 3.08641975308642e-5) b) (* (* (PI) (PI)) b))))
                            \begin{array}{l}
                            angle_m = \left|angle\right|
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;b \leq 6.6 \cdot 10^{+171}:\\
                            \;\;\;\;a \cdot a\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\left(\left(\left(angle\_m \cdot angle\_m\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if b < 6.59999999999999982e171

                              1. Initial program 74.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-*.f6454.8

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

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

                              if 6.59999999999999982e171 < b

                              1. Initial program 99.7%

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

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

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

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

                                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, 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 a around 0

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

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

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

                                Alternative 10: 60.8% accurate, 12.1× speedup?

                                \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 6.6 \cdot 10^{+171}:\\ \;\;\;\;a \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(\left(3.08641975308642 \cdot 10^{-5} \cdot angle\_m\right) \cdot angle\_m\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right) \cdot b\right)\\ \end{array} \end{array} \]
                                angle_m = (fabs.f64 angle)
                                (FPCore (a b angle_m)
                                 :precision binary64
                                 (if (<= b 6.6e+171)
                                   (* a a)
                                   (* (* (* 3.08641975308642e-5 angle_m) angle_m) (* (* (* (PI) (PI)) b) b))))
                                \begin{array}{l}
                                angle_m = \left|angle\right|
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;b \leq 6.6 \cdot 10^{+171}:\\
                                \;\;\;\;a \cdot a\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\left(\left(3.08641975308642 \cdot 10^{-5} \cdot angle\_m\right) \cdot angle\_m\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right) \cdot b\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if b < 6.59999999999999982e171

                                  1. Initial program 74.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-*.f6454.8

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

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

                                  if 6.59999999999999982e171 < b

                                  1. Initial program 99.7%

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

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

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

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, 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 a around 0

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

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

                                        \[\leadsto \left(\left(3.08641975308642 \cdot 10^{-5} \cdot angle\right) \cdot angle\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right) \cdot b\right) \]
                                    3. Recombined 2 regimes into one program.
                                    4. Add Preprocessing

                                    Alternative 11: 57.2% accurate, 74.7× speedup?

                                    \[\begin{array}{l} angle_m = \left|angle\right| \\ a \cdot a \end{array} \]
                                    angle_m = (fabs.f64 angle)
                                    (FPCore (a b angle_m) :precision binary64 (* a a))
                                    angle_m = fabs(angle);
                                    double code(double a, double b, double angle_m) {
                                    	return a * a;
                                    }
                                    
                                    angle_m = abs(angle)
                                    real(8) function code(a, b, angle_m)
                                        real(8), intent (in) :: a
                                        real(8), intent (in) :: b
                                        real(8), intent (in) :: angle_m
                                        code = a * a
                                    end function
                                    
                                    angle_m = Math.abs(angle);
                                    public static double code(double a, double b, double angle_m) {
                                    	return a * a;
                                    }
                                    
                                    angle_m = math.fabs(angle)
                                    def code(a, b, angle_m):
                                    	return a * a
                                    
                                    angle_m = abs(angle)
                                    function code(a, b, angle_m)
                                    	return Float64(a * a)
                                    end
                                    
                                    angle_m = abs(angle);
                                    function tmp = code(a, b, angle_m)
                                    	tmp = a * a;
                                    end
                                    
                                    angle_m = N[Abs[angle], $MachinePrecision]
                                    code[a_, b_, angle$95$m_] := N[(a * a), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    angle_m = \left|angle\right|
                                    
                                    \\
                                    a \cdot a
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 77.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-*.f6451.9

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

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

                                    Reproduce

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