raw-angle from scale-rotated-ellipse

Percentage Accurate: 13.3% → 55.2%
Time: 39.4s
Alternatives: 13
Speedup: 22.2×

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 13 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: 13.3% 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: 55.2% accurate, 4.3× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \sqrt{\mathsf{PI}\left(\right)}\\ t_1 := \mathsf{PI}\left(\right) \cdot angle\\ t_2 := angle \cdot \mathsf{PI}\left(\right)\\ t_3 := 0.005555555555555556 \cdot t\_2\\ t_4 := \sin t\_3\\ t_5 := \cos t\_3\\ t_6 := \sin \left(t\_1 \cdot 0.005555555555555556\right)\\ \mathbf{if}\;a\_m \leq 1.15 \cdot 10^{-79}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale \cdot {t\_5}^{2}}{x-scale}}{\cos \left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot t\_0\right) \cdot t\_0\right) \cdot t\_4}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;a\_m \leq 2.45 \cdot 10^{-11}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(\left(2 \cdot \frac{\left(a\_m \cdot a\_m\right) \cdot t\_4}{x-scale \cdot \cos \left(-0.005555555555555556 \cdot t\_2\right)}\right) \cdot \frac{y-scale}{\left(b - a\_m\right) \cdot \left(b + a\_m\right)}\right)\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;a\_m \leq 3.2 \cdot 10^{+111}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(-0.5 \cdot \frac{y-scale}{x-scale}\right) \cdot \frac{\left({\left(t\_6 \cdot a\_m\right)}^{2} + {\left(b \cdot \cos \left(t\_1 \cdot -0.005555555555555556\right)\right)}^{2}\right) \cdot 2}{\left(t\_6 \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_4}{t\_5}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
a_m = (fabs.f64 a)
(FPCore (a_m b angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (sqrt (PI)))
        (t_1 (* (PI) angle))
        (t_2 (* angle (PI)))
        (t_3 (* 0.005555555555555556 t_2))
        (t_4 (sin t_3))
        (t_5 (cos t_3))
        (t_6 (sin (* t_1 0.005555555555555556))))
   (if (<= a_m 1.15e-79)
     (*
      180.0
      (/
       (atan
        (*
         0.5
         (/
          (* -2.0 (/ (* y-scale (pow t_5 2.0)) x-scale))
          (* (cos (* (* (* 0.005555555555555556 angle) t_0) t_0)) t_4))))
       (PI)))
     (if (<= a_m 2.45e-11)
       (*
        180.0
        (/
         (atan
          (*
           -0.5
           (*
            (*
             2.0
             (/
              (* (* a_m a_m) t_4)
              (* x-scale (cos (* -0.005555555555555556 t_2)))))
            (/ y-scale (* (- b a_m) (+ b a_m))))))
         (PI)))
       (if (<= a_m 3.2e+111)
         (/
          (*
           (atan
            (*
             (* -0.5 (/ y-scale x-scale))
             (/
              (*
               (+
                (pow (* t_6 a_m) 2.0)
                (pow (* b (cos (* t_1 -0.005555555555555556))) 2.0))
               2.0)
              (* (* t_6 (- b a_m)) (+ b a_m)))))
           180.0)
          (PI))
         (* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_4 t_5))) (PI))))))))
\begin{array}{l}
a_m = \left|a\right|

\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
t_1 := \mathsf{PI}\left(\right) \cdot angle\\
t_2 := angle \cdot \mathsf{PI}\left(\right)\\
t_3 := 0.005555555555555556 \cdot t\_2\\
t_4 := \sin t\_3\\
t_5 := \cos t\_3\\
t_6 := \sin \left(t\_1 \cdot 0.005555555555555556\right)\\
\mathbf{if}\;a\_m \leq 1.15 \cdot 10^{-79}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale \cdot {t\_5}^{2}}{x-scale}}{\cos \left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot t\_0\right) \cdot t\_0\right) \cdot t\_4}\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;a\_m \leq 2.45 \cdot 10^{-11}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(\left(2 \cdot \frac{\left(a\_m \cdot a\_m\right) \cdot t\_4}{x-scale \cdot \cos \left(-0.005555555555555556 \cdot t\_2\right)}\right) \cdot \frac{y-scale}{\left(b - a\_m\right) \cdot \left(b + a\_m\right)}\right)\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;a\_m \leq 3.2 \cdot 10^{+111}:\\
\;\;\;\;\frac{\tan^{-1} \left(\left(-0.5 \cdot \frac{y-scale}{x-scale}\right) \cdot \frac{\left({\left(t\_6 \cdot a\_m\right)}^{2} + {\left(b \cdot \cos \left(t\_1 \cdot -0.005555555555555556\right)\right)}^{2}\right) \cdot 2}{\left(t\_6 \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_4}{t\_5}\right)}{\mathsf{PI}\left(\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < 1.15000000000000006e-79

    1. Initial program 16.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 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 rewrites27.6%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \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}}{\color{blue}{\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)} \]
    6. Step-by-step derivation
      1. Applied rewrites51.5%

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \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(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sin \left(\color{blue}{0.005555555555555556} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]

        if 1.15000000000000006e-79 < a < 2.4499999999999999e-11

        1. Initial program 12.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 rewrites42.9%

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-0.5 \cdot \frac{y-scale \cdot \left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, \left(b \cdot b\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)\right)}{\left(x-scale \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - a \cdot a\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
        5. Applied rewrites35.9%

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \left(\left(2 \cdot \frac{{a}^{2} \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{\color{blue}{y-scale}}{\left(b - a\right) \cdot \left(b + a\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        7. Step-by-step derivation
          1. Applied rewrites49.0%

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

          if 2.4499999999999999e-11 < a < 3.2000000000000001e111

          1. Initial program 19.3%

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, \left(b \cdot b\right) \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(b \cdot b - a \cdot a\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites50.3%

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, \left(b \cdot b\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\color{blue}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(b \cdot b - a \cdot a\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
            2. Applied rewrites73.2%

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

            if 3.2000000000000001e111 < a

            1. Initial program 0.1%

              \[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 rewrites18.8%

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \color{blue}{\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)}{\mathsf{PI}\left(\right)} \]
            7. Recombined 4 regimes into one program.
            8. Add Preprocessing

            Alternative 2: 41.5% accurate, 0.9× speedup?

            \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ t_1 := \cos t\_0\\ t_2 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ t_3 := \sin t\_0\\ t_4 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot t\_3\right) \cdot t\_1}{x-scale}}{y-scale}\\ t_5 := \frac{\frac{{\left(a\_m \cdot t\_3\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\ t_6 := \frac{\frac{{\left(a\_m \cdot t\_1\right)}^{2} + {\left(b \cdot t\_3\right)}^{2}}{y-scale}}{y-scale}\\ \mathbf{if}\;\frac{\left(t\_6 - t\_5\right) - \sqrt{{\left(t\_5 - t\_6\right)}^{2} + {t\_4}^{2}}}{t\_4} \leq 10^{+290}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 \cdot \mathsf{fma}\left(angle \cdot angle, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot t\_2, 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a\_m \cdot a\_m\right) \cdot t\_2\right)\right), b \cdot b\right)\right)}{x-scale \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - a\_m \cdot a\_m\right)\right)}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(x-scale \cdot \left(-2 \cdot \frac{y-scale}{angle \cdot \left(\left(x-scale \cdot x-scale\right) \cdot \mathsf{PI}\left(\right)\right)}\right)\right)\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
            a_m = (fabs.f64 a)
            (FPCore (a_m b angle x-scale y-scale)
             :precision binary64
             (let* ((t_0 (* (/ angle 180.0) (PI)))
                    (t_1 (cos t_0))
                    (t_2 (* (PI) (PI)))
                    (t_3 (sin t_0))
                    (t_4
                     (/
                      (/ (* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) t_3) t_1) x-scale)
                      y-scale))
                    (t_5
                     (/ (/ (+ (pow (* a_m t_3) 2.0) (pow (* b t_1) 2.0)) x-scale) x-scale))
                    (t_6
                     (/
                      (/ (+ (pow (* a_m t_1) 2.0) (pow (* b t_3) 2.0)) y-scale)
                      y-scale)))
               (if (<=
                    (/ (- (- t_6 t_5) (sqrt (+ (pow (- t_5 t_6) 2.0) (pow t_4 2.0)))) t_4)
                    1e+290)
                 (*
                  180.0
                  (/
                   (atan
                    (*
                     -0.5
                     (/
                      (*
                       y-scale
                       (*
                        2.0
                        (fma
                         (* angle angle)
                         (fma
                          -3.08641975308642e-5
                          (* (* b b) t_2)
                          (* 3.08641975308642e-5 (* (* a_m a_m) t_2)))
                         (* b b))))
                      (*
                       x-scale
                       (*
                        (sin (* 0.005555555555555556 (* angle (PI))))
                        (- (* b b) (* a_m a_m)))))))
                   (PI)))
                 (*
                  180.0
                  (/
                   (atan
                    (*
                     90.0
                     (*
                      x-scale
                      (* -2.0 (/ y-scale (* angle (* (* x-scale x-scale) (PI))))))))
                   (PI))))))
            \begin{array}{l}
            a_m = \left|a\right|
            
            \\
            \begin{array}{l}
            t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
            t_1 := \cos t\_0\\
            t_2 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
            t_3 := \sin t\_0\\
            t_4 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot t\_3\right) \cdot t\_1}{x-scale}}{y-scale}\\
            t_5 := \frac{\frac{{\left(a\_m \cdot t\_3\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{x-scale}}{x-scale}\\
            t_6 := \frac{\frac{{\left(a\_m \cdot t\_1\right)}^{2} + {\left(b \cdot t\_3\right)}^{2}}{y-scale}}{y-scale}\\
            \mathbf{if}\;\frac{\left(t\_6 - t\_5\right) - \sqrt{{\left(t\_5 - t\_6\right)}^{2} + {t\_4}^{2}}}{t\_4} \leq 10^{+290}:\\
            \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 \cdot \mathsf{fma}\left(angle \cdot angle, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot t\_2, 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a\_m \cdot a\_m\right) \cdot t\_2\right)\right), b \cdot b\right)\right)}{x-scale \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - a\_m \cdot a\_m\right)\right)}\right)}{\mathsf{PI}\left(\right)}\\
            
            \mathbf{else}:\\
            \;\;\;\;180 \cdot \frac{\tan^{-1} \left(90 \cdot \left(x-scale \cdot \left(-2 \cdot \frac{y-scale}{angle \cdot \left(\left(x-scale \cdot x-scale\right) \cdot \mathsf{PI}\left(\right)\right)}\right)\right)\right)}{\mathsf{PI}\left(\right)}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (/.f64 (-.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale)) (sqrt.f64 (+.f64 (pow.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale)) #s(literal 2 binary64)) (pow.f64 (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale) #s(literal 2 binary64))))) (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale)) < 1.00000000000000006e290

              1. Initial program 47.0%

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

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

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

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

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

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 \cdot \mathsf{fma}\left(angle \cdot angle, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(a \cdot a\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right), b \cdot b\right)\right)}{x-scale \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - a \cdot a\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]

                  if 1.00000000000000006e290 < (/.f64 (-.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale)) (sqrt.f64 (+.f64 (pow.f64 (-.f64 (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) x-scale) x-scale) (/.f64 (/.f64 (+.f64 (pow.f64 (*.f64 a (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) y-scale) y-scale)) #s(literal 2 binary64)) (pow.f64 (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale) #s(literal 2 binary64))))) (/.f64 (/.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) x-scale) y-scale))

                  1. Initial program 7.3%

                    \[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. Applied rewrites9.8%

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

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

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

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

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

                      Alternative 3: 55.1% accurate, 4.3× speedup?

                      \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \sqrt{\mathsf{PI}\left(\right)}\\ t_1 := \mathsf{PI}\left(\right) \cdot angle\\ t_2 := angle \cdot \mathsf{PI}\left(\right)\\ t_3 := 0.005555555555555556 \cdot t\_2\\ t_4 := \sin t\_3\\ t_5 := \cos t\_3\\ t_6 := \sin \left(t\_1 \cdot 0.005555555555555556\right)\\ \mathbf{if}\;a\_m \leq 1.15 \cdot 10^{-79}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale \cdot {t\_5}^{2}}{x-scale}}{\cos \left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot t\_0\right) \cdot t\_0\right) \cdot t\_4}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;a\_m \leq 4.4 \cdot 10^{-13}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(\left(2 \cdot \frac{\left(a\_m \cdot a\_m\right) \cdot t\_4}{x-scale \cdot \cos \left(-0.005555555555555556 \cdot t\_2\right)}\right) \cdot \frac{y-scale}{\left(b - a\_m\right) \cdot \left(b + a\_m\right)}\right)\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;a\_m \leq 3 \cdot 10^{+111}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\left(y-scale \cdot 2\right) \cdot \left({\left(t\_6 \cdot a\_m\right)}^{2} + {\left(b \cdot \cos \left(t\_1 \cdot -0.005555555555555556\right)\right)}^{2}\right)}{x-scale} \cdot -0.5}{\left(t\_6 \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_4}{t\_5}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                      a_m = (fabs.f64 a)
                      (FPCore (a_m b angle x-scale y-scale)
                       :precision binary64
                       (let* ((t_0 (sqrt (PI)))
                              (t_1 (* (PI) angle))
                              (t_2 (* angle (PI)))
                              (t_3 (* 0.005555555555555556 t_2))
                              (t_4 (sin t_3))
                              (t_5 (cos t_3))
                              (t_6 (sin (* t_1 0.005555555555555556))))
                         (if (<= a_m 1.15e-79)
                           (*
                            180.0
                            (/
                             (atan
                              (*
                               0.5
                               (/
                                (* -2.0 (/ (* y-scale (pow t_5 2.0)) x-scale))
                                (* (cos (* (* (* 0.005555555555555556 angle) t_0) t_0)) t_4))))
                             (PI)))
                           (if (<= a_m 4.4e-13)
                             (*
                              180.0
                              (/
                               (atan
                                (*
                                 -0.5
                                 (*
                                  (*
                                   2.0
                                   (/
                                    (* (* a_m a_m) t_4)
                                    (* x-scale (cos (* -0.005555555555555556 t_2)))))
                                  (/ y-scale (* (- b a_m) (+ b a_m))))))
                               (PI)))
                             (if (<= a_m 3e+111)
                               (*
                                180.0
                                (/
                                 (atan
                                  (/
                                   (*
                                    (/
                                     (*
                                      (* y-scale 2.0)
                                      (+
                                       (pow (* t_6 a_m) 2.0)
                                       (pow (* b (cos (* t_1 -0.005555555555555556))) 2.0)))
                                     x-scale)
                                    -0.5)
                                   (* (* t_6 (- b a_m)) (+ b a_m))))
                                 (PI)))
                               (* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_4 t_5))) (PI))))))))
                      \begin{array}{l}
                      a_m = \left|a\right|
                      
                      \\
                      \begin{array}{l}
                      t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
                      t_1 := \mathsf{PI}\left(\right) \cdot angle\\
                      t_2 := angle \cdot \mathsf{PI}\left(\right)\\
                      t_3 := 0.005555555555555556 \cdot t\_2\\
                      t_4 := \sin t\_3\\
                      t_5 := \cos t\_3\\
                      t_6 := \sin \left(t\_1 \cdot 0.005555555555555556\right)\\
                      \mathbf{if}\;a\_m \leq 1.15 \cdot 10^{-79}:\\
                      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale \cdot {t\_5}^{2}}{x-scale}}{\cos \left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot t\_0\right) \cdot t\_0\right) \cdot t\_4}\right)}{\mathsf{PI}\left(\right)}\\
                      
                      \mathbf{elif}\;a\_m \leq 4.4 \cdot 10^{-13}:\\
                      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \left(\left(2 \cdot \frac{\left(a\_m \cdot a\_m\right) \cdot t\_4}{x-scale \cdot \cos \left(-0.005555555555555556 \cdot t\_2\right)}\right) \cdot \frac{y-scale}{\left(b - a\_m\right) \cdot \left(b + a\_m\right)}\right)\right)}{\mathsf{PI}\left(\right)}\\
                      
                      \mathbf{elif}\;a\_m \leq 3 \cdot 10^{+111}:\\
                      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\left(y-scale \cdot 2\right) \cdot \left({\left(t\_6 \cdot a\_m\right)}^{2} + {\left(b \cdot \cos \left(t\_1 \cdot -0.005555555555555556\right)\right)}^{2}\right)}{x-scale} \cdot -0.5}{\left(t\_6 \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)}\right)}{\mathsf{PI}\left(\right)}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_4}{t\_5}\right)}{\mathsf{PI}\left(\right)}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if a < 1.15000000000000006e-79

                        1. Initial program 16.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 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 rewrites27.6%

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \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}}{\color{blue}{\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)} \]
                        6. Step-by-step derivation
                          1. Applied rewrites51.5%

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \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(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sin \left(\color{blue}{0.005555555555555556} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]

                            if 1.15000000000000006e-79 < a < 4.39999999999999993e-13

                            1. Initial program 12.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 rewrites42.9%

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-0.5 \cdot \frac{y-scale \cdot \left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, \left(b \cdot b\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)\right)}{\left(x-scale \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(b \cdot b - a \cdot a\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
                            5. Applied rewrites35.9%

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \left(\left(2 \cdot \frac{{a}^{2} \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{\color{blue}{y-scale}}{\left(b - a\right) \cdot \left(b + a\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
                            7. Step-by-step derivation
                              1. Applied rewrites49.0%

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

                              if 4.39999999999999993e-13 < a < 3e111

                              1. Initial program 19.3%

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

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, \left(b \cdot b\right) \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(b \cdot b - a \cdot a\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
                              6. Step-by-step derivation
                                1. Applied rewrites50.3%

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, \left(b \cdot b\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\color{blue}{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot \left(b \cdot b - a \cdot a\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
                                2. Applied rewrites73.1%

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

                                if 3e111 < a

                                1. Initial program 0.1%

                                  \[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 rewrites18.8%

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

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

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \color{blue}{\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)}{\mathsf{PI}\left(\right)} \]
                                7. Recombined 4 regimes into one program.
                                8. Add Preprocessing

                                Alternative 4: 51.7% accurate, 4.5× speedup?

                                \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\ t_1 := \sin t\_0\\ t_2 := \sqrt{\mathsf{PI}\left(\right)}\\ t_3 := \left(\left(0.005555555555555556 \cdot angle\right) \cdot t\_2\right) \cdot t\_2\\ t_4 := \cos t\_0\\ t_5 := \mathsf{fma}\left(0.005555555555555556 \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\\ t_6 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\\ \mathbf{if}\;b \leq 1.1 \cdot 10^{-80}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_1}{t\_4}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;b \leq 7.6 \cdot 10^{-14}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale \cdot \frac{\sin \left(t\_5 - t\_6\right) + \sin \left(t\_5 + t\_6\right)}{2}}{x-scale}}{t\_4 \cdot \sin t\_3}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale \cdot {t\_4}^{2}}{x-scale}}{\cos t\_3 \cdot t\_1}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                                a_m = (fabs.f64 a)
                                (FPCore (a_m b angle x-scale y-scale)
                                 :precision binary64
                                 (let* ((t_0 (* 0.005555555555555556 (* angle (PI))))
                                        (t_1 (sin t_0))
                                        (t_2 (sqrt (PI)))
                                        (t_3 (* (* (* 0.005555555555555556 angle) t_2) t_2))
                                        (t_4 (cos t_0))
                                        (t_5 (fma (* 0.005555555555555556 angle) (PI) (/ (PI) 2.0)))
                                        (t_6 (* (* (PI) angle) 0.005555555555555556)))
                                   (if (<= b 1.1e-80)
                                     (* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_1 t_4))) (PI)))
                                     (if (<= b 7.6e-14)
                                       (*
                                        180.0
                                        (/
                                         (atan
                                          (*
                                           0.5
                                           (/
                                            (*
                                             -2.0
                                             (/
                                              (* y-scale (/ (+ (sin (- t_5 t_6)) (sin (+ t_5 t_6))) 2.0))
                                              x-scale))
                                            (* t_4 (sin t_3)))))
                                         (PI)))
                                       (*
                                        180.0
                                        (/
                                         (atan
                                          (*
                                           0.5
                                           (/
                                            (* -2.0 (/ (* y-scale (pow t_4 2.0)) x-scale))
                                            (* (cos t_3) t_1))))
                                         (PI)))))))
                                \begin{array}{l}
                                a_m = \left|a\right|
                                
                                \\
                                \begin{array}{l}
                                t_0 := 0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\
                                t_1 := \sin t\_0\\
                                t_2 := \sqrt{\mathsf{PI}\left(\right)}\\
                                t_3 := \left(\left(0.005555555555555556 \cdot angle\right) \cdot t\_2\right) \cdot t\_2\\
                                t_4 := \cos t\_0\\
                                t_5 := \mathsf{fma}\left(0.005555555555555556 \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\\
                                t_6 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\\
                                \mathbf{if}\;b \leq 1.1 \cdot 10^{-80}:\\
                                \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_1}{t\_4}\right)}{\mathsf{PI}\left(\right)}\\
                                
                                \mathbf{elif}\;b \leq 7.6 \cdot 10^{-14}:\\
                                \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale \cdot \frac{\sin \left(t\_5 - t\_6\right) + \sin \left(t\_5 + t\_6\right)}{2}}{x-scale}}{t\_4 \cdot \sin t\_3}\right)}{\mathsf{PI}\left(\right)}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{-2 \cdot \frac{y-scale \cdot {t\_4}^{2}}{x-scale}}{\cos t\_3 \cdot t\_1}\right)}{\mathsf{PI}\left(\right)}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if b < 1.10000000000000005e-80

                                  1. Initial program 13.1%

                                    \[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 rewrites32.8%

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

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

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \color{blue}{\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)}{\mathsf{PI}\left(\right)} \]

                                    if 1.10000000000000005e-80 < b < 7.6000000000000004e-14

                                    1. Initial program 54.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 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 rewrites38.9%

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

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \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}}{\color{blue}{\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)} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites62.9%

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

                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \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(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
                                        2. Step-by-step derivation
                                          1. Applied rewrites71.2%

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

                                          if 7.6000000000000004e-14 < b

                                          1. Initial program 9.7%

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

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

                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \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}}{\color{blue}{\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)} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites54.7%

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

                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \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(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sin \left(\color{blue}{0.005555555555555556} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
                                            3. Recombined 3 regimes into one program.
                                            4. Add Preprocessing

                                            Alternative 5: 51.6% accurate, 5.0× speedup?

                                            \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \sqrt{\mathsf{PI}\left(\right)}\\ t_1 := 0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\ t_2 := \cos t\_1\\ t_3 := \left(\left(0.005555555555555556 \cdot angle\right) \cdot t\_0\right) \cdot t\_0\\ t_4 := \sin t\_1\\ t_5 := -2 \cdot \frac{y-scale \cdot {t\_2}^{2}}{x-scale}\\ \mathbf{if}\;b \leq 1.1 \cdot 10^{-80}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_4}{t\_2}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;b \leq 1.4 \cdot 10^{-20}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{t\_5}{\sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \sin t\_3}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{t\_5}{\cos t\_3 \cdot t\_4}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                                            a_m = (fabs.f64 a)
                                            (FPCore (a_m b angle x-scale y-scale)
                                             :precision binary64
                                             (let* ((t_0 (sqrt (PI)))
                                                    (t_1 (* 0.005555555555555556 (* angle (PI))))
                                                    (t_2 (cos t_1))
                                                    (t_3 (* (* (* 0.005555555555555556 angle) t_0) t_0))
                                                    (t_4 (sin t_1))
                                                    (t_5 (* -2.0 (/ (* y-scale (pow t_2 2.0)) x-scale))))
                                               (if (<= b 1.1e-80)
                                                 (* 180.0 (/ (atan (* (/ y-scale x-scale) (/ t_4 t_2))) (PI)))
                                                 (if (<= b 1.4e-20)
                                                   (*
                                                    180.0
                                                    (/
                                                     (atan
                                                      (*
                                                       0.5
                                                       (/
                                                        t_5
                                                        (*
                                                         (sin (fma (* 0.005555555555555556 angle) (PI) (/ (PI) 2.0)))
                                                         (sin t_3)))))
                                                     (PI)))
                                                   (* 180.0 (/ (atan (* 0.5 (/ t_5 (* (cos t_3) t_4)))) (PI)))))))
                                            \begin{array}{l}
                                            a_m = \left|a\right|
                                            
                                            \\
                                            \begin{array}{l}
                                            t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
                                            t_1 := 0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\
                                            t_2 := \cos t\_1\\
                                            t_3 := \left(\left(0.005555555555555556 \cdot angle\right) \cdot t\_0\right) \cdot t\_0\\
                                            t_4 := \sin t\_1\\
                                            t_5 := -2 \cdot \frac{y-scale \cdot {t\_2}^{2}}{x-scale}\\
                                            \mathbf{if}\;b \leq 1.1 \cdot 10^{-80}:\\
                                            \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_4}{t\_2}\right)}{\mathsf{PI}\left(\right)}\\
                                            
                                            \mathbf{elif}\;b \leq 1.4 \cdot 10^{-20}:\\
                                            \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{t\_5}{\sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle, \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot \sin t\_3}\right)}{\mathsf{PI}\left(\right)}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{t\_5}{\cos t\_3 \cdot t\_4}\right)}{\mathsf{PI}\left(\right)}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if b < 1.10000000000000005e-80

                                              1. Initial program 13.1%

                                                \[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 rewrites32.8%

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

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

                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \color{blue}{\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)}{\mathsf{PI}\left(\right)} \]

                                                if 1.10000000000000005e-80 < b < 1.4000000000000001e-20

                                                1. Initial program 59.0%

                                                  \[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 rewrites33.8%

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

                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \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}}{\color{blue}{\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)} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites67.9%

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

                                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \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(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
                                                    2. Step-by-step derivation
                                                      1. Applied rewrites77.9%

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

                                                      if 1.4000000000000001e-20 < b

                                                      1. Initial program 9.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 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 rewrites27.7%

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

                                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \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}}{\color{blue}{\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)} \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites54.0%

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

                                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \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(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sin \left(\color{blue}{0.005555555555555556} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
                                                        3. Recombined 3 regimes into one program.
                                                        4. Add Preprocessing

                                                        Alternative 6: 51.6% accurate, 5.1× speedup?

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

                                                          1. Initial program 13.1%

                                                            \[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 rewrites32.8%

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

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

                                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \color{blue}{\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)}{\mathsf{PI}\left(\right)} \]

                                                            if 1.2e-80 < b

                                                            1. Initial program 17.1%

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

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

                                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \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}}{\color{blue}{\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)} \]
                                                            6. Step-by-step derivation
                                                              1. Applied rewrites56.1%

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

                                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \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(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sin \left(\color{blue}{0.005555555555555556} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
                                                              3. Recombined 2 regimes into one program.
                                                              4. Add Preprocessing

                                                              Alternative 7: 51.7% accurate, 5.2× speedup?

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

                                                                1. Initial program 13.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 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 rewrites33.7%

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

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

                                                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \color{blue}{\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)}{\mathsf{PI}\left(\right)} \]

                                                                  if 7.6000000000000003e-64 < b

                                                                  1. Initial program 15.3%

                                                                    \[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 rewrites28.8%

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

                                                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \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}}{\color{blue}{\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)} \]
                                                                  6. Step-by-step derivation
                                                                    1. Applied rewrites57.7%

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

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

                                                                    Alternative 8: 51.7% accurate, 6.1× speedup?

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

                                                                      1. Initial program 13.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 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 rewrites33.7%

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

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

                                                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \color{blue}{\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)}{\mathsf{PI}\left(\right)} \]

                                                                        if 7.6000000000000003e-64 < b

                                                                        1. Initial program 15.3%

                                                                          \[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 rewrites28.8%

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

                                                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \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}}{\color{blue}{\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)} \]
                                                                        6. Step-by-step derivation
                                                                          1. Applied rewrites57.7%

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

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

                                                                          Alternative 9: 51.7% accurate, 8.5× speedup?

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

                                                                            1. Initial program 13.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 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 rewrites33.7%

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

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

                                                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \color{blue}{\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)}{\mathsf{PI}\left(\right)} \]

                                                                              if 7.6000000000000003e-64 < b

                                                                              1. Initial program 15.3%

                                                                                \[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 rewrites28.8%

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

                                                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \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}}{\color{blue}{\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)} \]
                                                                              6. Step-by-step derivation
                                                                                1. Applied rewrites57.7%

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

                                                                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \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(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}\right)}{\mathsf{PI}\left(\right)} \]
                                                                                  2. Taylor expanded in x-scale around 0

                                                                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-1 \cdot \color{blue}{\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)}{\mathsf{PI}\left(\right)} \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites57.7%

                                                                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \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)}{\mathsf{PI}\left(\right)} \]
                                                                                  4. Recombined 2 regimes into one program.
                                                                                  5. Final simplification49.7%

                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 7.6 \cdot 10^{-64}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \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)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \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)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                                                                                  6. Add Preprocessing

                                                                                  Alternative 10: 54.2% accurate, 8.6× speedup?

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

                                                                                    1. Initial program 17.0%

                                                                                      \[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. Applied rewrites15.4%

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

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

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

                                                                                        if 9.79999999999999961e-84 < a

                                                                                        1. Initial program 8.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 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 rewrites33.7%

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

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

                                                                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \color{blue}{\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)}{\mathsf{PI}\left(\right)} \]
                                                                                        7. Recombined 2 regimes into one program.
                                                                                        8. Add Preprocessing

                                                                                        Alternative 11: 39.0% accurate, 20.1× speedup?

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

                                                                                          \[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. Applied rewrites12.7%

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

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

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

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

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

                                                                                              Alternative 12: 38.0% accurate, 22.2× speedup?

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

                                                                                                \[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. Applied rewrites12.7%

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

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

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

                                                                                                  Alternative 13: 12.6% accurate, 22.2× speedup?

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

                                                                                                    \[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. Applied rewrites12.7%

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

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

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

                                                                                                      Reproduce

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