ab-angle->ABCF C

Percentage Accurate: 79.9% → 79.9%
Time: 11.9s
Alternatives: 14
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 79.9% 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.9% accurate, 0.2× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(angle\_m, -0.005555555555555556, 0.5\right) \cdot \mathsf{PI}\left(\right)\\ t_1 := \mathsf{fma}\left(angle\_m, -0.005555555555555556, 2\right) \cdot \mathsf{PI}\left(\right)\\ t_2 := \sin t\_1 \cdot \cos t\_0\\ t_3 := \cos t\_1 \cdot \sin t\_0\\ \mathsf{fma}\left(\frac{\frac{{t\_3}^{3} + {t\_2}^{3}}{\mathsf{fma}\left(t\_3, t\_3, t\_2 \cdot t\_2 - t\_3 \cdot t\_2\right)} + \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)}{2}, a \cdot a, {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right) \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* (fma angle_m -0.005555555555555556 0.5) (PI)))
        (t_1 (* (fma angle_m -0.005555555555555556 2.0) (PI)))
        (t_2 (* (sin t_1) (cos t_0)))
        (t_3 (* (cos t_1) (sin t_0))))
   (fma
    (/
     (+
      (/
       (+ (pow t_3 3.0) (pow t_2 3.0))
       (fma t_3 t_3 (- (* t_2 t_2) (* t_3 t_2))))
      (sin (* 0.5 (PI))))
     2.0)
    (* a a)
    (pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0))))
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(angle\_m, -0.005555555555555556, 0.5\right) \cdot \mathsf{PI}\left(\right)\\
t_1 := \mathsf{fma}\left(angle\_m, -0.005555555555555556, 2\right) \cdot \mathsf{PI}\left(\right)\\
t_2 := \sin t\_1 \cdot \cos t\_0\\
t_3 := \cos t\_1 \cdot \sin t\_0\\
\mathsf{fma}\left(\frac{\frac{{t\_3}^{3} + {t\_2}^{3}}{\mathsf{fma}\left(t\_3, t\_3, t\_2 \cdot t\_2 - t\_3 \cdot t\_2\right)} + \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)}{2}, a \cdot a, {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 81.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. 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. 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} \]
    4. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{\sin \left(\mathsf{PI}\left(\right) + \left(\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + \mathsf{PI}\left(\right) \cdot \left(1 - \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{180}\right)\right)} \cdot angle\right)\right) + \frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}{2}, a \cdot a, {\left(\sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right) \]
    4. fp-cancel-sign-sub-invN/A

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

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

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

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

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

Alternative 2: 79.9% accurate, 0.6× speedup?

\[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(angle\_m, -0.005555555555555556, 0.5\right) \cdot \mathsf{PI}\left(\right)\\ t_1 := \mathsf{fma}\left(angle\_m, -0.005555555555555556, 2\right) \cdot \mathsf{PI}\left(\right)\\ \mathsf{fma}\left(\frac{\mathsf{fma}\left(\sin t\_0, \cos t\_1, \sin t\_1 \cdot \cos t\_0\right) + \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)}{2}, a \cdot a, {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right) \end{array} \end{array} \]
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
 :precision binary64
 (let* ((t_0 (* (fma angle_m -0.005555555555555556 0.5) (PI)))
        (t_1 (* (fma angle_m -0.005555555555555556 2.0) (PI))))
   (fma
    (/
     (+ (fma (sin t_0) (cos t_1) (* (sin t_1) (cos t_0))) (sin (* 0.5 (PI))))
     2.0)
    (* a a)
    (pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0))))
\begin{array}{l}
angle_m = \left|angle\right|

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(angle\_m, -0.005555555555555556, 0.5\right) \cdot \mathsf{PI}\left(\right)\\
t_1 := \mathsf{fma}\left(angle\_m, -0.005555555555555556, 2\right) \cdot \mathsf{PI}\left(\right)\\
\mathsf{fma}\left(\frac{\mathsf{fma}\left(\sin t\_0, \cos t\_1, \sin t\_1 \cdot \cos t\_0\right) + \sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right)}{2}, a \cdot a, {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 81.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. 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. 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} \]
    4. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{\sin \left(\mathsf{PI}\left(\right) + \left(\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + \mathsf{PI}\left(\right) \cdot \left(1 - \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{180}\right)\right)} \cdot angle\right)\right) + \frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}{2}, a \cdot a, {\left(\sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right) \]
    4. fp-cancel-sign-sub-invN/A

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

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

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

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

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

    Alternative 3: 79.8% accurate, 0.9× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \mathsf{fma}\left(a \cdot \frac{\sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right) + \sin \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{fma}\left(angle\_m, -0.005555555555555556, 0.5\right) + \mathsf{fma}\left(angle\_m, -0.005555555555555556, 2\right)\right)\right)}{2}, a, {\left(\sin \left(\frac{angle\_m}{180} \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
      (*
       a
       (/
        (+
         (sin (* 0.5 (PI)))
         (sin
          (*
           (PI)
           (+
            (fma angle_m -0.005555555555555556 0.5)
            (fma angle_m -0.005555555555555556 2.0)))))
        2.0))
      a
      (pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0)))
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \mathsf{fma}\left(a \cdot \frac{\sin \left(0.5 \cdot \mathsf{PI}\left(\right)\right) + \sin \left(\mathsf{PI}\left(\right) \cdot \left(\mathsf{fma}\left(angle\_m, -0.005555555555555556, 0.5\right) + \mathsf{fma}\left(angle\_m, -0.005555555555555556, 2\right)\right)\right)}{2}, a, {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right)
    \end{array}
    
    Derivation
    1. Initial program 81.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. 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. 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} \]
      4. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\sin \left(\mathsf{PI}\left(\right) + \left(\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + \mathsf{PI}\left(\right) \cdot \left(1 - \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{180}\right)\right)} \cdot angle\right)\right) + \frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}{2}, a \cdot a, {\left(\sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right) \]
      4. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

    Alternative 4: 79.8% accurate, 1.9× speedup?

    \[\begin{array}{l} angle_m = \left|angle\right| \\ \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\sin \left(\frac{angle\_m}{180} \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) 1.0) a (pow (* (sin (* (/ angle_m 180.0) (PI))) b) 2.0)))
    \begin{array}{l}
    angle_m = \left|angle\right|
    
    \\
    \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\sin \left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right)
    \end{array}
    
    Derivation
    1. Initial program 81.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 {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    4. Step-by-step derivation
      1. Applied rewrites81.6%

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

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

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

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

      Alternative 5: 79.8% accurate, 1.9× speedup?

      \[\begin{array}{l} angle_m = \left|angle\right| \\ \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{2}\right) \end{array} \]
      angle_m = (fabs.f64 angle)
      (FPCore (a b angle_m)
       :precision binary64
       (fma
        (* (* 1.0 a) 1.0)
        a
        (pow (* (sin (* (* angle_m (PI)) 0.005555555555555556)) b) 2.0)))
      \begin{array}{l}
      angle_m = \left|angle\right|
      
      \\
      \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\sin \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{2}\right)
      \end{array}
      
      Derivation
      1. Initial program 81.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 {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
      4. Step-by-step derivation
        1. Applied rewrites81.6%

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

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

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

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

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

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

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

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

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

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

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

        Alternative 6: 66.9% accurate, 2.0× speedup?

        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{-120}:\\ \;\;\;\;{\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)}^{2} \cdot \left(a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right)}^{2}\right)\\ \end{array} \end{array} \]
        angle_m = (fabs.f64 angle)
        (FPCore (a b angle_m)
         :precision binary64
         (if (<= b 8e-120)
           (* (pow (cos (* (* 0.005555555555555556 (PI)) angle_m)) 2.0) (* a a))
           (fma
            (* (* 1.0 a) 1.0)
            a
            (pow (* (* (* b (PI)) 0.005555555555555556) angle_m) 2.0))))
        \begin{array}{l}
        angle_m = \left|angle\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;b \leq 8 \cdot 10^{-120}:\\
        \;\;\;\;{\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)}^{2} \cdot \left(a \cdot a\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right)}^{2}\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b < 7.99999999999999983e-120

          1. Initial program 80.5%

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

              \[\leadsto {\left(a \cdot \color{blue}{\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. sin-+PI/2-revN/A

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

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

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

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

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

              \[\leadsto {\left(a \cdot \color{blue}{\left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) - \left(\mathsf{neg}\left(\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\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 rewrites80.5%

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

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

              \[\leadsto \color{blue}{{\cos \left(\mathsf{PI}\left(\right) + \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(\mathsf{PI}\left(\right) + \frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {a}^{2}} \]
          7. Applied rewrites61.1%

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

          if 7.99999999999999983e-120 < b

          1. Initial program 83.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 {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
          4. Step-by-step derivation
            1. Applied rewrites84.1%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\color{blue}{\left(b \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{180}\right) \cdot angle\right)}^{2}\right) \]
              7. lower-PI.f6478.5

                \[\leadsto \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\left(b \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot 0.005555555555555556\right) \cdot angle\right)}^{2}\right) \]
            6. Applied rewrites78.5%

              \[\leadsto \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\color{blue}{\left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot angle\right)}}^{2}\right) \]
          5. Recombined 2 regimes into one program.
          6. Add Preprocessing

          Alternative 7: 66.8% accurate, 2.0× speedup?

          \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{-120}:\\ \;\;\;\;{\cos \left(-0.005555555555555556 \cdot \left(angle\_m \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right)}^{2}\right)\\ \end{array} \end{array} \]
          angle_m = (fabs.f64 angle)
          (FPCore (a b angle_m)
           :precision binary64
           (if (<= b 8e-120)
             (* (pow (cos (* -0.005555555555555556 (* angle_m (PI)))) 2.0) (* a a))
             (fma
              (* (* 1.0 a) 1.0)
              a
              (pow (* (* (* b (PI)) 0.005555555555555556) angle_m) 2.0))))
          \begin{array}{l}
          angle_m = \left|angle\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;b \leq 8 \cdot 10^{-120}:\\
          \;\;\;\;{\cos \left(-0.005555555555555556 \cdot \left(angle\_m \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right)}^{2}\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if b < 7.99999999999999983e-120

            1. Initial program 80.5%

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

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

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

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

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

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

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

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

              if 7.99999999999999983e-120 < b

              1. Initial program 83.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 {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
              4. Step-by-step derivation
                1. Applied rewrites84.1%

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\color{blue}{\left(b \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{180}\right) \cdot angle\right)}^{2}\right) \]
                  7. lower-PI.f6478.5

                    \[\leadsto \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\left(b \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot 0.005555555555555556\right) \cdot angle\right)}^{2}\right) \]
                6. Applied rewrites78.5%

                  \[\leadsto \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\color{blue}{\left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot angle\right)}}^{2}\right) \]
              5. Recombined 2 regimes into one program.
              6. Add Preprocessing

              Alternative 8: 66.9% accurate, 3.2× speedup?

              \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 7.2 \cdot 10^{-120}:\\ \;\;\;\;\mathsf{fma}\left(\cos \left(-2 \cdot \left(\mathsf{fma}\left(-0.005555555555555556, angle\_m, 1\right) \cdot \mathsf{PI}\left(\right)\right)\right), 0.5, 0.5\right) \cdot \left(a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right)}^{2}\right)\\ \end{array} \end{array} \]
              angle_m = (fabs.f64 angle)
              (FPCore (a b angle_m)
               :precision binary64
               (if (<= b 7.2e-120)
                 (*
                  (fma
                   (cos (* -2.0 (* (fma -0.005555555555555556 angle_m 1.0) (PI))))
                   0.5
                   0.5)
                  (* a a))
                 (fma
                  (* (* 1.0 a) 1.0)
                  a
                  (pow (* (* (* b (PI)) 0.005555555555555556) angle_m) 2.0))))
              \begin{array}{l}
              angle_m = \left|angle\right|
              
              \\
              \begin{array}{l}
              \mathbf{if}\;b \leq 7.2 \cdot 10^{-120}:\\
              \;\;\;\;\mathsf{fma}\left(\cos \left(-2 \cdot \left(\mathsf{fma}\left(-0.005555555555555556, angle\_m, 1\right) \cdot \mathsf{PI}\left(\right)\right)\right), 0.5, 0.5\right) \cdot \left(a \cdot a\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right)}^{2}\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if b < 7.2000000000000005e-120

                1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left({\cos \left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \left(\sqrt[3]{\color{blue}{\mathsf{PI}\left(\right)}} \cdot \frac{angle}{180}\right)\right)}^{2}, a \cdot a, {\left(\sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right) \cdot b\right)}^{2}\right) \]
                  15. lower-cbrt.f6480.7

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

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

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

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

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

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

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

                if 7.2000000000000005e-120 < b

                1. Initial program 83.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 {\left(a \cdot \color{blue}{1}\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
                4. Step-by-step derivation
                  1. Applied rewrites84.1%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\color{blue}{\left(b \cdot \mathsf{PI}\left(\right)\right)} \cdot \frac{1}{180}\right) \cdot angle\right)}^{2}\right) \]
                    7. lower-PI.f6478.5

                      \[\leadsto \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\left(\left(\left(b \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot 0.005555555555555556\right) \cdot angle\right)}^{2}\right) \]
                  6. Applied rewrites78.5%

                    \[\leadsto \mathsf{fma}\left(\left(1 \cdot a\right) \cdot 1, a, {\color{blue}{\left(\left(\left(b \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\right) \cdot angle\right)}}^{2}\right) \]
                5. Recombined 2 regimes into one program.
                6. Add Preprocessing

                Alternative 9: 57.8% accurate, 8.5× speedup?

                \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;a \leq 3.5 \cdot 10^{+82}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(-angle\_m\right), -angle\_m, 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
                 (if (<= a 3.5e+82)
                   (fma
                    (*
                     (* (* (- a b) (+ b a)) (* (* (PI) (PI)) -3.08641975308642e-5))
                     (- angle_m))
                    (- angle_m)
                    (* a a))
                   (* a a)))
                \begin{array}{l}
                angle_m = \left|angle\right|
                
                \\
                \begin{array}{l}
                \mathbf{if}\;a \leq 3.5 \cdot 10^{+82}:\\
                \;\;\;\;\mathsf{fma}\left(\left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(-angle\_m\right), -angle\_m, a \cdot a\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;a \cdot a\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if a < 3.5e82

                  1. Initial program 78.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 rewrites48.0%

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

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

                    if 3.5e82 < a

                    1. Initial program 93.6%

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

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

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

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

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

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

                  Alternative 10: 64.4% accurate, 9.1× speedup?

                  \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 7.5 \cdot 10^{-92}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{+152}:\\ \;\;\;\;\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(3.08641975308642 \cdot 10^{-5} \cdot \left(\left(\left(b \cdot angle\_m\right) \cdot angle\_m\right) \cdot b\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\\ \end{array} \end{array} \]
                  angle_m = (fabs.f64 angle)
                  (FPCore (a b angle_m)
                   :precision binary64
                   (if (<= b 7.5e-92)
                     (* a a)
                     (if (<= b 3.2e+152)
                       (fma
                        (* (* (* 3.08641975308642e-5 (* b b)) (PI)) (PI))
                        (* angle_m angle_m)
                        (* a a))
                       (*
                        (* 3.08641975308642e-5 (* (* (* b angle_m) angle_m) b))
                        (* (PI) (PI))))))
                  \begin{array}{l}
                  angle_m = \left|angle\right|
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;b \leq 7.5 \cdot 10^{-92}:\\
                  \;\;\;\;a \cdot a\\
                  
                  \mathbf{elif}\;b \leq 3.2 \cdot 10^{+152}:\\
                  \;\;\;\;\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(3.08641975308642 \cdot 10^{-5} \cdot \left(\left(\left(b \cdot angle\_m\right) \cdot angle\_m\right) \cdot b\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if b < 7.5000000000000005e-92

                    1. Initial program 80.5%

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

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

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

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

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

                    if 7.5000000000000005e-92 < b < 3.20000000000000005e152

                    1. Initial program 74.3%

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(a \cdot a - b \cdot b\right), angle \cdot angle, a \cdot a\right)} \]
                    6. 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 rewrites61.2%

                        \[\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 3.20000000000000005e152 < b

                      1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

                        Alternative 11: 57.8% accurate, 9.1× speedup?

                        \[\begin{array}{l} angle_m = \left|angle\right| \\ \begin{array}{l} \mathbf{if}\;a \leq 3.5 \cdot 10^{+82}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle\_m\right), angle\_m, 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
                         (if (<= a 3.5e+82)
                           (fma
                            (* (* (- a b) (+ b a)) (* (* (* (PI) (PI)) -3.08641975308642e-5) angle_m))
                            angle_m
                            (* a a))
                           (* a a)))
                        \begin{array}{l}
                        angle_m = \left|angle\right|
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;a \leq 3.5 \cdot 10^{+82}:\\
                        \;\;\;\;\mathsf{fma}\left(\left(\left(a - b\right) \cdot \left(b + a\right)\right) \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot -3.08641975308642 \cdot 10^{-5}\right) \cdot angle\_m\right), angle\_m, a \cdot a\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;a \cdot a\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if a < 3.5e82

                          1. Initial program 78.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 rewrites48.0%

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

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

                            if 3.5e82 < a

                            1. Initial program 93.6%

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

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

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

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

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

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

                          Alternative 12: 62.3% accurate, 12.1× speedup?

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

                            1. Initial program 79.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}{{a}^{2}} \]
                            4. Step-by-step derivation
                              1. unpow2N/A

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

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

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

                            if 5.4000000000000003e162 < b

                            1. Initial program 99.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}{{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 rewrites55.6%

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

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

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

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

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

                              Alternative 13: 61.1% accurate, 12.1× speedup?

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

                                1. Initial program 79.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}{{a}^{2}} \]
                                4. Step-by-step derivation
                                  1. unpow2N/A

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

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

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

                                if 5.4000000000000003e162 < b

                                1. Initial program 99.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}{{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 rewrites55.6%

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

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

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

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

                                Alternative 14: 56.9% 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 81.4%

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

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

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

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

                                  \[\leadsto \color{blue}{a \cdot a} \]
                                6. Final simplification57.4%

                                  \[\leadsto a \cdot a \]
                                7. Add Preprocessing

                                Reproduce

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