raw-angle from scale-rotated-ellipse

Percentage Accurate: 14.0% → 57.5%
Time: 29.5s
Alternatives: 11
Speedup: 21.5×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ t_1 := \cos t\_0\\ t_2 := \sin t\_0\\ t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\ t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\ t_5 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\ 180 \cdot \frac{\tan^{-1} \left(\frac{\left(t\_4 - t\_5\right) - \sqrt{{\left(t\_5 - t\_4\right)}^{2} + {t\_3}^{2}}}{t\_3}\right)}{\mathsf{PI}\left(\right)} \end{array} \end{array} \]
(FPCore (a b angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) (PI)))
        (t_1 (cos t_0))
        (t_2 (sin t_0))
        (t_3
         (/
          (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
          y-scale))
        (t_4
         (/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
        (t_5
         (/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
   (*
    180.0
    (/
     (atan
      (/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
     (PI)))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\
t_5 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
180 \cdot \frac{\tan^{-1} \left(\frac{\left(t\_4 - t\_5\right) - \sqrt{{\left(t\_5 - t\_4\right)}^{2} + {t\_3}^{2}}}{t\_3}\right)}{\mathsf{PI}\left(\right)}
\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 11 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: 14.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ t_1 := \cos t\_0\\ t_2 := \sin t\_0\\ t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\ t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\ t_5 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\ 180 \cdot \frac{\tan^{-1} \left(\frac{\left(t\_4 - t\_5\right) - \sqrt{{\left(t\_5 - t\_4\right)}^{2} + {t\_3}^{2}}}{t\_3}\right)}{\mathsf{PI}\left(\right)} \end{array} \end{array} \]
(FPCore (a b angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) (PI)))
        (t_1 (cos t_0))
        (t_2 (sin t_0))
        (t_3
         (/
          (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_2) t_1) x-scale)
          y-scale))
        (t_4
         (/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) y-scale) y-scale))
        (t_5
         (/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale)))
   (*
    180.0
    (/
     (atan
      (/ (- (- t_4 t_5) (sqrt (+ (pow (- t_5 t_4) 2.0) (pow t_3 2.0)))) t_3))
     (PI)))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_2\right) \cdot t\_1}{x-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{y-scale}}{y-scale}\\
t_5 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
180 \cdot \frac{\tan^{-1} \left(\frac{\left(t\_4 - t\_5\right) - \sqrt{{\left(t\_5 - t\_4\right)}^{2} + {t\_3}^{2}}}{t\_3}\right)}{\mathsf{PI}\left(\right)}
\end{array}
\end{array}

Alternative 1: 57.5% accurate, 3.5× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\\ t_1 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\ t_2 := \sqrt[3]{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;b\_m \leq 2400000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(t\_0 \cdot 0.005555555555555556\right)}{t\_1} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{\frac{{t\_1}^{2} \cdot y-scale}{x-scale} \cdot -2}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \cos \left(\left(\left({t\_2}^{2} \cdot t\_2\right) \cdot angle\right) \cdot -0.005555555555555556\right)}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* (PI) angle))
        (t_1 (cos (* t_0 -0.005555555555555556)))
        (t_2 (cbrt (PI))))
   (if (<= b_m 2400000000000.0)
     (*
      (/
       (atan
        (*
         -0.5
         (*
          (* (/ (sin (* t_0 0.005555555555555556)) t_1) (/ y-scale x-scale))
          -2.0)))
       (PI))
      180.0)
     (*
      (/
       (atan
        (*
         0.5
         (/
          (* (/ (* (pow t_1 2.0) y-scale) x-scale) -2.0)
          (*
           (sin (* (* 0.005555555555555556 angle) (PI)))
           (cos (* (* (* (pow t_2 2.0) t_2) angle) -0.005555555555555556))))))
       (PI))
      180.0))))
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot angle\\
t_1 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\
t_2 := \sqrt[3]{\mathsf{PI}\left(\right)}\\
\mathbf{if}\;b\_m \leq 2400000000000:\\
\;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(t\_0 \cdot 0.005555555555555556\right)}{t\_1} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\

\mathbf{else}:\\
\;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{\frac{{t\_1}^{2} \cdot y-scale}{x-scale} \cdot -2}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \cos \left(\left(\left({t\_2}^{2} \cdot t\_2\right) \cdot angle\right) \cdot -0.005555555555555556\right)}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\


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

    1. Initial program 14.6%

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}, {\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\right)\right) \cdot y-scale}{\left(x-scale \cdot \cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\right)} \cdot -0.5\right)}}{\mathsf{PI}\left(\right)} \]
    5. Taylor expanded in a around inf

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \frac{-1}{2}\right)}{\mathsf{PI}\left(\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites54.2%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]

      if 2.4e12 < b

      1. Initial program 11.4%

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{x-scale \cdot \left(y-scale \cdot \left(\frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}} - \left(\sqrt{4 \cdot \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} + {\left(\frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} - \frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}\right)\right)\right)}{\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)}}{\mathsf{PI}\left(\right)} \]
      4. Applied rewrites31.8%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(x-scale \cdot y-scale\right) \cdot \left(\left(\frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{y-scale \cdot y-scale} - \sqrt{\mathsf{fma}\left({\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}, 4, {\left(\frac{{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2}}{x-scale \cdot x-scale} - \frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{y-scale \cdot y-scale}\right)}^{2}\right)}\right) - \frac{{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2}}{x-scale \cdot x-scale}\right)}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}}{\mathsf{PI}\left(\right)} \]
      5. Taylor expanded in x-scale around 0

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(\frac{-1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)} \cdot \frac{1}{2}\right)}{\mathsf{PI}\left(\right)} \]
      6. Step-by-step derivation
        1. Applied rewrites58.8%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
        2. Step-by-step derivation
          1. Applied rewrites65.2%

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
          2. Step-by-step derivation
            1. Applied rewrites65.4%

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot angle\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification57.0%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2400000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(0.5 \cdot \frac{\frac{{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)}^{2} \cdot y-scale}{x-scale} \cdot -2}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \cos \left(\left(\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot angle\right) \cdot -0.005555555555555556\right)}\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
          5. Add Preprocessing

          Alternative 2: 57.1% accurate, 4.0× speedup?

          \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \sqrt[3]{\mathsf{PI}\left(\right)}\\ t_1 := \mathsf{PI}\left(\right) \cdot angle\\ t_2 := \sin \left(t\_1 \cdot 0.005555555555555556\right)\\ \mathbf{if}\;b\_m \leq 2400000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_2}{\cos \left(t\_1 \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{1}^{2} \cdot y-scale}{x-scale} \cdot -2}{t\_2 \cdot \cos \left(\left(\left({t\_0}^{2} \cdot t\_0\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
          b_m = (fabs.f64 b)
          (FPCore (a b_m angle x-scale y-scale)
           :precision binary64
           (let* ((t_0 (cbrt (PI)))
                  (t_1 (* (PI) angle))
                  (t_2 (sin (* t_1 0.005555555555555556))))
             (if (<= b_m 2400000000000.0)
               (*
                (/
                 (atan
                  (*
                   -0.5
                   (*
                    (* (/ t_2 (cos (* t_1 -0.005555555555555556))) (/ y-scale x-scale))
                    -2.0)))
                 (PI))
                180.0)
               (*
                (/
                 (atan
                  (*
                   (/
                    (* (/ (* (pow 1.0 2.0) y-scale) x-scale) -2.0)
                    (*
                     t_2
                     (cos (* (* (* (pow t_0 2.0) t_0) angle) -0.005555555555555556))))
                   0.5))
                 (PI))
                180.0))))
          \begin{array}{l}
          b_m = \left|b\right|
          
          \\
          \begin{array}{l}
          t_0 := \sqrt[3]{\mathsf{PI}\left(\right)}\\
          t_1 := \mathsf{PI}\left(\right) \cdot angle\\
          t_2 := \sin \left(t\_1 \cdot 0.005555555555555556\right)\\
          \mathbf{if}\;b\_m \leq 2400000000000:\\
          \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_2}{\cos \left(t\_1 \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{1}^{2} \cdot y-scale}{x-scale} \cdot -2}{t\_2 \cdot \cos \left(\left(\left({t\_0}^{2} \cdot t\_0\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if b < 2.4e12

            1. Initial program 14.6%

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}, {\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\right)\right) \cdot y-scale}{\left(x-scale \cdot \cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\right)} \cdot -0.5\right)}}{\mathsf{PI}\left(\right)} \]
            5. Taylor expanded in a around inf

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \frac{-1}{2}\right)}{\mathsf{PI}\left(\right)} \]
            6. Step-by-step derivation
              1. Applied rewrites54.2%

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]

              if 2.4e12 < b

              1. Initial program 11.4%

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{x-scale \cdot \left(y-scale \cdot \left(\frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}} - \left(\sqrt{4 \cdot \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} + {\left(\frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} - \frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}\right)\right)\right)}{\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)}}{\mathsf{PI}\left(\right)} \]
              4. Applied rewrites31.8%

                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(x-scale \cdot y-scale\right) \cdot \left(\left(\frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{y-scale \cdot y-scale} - \sqrt{\mathsf{fma}\left({\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}, 4, {\left(\frac{{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2}}{x-scale \cdot x-scale} - \frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{y-scale \cdot y-scale}\right)}^{2}\right)}\right) - \frac{{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2}}{x-scale \cdot x-scale}\right)}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}}{\mathsf{PI}\left(\right)} \]
              5. Taylor expanded in x-scale around 0

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(\frac{-1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)} \cdot \frac{1}{2}\right)}{\mathsf{PI}\left(\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites58.8%

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
                2. Step-by-step derivation
                  1. Applied rewrites65.2%

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
                  2. Taylor expanded in angle around 0

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {1}^{2}}{x-scale}}{\cos \left(\frac{-1}{180} \cdot \left(\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)} \cdot \frac{1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                  3. Step-by-step derivation
                    1. Applied rewrites65.3%

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {1}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
                  4. Recombined 2 regimes into one program.
                  5. Final simplification56.9%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2400000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{1}^{2} \cdot y-scale}{x-scale} \cdot -2}{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \cos \left(\left(\left({\left(\sqrt[3]{\mathsf{PI}\left(\right)}\right)}^{2} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                  6. Add Preprocessing

                  Alternative 3: 57.3% accurate, 5.1× speedup?

                  \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\\ t_1 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\ t_2 := \sqrt{\mathsf{PI}\left(\right)}\\ \mathbf{if}\;b\_m \leq 2400000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(t\_0 \cdot 0.005555555555555556\right)}{t\_1} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{t\_1}^{2} \cdot y-scale}{x-scale} \cdot -2}{\sin \left(\left(\left(t\_2 \cdot t\_2\right) \cdot angle\right) \cdot 0.005555555555555556\right) \cdot t\_1} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
                  b_m = (fabs.f64 b)
                  (FPCore (a b_m angle x-scale y-scale)
                   :precision binary64
                   (let* ((t_0 (* (PI) angle))
                          (t_1 (cos (* t_0 -0.005555555555555556)))
                          (t_2 (sqrt (PI))))
                     (if (<= b_m 2400000000000.0)
                       (*
                        (/
                         (atan
                          (*
                           -0.5
                           (*
                            (* (/ (sin (* t_0 0.005555555555555556)) t_1) (/ y-scale x-scale))
                            -2.0)))
                         (PI))
                        180.0)
                       (*
                        (/
                         (atan
                          (*
                           (/
                            (* (/ (* (pow t_1 2.0) y-scale) x-scale) -2.0)
                            (* (sin (* (* (* t_2 t_2) angle) 0.005555555555555556)) t_1))
                           0.5))
                         (PI))
                        180.0))))
                  \begin{array}{l}
                  b_m = \left|b\right|
                  
                  \\
                  \begin{array}{l}
                  t_0 := \mathsf{PI}\left(\right) \cdot angle\\
                  t_1 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\
                  t_2 := \sqrt{\mathsf{PI}\left(\right)}\\
                  \mathbf{if}\;b\_m \leq 2400000000000:\\
                  \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(t\_0 \cdot 0.005555555555555556\right)}{t\_1} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{t\_1}^{2} \cdot y-scale}{x-scale} \cdot -2}{\sin \left(\left(\left(t\_2 \cdot t\_2\right) \cdot angle\right) \cdot 0.005555555555555556\right) \cdot t\_1} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if b < 2.4e12

                    1. Initial program 14.6%

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}, {\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\right)\right) \cdot y-scale}{\left(x-scale \cdot \cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\right)} \cdot -0.5\right)}}{\mathsf{PI}\left(\right)} \]
                    5. Taylor expanded in a around inf

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \frac{-1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                    6. Step-by-step derivation
                      1. Applied rewrites54.2%

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]

                      if 2.4e12 < b

                      1. Initial program 11.4%

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

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{x-scale \cdot \left(y-scale \cdot \left(\frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}} - \left(\sqrt{4 \cdot \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} + {\left(\frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} - \frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}\right)\right)\right)}{\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)}}{\mathsf{PI}\left(\right)} \]
                      4. Applied rewrites31.8%

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(x-scale \cdot y-scale\right) \cdot \left(\left(\frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{y-scale \cdot y-scale} - \sqrt{\mathsf{fma}\left({\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}, 4, {\left(\frac{{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2}}{x-scale \cdot x-scale} - \frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{y-scale \cdot y-scale}\right)}^{2}\right)}\right) - \frac{{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2}}{x-scale \cdot x-scale}\right)}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}}{\mathsf{PI}\left(\right)} \]
                      5. Taylor expanded in x-scale around 0

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(\frac{-1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)} \cdot \frac{1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites58.8%

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
                        2. Step-by-step derivation
                          1. Applied rewrites60.5%

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
                        3. Recombined 2 regimes into one program.
                        4. Final simplification55.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2400000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)}^{2} \cdot y-scale}{x-scale} \cdot -2}{\sin \left(\left(\left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                        5. Add Preprocessing

                        Alternative 4: 57.0% accurate, 5.3× speedup?

                        \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\\ t_1 := \sin \left(t\_0 \cdot 0.005555555555555556\right)\\ t_2 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\ \mathbf{if}\;b\_m \leq 2300000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_1}{t\_2} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{\sin \left(\mathsf{fma}\left(t\_0, -0.005555555555555556, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot y-scale}{x-scale} \cdot -2}{t\_2 \cdot t\_1} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
                        b_m = (fabs.f64 b)
                        (FPCore (a b_m angle x-scale y-scale)
                         :precision binary64
                         (let* ((t_0 (* (PI) angle))
                                (t_1 (sin (* t_0 0.005555555555555556)))
                                (t_2 (cos (* t_0 -0.005555555555555556))))
                           (if (<= b_m 2300000000000.0)
                             (*
                              (/ (atan (* -0.5 (* (* (/ t_1 t_2) (/ y-scale x-scale)) -2.0))) (PI))
                              180.0)
                             (*
                              (/
                               (atan
                                (*
                                 (/
                                  (*
                                   (/
                                    (*
                                     (pow (sin (fma t_0 -0.005555555555555556 (* 0.5 (PI)))) 2.0)
                                     y-scale)
                                    x-scale)
                                   -2.0)
                                  (* t_2 t_1))
                                 0.5))
                               (PI))
                              180.0))))
                        \begin{array}{l}
                        b_m = \left|b\right|
                        
                        \\
                        \begin{array}{l}
                        t_0 := \mathsf{PI}\left(\right) \cdot angle\\
                        t_1 := \sin \left(t\_0 \cdot 0.005555555555555556\right)\\
                        t_2 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\
                        \mathbf{if}\;b\_m \leq 2300000000000:\\
                        \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_1}{t\_2} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{\sin \left(\mathsf{fma}\left(t\_0, -0.005555555555555556, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot y-scale}{x-scale} \cdot -2}{t\_2 \cdot t\_1} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if b < 2.3e12

                          1. Initial program 14.6%

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

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

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}, {\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\right)\right) \cdot y-scale}{\left(x-scale \cdot \cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\right)} \cdot -0.5\right)}}{\mathsf{PI}\left(\right)} \]
                          5. Taylor expanded in a around inf

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \frac{-1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                          6. Step-by-step derivation
                            1. Applied rewrites54.2%

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]

                            if 2.3e12 < b

                            1. Initial program 11.4%

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{x-scale \cdot \left(y-scale \cdot \left(\frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}} - \left(\sqrt{4 \cdot \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} + {\left(\frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} - \frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}\right)\right)\right)}{\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)}}{\mathsf{PI}\left(\right)} \]
                            4. Applied rewrites31.8%

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(x-scale \cdot y-scale\right) \cdot \left(\left(\frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{y-scale \cdot y-scale} - \sqrt{\mathsf{fma}\left({\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}, 4, {\left(\frac{{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2}}{x-scale \cdot x-scale} - \frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{y-scale \cdot y-scale}\right)}^{2}\right)}\right) - \frac{{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2}}{x-scale \cdot x-scale}\right)}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}}{\mathsf{PI}\left(\right)} \]
                            5. Taylor expanded in x-scale around 0

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(\frac{-1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)} \cdot \frac{1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                            6. Step-by-step derivation
                              1. Applied rewrites58.8%

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
                              2. Step-by-step derivation
                                1. Applied rewrites58.9%

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right) \cdot angle, -0.005555555555555556, \mathsf{PI}\left(\right) \cdot 0.5\right)\right)}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification55.3%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2300000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{\sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right) \cdot angle, -0.005555555555555556, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot y-scale}{x-scale} \cdot -2}{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                              5. Add Preprocessing

                              Alternative 5: 57.0% accurate, 5.3× speedup?

                              \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\\ t_1 := \sin \left(t\_0 \cdot 0.005555555555555556\right)\\ t_2 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\ \mathbf{if}\;b\_m \leq 2300000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_1}{t\_2} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{t\_2}^{2} \cdot y-scale}{x-scale} \cdot -2}{t\_2 \cdot t\_1} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
                              b_m = (fabs.f64 b)
                              (FPCore (a b_m angle x-scale y-scale)
                               :precision binary64
                               (let* ((t_0 (* (PI) angle))
                                      (t_1 (sin (* t_0 0.005555555555555556)))
                                      (t_2 (cos (* t_0 -0.005555555555555556))))
                                 (if (<= b_m 2300000000000.0)
                                   (*
                                    (/ (atan (* -0.5 (* (* (/ t_1 t_2) (/ y-scale x-scale)) -2.0))) (PI))
                                    180.0)
                                   (*
                                    (/
                                     (atan
                                      (* (/ (* (/ (* (pow t_2 2.0) y-scale) x-scale) -2.0) (* t_2 t_1)) 0.5))
                                     (PI))
                                    180.0))))
                              \begin{array}{l}
                              b_m = \left|b\right|
                              
                              \\
                              \begin{array}{l}
                              t_0 := \mathsf{PI}\left(\right) \cdot angle\\
                              t_1 := \sin \left(t\_0 \cdot 0.005555555555555556\right)\\
                              t_2 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\
                              \mathbf{if}\;b\_m \leq 2300000000000:\\
                              \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_1}{t\_2} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{t\_2}^{2} \cdot y-scale}{x-scale} \cdot -2}{t\_2 \cdot t\_1} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if b < 2.3e12

                                1. Initial program 14.6%

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

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

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}, {\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\right)\right) \cdot y-scale}{\left(x-scale \cdot \cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\right)} \cdot -0.5\right)}}{\mathsf{PI}\left(\right)} \]
                                5. Taylor expanded in a around inf

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \frac{-1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites54.2%

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]

                                  if 2.3e12 < b

                                  1. Initial program 11.4%

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

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{2} \cdot \frac{x-scale \cdot \left(y-scale \cdot \left(\frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}} - \left(\sqrt{4 \cdot \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} + {\left(\frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} - \frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}\right)\right)\right)}{\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)}}{\mathsf{PI}\left(\right)} \]
                                  4. Applied rewrites31.8%

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(x-scale \cdot y-scale\right) \cdot \left(\left(\frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{y-scale \cdot y-scale} - \sqrt{\mathsf{fma}\left({\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}, 4, {\left(\frac{{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2}}{x-scale \cdot x-scale} - \frac{{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}}{y-scale \cdot y-scale}\right)}^{2}\right)}\right) - \frac{{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2}}{x-scale \cdot x-scale}\right)}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}}{\mathsf{PI}\left(\right)} \]
                                  5. Taylor expanded in x-scale around 0

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(\frac{-1}{180} \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot \frac{1}{180}\right)} \cdot \frac{1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites58.8%

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \frac{y-scale \cdot {\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \]
                                  7. Recombined 2 regimes into one program.
                                  8. Final simplification55.3%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2300000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)}^{2} \cdot y-scale}{x-scale} \cdot -2}{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                                  9. Add Preprocessing

                                  Alternative 6: 57.0% accurate, 8.4× speedup?

                                  \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\\ t_1 := \sin \left(t\_0 \cdot 0.005555555555555556\right)\\ t_2 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\ \mathbf{if}\;b\_m \leq 2300000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_1}{t\_2} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{t\_2}{t\_1} \cdot \frac{y-scale}{x-scale}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
                                  b_m = (fabs.f64 b)
                                  (FPCore (a b_m angle x-scale y-scale)
                                   :precision binary64
                                   (let* ((t_0 (* (PI) angle))
                                          (t_1 (sin (* t_0 0.005555555555555556)))
                                          (t_2 (cos (* t_0 -0.005555555555555556))))
                                     (if (<= b_m 2300000000000.0)
                                       (*
                                        (/ (atan (* -0.5 (* (* (/ t_1 t_2) (/ y-scale x-scale)) -2.0))) (PI))
                                        180.0)
                                       (*
                                        (/ (atan (* (* (* (/ t_2 t_1) (/ y-scale x-scale)) 2.0) -0.5)) (PI))
                                        180.0))))
                                  \begin{array}{l}
                                  b_m = \left|b\right|
                                  
                                  \\
                                  \begin{array}{l}
                                  t_0 := \mathsf{PI}\left(\right) \cdot angle\\
                                  t_1 := \sin \left(t\_0 \cdot 0.005555555555555556\right)\\
                                  t_2 := \cos \left(t\_0 \cdot -0.005555555555555556\right)\\
                                  \mathbf{if}\;b\_m \leq 2300000000000:\\
                                  \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{t\_1}{t\_2} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{t\_2}{t\_1} \cdot \frac{y-scale}{x-scale}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if b < 2.3e12

                                    1. Initial program 14.6%

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

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

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}, {\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\right)\right) \cdot y-scale}{\left(x-scale \cdot \cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\right)} \cdot -0.5\right)}}{\mathsf{PI}\left(\right)} \]
                                    5. Taylor expanded in a around inf

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \frac{-1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites54.2%

                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]

                                      if 2.3e12 < b

                                      1. Initial program 11.4%

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

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

                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}, {\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\right)\right) \cdot y-scale}{\left(x-scale \cdot \cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\right)} \cdot -0.5\right)}}{\mathsf{PI}\left(\right)} \]
                                      5. Taylor expanded in a around 0

                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(2 \cdot \frac{y-scale \cdot \cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \frac{-1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites58.8%

                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(2 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]
                                      7. Recombined 2 regimes into one program.
                                      8. Final simplification55.3%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2300000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)}{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                                      9. Add Preprocessing

                                      Alternative 7: 54.4% accurate, 8.4× speedup?

                                      \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot angle\\ \mathbf{if}\;b\_m \leq 2400000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(t\_0 \cdot 0.005555555555555556\right)}{\cos \left(t\_0 \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
                                      b_m = (fabs.f64 b)
                                      (FPCore (a b_m angle x-scale y-scale)
                                       :precision binary64
                                       (let* ((t_0 (* (PI) angle)))
                                         (if (<= b_m 2400000000000.0)
                                           (*
                                            (/
                                             (atan
                                              (*
                                               -0.5
                                               (*
                                                (*
                                                 (/
                                                  (sin (* t_0 0.005555555555555556))
                                                  (cos (* t_0 -0.005555555555555556)))
                                                 (/ y-scale x-scale))
                                                -2.0)))
                                             (PI))
                                            180.0)
                                           (*
                                            (/ (atan (* 90.0 (* (/ y-scale (* (* (PI) x-scale) angle)) -2.0))) (PI))
                                            180.0))))
                                      \begin{array}{l}
                                      b_m = \left|b\right|
                                      
                                      \\
                                      \begin{array}{l}
                                      t_0 := \mathsf{PI}\left(\right) \cdot angle\\
                                      \mathbf{if}\;b\_m \leq 2400000000000:\\
                                      \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(t\_0 \cdot 0.005555555555555556\right)}{\cos \left(t\_0 \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if b < 2.4e12

                                        1. Initial program 14.6%

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

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

                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}, {\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\right)\right) \cdot y-scale}{\left(x-scale \cdot \cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\right)} \cdot -0.5\right)}}{\mathsf{PI}\left(\right)} \]
                                        5. Taylor expanded in a around inf

                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(\frac{-1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot \frac{-1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites54.2%

                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \left(\frac{y-scale}{x-scale} \cdot \frac{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]

                                          if 2.4e12 < b

                                          1. Initial program 11.4%

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

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

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

                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{x-scale \cdot \left(y-scale \cdot \left(2 \cdot \frac{{a}^{2}}{{y-scale}^{2}} - 2 \cdot \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)}{angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                          5. Applied rewrites14.4%

                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{x-scale}{angle} \cdot \frac{\left(2 \cdot \left(\frac{a \cdot a}{y-scale \cdot y-scale} - \frac{b \cdot b}{x-scale \cdot x-scale}\right)\right) \cdot y-scale}{\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                          6. Taylor expanded in a around inf

                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites21.7%

                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                            2. Taylor expanded in a around 0

                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites58.3%

                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                            4. Recombined 2 regimes into one program.
                                            5. Final simplification55.2%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2400000000000:\\ \;\;\;\;\frac{\tan^{-1} \left(-0.5 \cdot \left(\left(\frac{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot -0.005555555555555556\right)} \cdot \frac{y-scale}{x-scale}\right) \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                                            6. Add Preprocessing

                                            Alternative 8: 38.6% accurate, 16.8× speedup?

                                            \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;a \leq 0.55:\\ \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{\left(b\_m - a\right) \cdot \mathsf{PI}\left(\right)} \cdot \left(\frac{b\_m}{x-scale \cdot x-scale} \cdot -2\right)\right) \cdot \frac{x-scale}{angle}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
                                            b_m = (fabs.f64 b)
                                            (FPCore (a b_m angle x-scale y-scale)
                                             :precision binary64
                                             (if (<= a 0.55)
                                               (*
                                                (/ (atan (* 90.0 (* (/ y-scale (* (* (PI) x-scale) angle)) -2.0))) (PI))
                                                180.0)
                                               (*
                                                (/
                                                 (atan
                                                  (*
                                                   (*
                                                    (* (/ y-scale (* (- b_m a) (PI))) (* (/ b_m (* x-scale x-scale)) -2.0))
                                                    (/ x-scale angle))
                                                   90.0))
                                                 (PI))
                                                180.0)))
                                            \begin{array}{l}
                                            b_m = \left|b\right|
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;a \leq 0.55:\\
                                            \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{\left(b\_m - a\right) \cdot \mathsf{PI}\left(\right)} \cdot \left(\frac{b\_m}{x-scale \cdot x-scale} \cdot -2\right)\right) \cdot \frac{x-scale}{angle}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if a < 0.55000000000000004

                                              1. Initial program 15.8%

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

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

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

                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{x-scale \cdot \left(y-scale \cdot \left(2 \cdot \frac{{a}^{2}}{{y-scale}^{2}} - 2 \cdot \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)}{angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                              5. Applied rewrites13.1%

                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{x-scale}{angle} \cdot \frac{\left(2 \cdot \left(\frac{a \cdot a}{y-scale \cdot y-scale} - \frac{b \cdot b}{x-scale \cdot x-scale}\right)\right) \cdot y-scale}{\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                              6. Taylor expanded in a around inf

                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites13.5%

                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                2. Taylor expanded in a around 0

                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites40.0%

                                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]

                                                  if 0.55000000000000004 < a

                                                  1. Initial program 7.9%

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

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

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

                                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{x-scale \cdot \left(y-scale \cdot \left(2 \cdot \frac{{a}^{2}}{{y-scale}^{2}} - 2 \cdot \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)}{angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                                  5. Applied rewrites13.1%

                                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{x-scale}{angle} \cdot \frac{\left(2 \cdot \left(\frac{a \cdot a}{y-scale \cdot y-scale} - \frac{b \cdot b}{x-scale \cdot x-scale}\right)\right) \cdot y-scale}{\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                                  6. Step-by-step derivation
                                                    1. Applied rewrites24.7%

                                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \left(\frac{\left({\left(\frac{a}{y-scale}\right)}^{2} - {\left(\frac{b}{x-scale}\right)}^{2}\right) \cdot 2}{b + a} \cdot \frac{y-scale}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                    2. Taylor expanded in a around 0

                                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \left(\left(-2 \cdot \frac{b}{{x-scale}^{2}}\right) \cdot \frac{y-scale}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites40.0%

                                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \left(\left(-2 \cdot \frac{b}{x-scale \cdot x-scale}\right) \cdot \frac{y-scale}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}\right)\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                    4. Recombined 2 regimes into one program.
                                                    5. Final simplification40.0%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 0.55:\\ \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)} \cdot \left(\frac{b}{x-scale \cdot x-scale} \cdot -2\right)\right) \cdot \frac{x-scale}{angle}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                                                    6. Add Preprocessing

                                                    Alternative 9: 38.8% accurate, 17.6× speedup?

                                                    \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 2.02 \cdot 10^{+108}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right) \cdot 360}{\left(\left(\left(a + b\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b\_m - a\right)\right) \cdot \left(x-scale \cdot angle\right)} \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \end{array} \]
                                                    b_m = (fabs.f64 b)
                                                    (FPCore (a b_m angle x-scale y-scale)
                                                     :precision binary64
                                                     (if (<= b_m 2.02e+108)
                                                       (*
                                                        (/
                                                         (atan
                                                          (*
                                                           (/
                                                            (* (* (* b_m b_m) y-scale) 360.0)
                                                            (* (* (* (+ a b_m) (PI)) (- b_m a)) (* x-scale angle)))
                                                           -0.5))
                                                         (PI))
                                                        180.0)
                                                       (*
                                                        (/ (atan (* 90.0 (* (/ y-scale (* (* (PI) x-scale) angle)) -2.0))) (PI))
                                                        180.0)))
                                                    \begin{array}{l}
                                                    b_m = \left|b\right|
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;b\_m \leq 2.02 \cdot 10^{+108}:\\
                                                    \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right) \cdot 360}{\left(\left(\left(a + b\_m\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b\_m - a\right)\right) \cdot \left(x-scale \cdot angle\right)} \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 2 regimes
                                                    2. if b < 2.02000000000000007e108

                                                      1. Initial program 15.5%

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

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

                                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}, {\cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)}^{2} \cdot \left(b \cdot b\right)\right)\right) \cdot y-scale}{\left(x-scale \cdot \cos \left(-0.005555555555555556 \cdot \left(\mathsf{PI}\left(\right) \cdot angle\right)\right)\right) \cdot \left(\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\right)} \cdot -0.5\right)}}{\mathsf{PI}\left(\right)} \]
                                                      5. Taylor expanded in angle around 0

                                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(360 \cdot \frac{{b}^{2} \cdot y-scale}{angle \cdot \left(x-scale \cdot \left(\mathsf{PI}\left(\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)}\right) \cdot \frac{-1}{2}\right)}{\mathsf{PI}\left(\right)} \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites28.3%

                                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{360 \cdot \left(\left(b \cdot b\right) \cdot y-scale\right)}{\left(angle \cdot x-scale\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)} \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \]

                                                        if 2.02000000000000007e108 < b

                                                        1. Initial program 6.4%

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

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

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

                                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{x-scale \cdot \left(y-scale \cdot \left(2 \cdot \frac{{a}^{2}}{{y-scale}^{2}} - 2 \cdot \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)}{angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                                        5. Applied rewrites8.6%

                                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{x-scale}{angle} \cdot \frac{\left(2 \cdot \left(\frac{a \cdot a}{y-scale \cdot y-scale} - \frac{b \cdot b}{x-scale \cdot x-scale}\right)\right) \cdot y-scale}{\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                                        6. Taylor expanded in a around inf

                                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                        7. Step-by-step derivation
                                                          1. Applied rewrites25.4%

                                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                          2. Taylor expanded in a around 0

                                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites60.5%

                                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                          4. Recombined 2 regimes into one program.
                                                          5. Final simplification34.3%

                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.02 \cdot 10^{+108}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\left(\left(b \cdot b\right) \cdot y-scale\right) \cdot 360}{\left(\left(\left(a + b\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b - a\right)\right) \cdot \left(x-scale \cdot angle\right)} \cdot -0.5\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180\\ \end{array} \]
                                                          6. Add Preprocessing

                                                          Alternative 10: 37.5% accurate, 21.5× speedup?

                                                          \[\begin{array}{l} b_m = \left|b\right| \\ \frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180 \end{array} \]
                                                          b_m = (fabs.f64 b)
                                                          (FPCore (a b_m angle x-scale y-scale)
                                                           :precision binary64
                                                           (*
                                                            (/ (atan (* 90.0 (* (/ y-scale (* (* (PI) x-scale) angle)) -2.0))) (PI))
                                                            180.0))
                                                          \begin{array}{l}
                                                          b_m = \left|b\right|
                                                          
                                                          \\
                                                          \frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Initial program 13.8%

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

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

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

                                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{x-scale \cdot \left(y-scale \cdot \left(2 \cdot \frac{{a}^{2}}{{y-scale}^{2}} - 2 \cdot \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)}{angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                                          5. Applied rewrites13.1%

                                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{x-scale}{angle} \cdot \frac{\left(2 \cdot \left(\frac{a \cdot a}{y-scale \cdot y-scale} - \frac{b \cdot b}{x-scale \cdot x-scale}\right)\right) \cdot y-scale}{\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                                          6. Taylor expanded in a around inf

                                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites12.0%

                                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                            2. Taylor expanded in a around 0

                                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites38.2%

                                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                              2. Final simplification38.2%

                                                                \[\leadsto \frac{\tan^{-1} \left(90 \cdot \left(\frac{y-scale}{\left(\mathsf{PI}\left(\right) \cdot x-scale\right) \cdot angle} \cdot -2\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180 \]
                                                              3. Add Preprocessing

                                                              Alternative 11: 12.1% accurate, 21.5× speedup?

                                                              \[\begin{array}{l} b_m = \left|b\right| \\ \frac{\tan^{-1} \left(\left(\frac{x-scale}{\left(\mathsf{PI}\left(\right) \cdot y-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \cdot 180 \end{array} \]
                                                              b_m = (fabs.f64 b)
                                                              (FPCore (a b_m angle x-scale y-scale)
                                                               :precision binary64
                                                               (*
                                                                (/ (atan (* (* (/ x-scale (* (* (PI) y-scale) angle)) -2.0) 90.0)) (PI))
                                                                180.0))
                                                              \begin{array}{l}
                                                              b_m = \left|b\right|
                                                              
                                                              \\
                                                              \frac{\tan^{-1} \left(\left(\frac{x-scale}{\left(\mathsf{PI}\left(\right) \cdot y-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \cdot 180
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Initial program 13.8%

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

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

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

                                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{x-scale \cdot \left(y-scale \cdot \left(2 \cdot \frac{{a}^{2}}{{y-scale}^{2}} - 2 \cdot \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)}{angle \cdot \left(\mathsf{PI}\left(\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)} \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                                              5. Applied rewrites13.1%

                                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left(\frac{x-scale}{angle} \cdot \frac{\left(2 \cdot \left(\frac{a \cdot a}{y-scale \cdot y-scale} - \frac{b \cdot b}{x-scale \cdot x-scale}\right)\right) \cdot y-scale}{\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}}{\mathsf{PI}\left(\right)} \]
                                                              6. Taylor expanded in a around inf

                                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites12.0%

                                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                                2. Taylor expanded in a around inf

                                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites12.1%

                                                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                                  2. Final simplification12.1%

                                                                    \[\leadsto \frac{\tan^{-1} \left(\left(\frac{x-scale}{\left(\mathsf{PI}\left(\right) \cdot y-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \cdot 180 \]
                                                                  3. Add Preprocessing

                                                                  Reproduce

                                                                  ?
                                                                  herbie shell --seed 2024312 
                                                                  (FPCore (a b angle x-scale y-scale)
                                                                    :name "raw-angle from scale-rotated-ellipse"
                                                                    :precision binary64
                                                                    (* 180.0 (/ (atan (/ (- (- (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (sin (* (/ angle 180.0) (PI)))) 2.0)) y-scale) y-scale) (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0)) x-scale) x-scale)) (sqrt (+ (pow (- (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0)) x-scale) x-scale) (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (sin (* (/ angle 180.0) (PI)))) 2.0)) y-scale) y-scale)) 2.0) (pow (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) (PI)))) (cos (* (/ angle 180.0) (PI)))) x-scale) y-scale) 2.0)))) (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) (PI)))) (cos (* (/ angle 180.0) (PI)))) x-scale) y-scale))) (PI))))