ab-angle->ABCF C

Percentage Accurate: 79.5% → 79.5%
Time: 9.6s
Alternatives: 15
Speedup: 1.4×

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

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

Initial Program: 79.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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.5% accurate, 0.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \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)\right)}^{2} + {\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)}^{2} \]
    9. lower-cbrt.f64N/A

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

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

      \[\leadsto {\left(a \cdot \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)\right)}^{2} + {\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)}^{2} \]
    12. lower-cbrt.f6481.3

      \[\leadsto {\left(a \cdot \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)\right)}^{2} + {\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)\right)}^{2} \]
  7. Applied rewrites81.3%

    \[\leadsto {\left(a \cdot \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)}\right)}^{2} + {\left(b \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)\right)}^{2} \]
  8. Add Preprocessing

Alternative 2: 71.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\ t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ t_2 := {\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}\\ t_3 := \mathsf{PI}\left(\right) \cdot a\\ \mathbf{if}\;t\_2 \leq 2 \cdot 10^{-309}:\\ \;\;\;\;{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2} \cdot \left(b \cdot b\right)\\ \mathbf{elif}\;t\_2 \leq 10^{+302}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, t\_3 \cdot t\_3, a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), t\_1, 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(t\_1 \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (PI) (/ angle 180.0)))
        (t_1 (* (PI) (PI)))
        (t_2 (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0)))
        (t_3 (* (PI) a)))
   (if (<= t_2 2e-309)
     (* (pow (sin (* (* (PI) angle) 0.005555555555555556)) 2.0) (* b b))
     (if (<= t_2 1e+302)
       (+
        (fma (* (* angle angle) -3.08641975308642e-5) (* t_3 t_3) (* a a))
        (pow
         (*
          (*
           b
           (*
            (PI)
            (fma
             (* -2.8577960676726107e-8 (* angle angle))
             t_1
             0.005555555555555556)))
          angle)
         2.0))
       (fma
        (* (* (* t_1 3.08641975308642e-5) b) b)
        (* angle angle)
        (* a a))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
t_2 := {\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}\\
t_3 := \mathsf{PI}\left(\right) \cdot a\\
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{-309}:\\
\;\;\;\;{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2} \cdot \left(b \cdot b\right)\\

\mathbf{elif}\;t\_2 \leq 10^{+302}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, t\_3 \cdot t\_3, a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), t\_1, 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(t\_1 \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 1.9999999999999988e-309

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2} \cdot \color{blue}{\left(b \cdot b\right)} \]
    8. Applied rewrites95.3%

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

    if 1.9999999999999988e-309 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 1.0000000000000001e302

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{32400}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), \color{blue}{a \cdot a}\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\frac{-1}{34992000} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right) \cdot angle\right)}^{2} \]
      21. lower-*.f6459.8

        \[\leadsto \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), \color{blue}{a \cdot a}\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2} \]
    8. Applied rewrites59.8%

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

    if 1.0000000000000001e302 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)))

    1. Initial program 99.0%

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;{\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} \leq 2 \cdot 10^{-309}:\\ \;\;\;\;{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2} \cdot \left(b \cdot b\right)\\ \mathbf{elif}\;{\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} \leq 10^{+302}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\ \end{array} \]
    10. Add Preprocessing

    Alternative 3: 71.5% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\ t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ t_2 := {\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}\\ t_3 := \mathsf{PI}\left(\right) \cdot a\\ \mathbf{if}\;t\_2 \leq 2 \cdot 10^{-309}:\\ \;\;\;\;{\sin \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)}^{2} \cdot \left(b \cdot b\right)\\ \mathbf{elif}\;t\_2 \leq 10^{+302}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, t\_3 \cdot t\_3, a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), t\_1, 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(t\_1 \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\ \end{array} \end{array} \]
    (FPCore (a b angle)
     :precision binary64
     (let* ((t_0 (* (PI) (/ angle 180.0)))
            (t_1 (* (PI) (PI)))
            (t_2 (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0)))
            (t_3 (* (PI) a)))
       (if (<= t_2 2e-309)
         (* (pow (sin (* (* (PI) 0.005555555555555556) angle)) 2.0) (* b b))
         (if (<= t_2 1e+302)
           (+
            (fma (* (* angle angle) -3.08641975308642e-5) (* t_3 t_3) (* a a))
            (pow
             (*
              (*
               b
               (*
                (PI)
                (fma
                 (* -2.8577960676726107e-8 (* angle angle))
                 t_1
                 0.005555555555555556)))
              angle)
             2.0))
           (fma
            (* (* (* t_1 3.08641975308642e-5) b) b)
            (* angle angle)
            (* a a))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
    t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
    t_2 := {\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}\\
    t_3 := \mathsf{PI}\left(\right) \cdot a\\
    \mathbf{if}\;t\_2 \leq 2 \cdot 10^{-309}:\\
    \;\;\;\;{\sin \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)}^{2} \cdot \left(b \cdot b\right)\\
    
    \mathbf{elif}\;t\_2 \leq 10^{+302}:\\
    \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, t\_3 \cdot t\_3, a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), t\_1, 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\left(\left(t\_1 \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 1.9999999999999988e-309

      1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.9999999999999988e-309 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 1.0000000000000001e302

      1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{32400}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), \color{blue}{a \cdot a}\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\frac{-1}{34992000} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right) \cdot angle\right)}^{2} \]
        21. lower-*.f6459.8

          \[\leadsto \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), \color{blue}{a \cdot a}\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2} \]
      8. Applied rewrites59.8%

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

      if 1.0000000000000001e302 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)))

      1. Initial program 99.0%

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;{\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} \leq 2 \cdot 10^{-309}:\\ \;\;\;\;{\sin \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)}^{2} \cdot \left(b \cdot b\right)\\ \mathbf{elif}\;{\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} \leq 10^{+302}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\ \end{array} \]
      10. Add Preprocessing

      Alternative 4: 71.6% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\ t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ t_2 := {\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}\\ t_3 := \mathsf{PI}\left(\right) \cdot a\\ \mathbf{if}\;t\_2 \leq 2 \cdot 10^{-309}:\\ \;\;\;\;{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(a \cdot a\right)\\ \mathbf{elif}\;t\_2 \leq 10^{+302}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, t\_3 \cdot t\_3, a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), t\_1, 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(t\_1 \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\ \end{array} \end{array} \]
      (FPCore (a b angle)
       :precision binary64
       (let* ((t_0 (* (PI) (/ angle 180.0)))
              (t_1 (* (PI) (PI)))
              (t_2 (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0)))
              (t_3 (* (PI) a)))
         (if (<= t_2 2e-309)
           (* (pow (cos (* -0.005555555555555556 (* (PI) angle))) 2.0) (* a a))
           (if (<= t_2 1e+302)
             (+
              (fma (* (* angle angle) -3.08641975308642e-5) (* t_3 t_3) (* a a))
              (pow
               (*
                (*
                 b
                 (*
                  (PI)
                  (fma
                   (* -2.8577960676726107e-8 (* angle angle))
                   t_1
                   0.005555555555555556)))
                angle)
               2.0))
             (fma
              (* (* (* t_1 3.08641975308642e-5) b) b)
              (* angle angle)
              (* a a))))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
      t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
      t_2 := {\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}\\
      t_3 := \mathsf{PI}\left(\right) \cdot a\\
      \mathbf{if}\;t\_2 \leq 2 \cdot 10^{-309}:\\
      \;\;\;\;{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(a \cdot a\right)\\
      
      \mathbf{elif}\;t\_2 \leq 10^{+302}:\\
      \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, t\_3 \cdot t\_3, a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), t\_1, 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(\left(\left(t\_1 \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 1.9999999999999988e-309

        1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(b \cdot \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right) \cdot \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right), b, {\left(\cos \left(\frac{angle \cdot \mathsf{PI}\left(\right)}{-180}\right) \cdot a\right)}^{2}\right)} \]
          3. 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}} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.9999999999999988e-309 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 1.0000000000000001e302

          1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{32400}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), \color{blue}{a \cdot a}\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\frac{-1}{34992000} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right) \cdot angle\right)}^{2} \]
            21. lower-*.f6459.8

              \[\leadsto \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), \color{blue}{a \cdot a}\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2} \]
          8. Applied rewrites59.8%

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

          if 1.0000000000000001e302 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)))

          1. Initial program 99.0%

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

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;{\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} \leq 2 \cdot 10^{-309}:\\ \;\;\;\;{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(a \cdot a\right)\\ \mathbf{elif}\;{\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} \leq 10^{+302}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\ \end{array} \]
          10. Add Preprocessing

          Alternative 5: 71.6% accurate, 0.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ t_1 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\ t_2 := {\left(a \cdot \cos t\_1\right)}^{2} + {\left(b \cdot \sin t\_1\right)}^{2}\\ t_3 := \mathsf{PI}\left(\right) \cdot a\\ \mathbf{if}\;t\_2 \leq 2 \cdot 10^{-309}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;t\_2 \leq 10^{+302}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, t\_3 \cdot t\_3, a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), t\_0, 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(t\_0 \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\ \end{array} \end{array} \]
          (FPCore (a b angle)
           :precision binary64
           (let* ((t_0 (* (PI) (PI)))
                  (t_1 (* (PI) (/ angle 180.0)))
                  (t_2 (+ (pow (* a (cos t_1)) 2.0) (pow (* b (sin t_1)) 2.0)))
                  (t_3 (* (PI) a)))
             (if (<= t_2 2e-309)
               (* a a)
               (if (<= t_2 1e+302)
                 (+
                  (fma (* (* angle angle) -3.08641975308642e-5) (* t_3 t_3) (* a a))
                  (pow
                   (*
                    (*
                     b
                     (*
                      (PI)
                      (fma
                       (* -2.8577960676726107e-8 (* angle angle))
                       t_0
                       0.005555555555555556)))
                    angle)
                   2.0))
                 (fma
                  (* (* (* t_0 3.08641975308642e-5) b) b)
                  (* angle angle)
                  (* a a))))))
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
          t_1 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
          t_2 := {\left(a \cdot \cos t\_1\right)}^{2} + {\left(b \cdot \sin t\_1\right)}^{2}\\
          t_3 := \mathsf{PI}\left(\right) \cdot a\\
          \mathbf{if}\;t\_2 \leq 2 \cdot 10^{-309}:\\
          \;\;\;\;a \cdot a\\
          
          \mathbf{elif}\;t\_2 \leq 10^{+302}:\\
          \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, t\_3 \cdot t\_3, a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), t\_0, 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\left(\left(t\_0 \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 1.9999999999999988e-309

            1. Initial program 95.0%

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

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

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

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

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

            if 1.9999999999999988e-309 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64))) < 1.0000000000000001e302

            1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot \frac{-1}{32400}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), \color{blue}{a \cdot a}\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(\frac{-1}{34992000} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), \frac{1}{180}\right)\right)\right) \cdot angle\right)}^{2} \]
              21. lower-*.f6459.8

                \[\leadsto \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), \color{blue}{a \cdot a}\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2} \]
            8. Applied rewrites59.8%

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

            if 1.0000000000000001e302 < (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) #s(literal 2 binary64)))

            1. Initial program 99.0%

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;{\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} \leq 2 \cdot 10^{-309}:\\ \;\;\;\;a \cdot a\\ \mathbf{elif}\;{\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} \leq 10^{+302}:\\ \;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -3.08641975308642 \cdot 10^{-5}, \left(\mathsf{PI}\left(\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot a\right), a \cdot a\right) + {\left(\left(b \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 0.005555555555555556\right)\right)\right) \cdot angle\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b, angle \cdot angle, a \cdot a\right)\\ \end{array} \]
            10. Add Preprocessing

            Alternative 6: 79.5% accurate, 1.0× speedup?

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

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

                \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\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} \]
              5. *-commutativeN/A

                \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\frac{angle}{180} \cdot \mathsf{PI}\left(\right)} + \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} \]
              6. lower-fma.f64N/A

                \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\mathsf{fma}\left(\frac{angle}{180}, \mathsf{PI}\left(\right), \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} \]
              7. lift-PI.f64N/A

                \[\leadsto {\left(a \cdot \sin \left(\mathsf{fma}\left(\frac{angle}{180}, \mathsf{PI}\left(\right), \frac{\color{blue}{\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} \]
              8. lower-/.f6481.1

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

              \[\leadsto {\left(a \cdot \color{blue}{\sin \left(\mathsf{fma}\left(\frac{angle}{180}, \mathsf{PI}\left(\right), \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. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 7: 79.5% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 8: 79.5% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 9: 79.5% accurate, 1.9× speedup?

                \[\begin{array}{l} \\ \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) \end{array} \]
                (FPCore (a b angle)
                 :precision binary64
                 (fma (* (* 1.0 a) 1.0) a (pow (* (sin (* (/ angle 180.0) (PI))) b) 2.0)))
                \begin{array}{l}
                
                \\
                \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)
                \end{array}
                
                Derivation
                1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\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 10: 66.7% accurate, 1.9× speedup?

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

                    1. Initial program 80.7%

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

                        \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\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} \]
                      5. *-commutativeN/A

                        \[\leadsto {\left(a \cdot \sin \left(\color{blue}{\frac{angle}{180} \cdot \mathsf{PI}\left(\right)} + \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} \]
                      6. lower-fma.f64N/A

                        \[\leadsto {\left(a \cdot \sin \color{blue}{\left(\mathsf{fma}\left(\frac{angle}{180}, \mathsf{PI}\left(\right), \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} \]
                      7. lift-PI.f64N/A

                        \[\leadsto {\left(a \cdot \sin \left(\mathsf{fma}\left(\frac{angle}{180}, \mathsf{PI}\left(\right), \frac{\color{blue}{\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} \]
                      8. lower-/.f6480.8

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

                      \[\leadsto {\left(a \cdot \color{blue}{\sin \left(\mathsf{fma}\left(\frac{angle}{180}, \mathsf{PI}\left(\right), \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. Taylor expanded in a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 1.89999999999999994e-67 < b

                    1. Initial program 82.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 inf

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 11: 53.0% accurate, 3.5× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 3.6 \cdot 10^{-155}:\\ \;\;\;\;angle \cdot \left(angle \cdot \left({\left(b \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+142}:\\ \;\;\;\;\mathsf{fma}\left(\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(-b\right) \cdot b\right), angle \cdot angle, a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot a\\ \end{array} \end{array} \]
                      (FPCore (a b angle)
                       :precision binary64
                       (if (<= a 3.6e-155)
                         (* angle (* angle (* (pow (* b (PI)) 2.0) 3.08641975308642e-5)))
                         (if (<= a 2.5e+142)
                           (fma
                            (* (* -3.08641975308642e-5 (* (PI) (PI))) (* (- b) b))
                            (* angle angle)
                            (* a a))
                           (* a a))))
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;a \leq 3.6 \cdot 10^{-155}:\\
                      \;\;\;\;angle \cdot \left(angle \cdot \left({\left(b \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\\
                      
                      \mathbf{elif}\;a \leq 2.5 \cdot 10^{+142}:\\
                      \;\;\;\;\mathsf{fma}\left(\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(-b\right) \cdot b\right), angle \cdot angle, a \cdot a\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;a \cdot a\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if a < 3.59999999999999989e-155

                        1. Initial program 80.4%

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

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

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

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

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

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

                            if 3.59999999999999989e-155 < a < 2.5000000000000001e142

                            1. Initial program 72.8%

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

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

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

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

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

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

                              if 2.5000000000000001e142 < a

                              1. Initial program 100.0%

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

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

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

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

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

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

                            Alternative 12: 62.2% accurate, 10.0× speedup?

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

                              1. Initial program 80.7%

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

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

                                  \[\leadsto \color{blue}{a \cdot a} \]
                                2. lower-*.f6462.1

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

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

                              if 1.89999999999999994e-67 < b

                              1. Initial program 82.1%

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

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

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

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

                                \[\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(\left(\frac{-1}{32400} \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(-1 \cdot {b}^{2}\right), angle \cdot angle, a \cdot a\right) \]
                              7. Step-by-step derivation
                                1. Applied rewrites65.8%

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

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

                              Alternative 13: 62.2% accurate, 10.4× speedup?

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

                                1. Initial program 80.7%

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

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

                                    \[\leadsto \color{blue}{a \cdot a} \]
                                  2. lower-*.f6462.1

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

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

                                if 1.89999999999999994e-67 < b

                                1. Initial program 82.1%

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

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

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

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

                                  \[\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 rewrites65.8%

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

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

                                Alternative 14: 61.2% accurate, 12.1× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{+125}:\\ \;\;\;\;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} \end{array} \]
                                (FPCore (a b angle)
                                 :precision binary64
                                 (if (<= b 8e+125)
                                   (* a a)
                                   (* (* 3.08641975308642e-5 (* (* (* angle angle) b) b)) (* (PI) (PI)))))
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;b \leq 8 \cdot 10^{+125}:\\
                                \;\;\;\;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}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if b < 7.9999999999999994e125

                                  1. Initial program 80.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-*.f6461.3

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

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

                                  if 7.9999999999999994e125 < b

                                  1. Initial program 86.8%

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

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

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

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

                                      \[\leadsto \left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot b\right) \cdot b\right)} \]
                                    2. 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)} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites69.0%

                                        \[\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)} \]
                                    4. Recombined 2 regimes into one program.
                                    5. Final simplification62.5%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{+125}:\\ \;\;\;\;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} \]
                                    6. Add Preprocessing

                                    Alternative 15: 56.4% accurate, 74.7× speedup?

                                    \[\begin{array}{l} \\ a \cdot a \end{array} \]
                                    (FPCore (a b angle) :precision binary64 (* a a))
                                    double code(double a, double b, double angle) {
                                    	return a * a;
                                    }
                                    
                                    module fmin_fmax_functions
                                        implicit none
                                        private
                                        public fmax
                                        public fmin
                                    
                                        interface fmax
                                            module procedure fmax88
                                            module procedure fmax44
                                            module procedure fmax84
                                            module procedure fmax48
                                        end interface
                                        interface fmin
                                            module procedure fmin88
                                            module procedure fmin44
                                            module procedure fmin84
                                            module procedure fmin48
                                        end interface
                                    contains
                                        real(8) function fmax88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmax44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmax84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmax48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmin44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmin48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                        end function
                                    end module
                                    
                                    real(8) function code(a, b, angle)
                                    use fmin_fmax_functions
                                        real(8), intent (in) :: a
                                        real(8), intent (in) :: b
                                        real(8), intent (in) :: angle
                                        code = a * a
                                    end function
                                    
                                    public static double code(double a, double b, double angle) {
                                    	return a * a;
                                    }
                                    
                                    def code(a, b, angle):
                                    	return a * a
                                    
                                    function code(a, b, angle)
                                    	return Float64(a * a)
                                    end
                                    
                                    function tmp = code(a, b, angle)
                                    	tmp = a * a;
                                    end
                                    
                                    code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    a \cdot a
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 81.2%

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

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

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

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

                                      \[\leadsto \color{blue}{a \cdot a} \]
                                    6. Final simplification56.0%

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

                                    Reproduce

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