ab-angle->ABCF B

Percentage Accurate: 54.4% → 67.0%
Time: 13.3s
Alternatives: 17
Speedup: 10.3×

Specification

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

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

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

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

Alternative 1: 67.0% accurate, 0.9× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+124}:\\ \;\;\;\;\cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle\_m}}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+254}:\\ \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\frac{\left(\sin \left(\sqrt[3]{{\mathsf{PI}\left(\right)}^{3}} \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot \left(b + a\right)\right) \cdot 2}{{\left(b - a\right)}^{-1}} \cdot \left(\frac{b - a}{b + a} \cdot \frac{b + a}{b - a}\right)\right)\\ \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (*
  angle_s
  (if (<= (/ angle_m 180.0) 1e+124)
    (*
     (cos (/ 1.0 (/ 180.0 (* (PI) angle_m))))
     (*
      (- b a)
      (* (+ b a) (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 2.0))))
    (if (<= (/ angle_m 180.0) 1e+254)
      (*
       (cos (* (PI) (/ angle_m 180.0)))
       (* (* (+ b a) (- b a)) (* (* 0.011111111111111112 (PI)) angle_m)))
      (*
       1.0
       (*
        (/
         (*
          (*
           (sin (* (cbrt (pow (PI) 3.0)) (* 0.005555555555555556 angle_m)))
           (+ b a))
          2.0)
         (pow (- b a) -1.0))
        (* (/ (- b a) (+ b a)) (/ (+ b a) (- b a)))))))))
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+124}:\\
\;\;\;\;\cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle\_m}}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\

\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+254}:\\
\;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\

\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\frac{\left(\sin \left(\sqrt[3]{{\mathsf{PI}\left(\right)}^{3}} \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot \left(b + a\right)\right) \cdot 2}{{\left(b - a\right)}^{-1}} \cdot \left(\frac{b - a}{b + a} \cdot \frac{b + a}{b - a}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999948e123

    1. Initial program 56.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999948e123 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999994e253

    1. Initial program 30.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      12. difference-of-squaresN/A

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

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

        \[\leadsto \left(\left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      15. lower--.f6454.8

        \[\leadsto \left(\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    5. Applied rewrites54.8%

      \[\leadsto \color{blue}{\left(\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]

    if 9.9999999999999994e253 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\frac{b + a}{b - a} \cdot \frac{b - a}{b + a}\right) \cdot \frac{\left(\left(b + a\right) \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt[3]{{\mathsf{PI}\left(\right)}^{3}}\right)\right) \cdot 2}{{\left(b - a\right)}^{-1}}\right) \cdot \color{blue}{1} \]
    10. Recombined 3 regimes into one program.
    11. Final simplification73.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{+124}:\\ \;\;\;\;\cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+254}:\\ \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\frac{\left(\sin \left(\sqrt[3]{{\mathsf{PI}\left(\right)}^{3}} \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(b + a\right)\right) \cdot 2}{{\left(b - a\right)}^{-1}} \cdot \left(\frac{b - a}{b + a} \cdot \frac{b + a}{b - a}\right)\right)\\ \end{array} \]
    12. Add Preprocessing

    Alternative 2: 67.0% accurate, 1.1× speedup?

    \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+124}:\\ \;\;\;\;\cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle\_m}}\right) \cdot t\_0\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+254}:\\ \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left({\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}^{0.25} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right) \cdot t\_0\\ \end{array} \end{array} \end{array} \]
    angle\_m = (fabs.f64 angle)
    angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
    (FPCore (angle_s a b angle_m)
     :precision binary64
     (let* ((t_0
             (*
              (- b a)
              (*
               (+ b a)
               (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 2.0)))))
       (*
        angle_s
        (if (<= (/ angle_m 180.0) 1e+124)
          (* (cos (/ 1.0 (/ 180.0 (* (PI) angle_m)))) t_0)
          (if (<= (/ angle_m 180.0) 1e+254)
            (*
             (cos (* (PI) (/ angle_m 180.0)))
             (* (* (+ b a) (- b a)) (* (* 0.011111111111111112 (PI)) angle_m)))
            (*
             (cos
              (*
               (pow (* (PI) (PI)) 0.25)
               (* (sqrt (PI)) (* 0.005555555555555556 angle_m))))
             t_0))))))
    \begin{array}{l}
    angle\_m = \left|angle\right|
    \\
    angle\_s = \mathsf{copysign}\left(1, angle\right)
    
    \\
    \begin{array}{l}
    t_0 := \left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\\
    angle\_s \cdot \begin{array}{l}
    \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+124}:\\
    \;\;\;\;\cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle\_m}}\right) \cdot t\_0\\
    
    \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+254}:\\
    \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\cos \left({\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}^{0.25} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right) \cdot t\_0\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999948e123

      1. Initial program 56.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 9.99999999999999948e123 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999994e253

      1. Initial program 30.4%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
        12. difference-of-squaresN/A

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

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

          \[\leadsto \left(\left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
        15. lower--.f6454.8

          \[\leadsto \left(\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      5. Applied rewrites54.8%

        \[\leadsto \color{blue}{\left(\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]

      if 9.9999999999999994e253 < (/.f64 angle #s(literal 180 binary64))

      1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \]
      6. Applied rewrites46.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \color{blue}{{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}^{0.25}}\right) \]
    3. Recombined 3 regimes into one program.
    4. Final simplification73.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{+124}:\\ \;\;\;\;\cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+254}:\\ \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left({\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}^{0.25} \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 3: 66.2% accurate, 1.6× speedup?

    \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+60}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+277}:\\ \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
    angle\_m = (fabs.f64 angle)
    angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
    (FPCore (angle_s a b angle_m)
     :precision binary64
     (let* ((t_0
             (*
              (cos (* (* (PI) 0.005555555555555556) angle_m))
              (*
               (- b a)
               (*
                (+ b a)
                (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 2.0))))))
       (*
        angle_s
        (if (<= (/ angle_m 180.0) 1e+60)
          t_0
          (if (<= (/ angle_m 180.0) 5e+277)
            (*
             (cos (* (PI) (/ angle_m 180.0)))
             (* (* (+ b a) (- b a)) (* (* 0.011111111111111112 (PI)) angle_m)))
            t_0)))))
    \begin{array}{l}
    angle\_m = \left|angle\right|
    \\
    angle\_s = \mathsf{copysign}\left(1, angle\right)
    
    \\
    \begin{array}{l}
    t_0 := \cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\
    angle\_s \cdot \begin{array}{l}
    \mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+60}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+277}:\\
    \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999995e59 or 4.99999999999999982e277 < (/.f64 angle #s(literal 180 binary64))

      1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\left(\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \color{blue}{\sqrt{\mathsf{PI}\left(\right)}}\right) \]
      6. Applied rewrites76.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 9.9999999999999995e59 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999982e277

      1. Initial program 31.2%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
        12. difference-of-squaresN/A

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

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

          \[\leadsto \left(\left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
        15. lower--.f6448.8

          \[\leadsto \left(\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      5. Applied rewrites48.8%

        \[\leadsto \color{blue}{\left(\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification72.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 10^{+60}:\\ \;\;\;\;\cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+277}:\\ \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 66.2% accurate, 1.6× speedup?

    \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 500000000000:\\ \;\;\;\;\left(\sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+254}:\\ \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\cos t\_0 \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right) \cdot \left(\sin t\_0 \cdot 2\right)\\ \end{array} \end{array} \end{array} \]
    angle\_m = (fabs.f64 angle)
    angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
    (FPCore (angle_s a b angle_m)
     :precision binary64
     (let* ((t_0 (* (* 0.005555555555555556 angle_m) (PI))))
       (*
        angle_s
        (if (<= (/ angle_m 180.0) 500000000000.0)
          (* (* (sin (* 0.011111111111111112 (* (PI) angle_m))) (- b a)) (+ b a))
          (if (<= (/ angle_m 180.0) 1e+254)
            (*
             (cos (* (PI) (/ angle_m 180.0)))
             (* (* (+ b a) (- b a)) (* (* 0.011111111111111112 (PI)) angle_m)))
            (* (* (* (cos t_0) (- b a)) (+ b a)) (* (sin t_0) 2.0)))))))
    \begin{array}{l}
    angle\_m = \left|angle\right|
    \\
    angle\_s = \mathsf{copysign}\left(1, angle\right)
    
    \\
    \begin{array}{l}
    t_0 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\\
    angle\_s \cdot \begin{array}{l}
    \mathbf{if}\;\frac{angle\_m}{180} \leq 500000000000:\\
    \;\;\;\;\left(\sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
    
    \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+254}:\\
    \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\cos t\_0 \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right) \cdot \left(\sin t\_0 \cdot 2\right)\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 angle #s(literal 180 binary64)) < 5e11

      1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
        12. difference-of-squaresN/A

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

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

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

        \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\right)} \]

      if 5e11 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999994e253

      1. Initial program 27.4%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
        12. difference-of-squaresN/A

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

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

          \[\leadsto \left(\left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
        15. lower--.f6442.5

          \[\leadsto \left(\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      5. Applied rewrites42.5%

        \[\leadsto \color{blue}{\left(\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]

      if 9.9999999999999994e253 < (/.f64 angle #s(literal 180 binary64))

      1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(\left(b + a\right) \cdot \left(\cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right)\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification69.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 500000000000:\\ \;\;\;\;\left(\sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+254}:\\ \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 67.7% accurate, 1.6× speedup?

    \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \sqrt{\mathsf{PI}\left(\right)}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a \leq 10^{+181}:\\ \;\;\;\;\cos \left(\left(t\_0 \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot t\_0\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\left(\left(b + a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\\ \end{array} \end{array} \end{array} \]
    angle\_m = (fabs.f64 angle)
    angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
    (FPCore (angle_s a b angle_m)
     :precision binary64
     (let* ((t_0 (sqrt (PI))))
       (*
        angle_s
        (if (<= a 1e+181)
          (*
           (cos (* (* t_0 (* 0.005555555555555556 angle_m)) t_0))
           (*
            (- b a)
            (* (+ b a) (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 2.0))))
          (*
           (* (* (* (* (+ b a) (PI)) angle_m) 0.011111111111111112) (- b a))
           (cos (* (PI) (/ angle_m 180.0))))))))
    \begin{array}{l}
    angle\_m = \left|angle\right|
    \\
    angle\_s = \mathsf{copysign}\left(1, angle\right)
    
    \\
    \begin{array}{l}
    t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
    angle\_s \cdot \begin{array}{l}
    \mathbf{if}\;a \leq 10^{+181}:\\
    \;\;\;\;\cos \left(\left(t\_0 \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right) \cdot t\_0\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\left(\left(\left(b + a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if a < 9.9999999999999992e180

      1. Initial program 55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 9.9999999999999992e180 < a

      1. Initial program 30.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\left(\left(\left(b + a\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      7. Applied rewrites83.2%

        \[\leadsto \left(\color{blue}{\left(\left(\left(\left(b + a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 0.011111111111111112\right)} \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification72.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 10^{+181}:\\ \;\;\;\;\cos \left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\left(\left(b + a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 67.7% accurate, 1.7× speedup?

    \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a \leq 5 \cdot 10^{+207}:\\ \;\;\;\;\cos \left(\frac{1}{\frac{180}{t\_0}}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(0.011111111111111112 \cdot t\_0\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\\ \end{array} \end{array} \end{array} \]
    angle\_m = (fabs.f64 angle)
    angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
    (FPCore (angle_s a b angle_m)
     :precision binary64
     (let* ((t_0 (* (PI) angle_m)))
       (*
        angle_s
        (if (<= a 5e+207)
          (*
           (cos (/ 1.0 (/ 180.0 t_0)))
           (*
            (- b a)
            (* (+ b a) (* (sin (* (* 0.005555555555555556 angle_m) (PI))) 2.0))))
          (*
           (* (* (* 0.011111111111111112 t_0) (+ b a)) (- b a))
           (cos (* (PI) (/ angle_m 180.0))))))))
    \begin{array}{l}
    angle\_m = \left|angle\right|
    \\
    angle\_s = \mathsf{copysign}\left(1, angle\right)
    
    \\
    \begin{array}{l}
    t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\
    angle\_s \cdot \begin{array}{l}
    \mathbf{if}\;a \leq 5 \cdot 10^{+207}:\\
    \;\;\;\;\cos \left(\frac{1}{\frac{180}{t\_0}}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\left(0.011111111111111112 \cdot t\_0\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if a < 4.9999999999999999e207

      1. Initial program 55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 4.9999999999999999e207 < a

      1. Initial program 33.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\left(\frac{1}{90} \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
        4. lower-PI.f6480.9

          \[\leadsto \left(\left(\left(0.011111111111111112 \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot angle\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      7. Applied rewrites80.9%

        \[\leadsto \left(\left(\color{blue}{\left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)} \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification72.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5 \cdot 10^{+207}:\\ \;\;\;\;\cos \left(\frac{1}{\frac{180}{\mathsf{PI}\left(\right) \cdot angle}}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 59.9% accurate, 1.9× speedup?

    \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -\infty:\\ \;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle\_m\\ \end{array} \end{array} \]
    angle\_m = (fabs.f64 angle)
    angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
    (FPCore (angle_s a b angle_m)
     :precision binary64
     (*
      angle_s
      (if (<= (- (pow b 2.0) (pow a 2.0)) (- INFINITY))
        (* (* (* (PI) angle_m) a) (* -0.011111111111111112 a))
        (* (* (* (+ b a) (- b a)) (* 0.011111111111111112 (PI))) angle_m))))
    \begin{array}{l}
    angle\_m = \left|angle\right|
    \\
    angle\_s = \mathsf{copysign}\left(1, angle\right)
    
    \\
    angle\_s \cdot \begin{array}{l}
    \mathbf{if}\;{b}^{2} - {a}^{2} \leq -\infty:\\
    \;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle\_m\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0

      1. Initial program 49.7%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
        12. difference-of-squaresN/A

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

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

          \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
        15. lower--.f6449.7

          \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
      5. Applied rewrites49.7%

        \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
      6. Taylor expanded in a around inf

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

          \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)} \]
        2. Step-by-step derivation
          1. Applied rewrites77.0%

            \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right) \]

          if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

          1. Initial program 54.0%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
            12. difference-of-squaresN/A

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

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

              \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
            15. lower--.f6454.5

              \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
          5. Applied rewrites54.5%

            \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites54.5%

              \[\leadsto \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \color{blue}{angle} \]
          7. Recombined 2 regimes into one program.
          8. Final simplification58.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -\infty:\\ \;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot angle\\ \end{array} \]
          9. Add Preprocessing

          Alternative 8: 59.9% accurate, 1.9× speedup?

          \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -5 \cdot 10^{+286}:\\ \;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\\ \end{array} \end{array} \]
          angle\_m = (fabs.f64 angle)
          angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
          (FPCore (angle_s a b angle_m)
           :precision binary64
           (*
            angle_s
            (if (<= (- (pow b 2.0) (pow a 2.0)) -5e+286)
              (* (* (* (PI) angle_m) a) (* -0.011111111111111112 a))
              (* (* (+ b a) (- b a)) (* (* 0.011111111111111112 (PI)) angle_m)))))
          \begin{array}{l}
          angle\_m = \left|angle\right|
          \\
          angle\_s = \mathsf{copysign}\left(1, angle\right)
          
          \\
          angle\_s \cdot \begin{array}{l}
          \mathbf{if}\;{b}^{2} - {a}^{2} \leq -5 \cdot 10^{+286}:\\
          \;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.0000000000000004e286

            1. Initial program 49.2%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
              12. difference-of-squaresN/A

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

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

                \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
              15. lower--.f6448.4

                \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
            5. Applied rewrites48.4%

              \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
            6. Taylor expanded in a around inf

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

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

                  \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right) \]

                if -5.0000000000000004e286 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

                1. Initial program 54.3%

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                  12. difference-of-squaresN/A

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

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

                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                  15. lower--.f6455.0

                    \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                5. Applied rewrites55.0%

                  \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification58.7%

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

              Alternative 9: 58.7% accurate, 2.0× speedup?

              \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-202}:\\ \;\;\;\;\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot a\right) \cdot -0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\\ \end{array} \end{array} \]
              angle\_m = (fabs.f64 angle)
              angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
              (FPCore (angle_s a b angle_m)
               :precision binary64
               (*
                angle_s
                (if (<= (- (pow b 2.0) (pow a 2.0)) -2e-202)
                  (* (* (* (* (PI) angle_m) a) a) -0.011111111111111112)
                  (* (* (* (* b b) (PI)) angle_m) 0.011111111111111112))))
              \begin{array}{l}
              angle\_m = \left|angle\right|
              \\
              angle\_s = \mathsf{copysign}\left(1, angle\right)
              
              \\
              angle\_s \cdot \begin{array}{l}
              \mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-202}:\\
              \;\;\;\;\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot a\right) \cdot -0.011111111111111112\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -2.0000000000000001e-202

                1. Initial program 52.5%

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                  12. difference-of-squaresN/A

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

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

                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                  15. lower--.f6449.6

                    \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                5. Applied rewrites49.6%

                  \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                6. Taylor expanded in a around inf

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

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

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

                        \[\leadsto \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \cdot a\right) \cdot -0.011111111111111112 \]

                      if -2.0000000000000001e-202 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

                      1. Initial program 53.7%

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                        12. difference-of-squaresN/A

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

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

                          \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                        15. lower--.f6456.2

                          \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                      5. Applied rewrites56.2%

                        \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                      6. Taylor expanded in a around 0

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

                          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(b \cdot b\right)\right) \cdot angle\right) \cdot \color{blue}{0.011111111111111112} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification58.2%

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

                      Alternative 10: 58.8% accurate, 2.0× speedup?

                      \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-202}:\\ \;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\\ \end{array} \end{array} \]
                      angle\_m = (fabs.f64 angle)
                      angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
                      (FPCore (angle_s a b angle_m)
                       :precision binary64
                       (*
                        angle_s
                        (if (<= (- (pow b 2.0) (pow a 2.0)) -2e-202)
                          (* (* (* (PI) angle_m) a) (* -0.011111111111111112 a))
                          (* (* (* (* b b) (PI)) angle_m) 0.011111111111111112))))
                      \begin{array}{l}
                      angle\_m = \left|angle\right|
                      \\
                      angle\_s = \mathsf{copysign}\left(1, angle\right)
                      
                      \\
                      angle\_s \cdot \begin{array}{l}
                      \mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-202}:\\
                      \;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -2.0000000000000001e-202

                        1. Initial program 52.5%

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                          12. difference-of-squaresN/A

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

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

                            \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                          15. lower--.f6449.6

                            \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                        5. Applied rewrites49.6%

                          \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                        6. Taylor expanded in a around inf

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

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

                              \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right) \]

                            if -2.0000000000000001e-202 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

                            1. Initial program 53.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                              12. difference-of-squaresN/A

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

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

                                \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                              15. lower--.f6456.2

                                \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                            5. Applied rewrites56.2%

                              \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                            6. Taylor expanded in a around 0

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

                                \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot \left(b \cdot b\right)\right) \cdot angle\right) \cdot \color{blue}{0.011111111111111112} \]
                            8. Recombined 2 regimes into one program.
                            9. Final simplification58.2%

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

                            Alternative 11: 66.2% accurate, 2.5× speedup?

                            \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(b + a\right) \cdot \left(b - a\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 500000000000:\\ \;\;\;\;\left(\sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+254}:\\ \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(t\_0 \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot t\_0\\ \end{array} \end{array} \end{array} \]
                            angle\_m = (fabs.f64 angle)
                            angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
                            (FPCore (angle_s a b angle_m)
                             :precision binary64
                             (let* ((t_0 (* (+ b a) (- b a))))
                               (*
                                angle_s
                                (if (<= (/ angle_m 180.0) 500000000000.0)
                                  (* (* (sin (* 0.011111111111111112 (* (PI) angle_m))) (- b a)) (+ b a))
                                  (if (<= (/ angle_m 180.0) 1e+254)
                                    (*
                                     (cos (* (PI) (/ angle_m 180.0)))
                                     (* t_0 (* (* 0.011111111111111112 (PI)) angle_m)))
                                    (* (sin (* (* (* 0.005555555555555556 angle_m) (PI)) 2.0)) t_0))))))
                            \begin{array}{l}
                            angle\_m = \left|angle\right|
                            \\
                            angle\_s = \mathsf{copysign}\left(1, angle\right)
                            
                            \\
                            \begin{array}{l}
                            t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
                            angle\_s \cdot \begin{array}{l}
                            \mathbf{if}\;\frac{angle\_m}{180} \leq 500000000000:\\
                            \;\;\;\;\left(\sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
                            
                            \mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+254}:\\
                            \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right) \cdot \left(t\_0 \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\sin \left(\left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot t\_0\\
                            
                            
                            \end{array}
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if (/.f64 angle #s(literal 180 binary64)) < 5e11

                              1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
                                12. difference-of-squaresN/A

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

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

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

                                \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\right)} \]

                              if 5e11 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999994e253

                              1. Initial program 27.4%

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(\left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
                                12. difference-of-squaresN/A

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

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

                                  \[\leadsto \left(\left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
                                15. lower--.f6442.5

                                  \[\leadsto \left(\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
                              5. Applied rewrites42.5%

                                \[\leadsto \color{blue}{\left(\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)} \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]

                              if 9.9999999999999994e253 < (/.f64 angle #s(literal 180 binary64))

                              1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \mathsf{PI}\left(\right)\right)\right)} \]
                            3. Recombined 3 regimes into one program.
                            4. Final simplification69.2%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 500000000000:\\ \;\;\;\;\left(\sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 10^{+254}:\\ \;\;\;\;\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 12: 67.4% accurate, 2.8× speedup?

                            \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \left(b + a\right) \cdot \left(b - a\right)\\ t_1 := \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-29}:\\ \;\;\;\;\left(t\_1 \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\ \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+198}:\\ \;\;\;\;t\_0 \cdot \sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot t\_1\\ \end{array} \end{array} \end{array} \]
                            angle\_m = (fabs.f64 angle)
                            angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
                            (FPCore (angle_s a b angle_m)
                             :precision binary64
                             (let* ((t_0 (* (+ b a) (- b a)))
                                    (t_1 (* (* 0.011111111111111112 (PI)) angle_m)))
                               (*
                                angle_s
                                (if (<= (/ angle_m 180.0) 2e-29)
                                  (* (* t_1 (- b a)) (+ b a))
                                  (if (<= (/ angle_m 180.0) 5e+198)
                                    (* t_0 (sin (* 0.011111111111111112 (* (PI) angle_m))))
                                    (* t_0 t_1))))))
                            \begin{array}{l}
                            angle\_m = \left|angle\right|
                            \\
                            angle\_s = \mathsf{copysign}\left(1, angle\right)
                            
                            \\
                            \begin{array}{l}
                            t_0 := \left(b + a\right) \cdot \left(b - a\right)\\
                            t_1 := \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\\
                            angle\_s \cdot \begin{array}{l}
                            \mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-29}:\\
                            \;\;\;\;\left(t\_1 \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
                            
                            \mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+198}:\\
                            \;\;\;\;t\_0 \cdot \sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_0 \cdot t\_1\\
                            
                            
                            \end{array}
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999989e-29

                              1. Initial program 57.8%

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                                12. difference-of-squaresN/A

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

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

                                  \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                                15. lower--.f6459.7

                                  \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                              5. Applied rewrites59.7%

                                \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                              6. Step-by-step derivation
                                1. Applied rewrites74.4%

                                  \[\leadsto \left(b + a\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)} \]

                                if 1.99999999999999989e-29 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000049e198

                                1. Initial program 43.3%

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
                                  13. difference-of-squaresN/A

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)} \]

                                if 5.00000000000000049e198 < (/.f64 angle #s(literal 180 binary64))

                                1. Initial program 31.6%

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                                  12. difference-of-squaresN/A

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

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

                                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                                  15. lower--.f6440.9

                                    \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                                5. Applied rewrites40.9%

                                  \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                              7. Recombined 3 regimes into one program.
                              8. Final simplification67.2%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-29}:\\ \;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\ \mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+198}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\\ \end{array} \]
                              9. Add Preprocessing

                              Alternative 13: 65.8% accurate, 2.8× speedup?

                              \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 500000000000:\\ \;\;\;\;\left(\sin \left(0.011111111111111112 \cdot t\_0\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(t\_0 \cdot 0.005555555555555556\right) \cdot \left(\left(\left(\left(b + a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right) \cdot \left(0.011111111111111112 \cdot angle\_m\right)\right)\\ \end{array} \end{array} \end{array} \]
                              angle\_m = (fabs.f64 angle)
                              angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
                              (FPCore (angle_s a b angle_m)
                               :precision binary64
                               (let* ((t_0 (* (PI) angle_m)))
                                 (*
                                  angle_s
                                  (if (<= (/ angle_m 180.0) 500000000000.0)
                                    (* (* (sin (* 0.011111111111111112 t_0)) (- b a)) (+ b a))
                                    (*
                                     (cos (* t_0 0.005555555555555556))
                                     (* (* (* (+ b a) (PI)) (- b a)) (* 0.011111111111111112 angle_m)))))))
                              \begin{array}{l}
                              angle\_m = \left|angle\right|
                              \\
                              angle\_s = \mathsf{copysign}\left(1, angle\right)
                              
                              \\
                              \begin{array}{l}
                              t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\
                              angle\_s \cdot \begin{array}{l}
                              \mathbf{if}\;\frac{angle\_m}{180} \leq 500000000000:\\
                              \;\;\;\;\left(\sin \left(0.011111111111111112 \cdot t\_0\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\cos \left(t\_0 \cdot 0.005555555555555556\right) \cdot \left(\left(\left(\left(b + a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right) \cdot \left(0.011111111111111112 \cdot angle\_m\right)\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (/.f64 angle #s(literal 180 binary64)) < 5e11

                                1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
                                  12. difference-of-squaresN/A

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

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

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

                                  \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\right)} \]

                                if 5e11 < (/.f64 angle #s(literal 180 binary64))

                                1. Initial program 31.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\left(\color{blue}{\mathsf{PI}\left(\right)} \cdot 0.005555555555555556\right) \cdot angle\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
                                5. Applied rewrites27.8%

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

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

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

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

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

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

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

                                    \[\leadsto \left(\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot 0.005555555555555556\right) \cdot angle\right)\right) \cdot \cos \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \]
                                7. Applied rewrites22.6%

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

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

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

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

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

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

                                    \[\leadsto \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right)\right) \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right) \]
                                  6. difference-of-squaresN/A

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

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

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

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

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

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

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

                                    \[\leadsto \left(\left(\frac{1}{90} \cdot angle\right) \cdot \left(\left(\left(a + b\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \cdot \left(b - a\right)\right)\right) \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right) \]
                                  14. lower--.f6439.1

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

                                  \[\leadsto \color{blue}{\left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right)\right)} \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right) \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification68.2%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 500000000000:\\ \;\;\;\;\left(\sin \left(0.011111111111111112 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\left(\left(\left(b + a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right) \cdot \left(0.011111111111111112 \cdot angle\right)\right)\\ \end{array} \]
                              5. Add Preprocessing

                              Alternative 14: 67.4% accurate, 3.1× speedup?

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

                                1. Initial program 55.6%

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(2 \cdot \left(\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \]
                                  12. difference-of-squaresN/A

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

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

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

                                  \[\leadsto \color{blue}{\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\right)} \]

                                if 5.00000000000000049e198 < (/.f64 angle #s(literal 180 binary64))

                                1. Initial program 31.6%

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                                  12. difference-of-squaresN/A

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

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

                                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                                  15. lower--.f6440.9

                                    \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                                5. Applied rewrites40.9%

                                  \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification67.5%

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

                              Alternative 15: 40.4% accurate, 3.5× speedup?

                              \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;{a}^{2} \leq 4 \cdot 10^{+268}:\\ \;\;\;\;\left(\left(a \cdot a\right) \cdot -0.011111111111111112\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(t\_0 \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\ \end{array} \end{array} \end{array} \]
                              angle\_m = (fabs.f64 angle)
                              angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
                              (FPCore (angle_s a b angle_m)
                               :precision binary64
                               (let* ((t_0 (* (PI) angle_m)))
                                 (*
                                  angle_s
                                  (if (<= (pow a 2.0) 4e+268)
                                    (* (* (* a a) -0.011111111111111112) t_0)
                                    (* (* t_0 a) (* -0.011111111111111112 a))))))
                              \begin{array}{l}
                              angle\_m = \left|angle\right|
                              \\
                              angle\_s = \mathsf{copysign}\left(1, angle\right)
                              
                              \\
                              \begin{array}{l}
                              t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\
                              angle\_s \cdot \begin{array}{l}
                              \mathbf{if}\;{a}^{2} \leq 4 \cdot 10^{+268}:\\
                              \;\;\;\;\left(\left(a \cdot a\right) \cdot -0.011111111111111112\right) \cdot t\_0\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\left(t\_0 \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (pow.f64 a #s(literal 2 binary64)) < 3.9999999999999999e268

                                1. Initial program 57.3%

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                                  12. difference-of-squaresN/A

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

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

                                    \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                                  15. lower--.f6455.3

                                    \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                                5. Applied rewrites55.3%

                                  \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                                6. Taylor expanded in a around inf

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

                                    \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)} \]

                                  if 3.9999999999999999e268 < (pow.f64 a #s(literal 2 binary64))

                                  1. Initial program 42.5%

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                                    12. difference-of-squaresN/A

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

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

                                      \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                                    15. lower--.f6449.1

                                      \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                                  5. Applied rewrites49.1%

                                    \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                                  6. Taylor expanded in a around inf

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

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

                                        \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right) \]
                                    3. Recombined 2 regimes into one program.
                                    4. Final simplification42.8%

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

                                    Alternative 16: 64.7% accurate, 10.3× speedup?

                                    \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 0.011111111111111112 \cdot \mathsf{PI}\left(\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-43}:\\ \;\;\;\;\left(\left(t\_0 \cdot angle\_m\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot t\_0\right) \cdot angle\_m\\ \end{array} \end{array} \end{array} \]
                                    angle\_m = (fabs.f64 angle)
                                    angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
                                    (FPCore (angle_s a b angle_m)
                                     :precision binary64
                                     (let* ((t_0 (* 0.011111111111111112 (PI))))
                                       (*
                                        angle_s
                                        (if (<= (/ angle_m 180.0) 5e-43)
                                          (* (* (* t_0 angle_m) (- b a)) (+ b a))
                                          (* (* (* (+ b a) (- b a)) t_0) angle_m)))))
                                    \begin{array}{l}
                                    angle\_m = \left|angle\right|
                                    \\
                                    angle\_s = \mathsf{copysign}\left(1, angle\right)
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := 0.011111111111111112 \cdot \mathsf{PI}\left(\right)\\
                                    angle\_s \cdot \begin{array}{l}
                                    \mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-43}:\\
                                    \;\;\;\;\left(\left(t\_0 \cdot angle\_m\right) \cdot \left(b - a\right)\right) \cdot \left(b + a\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot t\_0\right) \cdot angle\_m\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000019e-43

                                      1. Initial program 57.1%

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                                        12. difference-of-squaresN/A

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

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

                                          \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                                        15. lower--.f6459.1

                                          \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                                      5. Applied rewrites59.1%

                                        \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites74.1%

                                          \[\leadsto \left(b + a\right) \cdot \color{blue}{\left(\left(b - a\right) \cdot \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right)\right)} \]

                                        if 5.00000000000000019e-43 < (/.f64 angle #s(literal 180 binary64))

                                        1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                                          12. difference-of-squaresN/A

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

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

                                            \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                                          15. lower--.f6436.8

                                            \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                                        5. Applied rewrites36.8%

                                          \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites36.8%

                                            \[\leadsto \left(\left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \color{blue}{angle} \]
                                        7. Recombined 2 regimes into one program.
                                        8. Final simplification64.9%

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

                                        Alternative 17: 39.0% accurate, 21.6× speedup?

                                        \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\right) \end{array} \]
                                        angle\_m = (fabs.f64 angle)
                                        angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
                                        (FPCore (angle_s a b angle_m)
                                         :precision binary64
                                         (* angle_s (* (* (* (PI) angle_m) a) (* -0.011111111111111112 a))))
                                        \begin{array}{l}
                                        angle\_m = \left|angle\right|
                                        \\
                                        angle\_s = \mathsf{copysign}\left(1, angle\right)
                                        
                                        \\
                                        angle\_s \cdot \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right)\right)
                                        \end{array}
                                        
                                        Derivation
                                        1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right) \]
                                          12. difference-of-squaresN/A

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

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

                                            \[\leadsto \left(angle \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\right) \]
                                          15. lower--.f6453.6

                                            \[\leadsto \left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right) \]
                                        5. Applied rewrites53.6%

                                          \[\leadsto \color{blue}{\left(angle \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]
                                        6. Taylor expanded in a around inf

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

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

                                              \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)}\right) \]
                                            2. Final simplification40.6%

                                              \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot a\right) \cdot \left(-0.011111111111111112 \cdot a\right) \]
                                            3. Add Preprocessing

                                            Reproduce

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