raw-angle from scale-rotated-ellipse

Percentage Accurate: 12.9% → 44.5%
Time: 42.9s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 12.9% 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: 44.5% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt[3]{{\mathsf{PI}\left(\right)}^{1.5}}\\
t_1 := \left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\
t_2 := \left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\\
t_3 := \sin t\_2\\
t_4 := \sqrt{\mathsf{PI}\left(\right)}\\
t_5 := \cos t\_2\\
\mathbf{if}\;a\_m \leq 1.1 \cdot 10^{+34}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(t\_4 \cdot t\_4\right)\right)}^{2} \cdot \frac{-2 \cdot y-scale}{x-scale}\right) \cdot \frac{0.5}{\sin t\_1 \cdot \cos t\_1}\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{elif}\;a\_m \leq 2.2 \cdot 10^{+88}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(2 \cdot \mathsf{fma}\left(a\_m \cdot a\_m, {t\_3}^{2}, {t\_5}^{2} \cdot \left(b \cdot b\right)\right)\right) \cdot y-scale}{\left(x-scale \cdot t\_5\right) \cdot \left(\left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right) \cdot t\_3\right)} \cdot -0.5\right)}{\mathsf{PI}\left(\right)}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\left(-2 \cdot y-scale\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \left(t\_0 \cdot t\_0\right)\right)\right)}^{2}}{x-scale}}{t\_5 \cdot \sin \left(\left(\sqrt[3]{{\mathsf{PI}\left(\right)}^{3}} \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < 1.1000000000000001e34

    1. Initial program 12.5%

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

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

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

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

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

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

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

        if 1.1000000000000001e34 < a < 2.20000000000000009e88

        1. Initial program 9.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. Step-by-step derivation
          1. *-commutativeN/A

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\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)} \cdot \frac{-1}{2}\right)}}{\mathsf{PI}\left(\right)} \]
        5. Applied rewrites44.9%

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

        if 2.20000000000000009e88 < a

        1. Initial program 0.1%

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

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

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

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

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

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

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

            Alternative 2: 44.6% accurate, 3.8× speedup?

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

              1. Initial program 12.5%

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

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

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

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

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

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

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

                  if 1.1000000000000001e34 < a < 2.20000000000000009e88

                  1. Initial program 9.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. Step-by-step derivation
                    1. *-commutativeN/A

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\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)} \cdot \frac{-1}{2}\right)}}{\mathsf{PI}\left(\right)} \]
                  5. Applied rewrites44.9%

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

                  if 2.20000000000000009e88 < a

                  1. Initial program 0.1%

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

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

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

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

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

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

                    Alternative 3: 44.5% accurate, 4.0× speedup?

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

                      1. Initial program 12.6%

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

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

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

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

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

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

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

                          if 4.8e33 < a < 2.20000000000000009e88

                          1. Initial program 8.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. Applied rewrites8.9%

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

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\left(-1 \cdot \frac{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)}{x-scale \cdot \left(\sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)}\right)} \cdot y-scale\right)}{\mathsf{PI}\left(\right)} \]
                          5. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\left(\mathsf{neg}\left(\frac{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)}{x-scale \cdot \left(\sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)}\right)\right)} \cdot y-scale\right)}{\mathsf{PI}\left(\right)} \]
                            2. lower-neg.f64N/A

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\color{blue}{\left(-\frac{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)}{x-scale \cdot \left(\sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)}\right)} \cdot y-scale\right)}{\mathsf{PI}\left(\right)} \]
                            3. lower-/.f64N/A

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

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

                          if 2.20000000000000009e88 < a

                          1. Initial program 0.1%

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

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

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

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4.8 \cdot 10^{+33}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(\sqrt{\mathsf{PI}\left(\right)} \cdot \sqrt{\mathsf{PI}\left(\right)}\right)\right)}^{2} \cdot \frac{-2 \cdot y-scale}{x-scale}\right) \cdot \frac{0.5}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{elif}\;a \leq 2.2 \cdot 10^{+88}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\left(-2\right) \cdot \mathsf{fma}\left(a \cdot a, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, \left(b \cdot b\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{\left(x-scale \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)} \cdot y-scale\right)}{\mathsf{PI}\left(\right)}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\left(-2 \cdot y-scale\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{\cos \left(\left(\mathsf{PI}\left(\right) \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \sin \left(\left(\sqrt[3]{{\mathsf{PI}\left(\right)}^{3}} \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 0.5\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 4: 44.9% accurate, 4.0× speedup?

                            \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\ 180 \cdot \frac{\tan^{-1} \left(\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{{\mathsf{PI}\left(\right)}^{3}}\right)}^{2} \cdot \frac{-2 \cdot y-scale}{x-scale}\right) \cdot \frac{0.5}{\sin t\_0 \cdot \cos t\_0}\right)}{\mathsf{PI}\left(\right)} \end{array} \end{array} \]
                            a_m = (fabs.f64 a)
                            (FPCore (a_m b angle x-scale y-scale)
                             :precision binary64
                             (let* ((t_0 (* (* 0.005555555555555556 angle) (PI))))
                               (*
                                180.0
                                (/
                                 (atan
                                  (*
                                   (*
                                    (pow
                                     (cos (* (* 0.005555555555555556 angle) (cbrt (pow (PI) 3.0))))
                                     2.0)
                                    (/ (* -2.0 y-scale) x-scale))
                                   (/ 0.5 (* (sin t_0) (cos t_0)))))
                                 (PI)))))
                            \begin{array}{l}
                            a_m = \left|a\right|
                            
                            \\
                            \begin{array}{l}
                            t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\
                            180 \cdot \frac{\tan^{-1} \left(\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{{\mathsf{PI}\left(\right)}^{3}}\right)}^{2} \cdot \frac{-2 \cdot y-scale}{x-scale}\right) \cdot \frac{0.5}{\sin t\_0 \cdot \cos t\_0}\right)}{\mathsf{PI}\left(\right)}
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Initial program 9.8%

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

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

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

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

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

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

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

                                Alternative 5: 45.0% accurate, 5.2× speedup?

                                \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \sqrt{\mathsf{PI}\left(\right)}\\ t_1 := \left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\ 180 \cdot \frac{\tan^{-1} \left(\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(t\_0 \cdot t\_0\right)\right)}^{2} \cdot \frac{-2 \cdot y-scale}{x-scale}\right) \cdot \frac{0.5}{\sin t\_1 \cdot \cos t\_1}\right)}{\mathsf{PI}\left(\right)} \end{array} \end{array} \]
                                a_m = (fabs.f64 a)
                                (FPCore (a_m b angle x-scale y-scale)
                                 :precision binary64
                                 (let* ((t_0 (sqrt (PI))) (t_1 (* (* 0.005555555555555556 angle) (PI))))
                                   (*
                                    180.0
                                    (/
                                     (atan
                                      (*
                                       (*
                                        (pow (cos (* (* 0.005555555555555556 angle) (* t_0 t_0))) 2.0)
                                        (/ (* -2.0 y-scale) x-scale))
                                       (/ 0.5 (* (sin t_1) (cos t_1)))))
                                     (PI)))))
                                \begin{array}{l}
                                a_m = \left|a\right|
                                
                                \\
                                \begin{array}{l}
                                t_0 := \sqrt{\mathsf{PI}\left(\right)}\\
                                t_1 := \left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\
                                180 \cdot \frac{\tan^{-1} \left(\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \left(t\_0 \cdot t\_0\right)\right)}^{2} \cdot \frac{-2 \cdot y-scale}{x-scale}\right) \cdot \frac{0.5}{\sin t\_1 \cdot \cos t\_1}\right)}{\mathsf{PI}\left(\right)}
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Initial program 9.8%

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

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

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

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

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

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

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

                                    Alternative 6: 45.0% accurate, 5.4× speedup?

                                    \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\ t_1 := \cos t\_0\\ 180 \cdot \frac{\tan^{-1} \left(\left({t\_1}^{2} \cdot \frac{-2 \cdot y-scale}{x-scale}\right) \cdot \frac{0.5}{\sin t\_0 \cdot t\_1}\right)}{\mathsf{PI}\left(\right)} \end{array} \end{array} \]
                                    a_m = (fabs.f64 a)
                                    (FPCore (a_m b angle x-scale y-scale)
                                     :precision binary64
                                     (let* ((t_0 (* (* 0.005555555555555556 angle) (PI))) (t_1 (cos t_0)))
                                       (*
                                        180.0
                                        (/
                                         (atan
                                          (*
                                           (* (pow t_1 2.0) (/ (* -2.0 y-scale) x-scale))
                                           (/ 0.5 (* (sin t_0) t_1))))
                                         (PI)))))
                                    \begin{array}{l}
                                    a_m = \left|a\right|
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\\
                                    t_1 := \cos t\_0\\
                                    180 \cdot \frac{\tan^{-1} \left(\left({t\_1}^{2} \cdot \frac{-2 \cdot y-scale}{x-scale}\right) \cdot \frac{0.5}{\sin t\_0 \cdot t\_1}\right)}{\mathsf{PI}\left(\right)}
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 9.8%

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

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

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

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

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

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

                                      Alternative 7: 44.9% accurate, 6.6× speedup?

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

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

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

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

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

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

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

                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{0.5 \cdot \left(\frac{-2 \cdot y-scale}{x-scale} \cdot {\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}^{2}\right)}{\color{blue}{\left(\sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right) + \sin 0\right) \cdot 0.5}}\right)}{\mathsf{PI}\left(\right)} \]
                                        4. Final simplification43.8%

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

                                        Alternative 8: 44.9% accurate, 6.6× speedup?

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

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

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

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

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

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

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

                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{0.5}{\sin \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right) + \sin 0} \cdot 2\right) \cdot \color{blue}{\left(\frac{-2 \cdot y-scale}{x-scale} \cdot {\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}^{2}\right)}\right)}{\mathsf{PI}\left(\right)} \]
                                          4. Final simplification43.7%

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

                                          Alternative 9: 44.9% accurate, 8.7× speedup?

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

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

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

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

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

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

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

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

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

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

                                              Alternative 10: 38.0% accurate, 17.1× speedup?

                                              \[\begin{array}{l} a_m = \left|a\right| \\ \begin{array}{l} \mathbf{if}\;b \leq 9.6 \cdot 10^{-39} \lor \neg \left(b \leq 2.9 \cdot 10^{+122}\right):\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(x-scale \cdot \mathsf{PI}\left(\right)\right) \cdot angle}\right)}{\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\_m\right)\right) \cdot \left(b - a\_m\right)\right)} \cdot 90\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \end{array} \]
                                              a_m = (fabs.f64 a)
                                              (FPCore (a_m b angle x-scale y-scale)
                                               :precision binary64
                                               (if (or (<= b 9.6e-39) (not (<= b 2.9e+122)))
                                                 (* 180.0 (/ (atan (* -180.0 (/ y-scale (* (* x-scale (PI)) angle)))) (PI)))
                                                 (*
                                                  180.0
                                                  (/
                                                   (atan
                                                    (*
                                                     (/
                                                      (* -2.0 (* (* b b) y-scale))
                                                      (* (* angle x-scale) (* (* (PI) (+ b a_m)) (- b a_m))))
                                                     90.0))
                                                   (PI)))))
                                              \begin{array}{l}
                                              a_m = \left|a\right|
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;b \leq 9.6 \cdot 10^{-39} \lor \neg \left(b \leq 2.9 \cdot 10^{+122}\right):\\
                                              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(x-scale \cdot \mathsf{PI}\left(\right)\right) \cdot angle}\right)}{\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\_m\right)\right) \cdot \left(b - a\_m\right)\right)} \cdot 90\right)}{\mathsf{PI}\left(\right)}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if b < 9.60000000000000063e-39 or 2.9000000000000001e122 < b

                                                1. Initial program 7.7%

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

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

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

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

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

                                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot \frac{-2 \cdot y-scale}{x-scale}\right) \cdot \frac{0.5}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
                                                  3. Taylor expanded in angle 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)} \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites35.3%

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

                                                    if 9.60000000000000063e-39 < b < 2.9000000000000001e122

                                                    1. Initial program 23.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 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 rewrites24.2%

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

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

                                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(\frac{x-scale}{angle} \cdot \frac{-2}{y-scale \cdot \mathsf{PI}\left(\right)}\right) \cdot 90\right)}{\mathsf{PI}\left(\right)} \]
                                                      2. Taylor expanded in 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)} \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites54.7%

                                                          \[\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)} \]
                                                      4. Recombined 2 regimes into one program.
                                                      5. Final simplification37.8%

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 9.6 \cdot 10^{-39} \lor \neg \left(b \leq 2.9 \cdot 10^{+122}\right):\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(x-scale \cdot \mathsf{PI}\left(\right)\right) \cdot angle}\right)}{\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} \]
                                                      6. Add Preprocessing

                                                      Alternative 11: 37.5% accurate, 22.2× speedup?

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

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

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

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

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

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

                                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\left({\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}^{2} \cdot \frac{-2 \cdot y-scale}{x-scale}\right) \cdot \frac{0.5}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
                                                        3. Taylor expanded in angle 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)} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites36.0%

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

                                                          Reproduce

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