ab-angle->ABCF A

Percentage Accurate: 79.4% → 79.4%
Time: 19.0s
Alternatives: 16
Speedup: 1.0×

Specification

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

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos 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 16 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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 79.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ {\left(a \cdot {\left({\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}^{-1}\right)}^{-1}\right)}^{2} + {\left(b \cdot \cos \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 (pow (pow (sin (* (PI) (/ angle 180.0))) -1.0) -1.0)) 2.0)
  (pow (* b (cos (* (* (PI) 0.005555555555555556) angle))) 2.0)))
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \color{blue}{\frac{\cosh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right) \cdot \cosh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right) - \sinh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right) \cdot \sinh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right)}{\cosh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right) - \sinh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right)}}\right)}^{2} + {\left(b \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)}^{2} \]
  7. Applied rewrites78.9%

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

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

Alternative 2: 79.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

Alternative 3: 79.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.3% accurate, 1.3× speedup?

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

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

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

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

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

    Alternative 5: 79.3% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(a \cdot \color{blue}{\frac{\cosh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right) \cdot \cosh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right) - \sinh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right) \cdot \sinh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right)}{\cosh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right) - \sinh \left(\log \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot 1\right)}}\right)}^{2} + {\left(b \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot \frac{1}{180}\right) \cdot angle\right)\right)}^{2} \]
    7. Applied rewrites78.9%

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

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

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

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

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

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

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

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

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

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

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

      Alternative 6: 53.3% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ \mathbf{if}\;b \leq 9.2 \cdot 10^{-153}:\\ \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\right)\right) \cdot t\_0\\ \mathbf{elif}\;b \leq 1.26 \cdot 10^{+149}:\\ \;\;\;\;\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\left(t\_0 \cdot a\right) \cdot a\right) + {\left(b \cdot \sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{{b}^{4}}\\ \end{array} \end{array} \]
      (FPCore (a b angle)
       :precision binary64
       (let* ((t_0 (* (PI) (PI))))
         (if (<= b 9.2e-153)
           (* (* (* (* 3.08641975308642e-5 a) angle) (* angle a)) t_0)
           (if (<= b 1.26e+149)
             (+
              (* (* (* angle angle) 3.08641975308642e-5) (* (* t_0 a) a))
              (pow (* b (sin (fma (PI) (/ angle 180.0) (/ (PI) 2.0)))) 2.0))
             (sqrt (pow b 4.0))))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
      \mathbf{if}\;b \leq 9.2 \cdot 10^{-153}:\\
      \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\right)\right) \cdot t\_0\\
      
      \mathbf{elif}\;b \leq 1.26 \cdot 10^{+149}:\\
      \;\;\;\;\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\left(t\_0 \cdot a\right) \cdot a\right) + {\left(b \cdot \sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}^{2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\sqrt{{b}^{4}}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if b < 9.19999999999999988e-153

        1. Initial program 79.2%

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

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

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

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

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

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

            if 9.19999999999999988e-153 < b < 1.26000000000000005e149

            1. Initial program 70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 1.26000000000000005e149 < b

            1. Initial program 93.0%

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

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

                \[\leadsto \color{blue}{b \cdot b} \]
              2. lower-*.f6490.4

                \[\leadsto \color{blue}{b \cdot b} \]
            5. Applied rewrites90.4%

              \[\leadsto \color{blue}{b \cdot b} \]
            6. Step-by-step derivation
              1. Applied rewrites92.4%

                \[\leadsto \sqrt{{b}^{4}} \]
            7. Recombined 3 regimes into one program.
            8. Add Preprocessing

            Alternative 7: 53.3% accurate, 1.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ \mathbf{if}\;b \leq 9.2 \cdot 10^{-153}:\\ \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\right)\right) \cdot t\_0\\ \mathbf{elif}\;b \leq 1.26 \cdot 10^{+149}:\\ \;\;\;\;\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\left(t\_0 \cdot a\right) \cdot a\right) + {\left(b \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{{b}^{4}}\\ \end{array} \end{array} \]
            (FPCore (a b angle)
             :precision binary64
             (let* ((t_0 (* (PI) (PI))))
               (if (<= b 9.2e-153)
                 (* (* (* (* 3.08641975308642e-5 a) angle) (* angle a)) t_0)
                 (if (<= b 1.26e+149)
                   (+
                    (* (* (* angle angle) 3.08641975308642e-5) (* (* t_0 a) a))
                    (pow (* b (cos (* (* (PI) 0.005555555555555556) angle))) 2.0))
                   (sqrt (pow b 4.0))))))
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
            \mathbf{if}\;b \leq 9.2 \cdot 10^{-153}:\\
            \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\right)\right) \cdot t\_0\\
            
            \mathbf{elif}\;b \leq 1.26 \cdot 10^{+149}:\\
            \;\;\;\;\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\left(t\_0 \cdot a\right) \cdot a\right) + {\left(b \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)\right)}^{2}\\
            
            \mathbf{else}:\\
            \;\;\;\;\sqrt{{b}^{4}}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if b < 9.19999999999999988e-153

              1. Initial program 79.2%

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

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

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

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

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

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

                  if 9.19999999999999988e-153 < b < 1.26000000000000005e149

                  1. Initial program 70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 1.26000000000000005e149 < b

                  1. Initial program 93.0%

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

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

                      \[\leadsto \color{blue}{b \cdot b} \]
                    2. lower-*.f6490.4

                      \[\leadsto \color{blue}{b \cdot b} \]
                  5. Applied rewrites90.4%

                    \[\leadsto \color{blue}{b \cdot b} \]
                  6. Step-by-step derivation
                    1. Applied rewrites92.4%

                      \[\leadsto \sqrt{{b}^{4}} \]
                  7. Recombined 3 regimes into one program.
                  8. Add Preprocessing

                  Alternative 8: 53.3% accurate, 1.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 9.2 \cdot 10^{-153}:\\ \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{elif}\;b \leq 1.26 \cdot 10^{+149}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), a \cdot a, {\left(\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot b\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{{b}^{4}}\\ \end{array} \end{array} \]
                  (FPCore (a b angle)
                   :precision binary64
                   (if (<= b 9.2e-153)
                     (* (* (* (* 3.08641975308642e-5 a) angle) (* angle a)) (* (PI) (PI)))
                     (if (<= b 1.26e+149)
                       (fma
                        (* (* (* 3.08641975308642e-5 (* angle angle)) (PI)) (PI))
                        (* a a)
                        (pow (* (cos (* (* 0.005555555555555556 (PI)) angle)) b) 2.0))
                       (sqrt (pow b 4.0)))))
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;b \leq 9.2 \cdot 10^{-153}:\\
                  \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\\
                  
                  \mathbf{elif}\;b \leq 1.26 \cdot 10^{+149}:\\
                  \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right)\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right), a \cdot a, {\left(\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot b\right)}^{2}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\sqrt{{b}^{4}}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if b < 9.19999999999999988e-153

                    1. Initial program 79.2%

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

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

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

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

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

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

                        if 9.19999999999999988e-153 < b < 1.26000000000000005e149

                        1. Initial program 70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 1.26000000000000005e149 < b

                        1. Initial program 93.0%

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

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

                            \[\leadsto \color{blue}{b \cdot b} \]
                          2. lower-*.f6490.4

                            \[\leadsto \color{blue}{b \cdot b} \]
                        5. Applied rewrites90.4%

                          \[\leadsto \color{blue}{b \cdot b} \]
                        6. Step-by-step derivation
                          1. Applied rewrites92.4%

                            \[\leadsto \sqrt{{b}^{4}} \]
                        7. Recombined 3 regimes into one program.
                        8. Add Preprocessing

                        Alternative 9: 53.2% accurate, 3.6× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ \mathbf{if}\;b \leq 9.2 \cdot 10^{-153}:\\ \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\right)\right) \cdot t\_0\\ \mathbf{elif}\;b \leq 1.26 \cdot 10^{+149}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot t\_0\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{{b}^{4}}\\ \end{array} \end{array} \]
                        (FPCore (a b angle)
                         :precision binary64
                         (let* ((t_0 (* (PI) (PI))))
                           (if (<= b 9.2e-153)
                             (* (* (* (* 3.08641975308642e-5 a) angle) (* angle a)) t_0)
                             (if (<= b 1.26e+149)
                               (fma (* (* (* 3.08641975308642e-5 t_0) a) a) (* angle angle) (* b b))
                               (sqrt (pow b 4.0))))))
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
                        \mathbf{if}\;b \leq 9.2 \cdot 10^{-153}:\\
                        \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\right)\right) \cdot t\_0\\
                        
                        \mathbf{elif}\;b \leq 1.26 \cdot 10^{+149}:\\
                        \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot t\_0\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\sqrt{{b}^{4}}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if b < 9.19999999999999988e-153

                          1. Initial program 79.2%

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

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

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

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

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

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

                              if 9.19999999999999988e-153 < b < 1.26000000000000005e149

                              1. Initial program 70.5%

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

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

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

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

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

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

                                if 1.26000000000000005e149 < b

                                1. Initial program 93.0%

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

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

                                    \[\leadsto \color{blue}{b \cdot b} \]
                                  2. lower-*.f6490.4

                                    \[\leadsto \color{blue}{b \cdot b} \]
                                5. Applied rewrites90.4%

                                  \[\leadsto \color{blue}{b \cdot b} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites92.4%

                                    \[\leadsto \sqrt{{b}^{4}} \]
                                7. Recombined 3 regimes into one program.
                                8. Add Preprocessing

                                Alternative 10: 53.4% accurate, 9.1× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ \mathbf{if}\;b \leq 9.2 \cdot 10^{-153}:\\ \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\right)\right) \cdot t\_0\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot t\_0\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot b\\ \end{array} \end{array} \]
                                (FPCore (a b angle)
                                 :precision binary64
                                 (let* ((t_0 (* (PI) (PI))))
                                   (if (<= b 9.2e-153)
                                     (* (* (* (* 3.08641975308642e-5 a) angle) (* angle a)) t_0)
                                     (if (<= b 1.15e+154)
                                       (fma (* (* (* 3.08641975308642e-5 t_0) a) a) (* angle angle) (* b b))
                                       (* b b)))))
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_0 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
                                \mathbf{if}\;b \leq 9.2 \cdot 10^{-153}:\\
                                \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\right)\right) \cdot t\_0\\
                                
                                \mathbf{elif}\;b \leq 1.15 \cdot 10^{+154}:\\
                                \;\;\;\;\mathsf{fma}\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot t\_0\right) \cdot a\right) \cdot a, angle \cdot angle, b \cdot b\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;b \cdot b\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if b < 9.19999999999999988e-153

                                  1. Initial program 79.2%

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

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

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

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

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

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

                                      if 9.19999999999999988e-153 < b < 1.15e154

                                      1. Initial program 68.7%

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

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

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

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

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

                                        if 1.15e154 < b

                                        1. Initial program 100.0%

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

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

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

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

                                          \[\leadsto \color{blue}{b \cdot b} \]
                                      8. Recombined 3 regimes into one program.
                                      9. Add Preprocessing

                                      Alternative 11: 62.3% accurate, 12.1× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 3.2 \cdot 10^{+124}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\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 (<= a 3.2e+124)
                                         (* b b)
                                         (* (* (* (* 3.08641975308642e-5 a) angle) (* angle a)) (* (PI) (PI)))))
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;a \leq 3.2 \cdot 10^{+124}:\\
                                      \;\;\;\;b \cdot b\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\left(\left(\left(3.08641975308642 \cdot 10^{-5} \cdot a\right) \cdot angle\right) \cdot \left(angle \cdot a\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 a < 3.19999999999999993e124

                                        1. Initial program 75.9%

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

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

                                            \[\leadsto \color{blue}{b \cdot b} \]
                                          2. lower-*.f6458.2

                                            \[\leadsto \color{blue}{b \cdot b} \]
                                        5. Applied rewrites58.2%

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

                                        if 3.19999999999999993e124 < a

                                        1. Initial program 92.1%

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

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

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

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

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

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

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

                                          Alternative 12: 62.3% accurate, 12.1× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 3.2 \cdot 10^{+124}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot a\right) \cdot \left(angle \cdot a\right)\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 (<= a 3.2e+124)
                                             (* b b)
                                             (* (* 3.08641975308642e-5 (* (* angle a) (* angle a))) (* (PI) (PI)))))
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;a \leq 3.2 \cdot 10^{+124}:\\
                                          \;\;\;\;b \cdot b\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot a\right) \cdot \left(angle \cdot a\right)\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 a < 3.19999999999999993e124

                                            1. Initial program 75.9%

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

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

                                                \[\leadsto \color{blue}{b \cdot b} \]
                                              2. lower-*.f6458.2

                                                \[\leadsto \color{blue}{b \cdot b} \]
                                            5. Applied rewrites58.2%

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

                                            if 3.19999999999999993e124 < a

                                            1. Initial program 92.1%

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

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

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

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

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

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

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

                                              Alternative 13: 61.9% accurate, 12.1× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 3.2 \cdot 10^{+124}:\\ \;\;\;\;b \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\left(a \cdot angle\right) \cdot angle\right)\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 (<= a 3.2e+124)
                                                 (* b b)
                                                 (* (* 3.08641975308642e-5 (* a (* (* a angle) angle))) (* (PI) (PI)))))
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;a \leq 3.2 \cdot 10^{+124}:\\
                                              \;\;\;\;b \cdot b\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot \left(\left(a \cdot angle\right) \cdot angle\right)\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 a < 3.19999999999999993e124

                                                1. Initial program 75.9%

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

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

                                                    \[\leadsto \color{blue}{b \cdot b} \]
                                                  2. lower-*.f6458.2

                                                    \[\leadsto \color{blue}{b \cdot b} \]
                                                5. Applied rewrites58.2%

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

                                                if 3.19999999999999993e124 < a

                                                1. Initial program 92.1%

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

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

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

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

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

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

                                                Alternative 14: 61.9% accurate, 12.1× speedup?

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

                                                  1. Initial program 75.9%

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

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

                                                      \[\leadsto \color{blue}{b \cdot b} \]
                                                    2. lower-*.f6458.2

                                                      \[\leadsto \color{blue}{b \cdot b} \]
                                                  5. Applied rewrites58.2%

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

                                                  if 3.19999999999999993e124 < a

                                                  1. Initial program 92.1%

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

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

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

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

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

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

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

                                                    Alternative 15: 60.0% accurate, 12.1× speedup?

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

                                                      1. Initial program 75.9%

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

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

                                                          \[\leadsto \color{blue}{b \cdot b} \]
                                                        2. lower-*.f6458.2

                                                          \[\leadsto \color{blue}{b \cdot b} \]
                                                      5. Applied rewrites58.2%

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

                                                      if 3.19999999999999993e124 < a

                                                      1. Initial program 92.1%

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

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

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

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

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

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

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

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

                                                        Alternative 16: 56.2% accurate, 74.7× speedup?

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

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

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

                                                            \[\leadsto \color{blue}{b \cdot b} \]
                                                          2. lower-*.f6452.3

                                                            \[\leadsto \color{blue}{b \cdot b} \]
                                                        5. Applied rewrites52.3%

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

                                                        Reproduce

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