raw-angle from scale-rotated-ellipse

Percentage Accurate: 17.5% → 57.8%
Time: 32.7s
Alternatives: 9
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 9 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: 17.5% accurate, 1.0× speedup?

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

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

Alternative 1: 57.8% accurate, 6.8× speedup?

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

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

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


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

    1. Initial program 18.4%

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      3. lower-sin.f64N/A

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      6. lower-PI.f64N/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\color{blue}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
      8. lower-cos.f64N/A

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

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{y-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
    9. Step-by-step derivation
      1. lift-PI.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
      2. associate-*r*N/A

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

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

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

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

    if 5.4e44 < b

    1. Initial program 8.0%

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-1 \cdot \frac{y-scale \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
      3. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{y-scale \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}}{\mathsf{PI}\left(\right)} \]
        3. lower-/.f64N/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{\color{blue}{y-scale \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}}{x-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        5. lower-pow.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{y-scale \cdot \color{blue}{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}}{x-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        6. lower-cos.f64N/A

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{y-scale \cdot {\cos \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}^{2}}{x-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        9. lower-PI.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{y-scale \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}^{2}}{x-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        10. *-commutativeN/A

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

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

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

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

    Alternative 2: 58.3% accurate, 8.7× speedup?

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

      1. Initial program 18.4%

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

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        3. lower-sin.f64N/A

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        6. lower-PI.f64N/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\color{blue}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-cos.f64N/A

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{y-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
      9. Step-by-step derivation
        1. lift-PI.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        2. associate-*r*N/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        4. lower-*.f6453.6

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

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

      if 5.2e39 < b

      1. Initial program 8.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{y-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\color{blue}{x-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        10. lower-sin.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{y-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        11. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\frac{y-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \sin \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right)\right)}{\mathsf{PI}\left(\right)} \]
        12. lower-*.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\mathsf{neg}\left(\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 \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}\right)\right)}{\mathsf{PI}\left(\right)} \]
        13. lower-PI.f6471.0

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

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

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

    Alternative 3: 56.0% accurate, 8.7× speedup?

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

      1. Initial program 18.1%

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

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        3. lower-sin.f64N/A

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        6. lower-PI.f64N/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\color{blue}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-cos.f64N/A

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{y-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
      9. Step-by-step derivation
        1. lift-PI.f64N/A

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        2. associate-*r*N/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        4. lower-*.f6453.2

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

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

      if 3.69999999999999994e88 < b

      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. 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. associate-*r/N/A

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
      7. Step-by-step derivation
        1. associate-*r/N/A

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

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

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

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

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

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

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

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

    Alternative 4: 57.5% accurate, 11.3× speedup?

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

      1. Initial program 18.1%

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

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        3. lower-sin.f64N/A

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
        6. lower-PI.f64N/A

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\color{blue}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
        8. lower-cos.f64N/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}}} \]
        2. Step-by-step derivation
          1. lift-PI.f64N/A

            \[\leadsto \frac{\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(\frac{1}{180} \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)\right)}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}} \]
          2. associate-*r*N/A

            \[\leadsto \frac{\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \mathsf{PI}\left(\right)\right)\right)}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}} \]
          4. lift-*.f6452.3

            \[\leadsto \frac{\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \color{blue}{\left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}\right)}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}} \]
        3. Applied rewrites52.3%

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

        if 9.99999999999999995e88 < b

        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. 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. associate-*r/N/A

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
        7. Step-by-step derivation
          1. associate-*r/N/A

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 10^{+89}:\\ \;\;\;\;\frac{\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \tan \left(\left(0.005555555555555556 \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)\right)}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot -180}{angle \cdot \left(\mathsf{PI}\left(\right) \cdot x-scale\right)}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
      12. Add Preprocessing

      Alternative 5: 56.1% accurate, 17.6× speedup?

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

        1. Initial program 18.1%

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

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
          3. lower-sin.f64N/A

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
          6. lower-PI.f64N/A

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\color{blue}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
          8. lower-cos.f64N/A

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

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

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

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

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

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

            \[\leadsto \frac{\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{x-scale} \cdot \color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}} \]
          3. Step-by-step derivation
            1. lower-*.f64N/A

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

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

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

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

          if 9.99999999999999995e88 < b

          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. 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. associate-*r/N/A

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
          7. Step-by-step derivation
            1. associate-*r/N/A

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-180 \cdot y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
        10. Recombined 2 regimes into one program.
        11. Final simplification54.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 10^{+89}:\\ \;\;\;\;\frac{\frac{180 \cdot \tan^{-1} \left(\left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \frac{y-scale}{x-scale}\right)}{\sqrt{\mathsf{PI}\left(\right)}}}{\sqrt{\mathsf{PI}\left(\right)}}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot -180}{angle \cdot \left(\mathsf{PI}\left(\right) \cdot x-scale\right)}\right)}{\mathsf{PI}\left(\right)}\\ \end{array} \]
        12. Add Preprocessing

        Alternative 6: 53.5% accurate, 21.3× speedup?

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

          1. Initial program 18.1%

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

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

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

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

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

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
            3. lower-sin.f64N/A

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
            6. lower-PI.f64N/A

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\color{blue}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
            8. lower-cos.f64N/A

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{y-scale \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
          9. Step-by-step derivation
            1. lift-PI.f64N/A

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
            2. associate-*r*N/A

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \color{blue}{\left(\left(\frac{1}{180} \cdot angle\right) \cdot \mathsf{PI}\left(\right)\right)}}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
            4. lower-*.f6453.2

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{180} \cdot \frac{angle \cdot \left(y-scale \cdot \mathsf{PI}\left(\right)\right)}{x-scale}\right)}}{\mathsf{PI}\left(\right)} \]
          12. Step-by-step derivation
            1. associate-*r/N/A

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{1}{180} \cdot \left(angle \cdot \left(y-scale \cdot \mathsf{PI}\left(\right)\right)\right)}{x-scale}\right)}}{\mathsf{PI}\left(\right)} \]
            3. associate-*r*N/A

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{1}{180} \cdot \color{blue}{\left(\left(angle \cdot y-scale\right) \cdot \mathsf{PI}\left(\right)\right)}}{x-scale}\right)}{\mathsf{PI}\left(\right)} \]
            4. associate-*r*N/A

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

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

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

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

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

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

          if 4.99999999999999997e88 < b

          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. 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. associate-*r/N/A

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
          7. Step-by-step derivation
            1. associate-*r/N/A

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

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

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

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

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

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

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

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

        Alternative 7: 53.5% accurate, 21.3× speedup?

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

          1. Initial program 18.1%

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

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

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

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

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

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
            3. lower-sin.f64N/A

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

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right)}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)}{\mathsf{PI}\left(\right)} \]
            6. lower-PI.f64N/A

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

              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{\color{blue}{x-scale \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}}\right)}{\mathsf{PI}\left(\right)} \]
            8. lower-cos.f64N/A

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{1}{180} \cdot \frac{angle \cdot \left(y-scale \cdot \mathsf{PI}\left(\right)\right)}{x-scale}\right)}}{\mathsf{PI}\left(\right)} \]
          10. Step-by-step derivation
            1. associate-*r/N/A

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

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

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

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

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

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

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

          if 4.99999999999999997e88 < b

          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. 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. associate-*r/N/A

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
          7. Step-by-step derivation
            1. associate-*r/N/A

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

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

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

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

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

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

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

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

        Alternative 8: 38.1% accurate, 22.2× speedup?

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

          \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}}{\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}}\right)}{\mathsf{PI}\left(\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in 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. associate-*r/N/A

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
        7. Step-by-step derivation
          1. associate-*r/N/A

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

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

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

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

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

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

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

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

        Alternative 9: 14.2% accurate, 22.2× speedup?

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

          \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}}{\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}}\right)}{\mathsf{PI}\left(\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in 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. associate-*r/N/A

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
        7. Step-by-step derivation
          1. associate-*r/N/A

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

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

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

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

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

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

          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-180 \cdot x-scale}{angle \cdot \left(y-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}}{\mathsf{PI}\left(\right)} \]
        9. Step-by-step derivation
          1. lift-PI.f64N/A

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot x-scale}{angle \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot y-scale\right)}}\right)}{\mathsf{PI}\left(\right)} \]
          3. associate-*r*N/A

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

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

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

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

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

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

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

            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{x-scale \cdot -180}{\color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot y-scale}}\right)}{\mathsf{PI}\left(\right)} \]
          5. associate-/l*N/A

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

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

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

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

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

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

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

        Reproduce

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