ab-angle->ABCF B

Percentage Accurate: 54.1% → 67.0%
Time: 6.8s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 54.1% accurate, 1.0× speedup?

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

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

Alternative 1: 67.0% accurate, 1.6× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \frac{\mathsf{PI}\left(\right)}{2}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 1.6 \cdot 10^{+142}:\\ \;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \mathsf{PI}\left(\right), t\_0\right)\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\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\_m}{180}\right) \cdot \sin \left(\left(-\mathsf{PI}\left(\right)\right) \cdot \frac{angle\_m}{180} + t\_0\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (/ (PI) 2.0)))
   (*
    angle_s
    (if (<= angle_m 1.6e+142)
      (*
       (* 2.0 (sin (fma (* 0.005555555555555556 angle_m) (PI) t_0)))
       (* (* (sin (* (* 0.005555555555555556 angle_m) (PI))) (+ a b)) (- b a)))
      (*
       (* (* (+ b a) (- b a)) 2.0)
       (*
        (sin (* (PI) (/ angle_m 180.0)))
        (sin (+ (* (- (PI)) (/ angle_m 180.0)) t_0))))))))
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

\\
\begin{array}{l}
t_0 := \frac{\mathsf{PI}\left(\right)}{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 1.6 \cdot 10^{+142}:\\
\;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \mathsf{PI}\left(\right), t\_0\right)\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\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\_m}{180}\right) \cdot \sin \left(\left(-\mathsf{PI}\left(\right)\right) \cdot \frac{angle\_m}{180} + t\_0\right)\right)\\


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

    1. Initial program 62.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 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({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \sin \left(\mathsf{fma}\left(\frac{1}{180} \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      14. lift-PI.f6475.0

        \[\leadsto \left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
    9. Applied rewrites75.0%

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

    if 1.60000000000000003e142 < angle

    1. Initial program 50.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. lift-*.f64N/A

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

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

        \[\leadsto \left(\color{blue}{\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) \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(2 \cdot \color{blue}{\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) \]
      5. lift-pow.f64N/A

        \[\leadsto \left(\left(2 \cdot \left(\color{blue}{{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) \]
      6. lift-pow.f64N/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{{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) \]
      7. lift-sin.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \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 \color{blue}{\frac{angle}{180}}\right) \]
    4. Applied rewrites50.8%

      \[\leadsto \color{blue}{\left(\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)} \]
    5. Step-by-step derivation
      1. lift-cos.f64N/A

        \[\leadsto \left(\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 \color{blue}{\cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)}\right) \]
      2. cos-neg-revN/A

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

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

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

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

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

        \[\leadsto \left(\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 \sin \left(\left(-\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) + \color{blue}{\frac{\mathsf{PI}\left(\right)}{2}}\right)\right) \]
      8. lift-PI.f6439.1

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

      \[\leadsto \left(\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 \color{blue}{\sin \left(\left(-\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification71.0%

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

Alternative 2: 57.5% accurate, 0.9× speedup?

\[\begin{array}{l} angle\_m = \left|angle\right| \\ angle\_s = \mathsf{copysign}\left(1, angle\right) \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq -2 \cdot 10^{+59}:\\ \;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.011111111111111112 \cdot angle\_m\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (PI) (/ angle_m 180.0))))
   (*
    angle_s
    (if (<=
         (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
         -2e+59)
      (* (* -0.011111111111111112 a) (* (* angle_m (PI)) a))
      (* (* 0.011111111111111112 angle_m) (* (* (PI) (+ 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 := \mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq -2 \cdot 10^{+59}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)\\

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


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

    1. Initial program 57.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. *-commutativeN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot angle\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. lift-*.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. lift-*.f64N/A

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

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

      \[\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. lift-*.f64N/A

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

        \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
      3. 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) \]
      4. lower-*.f64N/A

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

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

      \[\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. lift-*.f64N/A

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

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

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

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

        \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
      6. 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) \]
      7. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \]
      8. 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) \]
      9. lift-*.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) \]
      10. *-commutativeN/A

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

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

        \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
      13. lift-PI.f6432.5

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

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

    if -1.99999999999999994e59 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64)))))

    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. 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      5. *-commutativeN/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} \]
      6. lift-+.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} \]
      7. lift--.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} \]
      8. lift-*.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} \]
      9. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.5% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle\_m}{180}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 3.1 \cdot 10^{+137}:\\
\;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\

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


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

    1. Initial program 62.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in angle around 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({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \sin \left(\mathsf{fma}\left(\frac{1}{180} \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      14. lift-PI.f6475.3

        \[\leadsto \left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
    9. Applied rewrites75.3%

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

    if 3.0999999999999999e137 < angle

    1. Initial program 49.7%

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

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

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

        \[\leadsto \left(\color{blue}{\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) \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(2 \cdot \color{blue}{\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) \]
      5. lift-pow.f64N/A

        \[\leadsto \left(\left(2 \cdot \left(\color{blue}{{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) \]
      6. lift-pow.f64N/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{{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) \]
      7. lift-sin.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \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 \color{blue}{\frac{angle}{180}}\right) \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{\left(\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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.3%

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

Alternative 4: 67.5% accurate, 1.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 3.1 \cdot 10^{+137}:\\ \;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\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 3.1e+137)
    (*
     (* 2.0 (sin (fma (* 0.005555555555555556 angle_m) (PI) (/ (PI) 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 3.1 \cdot 10^{+137}:\\
\;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\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 < 3.0999999999999999e137

    1. Initial program 62.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in angle around 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({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \sin \left(\mathsf{fma}\left(\frac{1}{180} \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
      14. lift-PI.f6475.3

        \[\leadsto \left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \]
    9. Applied rewrites75.3%

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

    if 3.0999999999999999e137 < angle

    1. Initial program 49.7%

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

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

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

        \[\leadsto \left(\color{blue}{\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) \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(2 \cdot \color{blue}{\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) \]
      5. lift-pow.f64N/A

        \[\leadsto \left(\left(2 \cdot \left(\color{blue}{{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) \]
      6. lift-pow.f64N/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{{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) \]
      7. lift-sin.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \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 \color{blue}{\frac{angle}{180}}\right) \]
    4. Applied rewrites49.7%

      \[\leadsto \color{blue}{\left(\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)} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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)} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\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) \]
      3. lift-+.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) \]
      4. lift--.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) \]
      5. lift-*.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) \]
      6. lift-*.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)} \]
      7. lift-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) \]
      8. lift-PI.f64N/A

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

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

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

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

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

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

        \[\leadsto \left(\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 \color{blue}{\frac{angle}{180}}\right)\right) \]
    6. Applied rewrites49.7%

      \[\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. Final simplification72.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 3.1 \cdot 10^{+137}:\\ \;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\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}{180}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 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 := \left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.005555555555555556\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;a \leq 4 \cdot 10^{+256}:\\ \;\;\;\;\left(\left(\cos t\_0 \cdot 2\right) \cdot \left(\left(a + b\right) \cdot \sin t\_0\right)\right) \cdot \left(b - a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right) \cdot \left(\left(\left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot \left(b - a\right)\right)\\ \end{array} \end{array} \end{array} \]
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
 :precision binary64
 (let* ((t_0 (* (* angle_m (PI)) 0.005555555555555556)))
   (*
    angle_s
    (if (<= a 4e+256)
      (* (* (* (cos t_0) 2.0) (* (+ a b) (sin t_0))) (- b a))
      (*
       (* 2.0 (cos (* (* (PI) angle_m) 0.005555555555555556)))
       (* (* (* (* (+ a b) (PI)) angle_m) 0.005555555555555556) (- b a)))))))
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 4.0000000000000001e256

    1. Initial program 61.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 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({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.0000000000000001e256 < a

    1. Initial program 57.1%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in angle around 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({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)\right) \cdot \left(\left(\left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot angle\right) \cdot \frac{1}{180}\right) \cdot \left(b - a\right)\right) \]
      8. lift-PI.f64100.0

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

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

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

Alternative 6: 67.4% 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 3 \cdot 10^{+24}:\\ \;\;\;\;\left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\cos \left(-0.5 \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), \left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\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
 (*
  angle_s
  (if (<= angle_m 3e+24)
    (*
     (* 2.0 (cos (* (* (PI) angle_m) 0.005555555555555556)))
     (* (* (sin (* (* 0.005555555555555556 angle_m) (PI))) (+ a b)) (- b a)))
    (*
     (* (+ a b) (- b a))
     (-
      (cos (* -0.5 (PI)))
      (cos (fma 0.5 (PI) (* (* angle_m (PI)) 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 3 \cdot 10^{+24}:\\
\;\;\;\;\left(2 \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\

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


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

    1. Initial program 65.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. 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({b}^{2} - {a}^{2}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.99999999999999995e24 < angle

    1. Initial program 41.3%

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

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

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

        \[\leadsto \left(\color{blue}{\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) \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(2 \cdot \color{blue}{\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) \]
      5. lift-pow.f64N/A

        \[\leadsto \left(\left(2 \cdot \left(\color{blue}{{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) \]
      6. lift-pow.f64N/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{{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) \]
      7. lift-sin.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \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 \color{blue}{\frac{angle}{180}}\right) \]
    4. Applied rewrites41.3%

      \[\leadsto \color{blue}{\left(\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)} \]
    5. Step-by-step derivation
      1. lift-*.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)} \]
      2. lift-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) \]
      3. lift-cos.f64N/A

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

        \[\leadsto \left(\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 \color{blue}{\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \]
      5. 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(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} - \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}{2}} \]
      6. 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(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} - \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}{2}} \]
    6. Applied rewrites30.6%

      \[\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(\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \cos \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}{2}} \]
    7. Taylor expanded in angle around inf

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \]
    9. Applied rewrites35.7%

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

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

Alternative 7: 67.2% 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 0.000215:\\ \;\;\;\;\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(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\cos \left(-0.5 \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), \left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\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
 (*
  angle_s
  (if (<= angle_m 0.000215)
    (* (* (* (* (PI) angle_m) (+ a b)) (- b a)) 0.011111111111111112)
    (*
     (* (+ a b) (- b a))
     (-
      (cos (* -0.5 (PI)))
      (cos (fma 0.5 (PI) (* (* angle_m (PI)) 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 0.000215:\\
\;\;\;\;\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(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\cos \left(-0.5 \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), \left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 2.14999999999999995e-4

    1. Initial program 66.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
      5. associate-*r*N/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-*.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. lift-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} \]
      8. lift-*.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} \]
      9. *-commutativeN/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} \]
      10. 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} \]
      11. *-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} \]
      12. lift-*.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} \]
      13. lift-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} \]
      14. +-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} \]
      15. 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} \]
      16. lift--.f6476.2

        \[\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 rewrites76.2%

      \[\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 2.14999999999999995e-4 < angle

    1. Initial program 42.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. lift-*.f64N/A

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

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

        \[\leadsto \left(\color{blue}{\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) \]
      4. lift--.f64N/A

        \[\leadsto \left(\left(2 \cdot \color{blue}{\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) \]
      5. lift-pow.f64N/A

        \[\leadsto \left(\left(2 \cdot \left(\color{blue}{{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) \]
      6. lift-pow.f64N/A

        \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{{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) \]
      7. lift-sin.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \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 \color{blue}{\frac{angle}{180}}\right) \]
    4. Applied rewrites42.2%

      \[\leadsto \color{blue}{\left(\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)} \]
    5. Step-by-step derivation
      1. lift-*.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)} \]
      2. lift-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) \]
      3. lift-cos.f64N/A

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

        \[\leadsto \left(\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 \color{blue}{\sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \]
      5. 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(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} - \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}{2}} \]
      6. 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(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} - \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180} + \frac{\mathsf{PI}\left(\right)}{2}\right)\right)}{2}} \]
    6. Applied rewrites32.6%

      \[\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(\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right) - \cos \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{angle}{180}, \frac{\mathsf{PI}\left(\right)}{2}\right)\right)\right)}{2}} \]
    7. Taylor expanded in angle around inf

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

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

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

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

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

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

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

        \[\leadsto \left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) \]
    9. Applied rewrites36.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 0.000215:\\ \;\;\;\;\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(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\cos \left(-0.5 \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\mathsf{fma}\left(0.5, \mathsf{PI}\left(\right), \left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 58.3% 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 -5 \cdot 10^{-199}:\\ \;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\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))) -5e-199)
    (* (* -0.011111111111111112 a) (* (* angle_m (PI)) a))
    (* (* (* (PI) angle_m) (* 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 -5 \cdot 10^{-199}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{PI}\left(\right) \cdot angle\_m\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)))) < -4.9999999999999996e-199

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot angle\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. lift-*.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. lift-*.f64N/A

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

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

      \[\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. lift-*.f64N/A

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

        \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
      3. 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) \]
      4. lower-*.f64N/A

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

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

      \[\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. lift-*.f64N/A

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

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

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

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

        \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
      6. 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) \]
      7. *-commutativeN/A

        \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \]
      8. 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) \]
      9. lift-*.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) \]
      10. *-commutativeN/A

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

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

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

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

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

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

    1. Initial program 62.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. *-commutativeN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot angle\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(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(b \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
    7. Step-by-step derivation
      1. Applied rewrites56.5%

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

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

    Alternative 9: 57.7% 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 -5 \cdot 10^{-199}:\\ \;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle\_m \cdot \left(b \cdot b\right)\right) \cdot \left(0.011111111111111112 \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 (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) -5e-199)
        (* (* -0.011111111111111112 a) (* (* angle_m (PI)) a))
        (* (* angle_m (* b b)) (* 0.011111111111111112 (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}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq -5 \cdot 10^{-199}:\\
    \;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot \mathsf{PI}\left(\right)\right) \cdot a\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(angle\_m \cdot \left(b \cdot b\right)\right) \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right)\\
    
    
    \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)))) < -4.9999999999999996e-199

      1. Initial program 59.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot angle\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. lift-*.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. lift-*.f64N/A

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

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

        \[\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. lift-*.f64N/A

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

          \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        3. 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) \]
        4. lower-*.f64N/A

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

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

        \[\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. lift-*.f64N/A

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

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

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

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

          \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
        6. 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) \]
        7. *-commutativeN/A

          \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \]
        8. 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) \]
        9. lift-*.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) \]
        10. *-commutativeN/A

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

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

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

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

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

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

      1. Initial program 62.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 b around inf

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(angle \cdot \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(\frac{{a}^{2} \cdot \mathsf{PI}\left(\right)}{{b}^{2}}, \frac{-1}{90}, \frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \]
      8. Applied rewrites43.9%

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

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

          \[\leadsto \left(angle \cdot \left(b \cdot b\right)\right) \cdot \left(\frac{1}{90} \cdot \mathsf{PI}\left(\right)\right) \]
        2. lift-PI.f6456.7

          \[\leadsto \left(angle \cdot \left(b \cdot b\right)\right) \cdot \left(0.011111111111111112 \cdot \mathsf{PI}\left(\right)\right) \]
      11. Applied rewrites56.7%

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

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

    Alternative 10: 63.8% accurate, 2.0× speedup?

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

      1. Initial program 74.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 b around inf

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

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

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

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

        \[\leadsto \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{b} \cdot b\right) \]
      7. Step-by-step derivation
        1. lower-sin.f64N/A

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

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

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

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

          \[\leadsto \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{90}\right) \cdot \left(b \cdot b\right) \]
        6. lift-PI.f6474.4

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

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

      if 1.999999999999994e-310 < (pow.f64 a #s(literal 2 binary64))

      1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
        5. associate-*r*N/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-*.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. lift-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} \]
        8. lift-*.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} \]
        9. *-commutativeN/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} \]
        10. 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} \]
        11. *-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} \]
        12. lift-*.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} \]
        13. lift-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} \]
        14. +-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} \]
        15. 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} \]
        16. lift--.f6465.6

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

        \[\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 \]
    3. Recombined 2 regimes into one program.
    4. Final simplification68.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{-310}:\\ \;\;\;\;\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\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\\ \end{array} \]
    5. Add Preprocessing

    Alternative 11: 50.7% accurate, 3.1× speedup?

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

      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 b around inf

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

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

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

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

        \[\leadsto \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\color{blue}{b} \cdot b\right) \]
      7. Step-by-step derivation
        1. lower-sin.f64N/A

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

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

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

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

          \[\leadsto \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{90}\right) \cdot \left(b \cdot b\right) \]
        6. lift-PI.f6444.5

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

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

      if 2.25000000000000007e-222 < a < 2.55000000000000018e153

      1. Initial program 61.7%

        \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
      2. Add Preprocessing
      3. Taylor expanded in angle around 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({b}^{2} - {a}^{2}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2.55000000000000018e153 < a

        1. Initial program 52.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
          5. associate-*r*N/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-*.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. lift-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} \]
          8. lift-*.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} \]
          9. *-commutativeN/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} \]
          10. 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} \]
          11. *-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} \]
          12. lift-*.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} \]
          13. lift-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} \]
          14. +-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} \]
          15. 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} \]
          16. lift--.f6483.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 rewrites83.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 \]
      10. Recombined 3 regimes into one program.
      11. Final simplification55.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 2.25 \cdot 10^{-222}:\\ \;\;\;\;\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(b \cdot b\right)\\ \mathbf{elif}\;a \leq 2.55 \cdot 10^{+153}:\\ \;\;\;\;2 \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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\\ \end{array} \]
      12. Add Preprocessing

      Alternative 12: 66.8% 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 4.7 \cdot 10^{-87}:\\ \;\;\;\;\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(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 4.7e-87)
          (* (* (* (* (PI) angle_m) (+ a b)) (- b a)) 0.011111111111111112)
          (* (* (- 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.7 \cdot 10^{-87}:\\
      \;\;\;\;\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(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 < 4.7000000000000001e-87

        1. Initial program 63.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
          5. associate-*r*N/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-*.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. lift-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} \]
          8. lift-*.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} \]
          9. *-commutativeN/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} \]
          10. 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} \]
          11. *-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} \]
          12. lift-*.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} \]
          13. lift-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} \]
          14. +-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} \]
          15. 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} \]
          16. lift--.f6474.0

            \[\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 rewrites74.0%

          \[\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.7000000000000001e-87 < angle

        1. Initial program 54.6%

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

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

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

            \[\leadsto \left(\color{blue}{\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) \]
          4. lift--.f64N/A

            \[\leadsto \left(\left(2 \cdot \color{blue}{\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) \]
          5. lift-pow.f64N/A

            \[\leadsto \left(\left(2 \cdot \left(\color{blue}{{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) \]
          6. lift-pow.f64N/A

            \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{{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) \]
          7. lift-sin.f64N/A

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

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

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

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

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

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

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

            \[\leadsto \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 \color{blue}{\frac{angle}{180}}\right) \]
        4. Applied rewrites56.0%

          \[\leadsto \color{blue}{\left(\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)} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\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)} \]
          2. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\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) \]
          3. lift-+.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) \]
          4. lift--.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) \]
          5. lift-*.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) \]
          6. lift-*.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)} \]
          7. lift-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) \]
          8. lift-PI.f64N/A

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

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

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

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

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

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

            \[\leadsto \left(\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 \color{blue}{\frac{angle}{180}}\right)\right) \]
        6. Applied rewrites56.0%

          \[\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. Final simplification69.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 4.7 \cdot 10^{-87}:\\ \;\;\;\;\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(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)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 13: 66.9% accurate, 3.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) \cdot angle\_m\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 1.46 \cdot 10^{-88}:\\ \;\;\;\;\left(\left(t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(2 \cdot t\_0\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\\ \end{array} \end{array} \end{array} \]
      angle\_m = (fabs.f64 angle)
      angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
      (FPCore (angle_s a b angle_m)
       :precision binary64
       (let* ((t_0 (* (PI) angle_m)))
         (*
          angle_s
          (if (<= angle_m 1.46e-88)
            (* (* (* t_0 (+ a b)) (- b a)) 0.011111111111111112)
            (* (sin (* (* 2.0 t_0) 0.005555555555555556)) (* (- b a) (+ a b)))))))
      \begin{array}{l}
      angle\_m = \left|angle\right|
      \\
      angle\_s = \mathsf{copysign}\left(1, angle\right)
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\
      angle\_s \cdot \begin{array}{l}
      \mathbf{if}\;angle\_m \leq 1.46 \cdot 10^{-88}:\\
      \;\;\;\;\left(\left(t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112\\
      
      \mathbf{else}:\\
      \;\;\;\;\sin \left(\left(2 \cdot t\_0\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\\
      
      
      \end{array}
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if angle < 1.4600000000000001e-88

        1. Initial program 63.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
          5. associate-*r*N/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-*.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. lift-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} \]
          8. lift-*.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} \]
          9. *-commutativeN/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} \]
          10. 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} \]
          11. *-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} \]
          12. lift-*.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} \]
          13. lift-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} \]
          14. +-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} \]
          15. 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} \]
          16. lift--.f6474.0

            \[\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 rewrites74.0%

          \[\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 1.4600000000000001e-88 < angle

        1. Initial program 54.6%

          \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
        2. Add Preprocessing
        3. Taylor expanded in angle around 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({b}^{2} - {a}^{2}\right)\right)\right)} \]
        4. Step-by-step derivation
          1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 1.46 \cdot 10^{-88}:\\ \;\;\;\;\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}:\\ \;\;\;\;\sin \left(\left(2 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 14: 65.2% accurate, 3.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) \cdot angle\_m\\ angle\_s \cdot \begin{array}{l} \mathbf{if}\;angle\_m \leq 1.2 \cdot 10^{+142}:\\ \;\;\;\;\left(\left(t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sin \left(t\_0 \cdot 0.005555555555555556\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
      angle\_m = (fabs.f64 angle)
      angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
      (FPCore (angle_s a b angle_m)
       :precision binary64
       (let* ((t_0 (* (PI) angle_m)))
         (*
          angle_s
          (if (<= angle_m 1.2e+142)
            (* (* (* t_0 (+ a b)) (- b a)) 0.011111111111111112)
            (* 2.0 (* (sin (* t_0 0.005555555555555556)) (* (+ b a) (- b a))))))))
      \begin{array}{l}
      angle\_m = \left|angle\right|
      \\
      angle\_s = \mathsf{copysign}\left(1, angle\right)
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{PI}\left(\right) \cdot angle\_m\\
      angle\_s \cdot \begin{array}{l}
      \mathbf{if}\;angle\_m \leq 1.2 \cdot 10^{+142}:\\
      \;\;\;\;\left(\left(t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot 0.011111111111111112\\
      
      \mathbf{else}:\\
      \;\;\;\;2 \cdot \left(\sin \left(t\_0 \cdot 0.005555555555555556\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\
      
      
      \end{array}
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if angle < 1.2e142

        1. Initial program 62.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
          5. associate-*r*N/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-*.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. lift-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} \]
          8. lift-*.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} \]
          9. *-commutativeN/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} \]
          10. 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} \]
          11. *-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} \]
          12. lift-*.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} \]
          13. lift-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} \]
          14. +-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} \]
          15. 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} \]
          16. lift--.f6470.3

            \[\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 rewrites70.3%

          \[\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 1.2e142 < angle

        1. Initial program 50.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 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({b}^{2} - {a}^{2}\right)\right)\right)} \]
        4. Step-by-step derivation
          1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 1.2 \cdot 10^{+142}:\\ \;\;\;\;\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}:\\ \;\;\;\;2 \cdot \left(\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\ \end{array} \]
        10. Add Preprocessing

        Alternative 15: 63.5% accurate, 13.7× speedup?

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

          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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{1}{90} \]
            5. associate-*r*N/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-*.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. lift-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} \]
            8. lift-*.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} \]
            9. *-commutativeN/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} \]
            10. 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} \]
            11. *-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} \]
            12. lift-*.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} \]
            13. lift-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} \]
            14. +-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} \]
            15. 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} \]
            16. lift--.f6470.0

              \[\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 rewrites70.0%

            \[\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 1.25e155 < angle

          1. Initial program 52.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. *-commutativeN/A

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot angle\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(\mathsf{PI}\left(\right) \cdot angle\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(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(\mathsf{neg}\left(a\right)\right)\right)\right) \cdot \frac{1}{90} \]
            2. lower-neg.f6427.1

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

            \[\leadsto \left(\left(\mathsf{PI}\left(\right) \cdot angle\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.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;angle \leq 1.25 \cdot 10^{+155}:\\ \;\;\;\;\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(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(-a\right)\right)\right) \cdot 0.011111111111111112\\ \end{array} \]
        5. Add Preprocessing

        Alternative 16: 38.6% 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 \mathsf{PI}\left(\right)\right) \cdot a\right)\right) \end{array} \]
        angle\_m = (fabs.f64 angle)
        angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
        (FPCore (angle_s a b angle_m)
         :precision binary64
         (* angle_s (* (* -0.011111111111111112 a) (* (* angle_m (PI)) a))))
        \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 \mathsf{PI}\left(\right)\right) \cdot a\right)\right)
        \end{array}
        
        Derivation
        1. Initial program 61.2%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\left(\mathsf{PI}\left(\right) \cdot angle\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. lift-*.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. lift-*.f64N/A

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

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

          \[\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. lift-*.f64N/A

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

            \[\leadsto \left(\frac{-1}{90} \cdot \left(a \cdot a\right)\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
          3. 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) \]
          4. lower-*.f64N/A

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

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

          \[\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. lift-*.f64N/A

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

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

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

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

            \[\leadsto \left(\left(\frac{-1}{90} \cdot a\right) \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right) \]
          6. 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) \]
          7. *-commutativeN/A

            \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(a \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \]
          8. 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) \]
          9. lift-*.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) \]
          10. *-commutativeN/A

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

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

            \[\leadsto \left(\frac{-1}{90} \cdot a\right) \cdot \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot a\right) \]
          13. lift-PI.f6438.0

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

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

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

        Reproduce

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