raw-angle from scale-rotated-ellipse

Percentage Accurate: 16.9% → 61.2%
Time: 41.8s
Alternatives: 17
Speedup: 22.2×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ 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)}{\pi} \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))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = (angle / 180.0) * ((double) M_PI);
	double t_1 = cos(t_0);
	double t_2 = sin(t_0);
	double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
	double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
	double t_5 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
	return 180.0 * (atan((((t_4 - t_5) - sqrt((pow((t_5 - t_4), 2.0) + pow(t_3, 2.0)))) / t_3)) / ((double) M_PI));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = (angle / 180.0) * Math.PI;
	double t_1 = Math.cos(t_0);
	double t_2 = Math.sin(t_0);
	double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
	double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
	double t_5 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
	return 180.0 * (Math.atan((((t_4 - t_5) - Math.sqrt((Math.pow((t_5 - t_4), 2.0) + Math.pow(t_3, 2.0)))) / t_3)) / Math.PI);
}
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = (angle / 180.0) * math.pi
	t_1 = math.cos(t_0)
	t_2 = math.sin(t_0)
	t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale
	t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale
	t_5 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale
	return 180.0 * (math.atan((((t_4 - t_5) - math.sqrt((math.pow((t_5 - t_4), 2.0) + math.pow(t_3, 2.0)))) / t_3)) / math.pi)
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(Float64(angle / 180.0) * pi)
	t_1 = cos(t_0)
	t_2 = sin(t_0)
	t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale)
	t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale)
	t_5 = Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale)
	return Float64(180.0 * Float64(atan(Float64(Float64(Float64(t_4 - t_5) - sqrt(Float64((Float64(t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi))
end
function tmp = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = (angle / 180.0) * pi;
	t_1 = cos(t_0);
	t_2 = sin(t_0);
	t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
	t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale;
	t_5 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale;
	tmp = 180.0 * (atan((((t_4 - t_5) - sqrt((((t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi);
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[Power[N[(a * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[Power[N[(a * t$95$2), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, N[(180.0 * N[(N[ArcTan[N[(N[(N[(t$95$4 - t$95$5), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(t$95$5 - t$95$4), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
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)}{\pi}
\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 17 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: 16.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ 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)}{\pi} \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))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = (angle / 180.0) * ((double) M_PI);
	double t_1 = cos(t_0);
	double t_2 = sin(t_0);
	double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
	double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
	double t_5 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
	return 180.0 * (atan((((t_4 - t_5) - sqrt((pow((t_5 - t_4), 2.0) + pow(t_3, 2.0)))) / t_3)) / ((double) M_PI));
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = (angle / 180.0) * Math.PI;
	double t_1 = Math.cos(t_0);
	double t_2 = Math.sin(t_0);
	double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
	double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale;
	double t_5 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale;
	return 180.0 * (Math.atan((((t_4 - t_5) - Math.sqrt((Math.pow((t_5 - t_4), 2.0) + Math.pow(t_3, 2.0)))) / t_3)) / Math.PI);
}
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = (angle / 180.0) * math.pi
	t_1 = math.cos(t_0)
	t_2 = math.sin(t_0)
	t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale
	t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / y_45_scale) / y_45_scale
	t_5 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / x_45_scale) / x_45_scale
	return 180.0 * (math.atan((((t_4 - t_5) - math.sqrt((math.pow((t_5 - t_4), 2.0) + math.pow(t_3, 2.0)))) / t_3)) / math.pi)
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(Float64(angle / 180.0) * pi)
	t_1 = cos(t_0)
	t_2 = sin(t_0)
	t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale)
	t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale)
	t_5 = Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale)
	return Float64(180.0 * Float64(atan(Float64(Float64(Float64(t_4 - t_5) - sqrt(Float64((Float64(t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi))
end
function tmp = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = (angle / 180.0) * pi;
	t_1 = cos(t_0);
	t_2 = sin(t_0);
	t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_2) * t_1) / x_45_scale) / y_45_scale;
	t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / y_45_scale) / y_45_scale;
	t_5 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / x_45_scale) / x_45_scale;
	tmp = 180.0 * (atan((((t_4 - t_5) - sqrt((((t_5 - t_4) ^ 2.0) + (t_3 ^ 2.0)))) / t_3)) / pi);
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[Power[N[(a * t$95$1), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[Power[N[(a * t$95$2), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * t$95$1), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, N[(180.0 * N[(N[ArcTan[N[(N[(N[(t$95$4 - t$95$5), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(t$95$5 - t$95$4), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
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)}{\pi}
\end{array}
\end{array}

Alternative 1: 61.2% accurate, 4.9× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_1 := \sin t\_0\\ t_2 := x-scale \cdot \cos t\_0\\ t_3 := \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-88}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot t\_1}{t\_2}\right)}{\pi}\\ \mathbf{elif}\;b\_m \leq 5.2 \cdot 10^{+144}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(a, a \cdot \mathsf{fma}\left(-0.5, t\_3, 0.5\right), \left(b\_m \cdot b\_m\right) \cdot \mathsf{fma}\left(0.5, t\_3, 0.5\right)\right)}{t\_2 \cdot \left(t\_1 \cdot \left(b\_m + a\right)\right)} \cdot \frac{y-scale}{a - b\_m}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(y-scale \cdot \frac{-1}{x-scale \cdot \tan t\_0}\right)}}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* 0.005555555555555556 (* angle PI)))
        (t_1 (sin t_0))
        (t_2 (* x-scale (cos t_0)))
        (t_3 (cos (* PI (* angle 0.011111111111111112)))))
   (if (<= b_m 3.5e-88)
     (* 180.0 (/ (atan (/ (* y-scale t_1) t_2)) PI))
     (if (<= b_m 5.2e+144)
       (*
        180.0
        (/
         (atan
          (*
           (/
            (fma a (* a (fma -0.5 t_3 0.5)) (* (* b_m b_m) (fma 0.5 t_3 0.5)))
            (* t_2 (* t_1 (+ b_m a))))
           (/ y-scale (- a b_m))))
         PI))
       (/
        1.0
        (/ PI (* 180.0 (atan (* y-scale (/ -1.0 (* x-scale (tan t_0))))))))))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
	double t_1 = sin(t_0);
	double t_2 = x_45_scale * cos(t_0);
	double t_3 = cos((((double) M_PI) * (angle * 0.011111111111111112)));
	double tmp;
	if (b_m <= 3.5e-88) {
		tmp = 180.0 * (atan(((y_45_scale * t_1) / t_2)) / ((double) M_PI));
	} else if (b_m <= 5.2e+144) {
		tmp = 180.0 * (atan(((fma(a, (a * fma(-0.5, t_3, 0.5)), ((b_m * b_m) * fma(0.5, t_3, 0.5))) / (t_2 * (t_1 * (b_m + a)))) * (y_45_scale / (a - b_m)))) / ((double) M_PI));
	} else {
		tmp = 1.0 / (((double) M_PI) / (180.0 * atan((y_45_scale * (-1.0 / (x_45_scale * tan(t_0)))))));
	}
	return tmp;
}
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	t_0 = Float64(0.005555555555555556 * Float64(angle * pi))
	t_1 = sin(t_0)
	t_2 = Float64(x_45_scale * cos(t_0))
	t_3 = cos(Float64(pi * Float64(angle * 0.011111111111111112)))
	tmp = 0.0
	if (b_m <= 3.5e-88)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * t_1) / t_2)) / pi));
	elseif (b_m <= 5.2e+144)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(fma(a, Float64(a * fma(-0.5, t_3, 0.5)), Float64(Float64(b_m * b_m) * fma(0.5, t_3, 0.5))) / Float64(t_2 * Float64(t_1 * Float64(b_m + a)))) * Float64(y_45_scale / Float64(a - b_m)))) / pi));
	else
		tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(y_45_scale * Float64(-1.0 / Float64(x_45_scale * tan(t_0))))))));
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 3.5e-88], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 5.2e+144], N[(180.0 * N[(N[ArcTan[N[(N[(N[(a * N[(a * N[(-0.5 * t$95$3 + 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(b$95$m * b$95$m), $MachinePrecision] * N[(0.5 * t$95$3 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * N[(t$95$1 * N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / N[(a - b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(y$45$scale * N[(-1.0 / N[(x$45$scale * N[Tan[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
t_2 := x-scale \cdot \cos t\_0\\
t_3 := \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\
\mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-88}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot t\_1}{t\_2}\right)}{\pi}\\

\mathbf{elif}\;b\_m \leq 5.2 \cdot 10^{+144}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(a, a \cdot \mathsf{fma}\left(-0.5, t\_3, 0.5\right), \left(b\_m \cdot b\_m\right) \cdot \mathsf{fma}\left(0.5, t\_3, 0.5\right)\right)}{t\_2 \cdot \left(t\_1 \cdot \left(b\_m + a\right)\right)} \cdot \frac{y-scale}{a - b\_m}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(y-scale \cdot \frac{-1}{x-scale \cdot \tan t\_0}\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 3.5000000000000001e-88

    1. Initial program 14.3%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified26.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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. /-lowering-/.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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6448.6

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

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

    if 3.5000000000000001e-88 < b < 5.1999999999999998e144

    1. Initial program 24.2%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified39.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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    6. Applied egg-rr36.3%

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

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

    if 5.1999999999999998e144 < b

    1. Initial program 0.0%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified3.7%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6485.0

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

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

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

        \[\leadsto \color{blue}{\frac{180 \cdot \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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)}} \]
    10. Applied egg-rr77.5%

      \[\leadsto \color{blue}{\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)}{\pi}} \]
    11. Step-by-step derivation
      1. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 60.5% accurate, 5.9× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_1 := \pi \cdot \left(angle \cdot 0.011111111111111112\right)\\ t_2 := \cos t\_1\\ \mathbf{if}\;b\_m \leq 2.2 \cdot 10^{-88}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin t\_0}{x-scale \cdot \cos t\_0}\right)}{\pi}\\ \mathbf{elif}\;b\_m \leq 5.9 \cdot 10^{+100}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot \mathsf{fma}\left(a, a \cdot \mathsf{fma}\left(-0.5, t\_2, 0.5\right), \left(b\_m \cdot b\_m\right) \cdot \mathsf{fma}\left(0.5, t\_2, 0.5\right)\right)}{\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin t\_1\right)} \cdot -2}{x-scale}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{x-scale \cdot \frac{\tan t\_0}{y-scale}}\right)}{\pi}\\ \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 (* PI (* angle 0.011111111111111112)))
        (t_2 (cos t_1)))
   (if (<= b_m 2.2e-88)
     (* 180.0 (/ (atan (/ (* y-scale (sin t_0)) (* x-scale (cos t_0)))) PI))
     (if (<= b_m 5.9e+100)
       (*
        180.0
        (/
         (atan
          (/
           (*
            (/
             (*
              y-scale
              (fma
               a
               (* a (fma -0.5 t_2 0.5))
               (* (* b_m b_m) (fma 0.5 t_2 0.5))))
             (* (+ b_m a) (* (- b_m a) (sin t_1))))
            -2.0)
           x-scale))
         PI))
       (/ (* 180.0 (atan (/ -1.0 (* x-scale (/ (tan t_0) y-scale))))) PI)))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
	double t_1 = ((double) M_PI) * (angle * 0.011111111111111112);
	double t_2 = cos(t_1);
	double tmp;
	if (b_m <= 2.2e-88) {
		tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / ((double) M_PI));
	} else if (b_m <= 5.9e+100) {
		tmp = 180.0 * (atan(((((y_45_scale * fma(a, (a * fma(-0.5, t_2, 0.5)), ((b_m * b_m) * fma(0.5, t_2, 0.5)))) / ((b_m + a) * ((b_m - a) * sin(t_1)))) * -2.0) / x_45_scale)) / ((double) M_PI));
	} else {
		tmp = (180.0 * atan((-1.0 / (x_45_scale * (tan(t_0) / y_45_scale))))) / ((double) M_PI);
	}
	return tmp;
}
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	t_0 = Float64(0.005555555555555556 * Float64(angle * pi))
	t_1 = Float64(pi * Float64(angle * 0.011111111111111112))
	t_2 = cos(t_1)
	tmp = 0.0
	if (b_m <= 2.2e-88)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * sin(t_0)) / Float64(x_45_scale * cos(t_0)))) / pi));
	elseif (b_m <= 5.9e+100)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(y_45_scale * fma(a, Float64(a * fma(-0.5, t_2, 0.5)), Float64(Float64(b_m * b_m) * fma(0.5, t_2, 0.5)))) / Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(t_1)))) * -2.0) / x_45_scale)) / pi));
	else
		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(x_45_scale * Float64(tan(t_0) / y_45_scale))))) / pi);
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, If[LessEqual[b$95$m, 2.2e-88], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 5.9e+100], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(y$45$scale * N[(a * N[(a * N[(-0.5 * t$95$2 + 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(b$95$m * b$95$m), $MachinePrecision] * N[(0.5 * t$95$2 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] / x$45$scale), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(x$45$scale * N[(N[Tan[t$95$0], $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]]]]
\begin{array}{l}
b_m = \left|b\right|

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

\mathbf{elif}\;b\_m \leq 5.9 \cdot 10^{+100}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot \mathsf{fma}\left(a, a \cdot \mathsf{fma}\left(-0.5, t\_2, 0.5\right), \left(b\_m \cdot b\_m\right) \cdot \mathsf{fma}\left(0.5, t\_2, 0.5\right)\right)}{\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin t\_1\right)} \cdot -2}{x-scale}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{x-scale \cdot \frac{\tan t\_0}{y-scale}}\right)}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.20000000000000005e-88

    1. Initial program 14.3%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified26.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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. /-lowering-/.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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6448.6

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

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

    if 2.20000000000000005e-88 < b < 5.90000000000000027e100

    1. Initial program 25.3%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    2. Add Preprocessing
    3. Applied egg-rr16.6%

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\left(-\frac{y-scale \cdot \mathsf{fma}\left(a \cdot a, 0.5 + -0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}{\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}\right) - \frac{y-scale \cdot \mathsf{fma}\left(a \cdot a, 0.5 + -0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\right)}{\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}}{x-scale}\right)}}{\pi} \]
    7. Applied egg-rr46.4%

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

    if 5.90000000000000027e100 < b

    1. Initial program 2.2%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified6.1%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6484.0

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

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

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

        \[\leadsto \color{blue}{\frac{180 \cdot \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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)}} \]
    10. Applied egg-rr77.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{-1}{x-scale \cdot \frac{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)}{y-scale}}\right)}{\pi} \]
    12. Applied egg-rr86.4%

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

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

Alternative 3: 58.9% accurate, 8.7× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ \mathbf{if}\;b\_m \leq 1.5 \cdot 10^{+20}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{y-scale \cdot \sin t\_0}{x-scale \cdot \cos t\_0}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{x-scale \cdot \frac{\tan t\_0}{y-scale}}\right)}{\pi}\\ \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))))
   (if (<= b_m 1.5e+20)
     (* 180.0 (/ (atan (/ (* y-scale (sin t_0)) (* x-scale (cos t_0)))) PI))
     (/ (* 180.0 (atan (/ -1.0 (* x-scale (/ (tan t_0) y-scale))))) PI))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
	double tmp;
	if (b_m <= 1.5e+20) {
		tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / ((double) M_PI));
	} else {
		tmp = (180.0 * atan((-1.0 / (x_45_scale * (tan(t_0) / y_45_scale))))) / ((double) M_PI);
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = 0.005555555555555556 * (angle * Math.PI);
	double tmp;
	if (b_m <= 1.5e+20) {
		tmp = 180.0 * (Math.atan(((y_45_scale * Math.sin(t_0)) / (x_45_scale * Math.cos(t_0)))) / Math.PI);
	} else {
		tmp = (180.0 * Math.atan((-1.0 / (x_45_scale * (Math.tan(t_0) / y_45_scale))))) / Math.PI;
	}
	return tmp;
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	t_0 = 0.005555555555555556 * (angle * math.pi)
	tmp = 0
	if b_m <= 1.5e+20:
		tmp = 180.0 * (math.atan(((y_45_scale * math.sin(t_0)) / (x_45_scale * math.cos(t_0)))) / math.pi)
	else:
		tmp = (180.0 * math.atan((-1.0 / (x_45_scale * (math.tan(t_0) / y_45_scale))))) / math.pi
	return tmp
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	t_0 = Float64(0.005555555555555556 * Float64(angle * pi))
	tmp = 0.0
	if (b_m <= 1.5e+20)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(y_45_scale * sin(t_0)) / Float64(x_45_scale * cos(t_0)))) / pi));
	else
		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(x_45_scale * Float64(tan(t_0) / y_45_scale))))) / pi);
	end
	return tmp
end
b_m = abs(b);
function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
	t_0 = 0.005555555555555556 * (angle * pi);
	tmp = 0.0;
	if (b_m <= 1.5e+20)
		tmp = 180.0 * (atan(((y_45_scale * sin(t_0)) / (x_45_scale * cos(t_0)))) / pi);
	else
		tmp = (180.0 * atan((-1.0 / (x_45_scale * (tan(t_0) / y_45_scale))))) / pi;
	end
	tmp_2 = tmp;
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1.5e+20], N[(180.0 * N[(N[ArcTan[N[(N[(y$45$scale * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(x$45$scale * N[(N[Tan[t$95$0], $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|

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

\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{x-scale \cdot \frac{\tan t\_0}{y-scale}}\right)}{\pi}\\


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

    1. Initial program 15.8%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified28.1%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. /-lowering-/.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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6448.7

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

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

    if 1.5e20 < b

    1. Initial program 10.0%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified18.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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6471.8

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

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

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

        \[\leadsto \color{blue}{\frac{180 \cdot \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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)}} \]
    10. Applied egg-rr67.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{-1}{x-scale \cdot \frac{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)}{y-scale}}\right)}{\pi} \]
    12. Applied egg-rr73.4%

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

Alternative 4: 44.8% accurate, 11.1× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;x-scale \leq -9 \cdot 10^{-14}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \tan \left(\sqrt{\pi} \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}\right)\right)}\right)}{\pi}\\ \mathbf{elif}\;x-scale \leq 4.3 \cdot 10^{-201}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{90 \cdot \mathsf{fma}\left(y-scale, \left(b\_m \cdot b\_m\right) \cdot -2, 2 \cdot \left(a \cdot \frac{a \cdot \left(x-scale \cdot x-scale\right)}{y-scale}\right)\right)}{\left(angle \cdot \pi\right) \cdot x-scale}}{b\_m - a}}{b\_m + a}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (if (<= x-scale -9e-14)
   (/
    (*
     180.0
     (atan
      (/
       -1.0
       (*
        (/ x-scale y-scale)
        (tan (* (sqrt PI) (* (* 0.005555555555555556 angle) (sqrt PI))))))))
    PI)
   (if (<= x-scale 4.3e-201)
     (*
      180.0
      (/
       (atan
        (/
         (/
          (/
           (*
            90.0
            (fma
             y-scale
             (* (* b_m b_m) -2.0)
             (* 2.0 (* a (/ (* a (* x-scale x-scale)) y-scale)))))
           (* (* angle PI) x-scale))
          (- b_m a))
         (+ b_m a)))
       PI))
     (/
      180.0
      (/
       PI
       (atan
        (/
         -1.0
         (*
          (tan (* 0.005555555555555556 (* angle PI)))
          (/ x-scale y-scale)))))))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (x_45_scale <= -9e-14) {
		tmp = (180.0 * atan((-1.0 / ((x_45_scale / y_45_scale) * tan((sqrt(((double) M_PI)) * ((0.005555555555555556 * angle) * sqrt(((double) M_PI))))))))) / ((double) M_PI);
	} else if (x_45_scale <= 4.3e-201) {
		tmp = 180.0 * (atan(((((90.0 * fma(y_45_scale, ((b_m * b_m) * -2.0), (2.0 * (a * ((a * (x_45_scale * x_45_scale)) / y_45_scale))))) / ((angle * ((double) M_PI)) * x_45_scale)) / (b_m - a)) / (b_m + a))) / ((double) M_PI));
	} else {
		tmp = 180.0 / (((double) M_PI) / atan((-1.0 / (tan((0.005555555555555556 * (angle * ((double) M_PI)))) * (x_45_scale / y_45_scale)))));
	}
	return tmp;
}
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0
	if (x_45_scale <= -9e-14)
		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(Float64(x_45_scale / y_45_scale) * tan(Float64(sqrt(pi) * Float64(Float64(0.005555555555555556 * angle) * sqrt(pi)))))))) / pi);
	elseif (x_45_scale <= 4.3e-201)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(90.0 * fma(y_45_scale, Float64(Float64(b_m * b_m) * -2.0), Float64(2.0 * Float64(a * Float64(Float64(a * Float64(x_45_scale * x_45_scale)) / y_45_scale))))) / Float64(Float64(angle * pi) * x_45_scale)) / Float64(b_m - a)) / Float64(b_m + a))) / pi));
	else
		tmp = Float64(180.0 / Float64(pi / atan(Float64(-1.0 / Float64(tan(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(x_45_scale / y_45_scale))))));
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[x$45$scale, -9e-14], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[(x$45$scale / y$45$scale), $MachinePrecision] * N[Tan[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[x$45$scale, 4.3e-201], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(90.0 * N[(y$45$scale * N[(N[(b$95$m * b$95$m), $MachinePrecision] * -2.0), $MachinePrecision] + N[(2.0 * N[(a * N[(N[(a * N[(x$45$scale * x$45$scale), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * Pi), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] / N[(b$95$m + a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 / N[(Pi / N[ArcTan[N[(-1.0 / N[(N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
\mathbf{if}\;x-scale \leq -9 \cdot 10^{-14}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \tan \left(\sqrt{\pi} \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}\right)\right)}\right)}{\pi}\\

\mathbf{elif}\;x-scale \leq 4.3 \cdot 10^{-201}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{90 \cdot \mathsf{fma}\left(y-scale, \left(b\_m \cdot b\_m\right) \cdot -2, 2 \cdot \left(a \cdot \frac{a \cdot \left(x-scale \cdot x-scale\right)}{y-scale}\right)\right)}{\left(angle \cdot \pi\right) \cdot x-scale}}{b\_m - a}}{b\_m + a}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x-scale < -8.9999999999999995e-14

    1. Initial program 6.8%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified21.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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6442.0

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

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

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

        \[\leadsto \color{blue}{\frac{180 \cdot \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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)}} \]
    10. Applied egg-rr45.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \tan \left(\left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}\right) \cdot \sqrt{\color{blue}{\pi}}\right)}\right)}{\pi} \]
    12. Applied egg-rr46.9%

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

    if -8.9999999999999995e-14 < x-scale < 4.2999999999999997e-201

    1. Initial program 24.2%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified20.0%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    6. Taylor expanded in x-scale around 0

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\color{blue}{\mathsf{fma}\left(-2, {b}^{2} \cdot y-scale, 2 \cdot \frac{{a}^{2} \cdot {x-scale}^{2}}{y-scale}\right)}}{x-scale}}{\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)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \color{blue}{{b}^{2} \cdot y-scale}, 2 \cdot \frac{{a}^{2} \cdot {x-scale}^{2}}{y-scale}\right)}{x-scale}}{\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)} \]
      4. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \color{blue}{\left(b \cdot b\right)} \cdot y-scale, 2 \cdot \frac{{a}^{2} \cdot {x-scale}^{2}}{y-scale}\right)}{x-scale}}{\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)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \color{blue}{\left(b \cdot b\right)} \cdot y-scale, 2 \cdot \frac{{a}^{2} \cdot {x-scale}^{2}}{y-scale}\right)}{x-scale}}{\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. *-lowering-*.f64N/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \color{blue}{\frac{{a}^{2} \cdot {x-scale}^{2}}{y-scale}}\right)}{x-scale}}{\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)} \]
      8. *-lowering-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \frac{\color{blue}{{a}^{2} \cdot {x-scale}^{2}}}{y-scale}\right)}{x-scale}}{\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)} \]
      9. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \frac{\color{blue}{\left(a \cdot a\right)} \cdot {x-scale}^{2}}{y-scale}\right)}{x-scale}}{\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)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \frac{\color{blue}{\left(a \cdot a\right)} \cdot {x-scale}^{2}}{y-scale}\right)}{x-scale}}{\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)} \]
      11. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \frac{\left(a \cdot a\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}}{y-scale}\right)}{x-scale}}{\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)} \]
      12. *-lowering-*.f6427.3

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \frac{\left(a \cdot a\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}}{y-scale}\right)}{x-scale}}{\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}{\pi} \]
    8. Simplified27.3%

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

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

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

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

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

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

    if 4.2999999999999997e-201 < x-scale

    1. Initial program 12.4%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified22.7%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6445.8

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

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

        \[\leadsto 180 \cdot \color{blue}{\frac{1}{\frac{\mathsf{PI}\left(\right)}{\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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}}} \]
      2. un-div-invN/A

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

        \[\leadsto \color{blue}{\frac{180}{\frac{\mathsf{PI}\left(\right)}{\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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \frac{180}{\color{blue}{\frac{\mathsf{PI}\left(\right)}{\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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}}} \]
      5. PI-lowering-PI.f64N/A

        \[\leadsto \frac{180}{\frac{\color{blue}{\mathsf{PI}\left(\right)}}{\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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}} \]
      6. atan-lowering-atan.f64N/A

        \[\leadsto \frac{180}{\frac{\mathsf{PI}\left(\right)}{\color{blue}{\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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}}} \]
      7. neg-mul-1N/A

        \[\leadsto \frac{180}{\frac{\mathsf{PI}\left(\right)}{\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)}}} \]
      8. clear-numN/A

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x-scale \leq -9 \cdot 10^{-14}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \tan \left(\sqrt{\pi} \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt{\pi}\right)\right)}\right)}{\pi}\\ \mathbf{elif}\;x-scale \leq 4.3 \cdot 10^{-201}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{90 \cdot \mathsf{fma}\left(y-scale, \left(b \cdot b\right) \cdot -2, 2 \cdot \left(a \cdot \frac{a \cdot \left(x-scale \cdot x-scale\right)}{y-scale}\right)\right)}{\left(angle \cdot \pi\right) \cdot x-scale}}{b - a}}{b + a}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180}{\frac{\pi}{\tan^{-1} \left(\frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 45.0% accurate, 12.2× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 2.35 \cdot 10^{-178}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\ \mathbf{elif}\;b\_m \leq 5.6 \cdot 10^{+98}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(y-scale \cdot \frac{-1}{x-scale \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \frac{180}{\pi}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (if (<= b_m 2.35e-178)
   (*
    180.0
    (/
     (atan
      (/
       (fma
        (* angle angle)
        (* (/ (* y-scale PI) x-scale) 0.001851851851851852)
        (* -180.0 (/ y-scale (* PI x-scale))))
       angle))
     PI))
   (if (<= b_m 5.6e+98)
     (*
      180.0
      (/
       (atan
        (/
         (/ (/ (* -180.0 (* y-scale (* b_m b_m))) x-scale) (* angle PI))
         (* (+ b_m a) (- b_m a))))
       PI))
     (*
      (atan
       (*
        y-scale
        (/ -1.0 (* x-scale (tan (* 0.005555555555555556 (* angle PI)))))))
      (/ 180.0 PI)))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (b_m <= 2.35e-178) {
		tmp = 180.0 * (atan((fma((angle * angle), (((y_45_scale * ((double) M_PI)) / x_45_scale) * 0.001851851851851852), (-180.0 * (y_45_scale / (((double) M_PI) * x_45_scale)))) / angle)) / ((double) M_PI));
	} else if (b_m <= 5.6e+98) {
		tmp = 180.0 * (atan(((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / (angle * ((double) M_PI))) / ((b_m + a) * (b_m - a)))) / ((double) M_PI));
	} else {
		tmp = atan((y_45_scale * (-1.0 / (x_45_scale * tan((0.005555555555555556 * (angle * ((double) M_PI)))))))) * (180.0 / ((double) M_PI));
	}
	return tmp;
}
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0
	if (b_m <= 2.35e-178)
		tmp = Float64(180.0 * Float64(atan(Float64(fma(Float64(angle * angle), Float64(Float64(Float64(y_45_scale * pi) / x_45_scale) * 0.001851851851851852), Float64(-180.0 * Float64(y_45_scale / Float64(pi * x_45_scale)))) / angle)) / pi));
	elseif (b_m <= 5.6e+98)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(angle * pi)) / Float64(Float64(b_m + a) * Float64(b_m - a)))) / pi));
	else
		tmp = Float64(atan(Float64(y_45_scale * Float64(-1.0 / Float64(x_45_scale * tan(Float64(0.005555555555555556 * Float64(angle * pi))))))) * Float64(180.0 / pi));
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 2.35e-178], N[(180.0 * N[(N[ArcTan[N[(N[(N[(angle * angle), $MachinePrecision] * N[(N[(N[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision] * 0.001851851851851852), $MachinePrecision] + N[(-180.0 * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 5.6e+98], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision] / N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[ArcTan[N[(y$45$scale * N[(-1.0 / N[(x$45$scale * N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 2.35 \cdot 10^{-178}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\

\mathbf{elif}\;b\_m \leq 5.6 \cdot 10^{+98}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\tan^{-1} \left(y-scale \cdot \frac{-1}{x-scale \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \frac{180}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.35e-178

    1. Initial program 13.8%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified25.7%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6440.6

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{{angle}^{2} \cdot \left(\frac{-1}{1080} \cdot \frac{y-scale \cdot \mathsf{PI}\left(\right)}{x-scale} - \frac{-1}{360} \cdot \frac{y-scale \cdot \mathsf{PI}\left(\right)}{x-scale}\right) - 180 \cdot \frac{y-scale}{x-scale \cdot \mathsf{PI}\left(\right)}}{angle}\right)}}{\mathsf{PI}\left(\right)} \]
    11. Simplified37.3%

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

    if 2.35e-178 < b < 5.6000000000000001e98

    1. Initial program 23.6%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified17.3%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \color{blue}{\left(b \cdot b\right)}\right)}{x-scale}}{angle \cdot \pi}}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\pi} \]
    10. Simplified40.3%

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

    if 5.6000000000000001e98 < b

    1. Initial program 2.2%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified6.1%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6484.0

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

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

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

        \[\leadsto \color{blue}{\frac{180 \cdot \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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)}} \]
    10. Applied egg-rr77.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.35 \cdot 10^{-178}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\ \mathbf{elif}\;b \leq 5.6 \cdot 10^{+98}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b \cdot b\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1} \left(y-scale \cdot \frac{-1}{x-scale \cdot \tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right) \cdot \frac{180}{\pi}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 42.6% accurate, 12.2× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;y-scale \leq 5.5 \cdot 10^{-109}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (if (<= y-scale 5.5e-109)
   (/
    (*
     180.0
     (atan
      (/
       -1.0
       (* (tan (* 0.005555555555555556 (* angle PI))) (/ x-scale y-scale)))))
    PI)
   (* 180.0 (/ (atan (* (/ -180.0 angle) (/ y-scale (* PI x-scale)))) PI))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (y_45_scale <= 5.5e-109) {
		tmp = (180.0 * atan((-1.0 / (tan((0.005555555555555556 * (angle * ((double) M_PI)))) * (x_45_scale / y_45_scale))))) / ((double) M_PI);
	} else {
		tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (y_45_scale <= 5.5e-109) {
		tmp = (180.0 * Math.atan((-1.0 / (Math.tan((0.005555555555555556 * (angle * Math.PI))) * (x_45_scale / y_45_scale))))) / Math.PI;
	} else {
		tmp = 180.0 * (Math.atan(((-180.0 / angle) * (y_45_scale / (Math.PI * x_45_scale)))) / Math.PI);
	}
	return tmp;
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	tmp = 0
	if y_45_scale <= 5.5e-109:
		tmp = (180.0 * math.atan((-1.0 / (math.tan((0.005555555555555556 * (angle * math.pi))) * (x_45_scale / y_45_scale))))) / math.pi
	else:
		tmp = 180.0 * (math.atan(((-180.0 / angle) * (y_45_scale / (math.pi * x_45_scale)))) / math.pi)
	return tmp
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0
	if (y_45_scale <= 5.5e-109)
		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(tan(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(x_45_scale / y_45_scale))))) / pi);
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / angle) * Float64(y_45_scale / Float64(pi * x_45_scale)))) / pi));
	end
	return tmp
end
b_m = abs(b);
function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0;
	if (y_45_scale <= 5.5e-109)
		tmp = (180.0 * atan((-1.0 / (tan((0.005555555555555556 * (angle * pi))) * (x_45_scale / y_45_scale))))) / pi;
	else
		tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (pi * x_45_scale)))) / pi);
	end
	tmp_2 = tmp;
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[y$45$scale, 5.5e-109], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / angle), $MachinePrecision] * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
\mathbf{if}\;y-scale \leq 5.5 \cdot 10^{-109}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y-scale < 5.5000000000000003e-109

    1. Initial program 11.5%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified26.0%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6447.2

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

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

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

        \[\leadsto \color{blue}{\frac{180 \cdot \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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)}} \]
    10. Applied egg-rr49.9%

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

    if 5.5000000000000003e-109 < y-scale

    1. Initial program 21.1%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified16.0%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    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. *-lowering-*.f64N/A

        \[\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)} \]
      2. /-lowering-/.f64N/A

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

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}}{\pi} \]
    9. 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. times-fracN/A

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{x-scale \cdot \color{blue}{\pi}}\right)}{\pi} \]
    10. Applied egg-rr47.3%

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

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

Alternative 7: 42.6% accurate, 12.2× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;y-scale \leq 1.8 \cdot 10^{-104}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (if (<= y-scale 1.8e-104)
   (*
    180.0
    (/
     (atan
      (/
       -1.0
       (* (tan (* 0.005555555555555556 (* angle PI))) (/ x-scale y-scale))))
     PI))
   (* 180.0 (/ (atan (* (/ -180.0 angle) (/ y-scale (* PI x-scale)))) PI))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (y_45_scale <= 1.8e-104) {
		tmp = 180.0 * (atan((-1.0 / (tan((0.005555555555555556 * (angle * ((double) M_PI)))) * (x_45_scale / y_45_scale)))) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (y_45_scale <= 1.8e-104) {
		tmp = 180.0 * (Math.atan((-1.0 / (Math.tan((0.005555555555555556 * (angle * Math.PI))) * (x_45_scale / y_45_scale)))) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan(((-180.0 / angle) * (y_45_scale / (Math.PI * x_45_scale)))) / Math.PI);
	}
	return tmp;
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	tmp = 0
	if y_45_scale <= 1.8e-104:
		tmp = 180.0 * (math.atan((-1.0 / (math.tan((0.005555555555555556 * (angle * math.pi))) * (x_45_scale / y_45_scale)))) / math.pi)
	else:
		tmp = 180.0 * (math.atan(((-180.0 / angle) * (y_45_scale / (math.pi * x_45_scale)))) / math.pi)
	return tmp
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0
	if (y_45_scale <= 1.8e-104)
		tmp = Float64(180.0 * Float64(atan(Float64(-1.0 / Float64(tan(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(x_45_scale / y_45_scale)))) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / angle) * Float64(y_45_scale / Float64(pi * x_45_scale)))) / pi));
	end
	return tmp
end
b_m = abs(b);
function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0;
	if (y_45_scale <= 1.8e-104)
		tmp = 180.0 * (atan((-1.0 / (tan((0.005555555555555556 * (angle * pi))) * (x_45_scale / y_45_scale)))) / pi);
	else
		tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (pi * x_45_scale)))) / pi);
	end
	tmp_2 = tmp;
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[y$45$scale, 1.8e-104], N[(180.0 * N[(N[ArcTan[N[(-1.0 / N[(N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / angle), $MachinePrecision] * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
\mathbf{if}\;y-scale \leq 1.8 \cdot 10^{-104}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-1}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y-scale < 1.7999999999999999e-104

    1. Initial program 11.5%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified26.0%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6447.2

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

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

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

        \[\leadsto \color{blue}{\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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)} \cdot 180} \]
    10. Applied egg-rr49.9%

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

    if 1.7999999999999999e-104 < y-scale

    1. Initial program 21.1%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified16.0%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    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. *-lowering-*.f64N/A

        \[\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)} \]
      2. /-lowering-/.f64N/A

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

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}}{\pi} \]
    9. 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. times-fracN/A

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{x-scale \cdot \color{blue}{\pi}}\right)}{\pi} \]
    10. Applied egg-rr47.3%

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

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

Alternative 8: 45.0% accurate, 12.4× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 4 \cdot 10^{-179}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\ \mathbf{elif}\;b\_m \leq 3.1 \cdot 10^{+98}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-x-scale\right)}\right)}{\pi}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (if (<= b_m 4e-179)
   (*
    180.0
    (/
     (atan
      (/
       (fma
        (* angle angle)
        (* (/ (* y-scale PI) x-scale) 0.001851851851851852)
        (* -180.0 (/ y-scale (* PI x-scale))))
       angle))
     PI))
   (if (<= b_m 3.1e+98)
     (*
      180.0
      (/
       (atan
        (/
         (/ (/ (* -180.0 (* y-scale (* b_m b_m))) x-scale) (* angle PI))
         (* (+ b_m a) (- b_m a))))
       PI))
     (/
      (*
       180.0
       (atan
        (/
         y-scale
         (* (tan (* 0.005555555555555556 (* angle PI))) (- x-scale)))))
      PI))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (b_m <= 4e-179) {
		tmp = 180.0 * (atan((fma((angle * angle), (((y_45_scale * ((double) M_PI)) / x_45_scale) * 0.001851851851851852), (-180.0 * (y_45_scale / (((double) M_PI) * x_45_scale)))) / angle)) / ((double) M_PI));
	} else if (b_m <= 3.1e+98) {
		tmp = 180.0 * (atan(((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / (angle * ((double) M_PI))) / ((b_m + a) * (b_m - a)))) / ((double) M_PI));
	} else {
		tmp = (180.0 * atan((y_45_scale / (tan((0.005555555555555556 * (angle * ((double) M_PI)))) * -x_45_scale)))) / ((double) M_PI);
	}
	return tmp;
}
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0
	if (b_m <= 4e-179)
		tmp = Float64(180.0 * Float64(atan(Float64(fma(Float64(angle * angle), Float64(Float64(Float64(y_45_scale * pi) / x_45_scale) * 0.001851851851851852), Float64(-180.0 * Float64(y_45_scale / Float64(pi * x_45_scale)))) / angle)) / pi));
	elseif (b_m <= 3.1e+98)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(angle * pi)) / Float64(Float64(b_m + a) * Float64(b_m - a)))) / pi));
	else
		tmp = Float64(Float64(180.0 * atan(Float64(y_45_scale / Float64(tan(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(-x_45_scale))))) / pi);
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 4e-179], N[(180.0 * N[(N[ArcTan[N[(N[(N[(angle * angle), $MachinePrecision] * N[(N[(N[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision] * 0.001851851851851852), $MachinePrecision] + N[(-180.0 * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3.1e+98], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision] / N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(N[(180.0 * N[ArcTan[N[(y$45$scale / N[(N[Tan[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-x$45$scale)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 4 \cdot 10^{-179}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\

\mathbf{elif}\;b\_m \leq 3.1 \cdot 10^{+98}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-x-scale\right)}\right)}{\pi}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 4.0000000000000001e-179

    1. Initial program 13.8%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified25.7%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6440.6

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{{angle}^{2} \cdot \left(\frac{-1}{1080} \cdot \frac{y-scale \cdot \mathsf{PI}\left(\right)}{x-scale} - \frac{-1}{360} \cdot \frac{y-scale \cdot \mathsf{PI}\left(\right)}{x-scale}\right) - 180 \cdot \frac{y-scale}{x-scale \cdot \mathsf{PI}\left(\right)}}{angle}\right)}}{\mathsf{PI}\left(\right)} \]
    11. Simplified37.3%

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

    if 4.0000000000000001e-179 < b < 3.10000000000000019e98

    1. Initial program 23.6%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified17.3%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \color{blue}{\left(b \cdot b\right)}\right)}{x-scale}}{angle \cdot \pi}}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\pi} \]
    10. Simplified40.3%

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

    if 3.10000000000000019e98 < b

    1. Initial program 2.2%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified6.1%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6484.0

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

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

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

        \[\leadsto \color{blue}{\frac{180 \cdot \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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)}} \]
    10. Applied egg-rr77.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 4 \cdot 10^{-179}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{+98}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b \cdot b\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{y-scale}{\tan \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-x-scale\right)}\right)}{\pi}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 44.0% accurate, 16.5× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 7.2 \cdot 10^{-179}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\ \mathbf{elif}\;b\_m \leq 3 \cdot 10^{+139}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (if (<= b_m 7.2e-179)
   (*
    180.0
    (/
     (atan
      (/
       (fma
        (* angle angle)
        (* (/ (* y-scale PI) x-scale) 0.001851851851851852)
        (* -180.0 (/ y-scale (* PI x-scale))))
       angle))
     PI))
   (if (<= b_m 3e+139)
     (*
      180.0
      (/
       (atan
        (/
         (/ (/ (* -180.0 (* y-scale (* b_m b_m))) x-scale) (* angle PI))
         (* (+ b_m a) (- b_m a))))
       PI))
     (/
      1.0
      (/
       PI
       (* 180.0 (atan (* -180.0 (/ y-scale (* (* angle PI) x-scale))))))))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (b_m <= 7.2e-179) {
		tmp = 180.0 * (atan((fma((angle * angle), (((y_45_scale * ((double) M_PI)) / x_45_scale) * 0.001851851851851852), (-180.0 * (y_45_scale / (((double) M_PI) * x_45_scale)))) / angle)) / ((double) M_PI));
	} else if (b_m <= 3e+139) {
		tmp = 180.0 * (atan(((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / (angle * ((double) M_PI))) / ((b_m + a) * (b_m - a)))) / ((double) M_PI));
	} else {
		tmp = 1.0 / (((double) M_PI) / (180.0 * atan((-180.0 * (y_45_scale / ((angle * ((double) M_PI)) * x_45_scale))))));
	}
	return tmp;
}
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0
	if (b_m <= 7.2e-179)
		tmp = Float64(180.0 * Float64(atan(Float64(fma(Float64(angle * angle), Float64(Float64(Float64(y_45_scale * pi) / x_45_scale) * 0.001851851851851852), Float64(-180.0 * Float64(y_45_scale / Float64(pi * x_45_scale)))) / angle)) / pi));
	elseif (b_m <= 3e+139)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(angle * pi)) / Float64(Float64(b_m + a) * Float64(b_m - a)))) / pi));
	else
		tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(-180.0 * Float64(y_45_scale / Float64(Float64(angle * pi) * x_45_scale)))))));
	end
	return tmp
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 7.2e-179], N[(180.0 * N[(N[ArcTan[N[(N[(N[(angle * angle), $MachinePrecision] * N[(N[(N[(y$45$scale * Pi), $MachinePrecision] / x$45$scale), $MachinePrecision] * 0.001851851851851852), $MachinePrecision] + N[(-180.0 * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3e+139], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision] / N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(N[(angle * Pi), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 7.2 \cdot 10^{-179}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\

\mathbf{elif}\;b\_m \leq 3 \cdot 10^{+139}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 7.20000000000000015e-179

    1. Initial program 13.8%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified25.7%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6440.6

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{{angle}^{2} \cdot \left(\frac{-1}{1080} \cdot \frac{y-scale \cdot \mathsf{PI}\left(\right)}{x-scale} - \frac{-1}{360} \cdot \frac{y-scale \cdot \mathsf{PI}\left(\right)}{x-scale}\right) - 180 \cdot \frac{y-scale}{x-scale \cdot \mathsf{PI}\left(\right)}}{angle}\right)}}{\mathsf{PI}\left(\right)} \]
    11. Simplified37.3%

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

    if 7.20000000000000015e-179 < b < 3e139

    1. Initial program 22.9%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified16.0%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \color{blue}{\left(b \cdot b\right)}\right)}{x-scale}}{angle \cdot \pi}}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\pi} \]
    10. Simplified39.8%

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

    if 3e139 < b

    1. Initial program 0.0%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified0.0%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    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. *-lowering-*.f64N/A

        \[\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)} \]
      2. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{x-scale \cdot \left(angle \cdot \color{blue}{\pi}\right)}\right)}} \]
    10. Applied egg-rr83.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 7.2 \cdot 10^{-179}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\mathsf{fma}\left(angle \cdot angle, \frac{y-scale \cdot \pi}{x-scale} \cdot 0.001851851851851852, -180 \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{angle}\right)}{\pi}\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+139}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b \cdot b\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 43.5% accurate, 16.5× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 2.6 \cdot 10^{-253}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}\\ \mathbf{elif}\;b\_m \leq 1.75 \cdot 10^{+141}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (if (<= b_m 2.6e-253)
   (* 180.0 (/ (atan (* (/ -180.0 angle) (/ y-scale (* PI x-scale)))) PI))
   (if (<= b_m 1.75e+141)
     (*
      180.0
      (/
       (atan
        (/
         (/ (/ (* -180.0 (* y-scale (* b_m b_m))) x-scale) (* angle PI))
         (* (+ b_m a) (- b_m a))))
       PI))
     (/
      1.0
      (/
       PI
       (* 180.0 (atan (* -180.0 (/ y-scale (* (* angle PI) x-scale))))))))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (b_m <= 2.6e-253) {
		tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
	} else if (b_m <= 1.75e+141) {
		tmp = 180.0 * (atan(((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / (angle * ((double) M_PI))) / ((b_m + a) * (b_m - a)))) / ((double) M_PI));
	} else {
		tmp = 1.0 / (((double) M_PI) / (180.0 * atan((-180.0 * (y_45_scale / ((angle * ((double) M_PI)) * x_45_scale))))));
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (b_m <= 2.6e-253) {
		tmp = 180.0 * (Math.atan(((-180.0 / angle) * (y_45_scale / (Math.PI * x_45_scale)))) / Math.PI);
	} else if (b_m <= 1.75e+141) {
		tmp = 180.0 * (Math.atan(((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / (angle * Math.PI)) / ((b_m + a) * (b_m - a)))) / Math.PI);
	} else {
		tmp = 1.0 / (Math.PI / (180.0 * Math.atan((-180.0 * (y_45_scale / ((angle * Math.PI) * x_45_scale))))));
	}
	return tmp;
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	tmp = 0
	if b_m <= 2.6e-253:
		tmp = 180.0 * (math.atan(((-180.0 / angle) * (y_45_scale / (math.pi * x_45_scale)))) / math.pi)
	elif b_m <= 1.75e+141:
		tmp = 180.0 * (math.atan(((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / (angle * math.pi)) / ((b_m + a) * (b_m - a)))) / math.pi)
	else:
		tmp = 1.0 / (math.pi / (180.0 * math.atan((-180.0 * (y_45_scale / ((angle * math.pi) * x_45_scale))))))
	return tmp
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0
	if (b_m <= 2.6e-253)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / angle) * Float64(y_45_scale / Float64(pi * x_45_scale)))) / pi));
	elseif (b_m <= 1.75e+141)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(angle * pi)) / Float64(Float64(b_m + a) * Float64(b_m - a)))) / pi));
	else
		tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(-180.0 * Float64(y_45_scale / Float64(Float64(angle * pi) * x_45_scale)))))));
	end
	return tmp
end
b_m = abs(b);
function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0;
	if (b_m <= 2.6e-253)
		tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (pi * x_45_scale)))) / pi);
	elseif (b_m <= 1.75e+141)
		tmp = 180.0 * (atan(((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / (angle * pi)) / ((b_m + a) * (b_m - a)))) / pi);
	else
		tmp = 1.0 / (pi / (180.0 * atan((-180.0 * (y_45_scale / ((angle * pi) * x_45_scale))))));
	end
	tmp_2 = tmp;
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 2.6e-253], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / angle), $MachinePrecision] * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 1.75e+141], N[(180.0 * N[(N[ArcTan[N[(N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision] / N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(N[(angle * Pi), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 2.6 \cdot 10^{-253}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}\\

\mathbf{elif}\;b\_m \leq 1.75 \cdot 10^{+141}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b\_m + a\right) \cdot \left(b\_m - a\right)}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 2.6e-253

    1. Initial program 15.9%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified13.5%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    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. *-lowering-*.f64N/A

        \[\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)} \]
      2. /-lowering-/.f64N/A

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \color{blue}{\pi}\right)}\right)}{\pi} \]
    8. Simplified44.5%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}}{\pi} \]
    9. 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. times-fracN/A

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{x-scale \cdot \color{blue}{\pi}}\right)}{\pi} \]
    10. Applied egg-rr47.2%

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

    if 2.6e-253 < b < 1.75e141

    1. Initial program 17.2%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified12.1%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    6. Step-by-step derivation
      1. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \color{blue}{\left(b \cdot b\right)}\right)}{x-scale}}{angle \cdot \pi}}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\pi} \]
    10. Simplified36.1%

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

    if 1.75e141 < b

    1. Initial program 0.0%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified0.0%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    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. *-lowering-*.f64N/A

        \[\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)} \]
      2. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{x-scale \cdot \left(angle \cdot \color{blue}{\pi}\right)}\right)}} \]
    10. Applied egg-rr83.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.6 \cdot 10^{-253}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}\\ \mathbf{elif}\;b \leq 1.75 \cdot 10^{+141}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b \cdot b\right)\right)}{x-scale}}{angle \cdot \pi}}{\left(b + a\right) \cdot \left(b - a\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 41.9% accurate, 17.0× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 1.7 \cdot 10^{-24}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\ \mathbf{elif}\;b\_m \leq 8 \cdot 10^{+143}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{\left(angle \cdot \pi\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)}}{x-scale}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (if (<= b_m 1.7e-24)
   (/
    (*
     180.0
     (atan
      (/ -1.0 (* (* 0.005555555555555556 (* angle PI)) (/ x-scale y-scale)))))
    PI)
   (if (<= b_m 8e+143)
     (*
      180.0
      (/
       (atan
        (/
         (/
          (* -180.0 (* y-scale (* b_m b_m)))
          (* (* angle PI) (* (+ b_m a) (- b_m a))))
         x-scale))
       PI))
     (/
      1.0
      (/
       PI
       (* 180.0 (atan (* -180.0 (/ y-scale (* (* angle PI) x-scale))))))))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (b_m <= 1.7e-24) {
		tmp = (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * ((double) M_PI))) * (x_45_scale / y_45_scale))))) / ((double) M_PI);
	} else if (b_m <= 8e+143) {
		tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / ((angle * ((double) M_PI)) * ((b_m + a) * (b_m - a)))) / x_45_scale)) / ((double) M_PI));
	} else {
		tmp = 1.0 / (((double) M_PI) / (180.0 * atan((-180.0 * (y_45_scale / ((angle * ((double) M_PI)) * x_45_scale))))));
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (b_m <= 1.7e-24) {
		tmp = (180.0 * Math.atan((-1.0 / ((0.005555555555555556 * (angle * Math.PI)) * (x_45_scale / y_45_scale))))) / Math.PI;
	} else if (b_m <= 8e+143) {
		tmp = 180.0 * (Math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / ((angle * Math.PI) * ((b_m + a) * (b_m - a)))) / x_45_scale)) / Math.PI);
	} else {
		tmp = 1.0 / (Math.PI / (180.0 * Math.atan((-180.0 * (y_45_scale / ((angle * Math.PI) * x_45_scale))))));
	}
	return tmp;
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	tmp = 0
	if b_m <= 1.7e-24:
		tmp = (180.0 * math.atan((-1.0 / ((0.005555555555555556 * (angle * math.pi)) * (x_45_scale / y_45_scale))))) / math.pi
	elif b_m <= 8e+143:
		tmp = 180.0 * (math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / ((angle * math.pi) * ((b_m + a) * (b_m - a)))) / x_45_scale)) / math.pi)
	else:
		tmp = 1.0 / (math.pi / (180.0 * math.atan((-180.0 * (y_45_scale / ((angle * math.pi) * x_45_scale))))))
	return tmp
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0
	if (b_m <= 1.7e-24)
		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(Float64(0.005555555555555556 * Float64(angle * pi)) * Float64(x_45_scale / y_45_scale))))) / pi);
	elseif (b_m <= 8e+143)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / Float64(Float64(angle * pi) * Float64(Float64(b_m + a) * Float64(b_m - a)))) / x_45_scale)) / pi));
	else
		tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(-180.0 * Float64(y_45_scale / Float64(Float64(angle * pi) * x_45_scale)))))));
	end
	return tmp
end
b_m = abs(b);
function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0;
	if (b_m <= 1.7e-24)
		tmp = (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * pi)) * (x_45_scale / y_45_scale))))) / pi;
	elseif (b_m <= 8e+143)
		tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / ((angle * pi) * ((b_m + a) * (b_m - a)))) / x_45_scale)) / pi);
	else
		tmp = 1.0 / (pi / (180.0 * atan((-180.0 * (y_45_scale / ((angle * pi) * x_45_scale))))));
	end
	tmp_2 = tmp;
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 1.7e-24], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[b$95$m, 8e+143], N[(180.0 * N[(N[ArcTan[N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(angle * Pi), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(N[(angle * Pi), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 1.7 \cdot 10^{-24}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\

\mathbf{elif}\;b\_m \leq 8 \cdot 10^{+143}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{\left(angle \cdot \pi\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)}}{x-scale}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 1.69999999999999996e-24

    1. Initial program 15.1%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified27.1%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6438.9

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

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

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

        \[\leadsto \color{blue}{\frac{180 \cdot \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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)}} \]
    10. Applied egg-rr43.6%

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

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

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)}\right)}{\pi} \]
    13. Simplified42.2%

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

    if 1.69999999999999996e-24 < b < 8.0000000000000002e143

    1. Initial program 24.1%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    2. Add Preprocessing
    3. Applied egg-rr12.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b \cdot b\right)\right)}{\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \color{blue}{\left(b - a\right)}\right)}}{x-scale}\right)}{\pi} \]
    9. Simplified49.8%

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

    if 8.0000000000000002e143 < b

    1. Initial program 0.0%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified0.0%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    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. *-lowering-*.f64N/A

        \[\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)} \]
      2. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{x-scale \cdot \left(angle \cdot \color{blue}{\pi}\right)}\right)}} \]
    10. Applied egg-rr83.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.7 \cdot 10^{-24}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\ \mathbf{elif}\;b \leq 8 \cdot 10^{+143}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b \cdot b\right)\right)}{\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}}{x-scale}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 42.0% accurate, 17.0× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-24}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\ \mathbf{elif}\;b\_m \leq 2.7 \cdot 10^{+140}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{\left(angle \cdot \pi\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (if (<= b_m 3.5e-24)
   (/
    (*
     180.0
     (atan
      (/ -1.0 (* (* 0.005555555555555556 (* angle PI)) (/ x-scale y-scale)))))
    PI)
   (if (<= b_m 2.7e+140)
     (*
      180.0
      (/
       (atan
        (/
         (/ (* -180.0 (* y-scale (* b_m b_m))) x-scale)
         (* (* angle PI) (* (+ b_m a) (- b_m a)))))
       PI))
     (/
      1.0
      (/
       PI
       (* 180.0 (atan (* -180.0 (/ y-scale (* (* angle PI) x-scale))))))))))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (b_m <= 3.5e-24) {
		tmp = (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * ((double) M_PI))) * (x_45_scale / y_45_scale))))) / ((double) M_PI);
	} else if (b_m <= 2.7e+140) {
		tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * ((double) M_PI)) * ((b_m + a) * (b_m - a))))) / ((double) M_PI));
	} else {
		tmp = 1.0 / (((double) M_PI) / (180.0 * atan((-180.0 * (y_45_scale / ((angle * ((double) M_PI)) * x_45_scale))))));
	}
	return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (b_m <= 3.5e-24) {
		tmp = (180.0 * Math.atan((-1.0 / ((0.005555555555555556 * (angle * Math.PI)) * (x_45_scale / y_45_scale))))) / Math.PI;
	} else if (b_m <= 2.7e+140) {
		tmp = 180.0 * (Math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * Math.PI) * ((b_m + a) * (b_m - a))))) / Math.PI);
	} else {
		tmp = 1.0 / (Math.PI / (180.0 * Math.atan((-180.0 * (y_45_scale / ((angle * Math.PI) * x_45_scale))))));
	}
	return tmp;
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	tmp = 0
	if b_m <= 3.5e-24:
		tmp = (180.0 * math.atan((-1.0 / ((0.005555555555555556 * (angle * math.pi)) * (x_45_scale / y_45_scale))))) / math.pi
	elif b_m <= 2.7e+140:
		tmp = 180.0 * (math.atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * math.pi) * ((b_m + a) * (b_m - a))))) / math.pi)
	else:
		tmp = 1.0 / (math.pi / (180.0 * math.atan((-180.0 * (y_45_scale / ((angle * math.pi) * x_45_scale))))))
	return tmp
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0
	if (b_m <= 3.5e-24)
		tmp = Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(Float64(0.005555555555555556 * Float64(angle * pi)) * Float64(x_45_scale / y_45_scale))))) / pi);
	elseif (b_m <= 2.7e+140)
		tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(-180.0 * Float64(y_45_scale * Float64(b_m * b_m))) / x_45_scale) / Float64(Float64(angle * pi) * Float64(Float64(b_m + a) * Float64(b_m - a))))) / pi));
	else
		tmp = Float64(1.0 / Float64(pi / Float64(180.0 * atan(Float64(-180.0 * Float64(y_45_scale / Float64(Float64(angle * pi) * x_45_scale)))))));
	end
	return tmp
end
b_m = abs(b);
function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 0.0;
	if (b_m <= 3.5e-24)
		tmp = (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * pi)) * (x_45_scale / y_45_scale))))) / pi;
	elseif (b_m <= 2.7e+140)
		tmp = 180.0 * (atan((((-180.0 * (y_45_scale * (b_m * b_m))) / x_45_scale) / ((angle * pi) * ((b_m + a) * (b_m - a))))) / pi);
	else
		tmp = 1.0 / (pi / (180.0 * atan((-180.0 * (y_45_scale / ((angle * pi) * x_45_scale))))));
	end
	tmp_2 = tmp;
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[b$95$m, 3.5e-24], N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], If[LessEqual[b$95$m, 2.7e+140], N[(180.0 * N[(N[ArcTan[N[(N[(N[(-180.0 * N[(y$45$scale * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(N[(angle * Pi), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(Pi / N[(180.0 * N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(N[(angle * Pi), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|

\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 3.5 \cdot 10^{-24}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\

\mathbf{elif}\;b\_m \leq 2.7 \cdot 10^{+140}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b\_m \cdot b\_m\right)\right)}{x-scale}}{\left(angle \cdot \pi\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 3.4999999999999996e-24

    1. Initial program 15.1%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified27.1%

      \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
    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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6438.9

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

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

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

        \[\leadsto \color{blue}{\frac{180 \cdot \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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)}} \]
    10. Applied egg-rr43.6%

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

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

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

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

        \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)}\right)}{\pi} \]
    13. Simplified42.2%

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

    if 3.4999999999999996e-24 < b < 2.70000000000000018e140

    1. Initial program 24.1%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified19.0%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    6. Taylor expanded in x-scale around 0

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\color{blue}{\mathsf{fma}\left(-2, {b}^{2} \cdot y-scale, 2 \cdot \frac{{a}^{2} \cdot {x-scale}^{2}}{y-scale}\right)}}{x-scale}}{\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)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \color{blue}{{b}^{2} \cdot y-scale}, 2 \cdot \frac{{a}^{2} \cdot {x-scale}^{2}}{y-scale}\right)}{x-scale}}{\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)} \]
      4. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \color{blue}{\left(b \cdot b\right)} \cdot y-scale, 2 \cdot \frac{{a}^{2} \cdot {x-scale}^{2}}{y-scale}\right)}{x-scale}}{\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)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \color{blue}{\left(b \cdot b\right)} \cdot y-scale, 2 \cdot \frac{{a}^{2} \cdot {x-scale}^{2}}{y-scale}\right)}{x-scale}}{\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. *-lowering-*.f64N/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \color{blue}{\frac{{a}^{2} \cdot {x-scale}^{2}}{y-scale}}\right)}{x-scale}}{\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)} \]
      8. *-lowering-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \frac{\color{blue}{{a}^{2} \cdot {x-scale}^{2}}}{y-scale}\right)}{x-scale}}{\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)} \]
      9. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \frac{\color{blue}{\left(a \cdot a\right)} \cdot {x-scale}^{2}}{y-scale}\right)}{x-scale}}{\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)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \frac{\color{blue}{\left(a \cdot a\right)} \cdot {x-scale}^{2}}{y-scale}\right)}{x-scale}}{\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)} \]
      11. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \frac{\left(a \cdot a\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}}{y-scale}\right)}{x-scale}}{\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)} \]
      12. *-lowering-*.f6428.2

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{90 \cdot \frac{\mathsf{fma}\left(-2, \left(b \cdot b\right) \cdot y-scale, 2 \cdot \frac{\left(a \cdot a\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}}{y-scale}\right)}{x-scale}}{\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}{\pi} \]
    8. Simplified28.2%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{-180 \cdot \frac{{b}^{2} \cdot y-scale}{x-scale}}}{\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)} \]
    10. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\color{blue}{\frac{-180 \cdot \left({b}^{2} \cdot y-scale\right)}{x-scale}}}{\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)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{\color{blue}{-180 \cdot \left({b}^{2} \cdot y-scale\right)}}{x-scale}}{\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)} \]
      4. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \color{blue}{\left(y-scale \cdot {b}^{2}\right)}}{x-scale}}{\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)} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \color{blue}{\left(y-scale \cdot {b}^{2}\right)}}{x-scale}}{\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. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \color{blue}{\left(b \cdot b\right)}\right)}{x-scale}}{\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)} \]
      7. *-lowering-*.f6449.8

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \color{blue}{\left(b \cdot b\right)}\right)}{x-scale}}{\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}{\pi} \]
    11. Simplified49.8%

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

    if 2.70000000000000018e140 < b

    1. Initial program 0.0%

      \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
    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. /-lowering-/.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. Simplified0.0%

      \[\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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
    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. *-lowering-*.f64N/A

        \[\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)} \]
      2. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{x-scale \cdot \left(angle \cdot \color{blue}{\pi}\right)}\right)}} \]
    10. Applied egg-rr83.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3.5 \cdot 10^{-24}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{+140}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{\frac{-180 \cdot \left(y-scale \cdot \left(b \cdot b\right)\right)}{x-scale}}{\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\pi}{180 \cdot \tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot \pi\right) \cdot x-scale}\right)}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 39.8% accurate, 20.6× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (/
  (*
   180.0
   (atan
    (/ -1.0 (* (* 0.005555555555555556 (* angle PI)) (/ x-scale y-scale)))))
  PI))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	return (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * ((double) M_PI))) * (x_45_scale / y_45_scale))))) / ((double) M_PI);
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	return (180.0 * Math.atan((-1.0 / ((0.005555555555555556 * (angle * Math.PI)) * (x_45_scale / y_45_scale))))) / Math.PI;
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	return (180.0 * math.atan((-1.0 / ((0.005555555555555556 * (angle * math.pi)) * (x_45_scale / y_45_scale))))) / math.pi
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	return Float64(Float64(180.0 * atan(Float64(-1.0 / Float64(Float64(0.005555555555555556 * Float64(angle * pi)) * Float64(x_45_scale / y_45_scale))))) / pi)
end
b_m = abs(b);
function tmp = code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = (180.0 * atan((-1.0 / ((0.005555555555555556 * (angle * pi)) * (x_45_scale / y_45_scale))))) / pi;
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(N[(180.0 * N[ArcTan[N[(-1.0 / N[(N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision] * N[(x$45$scale / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|

\\
\frac{180 \cdot \tan^{-1} \left(\frac{-1}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \frac{x-scale}{y-scale}}\right)}{\pi}
\end{array}
Derivation
  1. Initial program 14.7%

    \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
  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. /-lowering-/.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. Simplified26.4%

    \[\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 \pi\right)\right)}^{2}, b \cdot b, {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)}\right)}}{\pi} \]
  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. neg-lowering-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. /-lowering-/.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. *-lowering-*.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. cos-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-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. *-lowering-*.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. sin-lowering-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. *-lowering-*.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. *-lowering-*.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. PI-lowering-PI.f6444.2

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

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

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

      \[\leadsto \color{blue}{\frac{180 \cdot \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 \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}\right)\right)}{\mathsf{PI}\left(\right)}} \]
  10. Applied egg-rr47.0%

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

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

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

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

      \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\pi}\right)\right)}\right)}{\pi} \]
  13. Simplified45.0%

    \[\leadsto \frac{180 \cdot \tan^{-1} \left(\frac{-1}{\frac{x-scale}{y-scale} \cdot \color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}}\right)}{\pi} \]
  14. Final simplification45.0%

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

Alternative 14: 39.5% accurate, 21.3× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot -180}{\pi \cdot x-scale}}{angle}\right)}{\pi} \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) (* PI x-scale)) angle)) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	return 180.0 * (atan((((y_45_scale * -180.0) / (((double) M_PI) * x_45_scale)) / angle)) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	return 180.0 * (Math.atan((((y_45_scale * -180.0) / (Math.PI * x_45_scale)) / angle)) / Math.PI);
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	return 180.0 * (math.atan((((y_45_scale * -180.0) / (math.pi * x_45_scale)) / angle)) / math.pi)
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	return Float64(180.0 * Float64(atan(Float64(Float64(Float64(y_45_scale * -180.0) / Float64(pi * x_45_scale)) / angle)) / pi))
end
b_m = abs(b);
function tmp = code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 180.0 * (atan((((y_45_scale * -180.0) / (pi * x_45_scale)) / angle)) / pi);
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(N[(y$45$scale * -180.0), $MachinePrecision] / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision] / angle), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|

\\
180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot -180}{\pi \cdot x-scale}}{angle}\right)}{\pi}
\end{array}
Derivation
  1. Initial program 14.7%

    \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
  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. /-lowering-/.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. Simplified11.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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
  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. *-lowering-*.f64N/A

      \[\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)} \]
    2. /-lowering-/.f64N/A

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \color{blue}{\pi}\right)}\right)}{\pi} \]
  8. Simplified42.5%

    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}}{\pi} \]
  9. 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. *-commutativeN/A

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

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

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

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

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{\frac{y-scale \cdot -180}{x-scale \cdot \color{blue}{\pi}}}{angle}\right)}{\pi} \]
  10. Applied egg-rr44.7%

    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\frac{y-scale \cdot -180}{x-scale \cdot \pi}}{angle}\right)}}{\pi} \]
  11. Final simplification44.7%

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

Alternative 15: 39.4% accurate, 21.3× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (* 180.0 (/ (atan (* (/ -180.0 angle) (/ y-scale (* PI x-scale)))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	return 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	return 180.0 * (Math.atan(((-180.0 / angle) * (y_45_scale / (Math.PI * x_45_scale)))) / Math.PI);
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	return 180.0 * (math.atan(((-180.0 / angle) * (y_45_scale / (math.pi * x_45_scale)))) / math.pi)
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	return Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / angle) * Float64(y_45_scale / Float64(pi * x_45_scale)))) / pi))
end
b_m = abs(b);
function tmp = code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (pi * x_45_scale)))) / pi);
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / angle), $MachinePrecision] * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|

\\
180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}
\end{array}
Derivation
  1. Initial program 14.7%

    \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
  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. /-lowering-/.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. Simplified11.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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
  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. *-lowering-*.f64N/A

      \[\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)} \]
    2. /-lowering-/.f64N/A

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \color{blue}{\pi}\right)}\right)}{\pi} \]
  8. Simplified42.5%

    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}}{\pi} \]
  9. 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. times-fracN/A

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

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

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{x-scale \cdot \color{blue}{\pi}}\right)}{\pi} \]
  10. Applied egg-rr44.6%

    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{-180}{angle} \cdot \frac{y-scale}{x-scale \cdot \pi}\right)}}{\pi} \]
  11. Final simplification44.6%

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

Alternative 16: 37.6% accurate, 22.2× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(\pi \cdot x-scale\right)}\right)}{\pi} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (* 180.0 (/ (atan (* -180.0 (/ y-scale (* angle (* PI x-scale))))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	return 180.0 * (atan((-180.0 * (y_45_scale / (angle * (((double) M_PI) * x_45_scale))))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	return 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * (Math.PI * x_45_scale))))) / Math.PI);
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	return 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * (math.pi * x_45_scale))))) / math.pi)
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(pi * x_45_scale))))) / pi))
end
b_m = abs(b);
function tmp = code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (pi * x_45_scale))))) / pi);
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(angle * N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|

\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(\pi \cdot x-scale\right)}\right)}{\pi}
\end{array}
Derivation
  1. Initial program 14.7%

    \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
  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. /-lowering-/.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. Simplified11.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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
  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. *-lowering-*.f64N/A

      \[\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)} \]
    2. /-lowering-/.f64N/A

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \color{blue}{\pi}\right)}\right)}{\pi} \]
  8. Simplified42.5%

    \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}}{\pi} \]
  9. Final simplification42.5%

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

Alternative 17: 14.6% accurate, 22.2× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (* 180.0 (/ (atan (* -180.0 (/ x-scale (* angle (* y-scale PI))))) PI)))
b_m = fabs(b);
double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	return 180.0 * (atan((-180.0 * (x_45_scale / (angle * (y_45_scale * ((double) M_PI)))))) / ((double) M_PI));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle, double x_45_scale, double y_45_scale) {
	return 180.0 * (Math.atan((-180.0 * (x_45_scale / (angle * (y_45_scale * Math.PI))))) / Math.PI);
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	return 180.0 * (math.atan((-180.0 * (x_45_scale / (angle * (y_45_scale * math.pi))))) / math.pi)
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(x_45_scale / Float64(angle * Float64(y_45_scale * pi))))) / pi))
end
b_m = abs(b);
function tmp = code(a, b_m, angle, x_45_scale, y_45_scale)
	tmp = 180.0 * (atan((-180.0 * (x_45_scale / (angle * (y_45_scale * pi))))) / pi);
end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(x$45$scale / N[(angle * N[(y$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|

\\
180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \pi\right)}\right)}{\pi}
\end{array}
Derivation
  1. Initial program 14.7%

    \[180 \cdot \frac{\tan^{-1} \left(\frac{\left(\frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale} - \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale}\right) - \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\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 \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}}\right)}{\pi} \]
  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. /-lowering-/.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. Simplified11.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 \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)}\right)}}{\pi} \]
  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. *-lowering-*.f64N/A

      \[\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)} \]
    2. /-lowering-/.f64N/A

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

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{x-scale}{angle \cdot \left(y-scale \cdot \color{blue}{\pi}\right)}\right)}{\pi} \]
  8. Simplified13.5%

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

Reproduce

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