raw-angle from scale-rotated-ellipse

Percentage Accurate: 14.2% → 57.9%
Time: 26.8s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 14.2% accurate, 1.0× speedup?

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

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

Alternative 1: 57.9% accurate, 8.6× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\ t_1 := \sin t\_0\\ \mathbf{if}\;b\_m \leq 118000:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \frac{t\_1}{\cos t\_0}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\cos \left(\mathsf{fma}\left(-0.005555555555555556 \cdot \mathsf{PI}\left(\right), angle, \mathsf{PI}\left(\right)\right)\right), y-scale, 0\right)}{x-scale \cdot t\_1}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* 0.005555555555555556 (* angle (PI)))) (t_1 (sin t_0)))
   (if (<= b_m 118000.0)
     (/ (* (atan (* (/ y-scale x-scale) (/ t_1 (cos t_0)))) 180.0) (PI))
     (/
      (*
       (atan
        (/
         (fma
          (cos (fma (* -0.005555555555555556 (PI)) angle (PI)))
          y-scale
          0.0)
         (* x-scale t_1)))
       180.0)
      (PI)))))
\begin{array}{l}
b_m = \left|b\right|

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

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


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

    1. Initial program 15.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 rewrites30.2%

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

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

      \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
    7. Step-by-step derivation
      1. Applied rewrites46.8%

        \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]

      if 118000 < b

      1. Initial program 11.6%

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

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

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

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

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

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

          \[\leadsto \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\cos \left(\mathsf{fma}\left(-0.005555555555555556 \cdot \mathsf{PI}\left(\right), angle, \mathsf{PI}\left(\right)\right)\right), y-scale, \frac{0}{b}\right)}{x-scale \cdot \sin \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right) \cdot 180}{\mathsf{PI}\left(\right)} \]
      8. Recombined 2 regimes into one program.
      9. Final simplification49.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 118000:\\ \;\;\;\;\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) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(\cos \left(\mathsf{fma}\left(-0.005555555555555556 \cdot \mathsf{PI}\left(\right), angle, \mathsf{PI}\left(\right)\right)\right), y-scale, 0\right)}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \]
      10. Add Preprocessing

      Alternative 2: 49.8% accurate, 8.6× speedup?

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

        1. Initial program 18.4%

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

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

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

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

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

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

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

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

            if 1.21999999999999991e-21 < a

            1. Initial program 6.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 rewrites23.4%

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

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

              \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
            7. Step-by-step derivation
              1. Applied rewrites49.2%

                \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
            8. Recombined 2 regimes into one program.
            9. Add Preprocessing

            Alternative 3: 43.4% accurate, 8.7× speedup?

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

              1. Initial program 18.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 rewrites31.1%

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

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

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

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

                  \[\leadsto \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) \cdot 180}{\mathsf{PI}\left(\right)} \]
                3. Step-by-step derivation
                  1. Applied rewrites50.9%

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

                  if 2.8000000000000002e-13 < a < 6.50000000000000015e149

                  1. Initial program 11.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 rewrites44.7%

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

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

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

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

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

                      if 6.50000000000000015e149 < a

                      1. Initial program 0.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 rewrites0.0%

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

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

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

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

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

                        Alternative 4: 42.5% accurate, 9.0× speedup?

                        \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\\ t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\ \mathbf{if}\;b\_m \leq 6.2 \cdot 10^{-176}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{1}{t\_0}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;b\_m \leq 2.15 \cdot 10^{+69}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{2 \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot y-scale, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(b\_m \cdot b\_m\right), t\_1, \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot t\_1\right), \left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(x-scale \cdot 1\right) \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot t\_0\right)} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;b\_m \leq 3.3 \cdot 10^{+190}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{\mathsf{fma}\left(-1.54320987654321 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), t\_1, 1\right)}{t\_0}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                        b_m = (fabs.f64 b)
                        (FPCore (a b_m angle x-scale y-scale)
                         :precision binary64
                         (let* ((t_0 (sin (* (* (PI) angle) 0.005555555555555556)))
                                (t_1 (* (PI) (PI))))
                           (if (<= b_m 6.2e-176)
                             (*
                              180.0
                              (/ (atan (* (* (* (/ y-scale x-scale) (/ 1.0 t_0)) 2.0) -0.5)) (PI)))
                             (if (<= b_m 2.15e+69)
                               (*
                                180.0
                                (/
                                 (atan
                                  (*
                                   (/
                                    (*
                                     2.0
                                     (fma
                                      (* (* angle angle) y-scale)
                                      (fma
                                       (* -3.08641975308642e-5 (* b_m b_m))
                                       t_1
                                       (* (* 3.08641975308642e-5 (* a a)) t_1))
                                      (* (* b_m b_m) y-scale)))
                                    (* (* x-scale 1.0) (* (* (+ b_m a) (- b_m a)) t_0)))
                                   -0.5))
                                 (PI)))
                               (if (<= b_m 3.3e+190)
                                 (*
                                  180.0
                                  (/
                                   (atan
                                    (*
                                     (*
                                      (*
                                       (/ y-scale x-scale)
                                       (/ (fma (* -1.54320987654321e-5 (* angle angle)) t_1 1.0) t_0))
                                      2.0)
                                     -0.5))
                                   (PI)))
                                 (/
                                  (*
                                   (atan
                                    (/
                                     (- y-scale)
                                     (* x-scale (sin (* 0.005555555555555556 (* angle (PI)))))))
                                   180.0)
                                  (PI)))))))
                        \begin{array}{l}
                        b_m = \left|b\right|
                        
                        \\
                        \begin{array}{l}
                        t_0 := \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\\
                        t_1 := \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\\
                        \mathbf{if}\;b\_m \leq 6.2 \cdot 10^{-176}:\\
                        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{1}{t\_0}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
                        
                        \mathbf{elif}\;b\_m \leq 2.15 \cdot 10^{+69}:\\
                        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{2 \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot y-scale, \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(b\_m \cdot b\_m\right), t\_1, \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot t\_1\right), \left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(x-scale \cdot 1\right) \cdot \left(\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot t\_0\right)} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
                        
                        \mathbf{elif}\;b\_m \leq 3.3 \cdot 10^{+190}:\\
                        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{\mathsf{fma}\left(-1.54320987654321 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), t\_1, 1\right)}{t\_0}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 4 regimes
                        2. if b < 6.19999999999999983e-176

                          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 x-scale around 0

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

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

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

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

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

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

                              if 6.19999999999999983e-176 < b < 2.14999999999999996e69

                              1. Initial program 20.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 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 rewrites46.1%

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

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

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

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

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

                                  if 2.14999999999999996e69 < b < 3.3e190

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

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

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

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

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

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

                                      if 3.3e190 < b

                                      1. Initial program 0.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 rewrites0.0%

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

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

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

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

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

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

                                        Alternative 5: 44.0% accurate, 10.7× speedup?

                                        \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\\ \mathbf{if}\;x-scale \leq -3.3 \cdot 10^{-38}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{1}{t\_0}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;x-scale \leq 4.6 \cdot 10^{+52}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{\mathsf{fma}\left(-1.54320987654321 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 1\right)}{t\_0}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                                        b_m = (fabs.f64 b)
                                        (FPCore (a b_m angle x-scale y-scale)
                                         :precision binary64
                                         (let* ((t_0 (sin (* (* (PI) angle) 0.005555555555555556))))
                                           (if (<= x-scale -3.3e-38)
                                             (*
                                              180.0
                                              (/ (atan (* (* (* (/ y-scale x-scale) (/ 1.0 t_0)) 2.0) -0.5)) (PI)))
                                             (if (<= x-scale 4.6e+52)
                                               (*
                                                180.0
                                                (/
                                                 (atan
                                                  (*
                                                   (*
                                                    (*
                                                     (/ y-scale x-scale)
                                                     (/
                                                      (fma (* -1.54320987654321e-5 (* angle angle)) (* (PI) (PI)) 1.0)
                                                      t_0))
                                                    2.0)
                                                   -0.5))
                                                 (PI)))
                                               (/
                                                (*
                                                 (atan
                                                  (/
                                                   (- y-scale)
                                                   (* x-scale (sin (* 0.005555555555555556 (* angle (PI)))))))
                                                 180.0)
                                                (PI))))))
                                        \begin{array}{l}
                                        b_m = \left|b\right|
                                        
                                        \\
                                        \begin{array}{l}
                                        t_0 := \sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)\\
                                        \mathbf{if}\;x-scale \leq -3.3 \cdot 10^{-38}:\\
                                        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{1}{t\_0}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
                                        
                                        \mathbf{elif}\;x-scale \leq 4.6 \cdot 10^{+52}:\\
                                        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{\mathsf{fma}\left(-1.54320987654321 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), \mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right), 1\right)}{t\_0}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if x-scale < -3.3000000000000002e-38

                                          1. Initial program 11.4%

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

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

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

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

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

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

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

                                              if -3.3000000000000002e-38 < x-scale < 4.6e52

                                              1. Initial program 20.4%

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

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

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

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

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

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

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

                                                  if 4.6e52 < x-scale

                                                  1. Initial program 5.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 rewrites21.6%

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

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

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

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

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

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

                                                    Alternative 6: 44.0% accurate, 11.2× speedup?

                                                    \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\\ \mathbf{if}\;x-scale \leq -1.15 \cdot 10^{-80}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{1}{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;x-scale \leq 6 \cdot 10^{+52}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(1.54320987654321 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), y-scale \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), -y-scale\right)}{t\_0}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{t\_0}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                                                    b_m = (fabs.f64 b)
                                                    (FPCore (a b_m angle x-scale y-scale)
                                                     :precision binary64
                                                     (let* ((t_0 (* x-scale (sin (* 0.005555555555555556 (* angle (PI)))))))
                                                       (if (<= x-scale -1.15e-80)
                                                         (*
                                                          180.0
                                                          (/
                                                           (atan
                                                            (*
                                                             (*
                                                              (*
                                                               (/ y-scale x-scale)
                                                               (/ 1.0 (sin (* (* (PI) angle) 0.005555555555555556))))
                                                              2.0)
                                                             -0.5))
                                                           (PI)))
                                                         (if (<= x-scale 6e+52)
                                                           (/
                                                            (*
                                                             (atan
                                                              (/
                                                               (fma
                                                                (* 1.54320987654321e-5 (* angle angle))
                                                                (* y-scale (* (PI) (PI)))
                                                                (- y-scale))
                                                               t_0))
                                                             180.0)
                                                            (PI))
                                                           (/ (* (atan (/ (- y-scale) t_0)) 180.0) (PI))))))
                                                    \begin{array}{l}
                                                    b_m = \left|b\right|
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    t_0 := x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\\
                                                    \mathbf{if}\;x-scale \leq -1.15 \cdot 10^{-80}:\\
                                                    \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{1}{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
                                                    
                                                    \mathbf{elif}\;x-scale \leq 6 \cdot 10^{+52}:\\
                                                    \;\;\;\;\frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(1.54320987654321 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), y-scale \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), -y-scale\right)}{t\_0}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{t\_0}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if x-scale < -1.1499999999999999e-80

                                                      1. Initial program 10.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 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 rewrites31.5%

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

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

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

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

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

                                                          if -1.1499999999999999e-80 < x-scale < 6e52

                                                          1. Initial program 21.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 rewrites31.5%

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

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

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

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

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

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

                                                              if 6e52 < x-scale

                                                              1. Initial program 5.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 rewrites21.6%

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

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

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

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

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

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

                                                                Alternative 7: 44.7% accurate, 11.8× speedup?

                                                                \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 2.6 \cdot 10^{-119}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{1}{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;b\_m \leq 1.45 \cdot 10^{+64}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(angle \cdot x-scale\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m + a\right)\right) \cdot \left(b\_m - a\right)\right)} \cdot 90\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                                                                b_m = (fabs.f64 b)
                                                                (FPCore (a b_m angle x-scale y-scale)
                                                                 :precision binary64
                                                                 (if (<= b_m 2.6e-119)
                                                                   (*
                                                                    180.0
                                                                    (/
                                                                     (atan
                                                                      (*
                                                                       (*
                                                                        (*
                                                                         (/ y-scale x-scale)
                                                                         (/ 1.0 (sin (* (* (PI) angle) 0.005555555555555556))))
                                                                        2.0)
                                                                       -0.5))
                                                                     (PI)))
                                                                   (if (<= b_m 1.45e+64)
                                                                     (*
                                                                      180.0
                                                                      (/
                                                                       (atan
                                                                        (*
                                                                         (/
                                                                          (* -2.0 (* (* b_m b_m) y-scale))
                                                                          (* (* angle x-scale) (* (* (PI) (+ b_m a)) (- b_m a))))
                                                                         90.0))
                                                                       (PI)))
                                                                     (/
                                                                      (*
                                                                       (atan
                                                                        (/
                                                                         (- y-scale)
                                                                         (* x-scale (sin (* 0.005555555555555556 (* angle (PI)))))))
                                                                       180.0)
                                                                      (PI)))))
                                                                \begin{array}{l}
                                                                b_m = \left|b\right|
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;b\_m \leq 2.6 \cdot 10^{-119}:\\
                                                                \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\left(\frac{y-scale}{x-scale} \cdot \frac{1}{\sin \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right)}\right) \cdot 2\right) \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\
                                                                
                                                                \mathbf{elif}\;b\_m \leq 1.45 \cdot 10^{+64}:\\
                                                                \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(angle \cdot x-scale\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m + a\right)\right) \cdot \left(b\_m - a\right)\right)} \cdot 90\right)}{\mathsf{PI}\left(\right)}\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 3 regimes
                                                                2. if b < 2.60000000000000012e-119

                                                                  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 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 rewrites29.4%

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

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

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

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

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

                                                                      if 2.60000000000000012e-119 < b < 1.44999999999999997e64

                                                                      1. Initial program 29.8%

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

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

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

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

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

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

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

                                                                        if 1.44999999999999997e64 < b

                                                                        1. Initial program 7.2%

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

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

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

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

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

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

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

                                                                          Alternative 8: 43.5% accurate, 12.4× speedup?

                                                                          \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 2.6 \cdot 10^{-119} \lor \neg \left(b\_m \leq 1.45 \cdot 10^{+64}\right):\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(angle \cdot x-scale\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m + a\right)\right) \cdot \left(b\_m - a\right)\right)} \cdot 90\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                                                                          b_m = (fabs.f64 b)
                                                                          (FPCore (a b_m angle x-scale y-scale)
                                                                           :precision binary64
                                                                           (if (or (<= b_m 2.6e-119) (not (<= b_m 1.45e+64)))
                                                                             (/
                                                                              (*
                                                                               (atan
                                                                                (/
                                                                                 (- y-scale)
                                                                                 (* x-scale (sin (* 0.005555555555555556 (* angle (PI)))))))
                                                                               180.0)
                                                                              (PI))
                                                                             (*
                                                                              180.0
                                                                              (/
                                                                               (atan
                                                                                (*
                                                                                 (/
                                                                                  (* -2.0 (* (* b_m b_m) y-scale))
                                                                                  (* (* angle x-scale) (* (* (PI) (+ b_m a)) (- b_m a))))
                                                                                 90.0))
                                                                               (PI)))))
                                                                          \begin{array}{l}
                                                                          b_m = \left|b\right|
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          \mathbf{if}\;b\_m \leq 2.6 \cdot 10^{-119} \lor \neg \left(b\_m \leq 1.45 \cdot 10^{+64}\right):\\
                                                                          \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(angle \cdot x-scale\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m + a\right)\right) \cdot \left(b\_m - a\right)\right)} \cdot 90\right)}{\mathsf{PI}\left(\right)}\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 2 regimes
                                                                          2. if b < 2.60000000000000012e-119 or 1.44999999999999997e64 < b

                                                                            1. Initial program 12.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 rewrites26.5%

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

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

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

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

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

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

                                                                                if 2.60000000000000012e-119 < b < 1.44999999999999997e64

                                                                                1. Initial program 29.8%

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

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

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

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

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

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

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

                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.6 \cdot 10^{-119} \lor \neg \left(b \leq 1.45 \cdot 10^{+64}\right):\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-y-scale}{x-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \left(\left(b \cdot b\right) \cdot y-scale\right)}{\left(angle \cdot x-scale\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right)} \cdot 90\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                                                                                10. Add Preprocessing

                                                                                Alternative 9: 39.3% accurate, 17.1× speedup?

                                                                                \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-170}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \left(\frac{y-scale}{\left(x-scale \cdot x-scale\right) \cdot \mathsf{PI}\left(\right)} \cdot -2\right)\right) \cdot 90\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;b\_m \leq 4 \cdot 10^{+132}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(angle \cdot x-scale\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m + a\right)\right) \cdot \left(b\_m - a\right)\right)} \cdot 90\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;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} \end{array} \]
                                                                                b_m = (fabs.f64 b)
                                                                                (FPCore (a b_m angle x-scale y-scale)
                                                                                 :precision binary64
                                                                                 (if (<= b_m 3.5e-170)
                                                                                   (*
                                                                                    180.0
                                                                                    (/
                                                                                     (atan
                                                                                      (*
                                                                                       (* (/ x-scale angle) (* (/ y-scale (* (* x-scale x-scale) (PI))) -2.0))
                                                                                       90.0))
                                                                                     (PI)))
                                                                                   (if (<= b_m 4e+132)
                                                                                     (*
                                                                                      180.0
                                                                                      (/
                                                                                       (atan
                                                                                        (*
                                                                                         (/
                                                                                          (* -2.0 (* (* b_m b_m) y-scale))
                                                                                          (* (* angle x-scale) (* (* (PI) (+ b_m a)) (- b_m a))))
                                                                                         90.0))
                                                                                       (PI)))
                                                                                     (*
                                                                                      180.0
                                                                                      (/ (atan (* -180.0 (/ y-scale (* angle (* x-scale (PI)))))) (PI))))))
                                                                                \begin{array}{l}
                                                                                b_m = \left|b\right|
                                                                                
                                                                                \\
                                                                                \begin{array}{l}
                                                                                \mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-170}:\\
                                                                                \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \left(\frac{y-scale}{\left(x-scale \cdot x-scale\right) \cdot \mathsf{PI}\left(\right)} \cdot -2\right)\right) \cdot 90\right)}{\mathsf{PI}\left(\right)}\\
                                                                                
                                                                                \mathbf{elif}\;b\_m \leq 4 \cdot 10^{+132}:\\
                                                                                \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-2 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(angle \cdot x-scale\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m + a\right)\right) \cdot \left(b\_m - a\right)\right)} \cdot 90\right)}{\mathsf{PI}\left(\right)}\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;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}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 3 regimes
                                                                                2. if b < 3.49999999999999985e-170

                                                                                  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 angle around 0

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

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

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

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

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

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

                                                                                    if 3.49999999999999985e-170 < b < 3.99999999999999996e132

                                                                                    1. Initial program 20.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 angle around 0

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

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

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

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

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

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

                                                                                      if 3.99999999999999996e132 < b

                                                                                      1. Initial program 3.2%

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

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

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

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

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

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

                                                                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{\left(y-scale \cdot \mathsf{PI}\left(\right)\right) \cdot angle} \cdot -2\right) \cdot 90\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 rewrites59.6%

                                                                                            \[\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)} \]
                                                                                        4. Recombined 3 regimes into one program.
                                                                                        5. Add Preprocessing

                                                                                        Alternative 10: 39.4% accurate, 17.5× speedup?

                                                                                        \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-170}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \left(\frac{y-scale}{\left(x-scale \cdot x-scale\right) \cdot \mathsf{PI}\left(\right)} \cdot -2\right)\right) \cdot 90\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;b\_m \leq 4 \cdot 10^{+132}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{-180 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(angle \cdot x-scale\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m + a\right)\right) \cdot \left(b\_m - a\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;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} \end{array} \]
                                                                                        b_m = (fabs.f64 b)
                                                                                        (FPCore (a b_m angle x-scale y-scale)
                                                                                         :precision binary64
                                                                                         (if (<= b_m 3.5e-170)
                                                                                           (*
                                                                                            180.0
                                                                                            (/
                                                                                             (atan
                                                                                              (*
                                                                                               (* (/ x-scale angle) (* (/ y-scale (* (* x-scale x-scale) (PI))) -2.0))
                                                                                               90.0))
                                                                                             (PI)))
                                                                                           (if (<= b_m 4e+132)
                                                                                             (/
                                                                                              (*
                                                                                               (atan
                                                                                                (/
                                                                                                 (* -180.0 (* (* b_m b_m) y-scale))
                                                                                                 (* (* angle x-scale) (* (* (PI) (+ b_m a)) (- b_m a)))))
                                                                                               180.0)
                                                                                              (PI))
                                                                                             (*
                                                                                              180.0
                                                                                              (/ (atan (* -180.0 (/ y-scale (* angle (* x-scale (PI)))))) (PI))))))
                                                                                        \begin{array}{l}
                                                                                        b_m = \left|b\right|
                                                                                        
                                                                                        \\
                                                                                        \begin{array}{l}
                                                                                        \mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-170}:\\
                                                                                        \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \left(\frac{y-scale}{\left(x-scale \cdot x-scale\right) \cdot \mathsf{PI}\left(\right)} \cdot -2\right)\right) \cdot 90\right)}{\mathsf{PI}\left(\right)}\\
                                                                                        
                                                                                        \mathbf{elif}\;b\_m \leq 4 \cdot 10^{+132}:\\
                                                                                        \;\;\;\;\frac{\tan^{-1} \left(\frac{-180 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(angle \cdot x-scale\right) \cdot \left(\left(\mathsf{PI}\left(\right) \cdot \left(b\_m + a\right)\right) \cdot \left(b\_m - a\right)\right)}\right) \cdot 180}{\mathsf{PI}\left(\right)}\\
                                                                                        
                                                                                        \mathbf{else}:\\
                                                                                        \;\;\;\;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}
                                                                                        \end{array}
                                                                                        
                                                                                        Derivation
                                                                                        1. Split input into 3 regimes
                                                                                        2. if b < 3.49999999999999985e-170

                                                                                          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 angle around 0

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

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

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

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

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

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

                                                                                            if 3.49999999999999985e-170 < b < 3.99999999999999996e132

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

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

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

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

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

                                                                                              if 3.99999999999999996e132 < b

                                                                                              1. Initial program 3.2%

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

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

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

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

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

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

                                                                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{\left(y-scale \cdot \mathsf{PI}\left(\right)\right) \cdot angle} \cdot -2\right) \cdot 90\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 rewrites59.6%

                                                                                                    \[\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)} \]
                                                                                                4. Recombined 3 regimes into one program.
                                                                                                5. Add Preprocessing

                                                                                                Alternative 11: 37.9% accurate, 22.2× speedup?

                                                                                                \[\begin{array}{l} b_m = \left|b\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} \]
                                                                                                b_m = (fabs.f64 b)
                                                                                                (FPCore (a b_m angle x-scale y-scale)
                                                                                                 :precision binary64
                                                                                                 (* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* x-scale (PI)))))) (PI))))
                                                                                                \begin{array}{l}
                                                                                                b_m = \left|b\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 15.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. *-commutativeN/A

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

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

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

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

                                                                                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{\left(y-scale \cdot \mathsf{PI}\left(\right)\right) \cdot angle} \cdot -2\right) \cdot 90\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.8%

                                                                                                      \[\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 12: 12.0% accurate, 22.2× speedup?

                                                                                                    \[\begin{array}{l} b_m = \left|b\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} \]
                                                                                                    b_m = (fabs.f64 b)
                                                                                                    (FPCore (a b_m angle x-scale y-scale)
                                                                                                     :precision binary64
                                                                                                     (* 180.0 (/ (atan (* -180.0 (/ x-scale (* angle (* y-scale (PI)))))) (PI))))
                                                                                                    \begin{array}{l}
                                                                                                    b_m = \left|b\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 15.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. *-commutativeN/A

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

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

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

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

                                                                                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{\left(y-scale \cdot \mathsf{PI}\left(\right)\right) \cdot angle} \cdot -2\right) \cdot 90\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 rewrites15.1%

                                                                                                          \[\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 2024358 
                                                                                                        (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))))