ab-angle->ABCF B

Percentage Accurate: 54.6% → 67.9%
Time: 6.7s
Alternatives: 15
Speedup: 13.7×

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

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

Initial Program: 54.6% 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.9% accurate, 1.3× 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)\\ t_1 := \frac{\mathsf{PI}\left(\right)}{2}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 4.2 \cdot 10^{+154}:\\ \;\;\;\;\left(\left(\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 2\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \frac{\sin \left(\left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right) - \mathsf{fma}\left(t\_0, \frac{angle\_m}{180}, t\_1\right)\right) + t\_1\right) - \cos \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle\_m}{180}, \mathsf{fma}\left(\frac{angle\_m}{180}, t\_0, t\_1\right)\right)\right)}{2}\\ \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))) (t_1 (/ (PI) 2.0)))
   (*
    angle_s
    (if (<= angle_m 4.2e+154)
      (*
       (*
        (* (cos (* (* 0.005555555555555556 (PI)) angle_m)) 2.0)
        (* (sin (* (* 0.005555555555555556 angle_m) (PI))) (+ a b)))
       (- b a))
      (*
       (* (* (+ b a) (- b a)) 2.0)
       (/
        (-
         (sin
          (+
           (- (* (/ angle_m 180.0) (PI)) (fma t_0 (/ angle_m 180.0) t_1))
           t_1))
         (cos (fma (PI) (/ angle_m 180.0) (fma (/ angle_m 180.0) t_0 t_1))))
        2.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)\\
t_1 := \frac{\mathsf{PI}\left(\right)}{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 4.2 \cdot 10^{+154}:\\
\;\;\;\;\left(\left(\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 2\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \frac{\sin \left(\left(\frac{angle\_m}{180} \cdot \mathsf{PI}\left(\right) - \mathsf{fma}\left(t\_0, \frac{angle\_m}{180}, t\_1\right)\right) + t\_1\right) - \cos \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle\_m}{180}, \mathsf{fma}\left(\frac{angle\_m}{180}, t\_0, t\_1\right)\right)\right)}{2}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 4.19999999999999989e154

    1. Initial program 63.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. Step-by-step derivation
      1. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 2\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right) \]
    10. Applied rewrites74.6%

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

    if 4.19999999999999989e154 < angle

    1. Initial program 34.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. Step-by-step derivation
      1. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \frac{\color{blue}{\sin \left(\left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right) - \mathsf{fma}\left(-\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)} - \cos \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \mathsf{fma}\left(\frac{angle}{180}, -\mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}{2} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 68.0% accurate, 1.5× 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}\;angle\_m \leq 3.8 \cdot 10^{+154}:\\ \;\;\;\;\left(\left(\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 2\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \frac{\cos \left(-0.5 \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle\_m}{180}, \mathsf{fma}\left(\frac{angle\_m}{180}, -\mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}{2}\\ \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 3.8e+154)
    (*
     (*
      (* (cos (* (* 0.005555555555555556 (PI)) angle_m)) 2.0)
      (* (sin (* (* 0.005555555555555556 angle_m) (PI))) (+ a b)))
     (- b a))
    (*
     (* (* (+ b a) (- b a)) 2.0)
     (/
      (-
       (cos (* -0.5 (PI)))
       (cos
        (fma
         (PI)
         (/ angle_m 180.0)
         (fma (/ angle_m 180.0) (- (PI)) (/ (PI) 2.0)))))
      2.0)))))
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \frac{\cos \left(-0.5 \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle\_m}{180}, \mathsf{fma}\left(\frac{angle\_m}{180}, -\mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 3.7999999999999998e154

    1. Initial program 63.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. Step-by-step derivation
      1. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 2\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right) \]
    10. Applied rewrites74.6%

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

    if 3.7999999999999998e154 < angle

    1. Initial program 34.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. Step-by-step derivation
      1. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \frac{\cos \left(-0.5 \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \mathsf{fma}\left(\frac{angle}{180}, -\mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}{2} \]
    9. Applied rewrites41.9%

      \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \frac{\cos \color{blue}{\left(-0.5 \cdot \mathsf{PI}\left(\right)\right)} - \cos \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \mathsf{fma}\left(\frac{angle}{180}, -\mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}{2} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 67.7% accurate, 1.8× 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}\;angle\_m \leq 6 \cdot 10^{+106}:\\ \;\;\;\;\left(\left(\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 2\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\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 6e+106)
    (*
     (*
      (* (cos (* (* 0.005555555555555556 (PI)) angle_m)) 2.0)
      (* (sin (* (* 0.005555555555555556 angle_m) (PI))) (+ a b)))
     (- b a))
    (* (* (- b a) (+ a b)) (sin (* 2.0 (* (PI) (/ angle_m 180.0))))))))
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 6.0000000000000001e106

    1. Initial program 64.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. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 2\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right) \]
    10. Applied rewrites75.7%

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

    if 6.0000000000000001e106 < angle

    1. Initial program 33.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. Step-by-step derivation
      1. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 67.7% accurate, 1.8× 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}\;angle\_m \leq 2 \cdot 10^{+94}:\\ \;\;\;\;\left(\left(\cos \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot 2\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\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 2e+94)
    (*
     (*
      (* (cos (* (* 0.005555555555555556 angle_m) (PI))) 2.0)
      (* (sin (* (* 0.005555555555555556 (PI)) angle_m)) (+ a b)))
     (- b a))
    (* (* (- b a) (+ a b)) (sin (* 2.0 (* (PI) (/ angle_m 180.0))))))))
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 2e94

    1. Initial program 65.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. Step-by-step derivation
      1. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e94 < angle

    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. Step-by-step derivation
      1. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 67.5% accurate, 1.8× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\\ t_1 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;b \leq 2.1 \cdot 10^{+183}:\\ \;\;\;\;\left(\left(\cos t\_1 \cdot 2\right) \cdot \left(\sin t\_1 \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \cos t\_0\right) \cdot \left(\left(\sin t\_0 \cdot b\right) \cdot b\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 (* (PI) angle_m)))
        (t_1 (* (* 0.005555555555555556 angle_m) (PI))))
   (*
    angle_s
    (if (<= b 2.1e+183)
      (* (* (* (cos t_1) 2.0) (* (sin t_1) (+ a b))) (- b a))
      (* (* 2.0 (cos t_0)) (* (* (sin t_0) b) b))))))
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\\
t_1 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.1 \cdot 10^{+183}:\\
\;\;\;\;\left(\left(\cos t\_1 \cdot 2\right) \cdot \left(\sin t\_1 \cdot \left(a + b\right)\right)\right) \cdot \left(b - a\right)\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \cos t\_0\right) \cdot \left(\left(\sin t\_0 \cdot b\right) \cdot b\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 2.1e183

    1. Initial program 58.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. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1e183 < b

    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. Step-by-step derivation
      1. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \cos \left(\frac{1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\sin \left(\frac{1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot b\right) \cdot b\right) \]
      3. Step-by-step derivation
        1. +-commutative91.2

          \[\leadsto \left(2 \cdot \cos \left(0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot b\right) \cdot b\right) \]
      4. Applied rewrites91.2%

        \[\leadsto \left(2 \cdot \cos \left(0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot b\right) \cdot b\right) \]
    9. Recombined 2 regimes into one program.
    10. Add Preprocessing

    Alternative 6: 67.7% accurate, 1.8× 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}\;angle\_m \leq 4 \cdot 10^{+114}:\\ \;\;\;\;\left(2 \cdot \cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\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 4e+114)
        (*
         (* 2.0 (cos (* (* 0.005555555555555556 (PI)) angle_m)))
         (* (* (sin (* 0.005555555555555556 (* (PI) angle_m))) (+ a b)) (- b a)))
        (* (* (- b a) (+ a b)) (sin (* 2.0 (* (PI) (/ angle_m 180.0))))))))
    \begin{array}{l}
    angle\_m = \left|angle\right|
    \\
    angle\_s = \mathsf{copysign}\left(1, angle\right)
    
    \\
    angle\_s \cdot \begin{array}{l}
    \mathbf{if}\;angle\_m \leq 4 \cdot 10^{+114}:\\
    \;\;\;\;\left(2 \cdot \cos \left(\left(0.005555555555555556 \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right)\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if angle < 4e114

      1. Initial program 64.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. 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)} \]
        2. lower-*.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)} \]
        3. *-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) \]
        4. lower-*.f64N/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) \]
        5. unpow2N/A

          \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

          \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
        7. difference-of-squaresN/A

          \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
        8. lower-*.f64N/A

          \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
        9. lower-+.f64N/A

          \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
        10. lower--.f64N/A

          \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
        12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 4e114 < angle

      1. Initial program 34.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. Step-by-step derivation
        1. 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)} \]
        2. lower-*.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)} \]
        3. *-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) \]
        4. lower-*.f64N/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) \]
        5. unpow2N/A

          \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

          \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
        7. difference-of-squaresN/A

          \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
        8. lower-*.f64N/A

          \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
        9. lower-+.f64N/A

          \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
        10. lower--.f64N/A

          \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
        12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 7: 67.6% accurate, 1.8× speedup?

    \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\\ angle\_s \cdot \left(\left(2 \cdot \cos t\_0\right) \cdot \left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\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
     (let* ((t_0 (* 0.005555555555555556 (* (PI) angle_m))))
       (* angle_s (* (* 2.0 (cos t_0)) (* (* (sin t_0) (+ a b)) (- b a))))))
    \begin{array}{l}
    angle\_m = \left|angle\right|
    \\
    angle\_s = \mathsf{copysign}\left(1, angle\right)
    
    \\
    \begin{array}{l}
    t_0 := 0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\\
    angle\_s \cdot \left(\left(2 \cdot \cos t\_0\right) \cdot \left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 58.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. Step-by-step derivation
      1. 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)} \]
      2. lower-*.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)} \]
      3. *-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) \]
      4. lower-*.f64N/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) \]
      5. unpow2N/A

        \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

        \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
      7. difference-of-squaresN/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      8. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
      9. lower-+.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
      10. lower--.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
      11. lower-*.f64N/A

        \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
      12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 58.1% 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}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq -1 \cdot 10^{-227}:\\ \;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot a\right) \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b \cdot \left(b - a\right)\right)\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 (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) -1e-227)
        (* (* -0.011111111111111112 a) (* (* angle_m a) (PI)))
        (* (* (* angle_m (PI)) (* b (- b a))) 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}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq -1 \cdot 10^{-227}:\\
    \;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot a\right) \cdot \mathsf{PI}\left(\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -9.99999999999999945e-228

      1. Initial program 56.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 \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
      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. associate-*r*N/A

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

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

          \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        4. pow2N/A

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

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
        6. *-commutativeN/A

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

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        8. lower-PI.f6453.4

          \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
      8. Applied rewrites53.4%

        \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)} \]
      9. Step-by-step derivation
        1. associate-*r*N/A

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

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        3. lower-*.f6453.4

          \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
      10. Applied rewrites53.4%

        \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
      11. Step-by-step derivation
        1. associate-*l*N/A

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

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

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

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

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

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(a \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \]
        7. *-commutativeN/A

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

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \]
        9. lower-PI.f6463.7

          \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \]
      12. Applied rewrites63.7%

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

      if -9.99999999999999945e-228 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))))

      1. Initial program 61.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 \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
        2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      7. Step-by-step derivation
        1. Applied rewrites56.9%

          \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112 \]
      8. Recombined 2 regimes into one program.
      9. Final simplification60.0%

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

      Alternative 9: 57.6% 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}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq -1 \cdot 10^{-227}:\\ \;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot a\right) \cdot \mathsf{PI}\left(\right)\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 (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) -1e-227)
          (* (* -0.011111111111111112 a) (* (* angle_m a) (PI)))
          (* (* (* (* 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}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq -1 \cdot 10^{-227}:\\
      \;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot a\right) \cdot \mathsf{PI}\left(\right)\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 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -9.99999999999999945e-228

        1. Initial program 56.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 \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
          2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
        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. associate-*r*N/A

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

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

            \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
          4. pow2N/A

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

            \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
          6. *-commutativeN/A

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

            \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
          8. lower-PI.f6453.4

            \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        8. Applied rewrites53.4%

          \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)} \]
        9. Step-by-step derivation
          1. associate-*r*N/A

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

            \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
          3. lower-*.f6453.4

            \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        10. Applied rewrites53.4%

          \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        11. Step-by-step derivation
          1. associate-*l*N/A

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

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

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

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

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

            \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(a \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \]
          7. *-commutativeN/A

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

            \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \]
          9. lower-PI.f6463.7

            \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \]
        12. Applied rewrites63.7%

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

        if -9.99999999999999945e-228 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))))

        1. Initial program 61.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 \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
          2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left({b}^{2} \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \frac{1}{90} \]
          4. pow2N/A

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

            \[\leadsto \left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \frac{1}{90} \]
          6. lower-PI.f6457.2

            \[\leadsto \left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 0.011111111111111112 \]
        8. Applied rewrites57.2%

          \[\leadsto \left(\left(\left(b \cdot b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 0.011111111111111112 \]
      3. Recombined 2 regimes into one program.
      4. Final simplification60.2%

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

      Alternative 10: 66.5% 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}\;angle\_m \leq 9.5 \cdot 10^{-120}:\\ \;\;\;\;\left(\left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\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 9.5e-120)
          (* (* (* (* (+ a b) (PI)) angle_m) 0.011111111111111112) (- b a))
          (* (* (- b a) (+ a b)) (sin (* 2.0 (* (PI) (/ angle_m 180.0))))))))
      \begin{array}{l}
      angle\_m = \left|angle\right|
      \\
      angle\_s = \mathsf{copysign}\left(1, angle\right)
      
      \\
      angle\_s \cdot \begin{array}{l}
      \mathbf{if}\;angle\_m \leq 9.5 \cdot 10^{-120}:\\
      \;\;\;\;\left(\left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if angle < 9.49999999999999937e-120

        1. Initial program 62.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. 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)} \]
          2. lower-*.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)} \]
          3. *-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) \]
          4. lower-*.f64N/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) \]
          5. unpow2N/A

            \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

            \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
          7. difference-of-squaresN/A

            \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
          8. lower-*.f64N/A

            \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
          9. lower-+.f64N/A

            \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
          10. lower--.f64N/A

            \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
          11. lower-*.f64N/A

            \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
          12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \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) \]
          2. lower-*.f64N/A

            \[\leadsto \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) \]
          3. *-commutativeN/A

            \[\leadsto \left(\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) \]
          4. lower-*.f64N/A

            \[\leadsto \left(\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) \]
          5. *-commutativeN/A

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

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

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

            \[\leadsto \left(\left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right) \]
        11. Applied rewrites74.6%

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

        if 9.49999999999999937e-120 < angle

        1. Initial program 52.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. Step-by-step derivation
          1. 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)} \]
          2. lower-*.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)} \]
          3. *-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) \]
          4. lower-*.f64N/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) \]
          5. unpow2N/A

            \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

            \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
          7. difference-of-squaresN/A

            \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
          8. lower-*.f64N/A

            \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
          9. lower-+.f64N/A

            \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
          10. lower--.f64N/A

            \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
          11. lower-*.f64N/A

            \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
          12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 11: 58.2% accurate, 3.4× 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}\;{a}^{2} \leq 2 \cdot 10^{+302}:\\ \;\;\;\;\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot 0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot a\right) \cdot \mathsf{PI}\left(\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 (<= (pow a 2.0) 2e+302)
          (* (* (PI) angle_m) (* (* (- b a) (+ a b)) 0.011111111111111112))
          (* (* -0.011111111111111112 a) (* (* angle_m a) (PI))))))
      \begin{array}{l}
      angle\_m = \left|angle\right|
      \\
      angle\_s = \mathsf{copysign}\left(1, angle\right)
      
      \\
      angle\_s \cdot \begin{array}{l}
      \mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+302}:\\
      \;\;\;\;\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot 0.011111111111111112\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot a\right) \cdot \mathsf{PI}\left(\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (pow.f64 a #s(literal 2 binary64)) < 2.0000000000000002e302

        1. Initial program 61.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 \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
          2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
        6. Step-by-step derivation
          1. difference-of-squares-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2.0000000000000002e302 < (pow.f64 a #s(literal 2 binary64))

        1. Initial program 50.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 \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
          2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
        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. associate-*r*N/A

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

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

            \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
          4. pow2N/A

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

            \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
          6. *-commutativeN/A

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

            \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
          8. lower-PI.f6458.8

            \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        8. Applied rewrites58.8%

          \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)} \]
        9. Step-by-step derivation
          1. associate-*r*N/A

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

            \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
          3. lower-*.f6458.8

            \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        10. Applied rewrites58.8%

          \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        11. Step-by-step derivation
          1. associate-*l*N/A

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

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

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

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

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

            \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(a \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \]
          7. *-commutativeN/A

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

            \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \]
          9. lower-PI.f6480.2

            \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \]
        12. Applied rewrites80.2%

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

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

      Alternative 12: 66.2% accurate, 3.4× speedup?

      \[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ angle\_s \cdot \left(2 \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\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
        (*
         2.0
         (* (* (sin (* 0.005555555555555556 (* (PI) angle_m))) (+ a b)) (- b a)))))
      \begin{array}{l}
      angle\_m = \left|angle\right|
      \\
      angle\_s = \mathsf{copysign}\left(1, angle\right)
      
      \\
      angle\_s \cdot \left(2 \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\_m\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\right)
      \end{array}
      
      Derivation
      1. Initial program 58.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. Step-by-step derivation
        1. 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)} \]
        2. lower-*.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)} \]
        3. *-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) \]
        4. lower-*.f64N/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) \]
        5. unpow2N/A

          \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

          \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
        7. difference-of-squaresN/A

          \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
        8. lower-*.f64N/A

          \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
        9. lower-+.f64N/A

          \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
        10. lower--.f64N/A

          \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
        11. lower-*.f64N/A

          \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
        12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 13: 63.4% accurate, 13.7× 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}\;angle\_m \leq 4.1 \cdot 10^{+187}:\\ \;\;\;\;\left(\left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(-a\right)\right)\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 (<= angle_m 4.1e+187)
            (* (* (* (* (+ a b) (PI)) angle_m) 0.011111111111111112) (- b a))
            (* (* (* angle_m (PI)) (* (+ b a) (- a))) 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}\;angle\_m \leq 4.1 \cdot 10^{+187}:\\
        \;\;\;\;\left(\left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(-a\right)\right)\right) \cdot 0.011111111111111112\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if angle < 4.1e187

          1. Initial program 62.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. Step-by-step derivation
            1. 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)} \]
            2. lower-*.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)} \]
            3. *-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) \]
            4. lower-*.f64N/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) \]
            5. unpow2N/A

              \[\leadsto \left(\left(\color{blue}{b \cdot b} - {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. unpow2N/A

              \[\leadsto \left(\left(b \cdot b - \color{blue}{a \cdot a}\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) \]
            7. difference-of-squaresN/A

              \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
            8. lower-*.f64N/A

              \[\leadsto \left(\color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\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) \]
            9. lower-+.f64N/A

              \[\leadsto \left(\left(\color{blue}{\left(b + a\right)} \cdot \left(b - a\right)\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) \]
            10. lower--.f64N/A

              \[\leadsto \left(\left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\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) \]
            11. lower-*.f64N/A

              \[\leadsto \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot 2\right) \cdot \color{blue}{\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)} \]
            12. lower-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \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) \]
            2. lower-*.f64N/A

              \[\leadsto \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) \]
            3. *-commutativeN/A

              \[\leadsto \left(\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) \]
            4. lower-*.f64N/A

              \[\leadsto \left(\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) \]
            5. *-commutativeN/A

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

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

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

              \[\leadsto \left(\left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\right) \]
          11. Applied rewrites69.9%

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

          if 4.1e187 < angle

          1. Initial program 35.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 \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
            2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(-1 \cdot a\right)\right)\right) \cdot \frac{1}{90} \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(\mathsf{neg}\left(a\right)\right)\right)\right) \cdot \frac{1}{90} \]
            2. lower-neg.f6437.6

              \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(-a\right)\right)\right) \cdot 0.011111111111111112 \]
          8. Applied rewrites37.6%

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

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

        Alternative 14: 63.3% accurate, 13.7× 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}\;angle\_m \leq 4.1 \cdot 10^{+187}:\\ \;\;\;\;\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;\left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(-a\right)\right)\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 (<= angle_m 4.1e+187)
            (* (* (* (* (PI) angle_m) (+ a b)) (- b a)) 0.011111111111111112)
            (* (* (* angle_m (PI)) (* (+ b a) (- a))) 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}\;angle\_m \leq 4.1 \cdot 10^{+187}:\\
        \;\;\;\;\left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(-a\right)\right)\right) \cdot 0.011111111111111112\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if angle < 4.1e187

          1. Initial program 62.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}{\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 \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
            2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
          6. Step-by-step derivation
            1. associate-*r*N/A

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

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

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

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

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

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

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

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

              \[\leadsto \left(\left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112 \]
          7. Applied rewrites69.9%

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

          if 4.1e187 < angle

          1. Initial program 35.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 \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
            2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(-1 \cdot a\right)\right)\right) \cdot \frac{1}{90} \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(\mathsf{neg}\left(a\right)\right)\right)\right) \cdot \frac{1}{90} \]
            2. lower-neg.f6437.6

              \[\leadsto \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(-a\right)\right)\right) \cdot 0.011111111111111112 \]
          8. Applied rewrites37.6%

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

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

        Alternative 15: 37.7% 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(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot a\right) \cdot \mathsf{PI}\left(\right)\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 (* (* -0.011111111111111112 a) (* (* angle_m a) (PI)))))
        \begin{array}{l}
        angle\_m = \left|angle\right|
        \\
        angle\_s = \mathsf{copysign}\left(1, angle\right)
        
        \\
        angle\_s \cdot \left(\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot a\right) \cdot \mathsf{PI}\left(\right)\right)\right)
        \end{array}
        
        Derivation
        1. Initial program 58.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 \left(angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \cdot \color{blue}{\frac{1}{90}} \]
          2. lower-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot 0.011111111111111112} \]
        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. associate-*r*N/A

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

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

            \[\leadsto \left(\frac{-1}{90} \cdot {a}^{2}\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
          4. pow2N/A

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

            \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) \]
          6. *-commutativeN/A

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

            \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
          8. lower-PI.f6435.6

            \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        8. Applied rewrites35.6%

          \[\leadsto \left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot angle\right)} \]
        9. Step-by-step derivation
          1. associate-*r*N/A

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

            \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
          3. lower-*.f6435.6

            \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        10. Applied rewrites35.6%

          \[\leadsto \left(\left(-0.011111111111111112 \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        11. Step-by-step derivation
          1. associate-*l*N/A

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

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

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

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

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

            \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(a \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \]
          7. *-commutativeN/A

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

            \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \]
          9. lower-PI.f6439.6

            \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle \cdot a\right) \cdot \mathsf{PI}\left(\right)\right) \]
        12. Applied rewrites39.6%

          \[\leadsto \left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle \cdot a\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
        13. Final simplification39.6%

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

        Reproduce

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