ab-angle->ABCF C

Percentage Accurate: 80.1% → 80.1%
Time: 12.1s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 80.1% accurate, 1.0× speedup?

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

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

Alternative 1: 80.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \log \mathsf{PI}\left(\right)\\
t_1 := \frac{angle}{180} \cdot \sinh t\_0\\
t_2 := \cosh t\_0\\
{\left(a \cdot \left(\cos \left(\frac{t\_2 \cdot angle}{-180}\right) \cdot \cos t\_1 - \sin \left(\frac{angle}{180} \cdot t\_2\right) \cdot \sin t\_1\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \left(\cos \left(\frac{\color{blue}{\cosh \log \mathsf{PI}\left(\right) \cdot angle}}{\mathsf{neg}\left(180\right)}\right) \cdot \cos \left(\frac{angle}{180} \cdot \sinh \log \mathsf{PI}\left(\right)\right) - \sin \left(\frac{angle}{180} \cdot \cosh \log \mathsf{PI}\left(\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \sinh \log \mathsf{PI}\left(\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. metadata-eval77.2

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

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

Alternative 2: 80.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \log \mathsf{PI}\left(\right)\\
t_1 := \frac{angle}{180} \cdot \sinh t\_0\\
t_2 := \frac{angle}{180} \cdot \cosh t\_0\\
{\left(a \cdot \left(\cos t\_2 \cdot \cos t\_1 - \sin t\_2 \cdot \sin t\_1\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 80.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \log \mathsf{PI}\left(\right)\\
t_1 := \cosh t\_0\\
{\left(a \cdot \left(\cos \left(\frac{t\_1 \cdot angle}{-180}\right) \cdot \cos \left(\frac{angle}{180} \cdot \sinh t\_0\right) - \sin \left(\frac{angle}{180} \cdot t\_1\right) \cdot \sin \left(\left(\left(\mathsf{PI}\left(\right) - {\mathsf{PI}\left(\right)}^{-1}\right) \cdot 0.002777777777777778\right) \cdot angle\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
\end{array}
Derivation
  1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\left(a \cdot \left(\cos \left(\frac{\color{blue}{\cosh \log \mathsf{PI}\left(\right) \cdot angle}}{\mathsf{neg}\left(180\right)}\right) \cdot \cos \left(\frac{angle}{180} \cdot \sinh \log \mathsf{PI}\left(\right)\right) - \sin \left(\frac{angle}{180} \cdot \cosh \log \mathsf{PI}\left(\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \sinh \log \mathsf{PI}\left(\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2} \]
    11. metadata-eval77.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 80.1% accurate, 0.7× speedup?

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

\\
{\left(a \cdot \cos \left(\left(\frac{\sqrt{\mathsf{PI}\left(\right)} \cdot angle}{180} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot {\mathsf{PI}\left(\right)}^{0.16666666666666666}\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.1% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 80.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 80.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 80.1% accurate, 1.3× speedup?

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

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

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

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

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

    Alternative 9: 63.2% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot angle\\ \mathbf{if}\;angle \leq 3.9:\\ \;\;\;\;\mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, t\_0, 1\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\\ \mathbf{elif}\;angle \leq 1.5 \cdot 10^{+172}:\\ \;\;\;\;{\left(a \cdot \cos \left(\frac{angle \cdot \mathsf{PI}\left(\right)}{180}\right)\right)}^{2} + \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;e^{\log a \cdot 2}\\ \end{array} \end{array} \]
    (FPCore (a b angle)
     :precision binary64
     (let* ((t_0 (* (* (* (PI) (PI)) angle) angle)))
       (if (<= angle 3.9)
         (+
          (* (fma -3.08641975308642e-5 t_0 1.0) (* a a))
          (pow (* b (sin (* (PI) (/ angle 180.0)))) 2.0))
         (if (<= angle 1.5e+172)
           (+
            (pow (* a (cos (/ (* angle (PI)) 180.0))) 2.0)
            (* (* 3.08641975308642e-5 (* b b)) t_0))
           (exp (* (log a) 2.0))))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot angle\\
    \mathbf{if}\;angle \leq 3.9:\\
    \;\;\;\;\mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, t\_0, 1\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)}^{2}\\
    
    \mathbf{elif}\;angle \leq 1.5 \cdot 10^{+172}:\\
    \;\;\;\;{\left(a \cdot \cos \left(\frac{angle \cdot \mathsf{PI}\left(\right)}{180}\right)\right)}^{2} + \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;e^{\log a \cdot 2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if angle < 3.89999999999999991

      1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.89999999999999991 < angle < 1.5e172

      1. Initial program 51.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.5e172 < angle

      1. Initial program 56.9%

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

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

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

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

        \[\leadsto \color{blue}{a \cdot a} \]
      6. Step-by-step derivation
        1. Applied rewrites12.8%

          \[\leadsto e^{\log a \cdot 2} \]
      7. Recombined 3 regimes into one program.
      8. Add Preprocessing

      Alternative 10: 62.9% accurate, 3.6× speedup?

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

        1. Initial program 75.9%

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

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

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

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

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

        if 5.5000000000000002e96 < b

        1. Initial program 82.2%

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

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

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

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

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

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

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

          Alternative 11: 57.8% accurate, 8.5× speedup?

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

            1. Initial program 75.6%

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

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

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

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

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

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

              if 4.59999999999999994e95 < a

              1. Initial program 85.4%

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

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

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

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

                \[\leadsto \color{blue}{a \cdot a} \]
            7. Recombined 2 regimes into one program.
            8. Add Preprocessing

            Alternative 12: 57.8% accurate, 9.1× speedup?

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

              1. Initial program 75.6%

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

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

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

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

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

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

                if 4.59999999999999994e95 < a

                1. Initial program 85.4%

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

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

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

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

                  \[\leadsto \color{blue}{a \cdot a} \]
              7. Recombined 2 regimes into one program.
              8. Add Preprocessing

              Alternative 13: 62.5% accurate, 10.0× speedup?

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

                1. Initial program 75.2%

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

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

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

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

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

                if 1.69999999999999994e-54 < b

                1. Initial program 81.8%

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

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

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

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

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

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

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

                Alternative 14: 62.5% accurate, 10.4× speedup?

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

                  1. Initial program 75.2%

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

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

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

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

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

                  if 1.69999999999999994e-54 < b

                  1. Initial program 81.8%

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

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

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

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

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

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

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

                  Alternative 15: 61.1% accurate, 12.1× speedup?

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

                    1. Initial program 75.9%

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

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

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

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

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

                    if 8.99999999999999914e96 < b

                    1. Initial program 82.2%

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

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

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

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

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

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

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

                      Alternative 16: 60.4% accurate, 12.1× speedup?

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

                        1. Initial program 75.9%

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

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

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

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

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

                        if 8.99999999999999914e96 < b

                        1. Initial program 82.2%

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

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

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

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

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

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

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

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

                          Alternative 17: 56.9% accurate, 74.7× speedup?

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

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

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

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

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

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

                          Reproduce

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