raw-angle from scale-rotated-ellipse

Percentage Accurate: 17.0% → 58.6%
Time: 54.7s
Alternatives: 9
Speedup: 21.5×

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 9 alternatives:

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

Initial Program: 17.0% 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: 58.6% accurate, 11.0× speedup?

\[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \frac{y-scale}{x-scale} \cdot -2\\ \mathbf{if}\;b\_m \leq 1.82 \cdot 10^{+19}:\\ \;\;\;\;\tan^{-1} \left(\left(\tan \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot t\_0\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{elif}\;b\_m \leq 3 \cdot 10^{+112}:\\ \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \frac{\frac{\frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{x-scale} \cdot -2}{\pi \cdot angle}}{\left(a + b\_m\right) \cdot \left(b\_m - a\right)}\right)}{\pi} \cdot 180\\ \mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{\frac{\pi}{\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot t\_0\right) \cdot -0.5\right) \cdot 180}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\ \end{array} \end{array} \]
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* (/ y-scale x-scale) -2.0)))
   (if (<= b_m 1.82e+19)
     (*
      (atan
       (*
        (*
         (tan (* (* (sqrt PI) (sqrt PI)) (* 0.005555555555555556 angle)))
         t_0)
        -0.5))
      (* (/ 1.0 PI) 180.0))
     (if (<= b_m 3e+112)
       (*
        (/
         (atan
          (*
           90.0
           (/
            (/ (* (/ (* (* b_m b_m) y-scale) x-scale) -2.0) (* PI angle))
            (* (+ a b_m) (- b_m a)))))
         PI)
        180.0)
       (if (<= b_m 7.5e+153)
         (/
          1.0
          (/
           PI
           (*
            (atan (* (* (* (* PI angle) 0.005555555555555556) t_0) -0.5))
            180.0)))
         (*
          (/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI)
          180.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 = (y_45_scale / x_45_scale) * -2.0;
	double tmp;
	if (b_m <= 1.82e+19) {
		tmp = atan(((tan(((sqrt(((double) M_PI)) * sqrt(((double) M_PI))) * (0.005555555555555556 * angle))) * t_0) * -0.5)) * ((1.0 / ((double) M_PI)) * 180.0);
	} else if (b_m <= 3e+112) {
		tmp = (atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((double) M_PI) * angle)) / ((a + b_m) * (b_m - a))))) / ((double) M_PI)) * 180.0;
	} else if (b_m <= 7.5e+153) {
		tmp = 1.0 / (((double) M_PI) / (atan(((((((double) M_PI) * angle) * 0.005555555555555556) * t_0) * -0.5)) * 180.0));
	} else {
		tmp = (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.0;
	}
	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 = (y_45_scale / x_45_scale) * -2.0;
	double tmp;
	if (b_m <= 1.82e+19) {
		tmp = Math.atan(((Math.tan(((Math.sqrt(Math.PI) * Math.sqrt(Math.PI)) * (0.005555555555555556 * angle))) * t_0) * -0.5)) * ((1.0 / Math.PI) * 180.0);
	} else if (b_m <= 3e+112) {
		tmp = (Math.atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (Math.PI * angle)) / ((a + b_m) * (b_m - a))))) / Math.PI) * 180.0;
	} else if (b_m <= 7.5e+153) {
		tmp = 1.0 / (Math.PI / (Math.atan(((((Math.PI * angle) * 0.005555555555555556) * t_0) * -0.5)) * 180.0));
	} else {
		tmp = (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
	}
	return tmp;
}
b_m = math.fabs(b)
def code(a, b_m, angle, x_45_scale, y_45_scale):
	t_0 = (y_45_scale / x_45_scale) * -2.0
	tmp = 0
	if b_m <= 1.82e+19:
		tmp = math.atan(((math.tan(((math.sqrt(math.pi) * math.sqrt(math.pi)) * (0.005555555555555556 * angle))) * t_0) * -0.5)) * ((1.0 / math.pi) * 180.0)
	elif b_m <= 3e+112:
		tmp = (math.atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (math.pi * angle)) / ((a + b_m) * (b_m - a))))) / math.pi) * 180.0
	elif b_m <= 7.5e+153:
		tmp = 1.0 / (math.pi / (math.atan(((((math.pi * angle) * 0.005555555555555556) * t_0) * -0.5)) * 180.0))
	else:
		tmp = (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0
	return tmp
b_m = abs(b)
function code(a, b_m, angle, x_45_scale, y_45_scale)
	t_0 = Float64(Float64(y_45_scale / x_45_scale) * -2.0)
	tmp = 0.0
	if (b_m <= 1.82e+19)
		tmp = Float64(atan(Float64(Float64(tan(Float64(Float64(sqrt(pi) * sqrt(pi)) * Float64(0.005555555555555556 * angle))) * t_0) * -0.5)) * Float64(Float64(1.0 / pi) * 180.0));
	elseif (b_m <= 3e+112)
		tmp = Float64(Float64(atan(Float64(90.0 * Float64(Float64(Float64(Float64(Float64(Float64(b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / Float64(pi * angle)) / Float64(Float64(a + b_m) * Float64(b_m - a))))) / pi) * 180.0);
	elseif (b_m <= 7.5e+153)
		tmp = Float64(1.0 / Float64(pi / Float64(atan(Float64(Float64(Float64(Float64(pi * angle) * 0.005555555555555556) * t_0) * -0.5)) * 180.0)));
	else
		tmp = Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0);
	end
	return tmp
end
b_m = abs(b);
function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
	t_0 = (y_45_scale / x_45_scale) * -2.0;
	tmp = 0.0;
	if (b_m <= 1.82e+19)
		tmp = atan(((tan(((sqrt(pi) * sqrt(pi)) * (0.005555555555555556 * angle))) * t_0) * -0.5)) * ((1.0 / pi) * 180.0);
	elseif (b_m <= 3e+112)
		tmp = (atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (pi * angle)) / ((a + b_m) * (b_m - a))))) / pi) * 180.0;
	elseif (b_m <= 7.5e+153)
		tmp = 1.0 / (pi / (atan(((((pi * angle) * 0.005555555555555556) * t_0) * -0.5)) * 180.0));
	else
		tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0;
	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[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[b$95$m, 1.82e+19], N[(N[ArcTan[N[(N[(N[Tan[N[(N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3e+112], N[(N[(N[ArcTan[N[(90.0 * N[(N[(N[(N[(N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision] / N[(Pi * angle), $MachinePrecision]), $MachinePrecision] / N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[b$95$m, 7.5e+153], N[(1.0 / N[(Pi / N[(N[ArcTan[N[(N[(N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * t$95$0), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|

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

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

\mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\
\;\;\;\;\frac{1}{\frac{\pi}{\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot t\_0\right) \cdot -0.5\right) \cdot 180}}\\

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


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

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

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

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
      2. Applied rewrites54.0%

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

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

        if 1.82e19 < b < 2.99999999999999979e112

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

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

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

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

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

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

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

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

            if 2.99999999999999979e112 < b < 7.50000000000000065e153

            1. Initial program 25.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. *-commutativeN/A

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

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

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
              2. Applied rewrites50.8%

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

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

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

                if 7.50000000000000065e153 < 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. *-commutativeN/A

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

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\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)}{\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot 90\right)}}{\pi} \]
                6. Taylor expanded in b around inf

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.82 \cdot 10^{+19}:\\ \;\;\;\;\tan^{-1} \left(\left(\tan \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+112}:\\ \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \frac{\frac{\frac{\left(b \cdot b\right) \cdot y-scale}{x-scale} \cdot -2}{\pi \cdot angle}}{\left(a + b\right) \cdot \left(b - a\right)}\right)}{\pi} \cdot 180\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{\frac{\pi}{\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot 180}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\ \end{array} \]
                10. Add Preprocessing

                Alternative 2: 60.8% accurate, 8.5× speedup?

                \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \left(\pi \cdot angle\right) \cdot 0.005555555555555556\\ \mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+19}:\\ \;\;\;\;\left(\frac{1}{\pi} \cdot 180\right) \cdot \tan^{-1} \left(\left(\tan \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{\cos t\_0}{\sin t\_0 \cdot x-scale} \cdot y-scale\right) \cdot 2\right) \cdot -0.5\right)}{\pi} \cdot 180\\ \end{array} \end{array} \]
                b_m = (fabs.f64 b)
                (FPCore (a b_m angle x-scale y-scale)
                 :precision binary64
                 (let* ((t_0 (* (* PI angle) 0.005555555555555556)))
                   (if (<= b_m 1.4e+19)
                     (*
                      (* (/ 1.0 PI) 180.0)
                      (atan
                       (*
                        (*
                         (tan (* (* 0.005555555555555556 angle) (cbrt (* (* PI PI) PI))))
                         (* (/ y-scale x-scale) -2.0))
                        -0.5)))
                     (*
                      (/
                       (atan (* (* (* (/ (cos t_0) (* (sin t_0) x-scale)) y-scale) 2.0) -0.5))
                       PI)
                      180.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 = (((double) M_PI) * angle) * 0.005555555555555556;
                	double tmp;
                	if (b_m <= 1.4e+19) {
                		tmp = ((1.0 / ((double) M_PI)) * 180.0) * atan(((tan(((0.005555555555555556 * angle) * cbrt(((((double) M_PI) * ((double) M_PI)) * ((double) M_PI))))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                	} else {
                		tmp = (atan(((((cos(t_0) / (sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / ((double) M_PI)) * 180.0;
                	}
                	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 = (Math.PI * angle) * 0.005555555555555556;
                	double tmp;
                	if (b_m <= 1.4e+19) {
                		tmp = ((1.0 / Math.PI) * 180.0) * Math.atan(((Math.tan(((0.005555555555555556 * angle) * Math.cbrt(((Math.PI * Math.PI) * Math.PI)))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                	} else {
                		tmp = (Math.atan(((((Math.cos(t_0) / (Math.sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / Math.PI) * 180.0;
                	}
                	return tmp;
                }
                
                b_m = abs(b)
                function code(a, b_m, angle, x_45_scale, y_45_scale)
                	t_0 = Float64(Float64(pi * angle) * 0.005555555555555556)
                	tmp = 0.0
                	if (b_m <= 1.4e+19)
                		tmp = Float64(Float64(Float64(1.0 / pi) * 180.0) * atan(Float64(Float64(tan(Float64(Float64(0.005555555555555556 * angle) * cbrt(Float64(Float64(pi * pi) * pi)))) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5)));
                	else
                		tmp = Float64(Float64(atan(Float64(Float64(Float64(Float64(cos(t_0) / Float64(sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / pi) * 180.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[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, If[LessEqual[b$95$m, 1.4e+19], N[(N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision] * N[ArcTan[N[(N[(N[Tan[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * N[Power[N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(N[(N[Cos[t$95$0], $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] * 2.0), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]
                
                \begin{array}{l}
                b_m = \left|b\right|
                
                \\
                \begin{array}{l}
                t_0 := \left(\pi \cdot angle\right) \cdot 0.005555555555555556\\
                \mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+19}:\\
                \;\;\;\;\left(\frac{1}{\pi} \cdot 180\right) \cdot \tan^{-1} \left(\left(\tan \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{\cos t\_0}{\sin t\_0 \cdot x-scale} \cdot y-scale\right) \cdot 2\right) \cdot -0.5\right)}{\pi} \cdot 180\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if b < 1.4e19

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

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

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

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                    2. Applied rewrites54.0%

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

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

                      if 1.4e19 < b

                      1. Initial program 20.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. *-commutativeN/A

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

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

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                        2. Taylor expanded in b around inf

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.4 \cdot 10^{+19}:\\ \;\;\;\;\left(\frac{1}{\pi} \cdot 180\right) \cdot \tan^{-1} \left(\left(\tan \left(\left(0.005555555555555556 \cdot angle\right) \cdot \sqrt[3]{\left(\pi \cdot \pi\right) \cdot \pi}\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{\cos \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}{\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot x-scale} \cdot y-scale\right) \cdot 2\right) \cdot -0.5\right)}{\pi} \cdot 180\\ \end{array} \]
                        6. Add Preprocessing

                        Alternative 3: 60.7% accurate, 8.5× speedup?

                        \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \left(\pi \cdot angle\right) \cdot 0.005555555555555556\\ \mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+19}:\\ \;\;\;\;\tan^{-1} \left(\left(\tan \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{\cos t\_0}{\sin t\_0 \cdot x-scale} \cdot y-scale\right) \cdot 2\right) \cdot -0.5\right)}{\pi} \cdot 180\\ \end{array} \end{array} \]
                        b_m = (fabs.f64 b)
                        (FPCore (a b_m angle x-scale y-scale)
                         :precision binary64
                         (let* ((t_0 (* (* PI angle) 0.005555555555555556)))
                           (if (<= b_m 1.4e+19)
                             (*
                              (atan
                               (*
                                (*
                                 (tan (* (* (sqrt PI) (sqrt PI)) (* 0.005555555555555556 angle)))
                                 (* (/ y-scale x-scale) -2.0))
                                -0.5))
                              (* (/ 1.0 PI) 180.0))
                             (*
                              (/
                               (atan (* (* (* (/ (cos t_0) (* (sin t_0) x-scale)) y-scale) 2.0) -0.5))
                               PI)
                              180.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 = (((double) M_PI) * angle) * 0.005555555555555556;
                        	double tmp;
                        	if (b_m <= 1.4e+19) {
                        		tmp = atan(((tan(((sqrt(((double) M_PI)) * sqrt(((double) M_PI))) * (0.005555555555555556 * angle))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / ((double) M_PI)) * 180.0);
                        	} else {
                        		tmp = (atan(((((cos(t_0) / (sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / ((double) M_PI)) * 180.0;
                        	}
                        	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 = (Math.PI * angle) * 0.005555555555555556;
                        	double tmp;
                        	if (b_m <= 1.4e+19) {
                        		tmp = Math.atan(((Math.tan(((Math.sqrt(Math.PI) * Math.sqrt(Math.PI)) * (0.005555555555555556 * angle))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / Math.PI) * 180.0);
                        	} else {
                        		tmp = (Math.atan(((((Math.cos(t_0) / (Math.sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / Math.PI) * 180.0;
                        	}
                        	return tmp;
                        }
                        
                        b_m = math.fabs(b)
                        def code(a, b_m, angle, x_45_scale, y_45_scale):
                        	t_0 = (math.pi * angle) * 0.005555555555555556
                        	tmp = 0
                        	if b_m <= 1.4e+19:
                        		tmp = math.atan(((math.tan(((math.sqrt(math.pi) * math.sqrt(math.pi)) * (0.005555555555555556 * angle))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / math.pi) * 180.0)
                        	else:
                        		tmp = (math.atan(((((math.cos(t_0) / (math.sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / math.pi) * 180.0
                        	return tmp
                        
                        b_m = abs(b)
                        function code(a, b_m, angle, x_45_scale, y_45_scale)
                        	t_0 = Float64(Float64(pi * angle) * 0.005555555555555556)
                        	tmp = 0.0
                        	if (b_m <= 1.4e+19)
                        		tmp = Float64(atan(Float64(Float64(tan(Float64(Float64(sqrt(pi) * sqrt(pi)) * Float64(0.005555555555555556 * angle))) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5)) * Float64(Float64(1.0 / pi) * 180.0));
                        	else
                        		tmp = Float64(Float64(atan(Float64(Float64(Float64(Float64(cos(t_0) / Float64(sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / pi) * 180.0);
                        	end
                        	return tmp
                        end
                        
                        b_m = abs(b);
                        function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
                        	t_0 = (pi * angle) * 0.005555555555555556;
                        	tmp = 0.0;
                        	if (b_m <= 1.4e+19)
                        		tmp = atan(((tan(((sqrt(pi) * sqrt(pi)) * (0.005555555555555556 * angle))) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / pi) * 180.0);
                        	else
                        		tmp = (atan(((((cos(t_0) / (sin(t_0) * x_45_scale)) * y_45_scale) * 2.0) * -0.5)) / pi) * 180.0;
                        	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[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, If[LessEqual[b$95$m, 1.4e+19], N[(N[ArcTan[N[(N[(N[Tan[N[(N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(N[(N[Cos[t$95$0], $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] * 2.0), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        b_m = \left|b\right|
                        
                        \\
                        \begin{array}{l}
                        t_0 := \left(\pi \cdot angle\right) \cdot 0.005555555555555556\\
                        \mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+19}:\\
                        \;\;\;\;\tan^{-1} \left(\left(\tan \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\tan^{-1} \left(\left(\left(\frac{\cos t\_0}{\sin t\_0 \cdot x-scale} \cdot y-scale\right) \cdot 2\right) \cdot -0.5\right)}{\pi} \cdot 180\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if b < 1.4e19

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

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

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

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

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

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                            2. Applied rewrites54.0%

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

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

                              if 1.4e19 < b

                              1. Initial program 20.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. *-commutativeN/A

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

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

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

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

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                                2. Taylor expanded in b around inf

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

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(2 \cdot \left(y-scale \cdot \frac{\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)\right) \cdot -0.5\right)}{\pi} \]
                                4. Recombined 2 regimes into one program.
                                5. Final simplification56.6%

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

                                Alternative 4: 57.7% accurate, 16.0× speedup?

                                \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\ \mathbf{if}\;b\_m \leq 8 \cdot 10^{+18}:\\ \;\;\;\;t\_0 \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{elif}\;b\_m \leq 3 \cdot 10^{+112}:\\ \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \frac{\frac{\frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{x-scale} \cdot -2}{\pi \cdot angle}}{\left(a + b\_m\right) \cdot \left(b\_m - a\right)}\right)}{\pi} \cdot 180\\ \mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{\frac{\pi}{t\_0 \cdot 180}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\ \end{array} \end{array} \]
                                b_m = (fabs.f64 b)
                                (FPCore (a b_m angle x-scale y-scale)
                                 :precision binary64
                                 (let* ((t_0
                                         (atan
                                          (*
                                           (*
                                            (* (* PI angle) 0.005555555555555556)
                                            (* (/ y-scale x-scale) -2.0))
                                           -0.5))))
                                   (if (<= b_m 8e+18)
                                     (* t_0 (* (/ 1.0 PI) 180.0))
                                     (if (<= b_m 3e+112)
                                       (*
                                        (/
                                         (atan
                                          (*
                                           90.0
                                           (/
                                            (/ (* (/ (* (* b_m b_m) y-scale) x-scale) -2.0) (* PI angle))
                                            (* (+ a b_m) (- b_m a)))))
                                         PI)
                                        180.0)
                                       (if (<= b_m 7.5e+153)
                                         (/ 1.0 (/ PI (* t_0 180.0)))
                                         (*
                                          (/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI)
                                          180.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 = atan(((((((double) M_PI) * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                                	double tmp;
                                	if (b_m <= 8e+18) {
                                		tmp = t_0 * ((1.0 / ((double) M_PI)) * 180.0);
                                	} else if (b_m <= 3e+112) {
                                		tmp = (atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((double) M_PI) * angle)) / ((a + b_m) * (b_m - a))))) / ((double) M_PI)) * 180.0;
                                	} else if (b_m <= 7.5e+153) {
                                		tmp = 1.0 / (((double) M_PI) / (t_0 * 180.0));
                                	} else {
                                		tmp = (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.0;
                                	}
                                	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 = Math.atan(((((Math.PI * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                                	double tmp;
                                	if (b_m <= 8e+18) {
                                		tmp = t_0 * ((1.0 / Math.PI) * 180.0);
                                	} else if (b_m <= 3e+112) {
                                		tmp = (Math.atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (Math.PI * angle)) / ((a + b_m) * (b_m - a))))) / Math.PI) * 180.0;
                                	} else if (b_m <= 7.5e+153) {
                                		tmp = 1.0 / (Math.PI / (t_0 * 180.0));
                                	} else {
                                		tmp = (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
                                	}
                                	return tmp;
                                }
                                
                                b_m = math.fabs(b)
                                def code(a, b_m, angle, x_45_scale, y_45_scale):
                                	t_0 = math.atan(((((math.pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5))
                                	tmp = 0
                                	if b_m <= 8e+18:
                                		tmp = t_0 * ((1.0 / math.pi) * 180.0)
                                	elif b_m <= 3e+112:
                                		tmp = (math.atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (math.pi * angle)) / ((a + b_m) * (b_m - a))))) / math.pi) * 180.0
                                	elif b_m <= 7.5e+153:
                                		tmp = 1.0 / (math.pi / (t_0 * 180.0))
                                	else:
                                		tmp = (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0
                                	return tmp
                                
                                b_m = abs(b)
                                function code(a, b_m, angle, x_45_scale, y_45_scale)
                                	t_0 = atan(Float64(Float64(Float64(Float64(pi * angle) * 0.005555555555555556) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5))
                                	tmp = 0.0
                                	if (b_m <= 8e+18)
                                		tmp = Float64(t_0 * Float64(Float64(1.0 / pi) * 180.0));
                                	elseif (b_m <= 3e+112)
                                		tmp = Float64(Float64(atan(Float64(90.0 * Float64(Float64(Float64(Float64(Float64(Float64(b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / Float64(pi * angle)) / Float64(Float64(a + b_m) * Float64(b_m - a))))) / pi) * 180.0);
                                	elseif (b_m <= 7.5e+153)
                                		tmp = Float64(1.0 / Float64(pi / Float64(t_0 * 180.0)));
                                	else
                                		tmp = Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0);
                                	end
                                	return tmp
                                end
                                
                                b_m = abs(b);
                                function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
                                	t_0 = atan(((((pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                                	tmp = 0.0;
                                	if (b_m <= 8e+18)
                                		tmp = t_0 * ((1.0 / pi) * 180.0);
                                	elseif (b_m <= 3e+112)
                                		tmp = (atan((90.0 * ((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (pi * angle)) / ((a + b_m) * (b_m - a))))) / pi) * 180.0;
                                	elseif (b_m <= 7.5e+153)
                                		tmp = 1.0 / (pi / (t_0 * 180.0));
                                	else
                                		tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0;
                                	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[ArcTan[N[(N[(N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 8e+18], N[(t$95$0 * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3e+112], N[(N[(N[ArcTan[N[(90.0 * N[(N[(N[(N[(N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision] / N[(Pi * angle), $MachinePrecision]), $MachinePrecision] / N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[b$95$m, 7.5e+153], N[(1.0 / N[(Pi / N[(t$95$0 * 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]]]
                                
                                \begin{array}{l}
                                b_m = \left|b\right|
                                
                                \\
                                \begin{array}{l}
                                t_0 := \tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\
                                \mathbf{if}\;b\_m \leq 8 \cdot 10^{+18}:\\
                                \;\;\;\;t\_0 \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
                                
                                \mathbf{elif}\;b\_m \leq 3 \cdot 10^{+112}:\\
                                \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \frac{\frac{\frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{x-scale} \cdot -2}{\pi \cdot angle}}{\left(a + b\_m\right) \cdot \left(b\_m - a\right)}\right)}{\pi} \cdot 180\\
                                
                                \mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\
                                \;\;\;\;\frac{1}{\frac{\pi}{t\_0 \cdot 180}}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 4 regimes
                                2. if b < 8e18

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

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

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

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

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

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

                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                                    2. Applied rewrites54.0%

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

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

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

                                      if 8e18 < b < 2.99999999999999979e112

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

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

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

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

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

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

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

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

                                          if 2.99999999999999979e112 < b < 7.50000000000000065e153

                                          1. Initial program 25.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. *-commutativeN/A

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

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

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

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

                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                                            2. Applied rewrites50.8%

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

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

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

                                              if 7.50000000000000065e153 < 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. *-commutativeN/A

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

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

                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\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)}{\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot 90\right)}}{\pi} \]
                                              6. Taylor expanded in b around inf

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

                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right) \cdot 90\right)}{\pi} \]
                                              8. Recombined 4 regimes into one program.
                                              9. Final simplification57.7%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{+18}:\\ \;\;\;\;\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+112}:\\ \;\;\;\;\frac{\tan^{-1} \left(90 \cdot \frac{\frac{\frac{\left(b \cdot b\right) \cdot y-scale}{x-scale} \cdot -2}{\pi \cdot angle}}{\left(a + b\right) \cdot \left(b - a\right)}\right)}{\pi} \cdot 180\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{\frac{\pi}{\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot 180}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\ \end{array} \]
                                              10. Add Preprocessing

                                              Alternative 5: 57.6% accurate, 16.5× speedup?

                                              \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\ \mathbf{if}\;b\_m \leq 1550000000:\\ \;\;\;\;t\_0 \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{elif}\;b\_m \leq 3 \cdot 10^{+112}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{x-scale} \cdot -2}{\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \left(\pi \cdot angle\right)} \cdot 90\right)}{\pi} \cdot 180\\ \mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{\frac{\pi}{t\_0 \cdot 180}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\ \end{array} \end{array} \]
                                              b_m = (fabs.f64 b)
                                              (FPCore (a b_m angle x-scale y-scale)
                                               :precision binary64
                                               (let* ((t_0
                                                       (atan
                                                        (*
                                                         (*
                                                          (* (* PI angle) 0.005555555555555556)
                                                          (* (/ y-scale x-scale) -2.0))
                                                         -0.5))))
                                                 (if (<= b_m 1550000000.0)
                                                   (* t_0 (* (/ 1.0 PI) 180.0))
                                                   (if (<= b_m 3e+112)
                                                     (*
                                                      (/
                                                       (atan
                                                        (*
                                                         (/
                                                          (* (/ (* (* b_m b_m) y-scale) x-scale) -2.0)
                                                          (* (* (+ a b_m) (- b_m a)) (* PI angle)))
                                                         90.0))
                                                       PI)
                                                      180.0)
                                                     (if (<= b_m 7.5e+153)
                                                       (/ 1.0 (/ PI (* t_0 180.0)))
                                                       (*
                                                        (/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI)
                                                        180.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 = atan(((((((double) M_PI) * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                                              	double tmp;
                                              	if (b_m <= 1550000000.0) {
                                              		tmp = t_0 * ((1.0 / ((double) M_PI)) * 180.0);
                                              	} else if (b_m <= 3e+112) {
                                              		tmp = (atan(((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((a + b_m) * (b_m - a)) * (((double) M_PI) * angle))) * 90.0)) / ((double) M_PI)) * 180.0;
                                              	} else if (b_m <= 7.5e+153) {
                                              		tmp = 1.0 / (((double) M_PI) / (t_0 * 180.0));
                                              	} else {
                                              		tmp = (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.0;
                                              	}
                                              	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 = Math.atan(((((Math.PI * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                                              	double tmp;
                                              	if (b_m <= 1550000000.0) {
                                              		tmp = t_0 * ((1.0 / Math.PI) * 180.0);
                                              	} else if (b_m <= 3e+112) {
                                              		tmp = (Math.atan(((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((a + b_m) * (b_m - a)) * (Math.PI * angle))) * 90.0)) / Math.PI) * 180.0;
                                              	} else if (b_m <= 7.5e+153) {
                                              		tmp = 1.0 / (Math.PI / (t_0 * 180.0));
                                              	} else {
                                              		tmp = (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              b_m = math.fabs(b)
                                              def code(a, b_m, angle, x_45_scale, y_45_scale):
                                              	t_0 = math.atan(((((math.pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5))
                                              	tmp = 0
                                              	if b_m <= 1550000000.0:
                                              		tmp = t_0 * ((1.0 / math.pi) * 180.0)
                                              	elif b_m <= 3e+112:
                                              		tmp = (math.atan(((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((a + b_m) * (b_m - a)) * (math.pi * angle))) * 90.0)) / math.pi) * 180.0
                                              	elif b_m <= 7.5e+153:
                                              		tmp = 1.0 / (math.pi / (t_0 * 180.0))
                                              	else:
                                              		tmp = (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0
                                              	return tmp
                                              
                                              b_m = abs(b)
                                              function code(a, b_m, angle, x_45_scale, y_45_scale)
                                              	t_0 = atan(Float64(Float64(Float64(Float64(pi * angle) * 0.005555555555555556) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5))
                                              	tmp = 0.0
                                              	if (b_m <= 1550000000.0)
                                              		tmp = Float64(t_0 * Float64(Float64(1.0 / pi) * 180.0));
                                              	elseif (b_m <= 3e+112)
                                              		tmp = Float64(Float64(atan(Float64(Float64(Float64(Float64(Float64(Float64(b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * Float64(pi * angle))) * 90.0)) / pi) * 180.0);
                                              	elseif (b_m <= 7.5e+153)
                                              		tmp = Float64(1.0 / Float64(pi / Float64(t_0 * 180.0)));
                                              	else
                                              		tmp = Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0);
                                              	end
                                              	return tmp
                                              end
                                              
                                              b_m = abs(b);
                                              function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
                                              	t_0 = atan(((((pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                                              	tmp = 0.0;
                                              	if (b_m <= 1550000000.0)
                                              		tmp = t_0 * ((1.0 / pi) * 180.0);
                                              	elseif (b_m <= 3e+112)
                                              		tmp = (atan(((((((b_m * b_m) * y_45_scale) / x_45_scale) * -2.0) / (((a + b_m) * (b_m - a)) * (pi * angle))) * 90.0)) / pi) * 180.0;
                                              	elseif (b_m <= 7.5e+153)
                                              		tmp = 1.0 / (pi / (t_0 * 180.0));
                                              	else
                                              		tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0;
                                              	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[ArcTan[N[(N[(N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 1550000000.0], N[(t$95$0 * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 3e+112], N[(N[(N[ArcTan[N[(N[(N[(N[(N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision] / N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[b$95$m, 7.5e+153], N[(1.0 / N[(Pi / N[(t$95$0 * 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]]]
                                              
                                              \begin{array}{l}
                                              b_m = \left|b\right|
                                              
                                              \\
                                              \begin{array}{l}
                                              t_0 := \tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\
                                              \mathbf{if}\;b\_m \leq 1550000000:\\
                                              \;\;\;\;t\_0 \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
                                              
                                              \mathbf{elif}\;b\_m \leq 3 \cdot 10^{+112}:\\
                                              \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{\left(b\_m \cdot b\_m\right) \cdot y-scale}{x-scale} \cdot -2}{\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \left(\pi \cdot angle\right)} \cdot 90\right)}{\pi} \cdot 180\\
                                              
                                              \mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\
                                              \;\;\;\;\frac{1}{\frac{\pi}{t\_0 \cdot 180}}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 4 regimes
                                              2. if b < 1.55e9

                                                1. Initial program 16.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. *-commutativeN/A

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

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

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

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

                                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                                                  2. Applied rewrites54.0%

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

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

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

                                                    if 1.55e9 < b < 2.99999999999999979e112

                                                    1. Initial program 45.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. *-commutativeN/A

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

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

                                                      \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\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)}{\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot 90\right)}}{\pi} \]
                                                    6. Taylor expanded in b around inf

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

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

                                                      if 2.99999999999999979e112 < b < 7.50000000000000065e153

                                                      1. Initial program 25.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. *-commutativeN/A

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

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

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

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

                                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                                                        2. Applied rewrites50.8%

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

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

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

                                                          if 7.50000000000000065e153 < 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. *-commutativeN/A

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

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

                                                            \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\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)}{\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot 90\right)}}{\pi} \]
                                                          6. Taylor expanded in b around inf

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

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

                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1550000000:\\ \;\;\;\;\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{elif}\;b \leq 3 \cdot 10^{+112}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{\frac{\left(b \cdot b\right) \cdot y-scale}{x-scale} \cdot -2}{\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot angle\right)} \cdot 90\right)}{\pi} \cdot 180\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{\frac{\pi}{\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot 180}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\ \end{array} \]
                                                          10. Add Preprocessing

                                                          Alternative 6: 57.2% accurate, 17.1× speedup?

                                                          \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} t_0 := \tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\ \mathbf{if}\;b\_m \leq 8 \cdot 10^{+18}:\\ \;\;\;\;t\_0 \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{elif}\;b\_m \leq 2.9 \cdot 10^{+112}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{360 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(\left(\left(a + b\_m\right) \cdot \pi\right) \cdot \left(b\_m - a\right)\right) \cdot \left(x-scale \cdot angle\right)} \cdot -0.5\right)}{\pi} \cdot 180\\ \mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{\frac{\pi}{t\_0 \cdot 180}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\ \end{array} \end{array} \]
                                                          b_m = (fabs.f64 b)
                                                          (FPCore (a b_m angle x-scale y-scale)
                                                           :precision binary64
                                                           (let* ((t_0
                                                                   (atan
                                                                    (*
                                                                     (*
                                                                      (* (* PI angle) 0.005555555555555556)
                                                                      (* (/ y-scale x-scale) -2.0))
                                                                     -0.5))))
                                                             (if (<= b_m 8e+18)
                                                               (* t_0 (* (/ 1.0 PI) 180.0))
                                                               (if (<= b_m 2.9e+112)
                                                                 (*
                                                                  (/
                                                                   (atan
                                                                    (*
                                                                     (/
                                                                      (* 360.0 (* (* b_m b_m) y-scale))
                                                                      (* (* (* (+ a b_m) PI) (- b_m a)) (* x-scale angle)))
                                                                     -0.5))
                                                                   PI)
                                                                  180.0)
                                                                 (if (<= b_m 7.5e+153)
                                                                   (/ 1.0 (/ PI (* t_0 180.0)))
                                                                   (*
                                                                    (/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI)
                                                                    180.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 = atan(((((((double) M_PI) * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                                                          	double tmp;
                                                          	if (b_m <= 8e+18) {
                                                          		tmp = t_0 * ((1.0 / ((double) M_PI)) * 180.0);
                                                          	} else if (b_m <= 2.9e+112) {
                                                          		tmp = (atan((((360.0 * ((b_m * b_m) * y_45_scale)) / ((((a + b_m) * ((double) M_PI)) * (b_m - a)) * (x_45_scale * angle))) * -0.5)) / ((double) M_PI)) * 180.0;
                                                          	} else if (b_m <= 7.5e+153) {
                                                          		tmp = 1.0 / (((double) M_PI) / (t_0 * 180.0));
                                                          	} else {
                                                          		tmp = (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.0;
                                                          	}
                                                          	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 = Math.atan(((((Math.PI * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                                                          	double tmp;
                                                          	if (b_m <= 8e+18) {
                                                          		tmp = t_0 * ((1.0 / Math.PI) * 180.0);
                                                          	} else if (b_m <= 2.9e+112) {
                                                          		tmp = (Math.atan((((360.0 * ((b_m * b_m) * y_45_scale)) / ((((a + b_m) * Math.PI) * (b_m - a)) * (x_45_scale * angle))) * -0.5)) / Math.PI) * 180.0;
                                                          	} else if (b_m <= 7.5e+153) {
                                                          		tmp = 1.0 / (Math.PI / (t_0 * 180.0));
                                                          	} else {
                                                          		tmp = (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          b_m = math.fabs(b)
                                                          def code(a, b_m, angle, x_45_scale, y_45_scale):
                                                          	t_0 = math.atan(((((math.pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5))
                                                          	tmp = 0
                                                          	if b_m <= 8e+18:
                                                          		tmp = t_0 * ((1.0 / math.pi) * 180.0)
                                                          	elif b_m <= 2.9e+112:
                                                          		tmp = (math.atan((((360.0 * ((b_m * b_m) * y_45_scale)) / ((((a + b_m) * math.pi) * (b_m - a)) * (x_45_scale * angle))) * -0.5)) / math.pi) * 180.0
                                                          	elif b_m <= 7.5e+153:
                                                          		tmp = 1.0 / (math.pi / (t_0 * 180.0))
                                                          	else:
                                                          		tmp = (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0
                                                          	return tmp
                                                          
                                                          b_m = abs(b)
                                                          function code(a, b_m, angle, x_45_scale, y_45_scale)
                                                          	t_0 = atan(Float64(Float64(Float64(Float64(pi * angle) * 0.005555555555555556) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5))
                                                          	tmp = 0.0
                                                          	if (b_m <= 8e+18)
                                                          		tmp = Float64(t_0 * Float64(Float64(1.0 / pi) * 180.0));
                                                          	elseif (b_m <= 2.9e+112)
                                                          		tmp = Float64(Float64(atan(Float64(Float64(Float64(360.0 * Float64(Float64(b_m * b_m) * y_45_scale)) / Float64(Float64(Float64(Float64(a + b_m) * pi) * Float64(b_m - a)) * Float64(x_45_scale * angle))) * -0.5)) / pi) * 180.0);
                                                          	elseif (b_m <= 7.5e+153)
                                                          		tmp = Float64(1.0 / Float64(pi / Float64(t_0 * 180.0)));
                                                          	else
                                                          		tmp = Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          b_m = abs(b);
                                                          function tmp_2 = code(a, b_m, angle, x_45_scale, y_45_scale)
                                                          	t_0 = atan(((((pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5));
                                                          	tmp = 0.0;
                                                          	if (b_m <= 8e+18)
                                                          		tmp = t_0 * ((1.0 / pi) * 180.0);
                                                          	elseif (b_m <= 2.9e+112)
                                                          		tmp = (atan((((360.0 * ((b_m * b_m) * y_45_scale)) / ((((a + b_m) * pi) * (b_m - a)) * (x_45_scale * angle))) * -0.5)) / pi) * 180.0;
                                                          	elseif (b_m <= 7.5e+153)
                                                          		tmp = 1.0 / (pi / (t_0 * 180.0));
                                                          	else
                                                          		tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0;
                                                          	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[ArcTan[N[(N[(N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 8e+18], N[(t$95$0 * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 2.9e+112], N[(N[(N[ArcTan[N[(N[(N[(360.0 * N[(N[(b$95$m * b$95$m), $MachinePrecision] * y$45$scale), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(a + b$95$m), $MachinePrecision] * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(x$45$scale * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision], If[LessEqual[b$95$m, 7.5e+153], N[(1.0 / N[(Pi / N[(t$95$0 * 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]]]]
                                                          
                                                          \begin{array}{l}
                                                          b_m = \left|b\right|
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          t_0 := \tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right)\\
                                                          \mathbf{if}\;b\_m \leq 8 \cdot 10^{+18}:\\
                                                          \;\;\;\;t\_0 \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
                                                          
                                                          \mathbf{elif}\;b\_m \leq 2.9 \cdot 10^{+112}:\\
                                                          \;\;\;\;\frac{\tan^{-1} \left(\frac{360 \cdot \left(\left(b\_m \cdot b\_m\right) \cdot y-scale\right)}{\left(\left(\left(a + b\_m\right) \cdot \pi\right) \cdot \left(b\_m - a\right)\right) \cdot \left(x-scale \cdot angle\right)} \cdot -0.5\right)}{\pi} \cdot 180\\
                                                          
                                                          \mathbf{elif}\;b\_m \leq 7.5 \cdot 10^{+153}:\\
                                                          \;\;\;\;\frac{1}{\frac{\pi}{t\_0 \cdot 180}}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 4 regimes
                                                          2. if b < 8e18

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

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

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

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

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

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

                                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                                                              2. Applied rewrites54.0%

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

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

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

                                                                if 8e18 < b < 2.9000000000000002e112

                                                                1. Initial program 50.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. *-commutativeN/A

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

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

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

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

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

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

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

                                                                    if 2.9000000000000002e112 < b < 7.50000000000000065e153

                                                                    1. Initial program 25.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. *-commutativeN/A

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

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

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

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

                                                                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                                                                      2. Applied rewrites50.8%

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

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

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

                                                                        if 7.50000000000000065e153 < 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. *-commutativeN/A

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

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

                                                                          \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\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)}{\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot 90\right)}}{\pi} \]
                                                                        6. Taylor expanded in b around inf

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

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

                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{+18}:\\ \;\;\;\;\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{+112}:\\ \;\;\;\;\frac{\tan^{-1} \left(\frac{360 \cdot \left(\left(b \cdot b\right) \cdot y-scale\right)}{\left(\left(\left(a + b\right) \cdot \pi\right) \cdot \left(b - a\right)\right) \cdot \left(x-scale \cdot angle\right)} \cdot -0.5\right)}{\pi} \cdot 180\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{\frac{\pi}{\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot 180}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\ \end{array} \]
                                                                        10. Add Preprocessing

                                                                        Alternative 7: 57.6% accurate, 19.4× speedup?

                                                                        \[\begin{array}{l} b_m = \left|b\right| \\ \begin{array}{l} \mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+19}:\\ \;\;\;\;\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\ \end{array} \end{array} \]
                                                                        b_m = (fabs.f64 b)
                                                                        (FPCore (a b_m angle x-scale y-scale)
                                                                         :precision binary64
                                                                         (if (<= b_m 1.4e+19)
                                                                           (*
                                                                            (atan
                                                                             (*
                                                                              (* (* (* PI angle) 0.005555555555555556) (* (/ y-scale x-scale) -2.0))
                                                                              -0.5))
                                                                            (* (/ 1.0 PI) 180.0))
                                                                           (*
                                                                            (/ (atan (* (* (/ y-scale (* (* PI x-scale) angle)) -2.0) 90.0)) PI)
                                                                            180.0)))
                                                                        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.4e+19) {
                                                                        		tmp = atan(((((((double) M_PI) * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / ((double) M_PI)) * 180.0);
                                                                        	} else {
                                                                        		tmp = (atan((((y_45_scale / ((((double) M_PI) * x_45_scale) * angle)) * -2.0) * 90.0)) / ((double) M_PI)) * 180.0;
                                                                        	}
                                                                        	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.4e+19) {
                                                                        		tmp = Math.atan(((((Math.PI * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / Math.PI) * 180.0);
                                                                        	} else {
                                                                        		tmp = (Math.atan((((y_45_scale / ((Math.PI * x_45_scale) * angle)) * -2.0) * 90.0)) / Math.PI) * 180.0;
                                                                        	}
                                                                        	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.4e+19:
                                                                        		tmp = math.atan(((((math.pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / math.pi) * 180.0)
                                                                        	else:
                                                                        		tmp = (math.atan((((y_45_scale / ((math.pi * x_45_scale) * angle)) * -2.0) * 90.0)) / math.pi) * 180.0
                                                                        	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.4e+19)
                                                                        		tmp = Float64(atan(Float64(Float64(Float64(Float64(pi * angle) * 0.005555555555555556) * Float64(Float64(y_45_scale / x_45_scale) * -2.0)) * -0.5)) * Float64(Float64(1.0 / pi) * 180.0));
                                                                        	else
                                                                        		tmp = Float64(Float64(atan(Float64(Float64(Float64(y_45_scale / Float64(Float64(pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0);
                                                                        	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.4e+19)
                                                                        		tmp = atan(((((pi * angle) * 0.005555555555555556) * ((y_45_scale / x_45_scale) * -2.0)) * -0.5)) * ((1.0 / pi) * 180.0);
                                                                        	else
                                                                        		tmp = (atan((((y_45_scale / ((pi * x_45_scale) * angle)) * -2.0) * 90.0)) / pi) * 180.0;
                                                                        	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.4e+19], N[(N[ArcTan[N[(N[(N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(N[(y$45$scale / x$45$scale), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / Pi), $MachinePrecision] * 180.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[N[(N[(N[(y$45$scale / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 90.0), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision] * 180.0), $MachinePrecision]]
                                                                        
                                                                        \begin{array}{l}
                                                                        b_m = \left|b\right|
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        \mathbf{if}\;b\_m \leq 1.4 \cdot 10^{+19}:\\
                                                                        \;\;\;\;\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 2 regimes
                                                                        2. if b < 1.4e19

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

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

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

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

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

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

                                                                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \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) \cdot -0.5\right)}{\pi} \]
                                                                            2. Applied rewrites54.0%

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

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

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

                                                                              if 1.4e19 < b

                                                                              1. Initial program 20.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. *-commutativeN/A

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

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

                                                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\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)}{\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot 90\right)}}{\pi} \]
                                                                              6. Taylor expanded in b around inf

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

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

                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.4 \cdot 10^{+19}:\\ \;\;\;\;\tan^{-1} \left(\left(\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot \left(\frac{y-scale}{x-scale} \cdot -2\right)\right) \cdot -0.5\right) \cdot \left(\frac{1}{\pi} \cdot 180\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan^{-1} \left(\left(\frac{y-scale}{\left(\pi \cdot x-scale\right) \cdot angle} \cdot -2\right) \cdot 90\right)}{\pi} \cdot 180\\ \end{array} \]
                                                                              10. Add Preprocessing

                                                                              Alternative 8: 38.4% accurate, 21.5× speedup?

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

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

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

                                                                                \[\leadsto 180 \cdot \frac{\tan^{-1} \color{blue}{\left(\frac{\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)}{\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)} \cdot 90\right)}}{\pi} \]
                                                                              6. Taylor expanded in b around inf

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

                                                                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\left(-2 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right) \cdot 90\right)}{\pi} \]
                                                                                2. Final simplification31.9%

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

                                                                                Alternative 9: 14.7% accurate, 22.2× speedup?

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

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

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

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

                                                                                  \[\leadsto \frac{180 \cdot \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)} \]
                                                                                7. Step-by-step derivation
                                                                                  1. Applied rewrites13.6%

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

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

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

                                                                                    Reproduce

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