raw-angle from scale-rotated-ellipse

Percentage Accurate: 14.1% → 50.0%
Time: 21.3s
Alternatives: 15
Speedup: 29.2×

Specification

?
\[\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} \]
(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}
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}

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

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

Initial Program: 14.1% accurate, 1.0× speedup?

\[\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} \]
(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}
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}

Alternative 1: 50.0% accurate, 3.1× speedup?

\[\begin{array}{l} t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\ t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_2 := \cos t\_1\\ t_3 := \sin t\_1\\ t_4 := x-scale \cdot \left(t\_2 \cdot t\_3\right)\\ \mathbf{if}\;\left|a\right| \leq 8 \cdot 10^{+39}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{t\_2}^{4}} + \frac{\cos \left(0.005555555555555556 \cdot \left|angle \cdot \pi\right|\right) + \cos \left(\left|t\_0\right| - \left(-t\_0\right)\right)}{2}\right)}{t\_4}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{t\_3}^{4}} + {t\_3}^{2}\right)}{t\_4}\right)}{\pi}\\ \end{array} \]
(FPCore (a b angle x-scale y-scale)
  :precision binary64
  (let* ((t_0 (* (* 0.005555555555555556 angle) PI))
       (t_1 (* 0.005555555555555556 (* angle PI)))
       (t_2 (cos t_1))
       (t_3 (sin t_1))
       (t_4 (* x-scale (* t_2 t_3))))
  (if (<= (fabs a) 8e+39)
    (*
     180.0
     (/
      (atan
       (*
        -0.5
        (/
         (*
          y-scale
          (+
           (sqrt (pow t_2 4.0))
           (/
            (+
             (cos (* 0.005555555555555556 (fabs (* angle PI))))
             (cos (- (fabs t_0) (- t_0))))
            2.0)))
         t_4)))
      PI))
    (*
     180.0
     (/
      (atan
       (*
        0.5
        (/ (* y-scale (+ (sqrt (pow t_3 4.0)) (pow t_3 2.0))) t_4)))
      PI)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = (0.005555555555555556 * angle) * ((double) M_PI);
	double t_1 = 0.005555555555555556 * (angle * ((double) M_PI));
	double t_2 = cos(t_1);
	double t_3 = sin(t_1);
	double t_4 = x_45_scale * (t_2 * t_3);
	double tmp;
	if (fabs(a) <= 8e+39) {
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (sqrt(pow(t_2, 4.0)) + ((cos((0.005555555555555556 * fabs((angle * ((double) M_PI))))) + cos((fabs(t_0) - -t_0))) / 2.0))) / t_4))) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan((0.5 * ((y_45_scale * (sqrt(pow(t_3, 4.0)) + pow(t_3, 2.0))) / t_4))) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = (0.005555555555555556 * angle) * Math.PI;
	double t_1 = 0.005555555555555556 * (angle * Math.PI);
	double t_2 = Math.cos(t_1);
	double t_3 = Math.sin(t_1);
	double t_4 = x_45_scale * (t_2 * t_3);
	double tmp;
	if (Math.abs(a) <= 8e+39) {
		tmp = 180.0 * (Math.atan((-0.5 * ((y_45_scale * (Math.sqrt(Math.pow(t_2, 4.0)) + ((Math.cos((0.005555555555555556 * Math.abs((angle * Math.PI)))) + Math.cos((Math.abs(t_0) - -t_0))) / 2.0))) / t_4))) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan((0.5 * ((y_45_scale * (Math.sqrt(Math.pow(t_3, 4.0)) + Math.pow(t_3, 2.0))) / t_4))) / Math.PI);
	}
	return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = (0.005555555555555556 * angle) * math.pi
	t_1 = 0.005555555555555556 * (angle * math.pi)
	t_2 = math.cos(t_1)
	t_3 = math.sin(t_1)
	t_4 = x_45_scale * (t_2 * t_3)
	tmp = 0
	if math.fabs(a) <= 8e+39:
		tmp = 180.0 * (math.atan((-0.5 * ((y_45_scale * (math.sqrt(math.pow(t_2, 4.0)) + ((math.cos((0.005555555555555556 * math.fabs((angle * math.pi)))) + math.cos((math.fabs(t_0) - -t_0))) / 2.0))) / t_4))) / math.pi)
	else:
		tmp = 180.0 * (math.atan((0.5 * ((y_45_scale * (math.sqrt(math.pow(t_3, 4.0)) + math.pow(t_3, 2.0))) / t_4))) / math.pi)
	return tmp
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(Float64(0.005555555555555556 * angle) * pi)
	t_1 = Float64(0.005555555555555556 * Float64(angle * pi))
	t_2 = cos(t_1)
	t_3 = sin(t_1)
	t_4 = Float64(x_45_scale * Float64(t_2 * t_3))
	tmp = 0.0
	if (abs(a) <= 8e+39)
		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(sqrt((t_2 ^ 4.0)) + Float64(Float64(cos(Float64(0.005555555555555556 * abs(Float64(angle * pi)))) + cos(Float64(abs(t_0) - Float64(-t_0)))) / 2.0))) / t_4))) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(y_45_scale * Float64(sqrt((t_3 ^ 4.0)) + (t_3 ^ 2.0))) / t_4))) / pi));
	end
	return tmp
end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = (0.005555555555555556 * angle) * pi;
	t_1 = 0.005555555555555556 * (angle * pi);
	t_2 = cos(t_1);
	t_3 = sin(t_1);
	t_4 = x_45_scale * (t_2 * t_3);
	tmp = 0.0;
	if (abs(a) <= 8e+39)
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (sqrt((t_2 ^ 4.0)) + ((cos((0.005555555555555556 * abs((angle * pi)))) + cos((abs(t_0) - -t_0))) / 2.0))) / t_4))) / pi);
	else
		tmp = 180.0 * (atan((0.5 * ((y_45_scale * (sqrt((t_3 ^ 4.0)) + (t_3 ^ 2.0))) / t_4))) / pi);
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$4 = N[(x$45$scale * N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[a], $MachinePrecision], 8e+39], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(y$45$scale * N[(N[Sqrt[N[Power[t$95$2, 4.0], $MachinePrecision]], $MachinePrecision] + N[(N[(N[Cos[N[(0.005555555555555556 * N[Abs[N[(angle * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Cos[N[(N[Abs[t$95$0], $MachinePrecision] - (-t$95$0)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(y$45$scale * N[(N[Sqrt[N[Power[t$95$3, 4.0], $MachinePrecision]], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_2 := \cos t\_1\\
t_3 := \sin t\_1\\
t_4 := x-scale \cdot \left(t\_2 \cdot t\_3\right)\\
\mathbf{if}\;\left|a\right| \leq 8 \cdot 10^{+39}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{t\_2}^{4}} + \frac{\cos \left(0.005555555555555556 \cdot \left|angle \cdot \pi\right|\right) + \cos \left(\left|t\_0\right| - \left(-t\_0\right)\right)}{2}\right)}{t\_4}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{t\_3}^{4}} + {t\_3}^{2}\right)}{t\_4}\right)}{\pi}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 7.9999999999999995e39

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    7. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      2. unpow2N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      3. lift-cos.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      4. cos-fabs-revN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right|\right) \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      5. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right|\right) \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      6. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right|\right) \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      7. associate-*r*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right|\right) \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      8. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right|\right) \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      9. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\pi \cdot \left(\frac{1}{180} \cdot angle\right)\right|\right) \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      10. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\pi \cdot \left(\frac{1}{180} \cdot angle\right)\right|\right) \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      11. lift-cos.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\pi \cdot \left(\frac{1}{180} \cdot angle\right)\right|\right) \cdot \cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      12. cos-neg-revN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\pi \cdot \left(\frac{1}{180} \cdot angle\right)\right|\right) \cdot \cos \left(\mathsf{neg}\left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      13. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\pi \cdot \left(\frac{1}{180} \cdot angle\right)\right|\right) \cdot \cos \left(\mathsf{neg}\left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      14. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\pi \cdot \left(\frac{1}{180} \cdot angle\right)\right|\right) \cdot \cos \left(\mathsf{neg}\left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      15. associate-*r*N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\pi \cdot \left(\frac{1}{180} \cdot angle\right)\right|\right) \cdot \cos \left(\mathsf{neg}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      16. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\pi \cdot \left(\frac{1}{180} \cdot angle\right)\right|\right) \cdot \cos \left(\mathsf{neg}\left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      17. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \cos \left(\left|\pi \cdot \left(\frac{1}{180} \cdot angle\right)\right|\right) \cdot \cos \left(\mathsf{neg}\left(\pi \cdot \left(\frac{1}{180} \cdot angle\right)\right)\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      18. lift-*.f64N/A

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

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \frac{\cos \left(\frac{1}{180} \cdot \left|angle \cdot \pi\right|\right) + \cos \left(\left|\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right| - \left(-\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right)}{2}\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \frac{\cos \left(\frac{1}{180} \cdot \left|angle \cdot \mathsf{PI}\left(\right)\right|\right) + \cos \left(\left|\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right| - \left(-\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)\right)}{2}\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      2. lower-fabs.f64N/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \frac{\cos \left(\frac{1}{180} \cdot \left|angle \cdot \mathsf{PI}\left(\right)\right|\right) + \cos \left(\left|\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right| - \left(-\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)\right)}{2}\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      4. lower-PI.f6444.1%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}} + \frac{\cos \left(0.005555555555555556 \cdot \left|angle \cdot \pi\right|\right) + \cos \left(\left|\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right| - \left(-\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right)}{2}\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
    11. Applied rewrites44.1%

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

    if 7.9999999999999995e39 < a

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\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)}}\right)}{\pi} \]
    10. Applied rewrites37.3%

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

Alternative 2: 50.0% accurate, 3.7× speedup?

\[\begin{array}{l} t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\ t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_2 := \sin t\_1\\ t_3 := \cos t\_1\\ \mathbf{if}\;\left|a\right| \leq 5.5 \cdot 10^{+38}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{t\_3}^{4}} + {t\_3}^{2}\right)}{\left(\sin t\_0 \cdot \cos t\_0\right) \cdot x-scale}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{t\_2}^{4}} + {t\_2}^{2}\right)}{x-scale \cdot \left(t\_3 \cdot t\_2\right)}\right)}{\pi}\\ \end{array} \]
(FPCore (a b angle x-scale y-scale)
  :precision binary64
  (let* ((t_0 (* (* 0.005555555555555556 angle) PI))
       (t_1 (* 0.005555555555555556 (* angle PI)))
       (t_2 (sin t_1))
       (t_3 (cos t_1)))
  (if (<= (fabs a) 5.5e+38)
    (*
     180.0
     (/
      (atan
       (*
        -0.5
        (/
         (* y-scale (+ (sqrt (pow t_3 4.0)) (pow t_3 2.0)))
         (* (* (sin t_0) (cos t_0)) x-scale))))
      PI))
    (*
     180.0
     (/
      (atan
       (*
        0.5
        (/
         (* y-scale (+ (sqrt (pow t_2 4.0)) (pow t_2 2.0)))
         (* x-scale (* t_3 t_2)))))
      PI)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = (0.005555555555555556 * angle) * ((double) M_PI);
	double t_1 = 0.005555555555555556 * (angle * ((double) M_PI));
	double t_2 = sin(t_1);
	double t_3 = cos(t_1);
	double tmp;
	if (fabs(a) <= 5.5e+38) {
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (sqrt(pow(t_3, 4.0)) + pow(t_3, 2.0))) / ((sin(t_0) * cos(t_0)) * x_45_scale)))) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan((0.5 * ((y_45_scale * (sqrt(pow(t_2, 4.0)) + pow(t_2, 2.0))) / (x_45_scale * (t_3 * t_2))))) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = (0.005555555555555556 * angle) * Math.PI;
	double t_1 = 0.005555555555555556 * (angle * Math.PI);
	double t_2 = Math.sin(t_1);
	double t_3 = Math.cos(t_1);
	double tmp;
	if (Math.abs(a) <= 5.5e+38) {
		tmp = 180.0 * (Math.atan((-0.5 * ((y_45_scale * (Math.sqrt(Math.pow(t_3, 4.0)) + Math.pow(t_3, 2.0))) / ((Math.sin(t_0) * Math.cos(t_0)) * x_45_scale)))) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan((0.5 * ((y_45_scale * (Math.sqrt(Math.pow(t_2, 4.0)) + Math.pow(t_2, 2.0))) / (x_45_scale * (t_3 * t_2))))) / Math.PI);
	}
	return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = (0.005555555555555556 * angle) * math.pi
	t_1 = 0.005555555555555556 * (angle * math.pi)
	t_2 = math.sin(t_1)
	t_3 = math.cos(t_1)
	tmp = 0
	if math.fabs(a) <= 5.5e+38:
		tmp = 180.0 * (math.atan((-0.5 * ((y_45_scale * (math.sqrt(math.pow(t_3, 4.0)) + math.pow(t_3, 2.0))) / ((math.sin(t_0) * math.cos(t_0)) * x_45_scale)))) / math.pi)
	else:
		tmp = 180.0 * (math.atan((0.5 * ((y_45_scale * (math.sqrt(math.pow(t_2, 4.0)) + math.pow(t_2, 2.0))) / (x_45_scale * (t_3 * t_2))))) / math.pi)
	return tmp
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(Float64(0.005555555555555556 * angle) * pi)
	t_1 = Float64(0.005555555555555556 * Float64(angle * pi))
	t_2 = sin(t_1)
	t_3 = cos(t_1)
	tmp = 0.0
	if (abs(a) <= 5.5e+38)
		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(sqrt((t_3 ^ 4.0)) + (t_3 ^ 2.0))) / Float64(Float64(sin(t_0) * cos(t_0)) * x_45_scale)))) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(y_45_scale * Float64(sqrt((t_2 ^ 4.0)) + (t_2 ^ 2.0))) / Float64(x_45_scale * Float64(t_3 * t_2))))) / pi));
	end
	return tmp
end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = (0.005555555555555556 * angle) * pi;
	t_1 = 0.005555555555555556 * (angle * pi);
	t_2 = sin(t_1);
	t_3 = cos(t_1);
	tmp = 0.0;
	if (abs(a) <= 5.5e+38)
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (sqrt((t_3 ^ 4.0)) + (t_3 ^ 2.0))) / ((sin(t_0) * cos(t_0)) * x_45_scale)))) / pi);
	else
		tmp = 180.0 * (atan((0.5 * ((y_45_scale * (sqrt((t_2 ^ 4.0)) + (t_2 ^ 2.0))) / (x_45_scale * (t_3 * t_2))))) / pi);
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$1], $MachinePrecision]}, If[LessEqual[N[Abs[a], $MachinePrecision], 5.5e+38], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(y$45$scale * N[(N[Sqrt[N[Power[t$95$3, 4.0], $MachinePrecision]], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(y$45$scale * N[(N[Sqrt[N[Power[t$95$2, 4.0], $MachinePrecision]], $MachinePrecision] + N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[(t$95$3 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_2 := \sin t\_1\\
t_3 := \cos t\_1\\
\mathbf{if}\;\left|a\right| \leq 5.5 \cdot 10^{+38}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{t\_3}^{4}} + {t\_3}^{2}\right)}{\left(\sin t\_0 \cdot \cos t\_0\right) \cdot x-scale}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{t\_2}^{4}} + {t\_2}^{2}\right)}{x-scale \cdot \left(t\_3 \cdot t\_2\right)}\right)}{\pi}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 5.5000000000000003e38

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}\right)}\right)}{\pi} \]
      2. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right) \cdot x-scale}\right)}{\pi} \]
    8. Applied rewrites44.0%

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

    if 5.5000000000000003e38 < a

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\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)}}\right)}{\pi} \]
    10. Applied rewrites37.3%

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

Alternative 3: 49.7% accurate, 3.7× speedup?

\[\begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_1 := \sin t\_0\\ t_2 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\ t_3 := \cos t\_2\\ \mathbf{if}\;\left|a\right| \leq 5.5 \cdot 10^{+38}:\\ \;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_2\right)\right) + \sqrt{{t\_3}^{4}}\right) \cdot y-scale}{\left(x-scale \cdot t\_3\right) \cdot \sin t\_2} \cdot -0.5\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{t\_1}^{4}} + {t\_1}^{2}\right)}{x-scale \cdot \left(\cos t\_0 \cdot t\_1\right)}\right)}{\pi}\\ \end{array} \]
(FPCore (a b angle x-scale y-scale)
  :precision binary64
  (let* ((t_0 (* 0.005555555555555556 (* angle PI)))
       (t_1 (sin t_0))
       (t_2 (* (* 0.005555555555555556 angle) PI))
       (t_3 (cos t_2)))
  (if (<= (fabs a) 5.5e+38)
    (/
     (*
      180.0
      (atan
       (*
        (/
         (*
          (+ (+ 0.5 (* 0.5 (cos (* 2.0 t_2)))) (sqrt (pow t_3 4.0)))
          y-scale)
         (* (* x-scale t_3) (sin t_2)))
        -0.5)))
     PI)
    (*
     180.0
     (/
      (atan
       (*
        0.5
        (/
         (* y-scale (+ (sqrt (pow t_1 4.0)) (pow t_1 2.0)))
         (* x-scale (* (cos t_0) t_1)))))
      PI)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
	double t_1 = sin(t_0);
	double t_2 = (0.005555555555555556 * angle) * ((double) M_PI);
	double t_3 = cos(t_2);
	double tmp;
	if (fabs(a) <= 5.5e+38) {
		tmp = (180.0 * atan((((((0.5 + (0.5 * cos((2.0 * t_2)))) + sqrt(pow(t_3, 4.0))) * y_45_scale) / ((x_45_scale * t_3) * sin(t_2))) * -0.5))) / ((double) M_PI);
	} else {
		tmp = 180.0 * (atan((0.5 * ((y_45_scale * (sqrt(pow(t_1, 4.0)) + pow(t_1, 2.0))) / (x_45_scale * (cos(t_0) * t_1))))) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = 0.005555555555555556 * (angle * Math.PI);
	double t_1 = Math.sin(t_0);
	double t_2 = (0.005555555555555556 * angle) * Math.PI;
	double t_3 = Math.cos(t_2);
	double tmp;
	if (Math.abs(a) <= 5.5e+38) {
		tmp = (180.0 * Math.atan((((((0.5 + (0.5 * Math.cos((2.0 * t_2)))) + Math.sqrt(Math.pow(t_3, 4.0))) * y_45_scale) / ((x_45_scale * t_3) * Math.sin(t_2))) * -0.5))) / Math.PI;
	} else {
		tmp = 180.0 * (Math.atan((0.5 * ((y_45_scale * (Math.sqrt(Math.pow(t_1, 4.0)) + Math.pow(t_1, 2.0))) / (x_45_scale * (Math.cos(t_0) * t_1))))) / Math.PI);
	}
	return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = 0.005555555555555556 * (angle * math.pi)
	t_1 = math.sin(t_0)
	t_2 = (0.005555555555555556 * angle) * math.pi
	t_3 = math.cos(t_2)
	tmp = 0
	if math.fabs(a) <= 5.5e+38:
		tmp = (180.0 * math.atan((((((0.5 + (0.5 * math.cos((2.0 * t_2)))) + math.sqrt(math.pow(t_3, 4.0))) * y_45_scale) / ((x_45_scale * t_3) * math.sin(t_2))) * -0.5))) / math.pi
	else:
		tmp = 180.0 * (math.atan((0.5 * ((y_45_scale * (math.sqrt(math.pow(t_1, 4.0)) + math.pow(t_1, 2.0))) / (x_45_scale * (math.cos(t_0) * t_1))))) / math.pi)
	return tmp
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(0.005555555555555556 * Float64(angle * pi))
	t_1 = sin(t_0)
	t_2 = Float64(Float64(0.005555555555555556 * angle) * pi)
	t_3 = cos(t_2)
	tmp = 0.0
	if (abs(a) <= 5.5e+38)
		tmp = Float64(Float64(180.0 * atan(Float64(Float64(Float64(Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * t_2)))) + sqrt((t_3 ^ 4.0))) * y_45_scale) / Float64(Float64(x_45_scale * t_3) * sin(t_2))) * -0.5))) / pi);
	else
		tmp = Float64(180.0 * Float64(atan(Float64(0.5 * Float64(Float64(y_45_scale * Float64(sqrt((t_1 ^ 4.0)) + (t_1 ^ 2.0))) / Float64(x_45_scale * Float64(cos(t_0) * t_1))))) / pi));
	end
	return tmp
end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = 0.005555555555555556 * (angle * pi);
	t_1 = sin(t_0);
	t_2 = (0.005555555555555556 * angle) * pi;
	t_3 = cos(t_2);
	tmp = 0.0;
	if (abs(a) <= 5.5e+38)
		tmp = (180.0 * atan((((((0.5 + (0.5 * cos((2.0 * t_2)))) + sqrt((t_3 ^ 4.0))) * y_45_scale) / ((x_45_scale * t_3) * sin(t_2))) * -0.5))) / pi;
	else
		tmp = 180.0 * (atan((0.5 * ((y_45_scale * (sqrt((t_1 ^ 4.0)) + (t_1 ^ 2.0))) / (x_45_scale * (cos(t_0) * t_1))))) / pi);
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$3 = N[Cos[t$95$2], $MachinePrecision]}, If[LessEqual[N[Abs[a], $MachinePrecision], 5.5e+38], N[(N[(180.0 * N[ArcTan[N[(N[(N[(N[(N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[Power[t$95$3, 4.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] / N[(N[(x$45$scale * t$95$3), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Pi), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(0.5 * N[(N[(y$45$scale * N[(N[Sqrt[N[Power[t$95$1, 4.0], $MachinePrecision]], $MachinePrecision] + N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[(N[Cos[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
t_2 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_3 := \cos t\_2\\
\mathbf{if}\;\left|a\right| \leq 5.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{180 \cdot \tan^{-1} \left(\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_2\right)\right) + \sqrt{{t\_3}^{4}}\right) \cdot y-scale}{\left(x-scale \cdot t\_3\right) \cdot \sin t\_2} \cdot -0.5\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{t\_1}^{4}} + {t\_1}^{2}\right)}{x-scale \cdot \left(\cos t\_0 \cdot t\_1\right)}\right)}{\pi}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 5.5000000000000003e38

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

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

    if 5.5000000000000003e38 < a

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\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)}}\right)}{\pi} \]
    10. Applied rewrites37.3%

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

Alternative 4: 46.5% accurate, 3.8× speedup?

\[\begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_1 := \frac{angle}{180} \cdot \pi\\ t_2 := \cos t\_1\\ \mathbf{if}\;y-scale \leq -2.8 \cdot 10^{-82}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos t\_0 \cdot \sin t\_0\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_1\right)\right) + \sqrt{{t\_2}^{4}}\right) \cdot y-scale}{x-scale}}{\sin t\_1 \cdot t\_2}\right)}{\pi}\\ \end{array} \]
(FPCore (a b angle x-scale y-scale)
  :precision binary64
  (let* ((t_0 (* 0.005555555555555556 (* angle PI)))
       (t_1 (* (/ angle 180.0) PI))
       (t_2 (cos t_1)))
  (if (<= y-scale -2.8e-82)
    (*
     180.0
     (/
      (atan
       (*
        -0.5
        (/
         (*
          y-scale
          (+
           2.0
           (* -6.17283950617284e-5 (* (pow angle 2.0) (pow PI 2.0)))))
         (* x-scale (* (cos t_0) (sin t_0))))))
      PI))
    (*
     180.0
     (/
      (atan
       (*
        -0.5
        (/
         (/
          (*
           (+ (+ 0.5 (* 0.5 (cos (* 2.0 t_1)))) (sqrt (pow t_2 4.0)))
           y-scale)
          x-scale)
         (* (sin t_1) t_2))))
      PI)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
	double t_1 = (angle / 180.0) * ((double) M_PI);
	double t_2 = cos(t_1);
	double tmp;
	if (y_45_scale <= -2.8e-82) {
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (2.0 + (-6.17283950617284e-5 * (pow(angle, 2.0) * pow(((double) M_PI), 2.0))))) / (x_45_scale * (cos(t_0) * sin(t_0)))))) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan((-0.5 * (((((0.5 + (0.5 * cos((2.0 * t_1)))) + sqrt(pow(t_2, 4.0))) * y_45_scale) / x_45_scale) / (sin(t_1) * t_2)))) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = 0.005555555555555556 * (angle * Math.PI);
	double t_1 = (angle / 180.0) * Math.PI;
	double t_2 = Math.cos(t_1);
	double tmp;
	if (y_45_scale <= -2.8e-82) {
		tmp = 180.0 * (Math.atan((-0.5 * ((y_45_scale * (2.0 + (-6.17283950617284e-5 * (Math.pow(angle, 2.0) * Math.pow(Math.PI, 2.0))))) / (x_45_scale * (Math.cos(t_0) * Math.sin(t_0)))))) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan((-0.5 * (((((0.5 + (0.5 * Math.cos((2.0 * t_1)))) + Math.sqrt(Math.pow(t_2, 4.0))) * y_45_scale) / x_45_scale) / (Math.sin(t_1) * t_2)))) / Math.PI);
	}
	return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = 0.005555555555555556 * (angle * math.pi)
	t_1 = (angle / 180.0) * math.pi
	t_2 = math.cos(t_1)
	tmp = 0
	if y_45_scale <= -2.8e-82:
		tmp = 180.0 * (math.atan((-0.5 * ((y_45_scale * (2.0 + (-6.17283950617284e-5 * (math.pow(angle, 2.0) * math.pow(math.pi, 2.0))))) / (x_45_scale * (math.cos(t_0) * math.sin(t_0)))))) / math.pi)
	else:
		tmp = 180.0 * (math.atan((-0.5 * (((((0.5 + (0.5 * math.cos((2.0 * t_1)))) + math.sqrt(math.pow(t_2, 4.0))) * y_45_scale) / x_45_scale) / (math.sin(t_1) * t_2)))) / math.pi)
	return tmp
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(0.005555555555555556 * Float64(angle * pi))
	t_1 = Float64(Float64(angle / 180.0) * pi)
	t_2 = cos(t_1)
	tmp = 0.0
	if (y_45_scale <= -2.8e-82)
		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(2.0 + Float64(-6.17283950617284e-5 * Float64((angle ^ 2.0) * (pi ^ 2.0))))) / Float64(x_45_scale * Float64(cos(t_0) * sin(t_0)))))) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(Float64(Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * t_1)))) + sqrt((t_2 ^ 4.0))) * y_45_scale) / x_45_scale) / Float64(sin(t_1) * t_2)))) / pi));
	end
	return tmp
end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = 0.005555555555555556 * (angle * pi);
	t_1 = (angle / 180.0) * pi;
	t_2 = cos(t_1);
	tmp = 0.0;
	if (y_45_scale <= -2.8e-82)
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (2.0 + (-6.17283950617284e-5 * ((angle ^ 2.0) * (pi ^ 2.0))))) / (x_45_scale * (cos(t_0) * sin(t_0)))))) / pi);
	else
		tmp = 180.0 * (atan((-0.5 * (((((0.5 + (0.5 * cos((2.0 * t_1)))) + sqrt((t_2 ^ 4.0))) * y_45_scale) / x_45_scale) / (sin(t_1) * t_2)))) / pi);
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, If[LessEqual[y$45$scale, -2.8e-82], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(y$45$scale * N[(2.0 + N[(-6.17283950617284e-5 * N[(N[Power[angle, 2.0], $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(N[(N[(N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[Power[t$95$2, 4.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(N[Sin[t$95$1], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \frac{angle}{180} \cdot \pi\\
t_2 := \cos t\_1\\
\mathbf{if}\;y-scale \leq -2.8 \cdot 10^{-82}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos t\_0 \cdot \sin t\_0\right)}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_1\right)\right) + \sqrt{{t\_2}^{4}}\right) \cdot y-scale}{x-scale}}{\sin t\_1 \cdot t\_2}\right)}{\pi}\\


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

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + \frac{-1}{16200} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
    8. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(2 + \frac{-1}{16200} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      6. lower-PI.f6437.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
    9. Applied rewrites37.9%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]

    if -2.8000000000000002e-82 < y-scale

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot \color{blue}{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}}\right)}{\pi} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      2. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      3. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      4. mult-flipN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      5. lower-/.f6445.6%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
    9. Applied rewrites45.6%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      2. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      3. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      4. mult-flipN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      5. lower-/.f6445.6%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
    11. Applied rewrites45.6%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
    12. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      2. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      3. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      4. mult-flipN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      5. lower-/.f6445.8%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
    13. Applied rewrites45.8%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
    14. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}\right)}{\pi} \]
      2. *-commutativeN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}\right)}{\pi} \]
      3. metadata-evalN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\left(angle \cdot \frac{1}{180}\right) \cdot \pi\right)}\right)}{\pi} \]
      4. mult-flipN/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}\right)}{\pi} \]
      5. lower-/.f6445.8%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\frac{angle}{180} \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}\right)}{\pi} \]
    15. Applied rewrites45.8%

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

Alternative 5: 45.4% accurate, 3.8× speedup?

\[\begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_1 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\ t_2 := \cos t\_1\\ \mathbf{if}\;y-scale \leq -2.9 \cdot 10^{-55}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos t\_0 \cdot \sin t\_0\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_1\right)\right) + \sqrt{{t\_2}^{4}}\right) \cdot y-scale}{x-scale}}{\sin t\_1 \cdot t\_2}\right)}{\pi}\\ \end{array} \]
(FPCore (a b angle x-scale y-scale)
  :precision binary64
  (let* ((t_0 (* 0.005555555555555556 (* angle PI)))
       (t_1 (* (* 0.005555555555555556 angle) PI))
       (t_2 (cos t_1)))
  (if (<= y-scale -2.9e-55)
    (*
     180.0
     (/
      (atan
       (*
        -0.5
        (/
         (*
          y-scale
          (+
           2.0
           (* -6.17283950617284e-5 (* (pow angle 2.0) (pow PI 2.0)))))
         (* x-scale (* (cos t_0) (sin t_0))))))
      PI))
    (*
     180.0
     (/
      (atan
       (*
        -0.5
        (/
         (/
          (*
           (+ (+ 0.5 (* 0.5 (cos (* 2.0 t_1)))) (sqrt (pow t_2 4.0)))
           y-scale)
          x-scale)
         (* (sin t_1) t_2))))
      PI)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
	double t_1 = (0.005555555555555556 * angle) * ((double) M_PI);
	double t_2 = cos(t_1);
	double tmp;
	if (y_45_scale <= -2.9e-55) {
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (2.0 + (-6.17283950617284e-5 * (pow(angle, 2.0) * pow(((double) M_PI), 2.0))))) / (x_45_scale * (cos(t_0) * sin(t_0)))))) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan((-0.5 * (((((0.5 + (0.5 * cos((2.0 * t_1)))) + sqrt(pow(t_2, 4.0))) * y_45_scale) / x_45_scale) / (sin(t_1) * t_2)))) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = 0.005555555555555556 * (angle * Math.PI);
	double t_1 = (0.005555555555555556 * angle) * Math.PI;
	double t_2 = Math.cos(t_1);
	double tmp;
	if (y_45_scale <= -2.9e-55) {
		tmp = 180.0 * (Math.atan((-0.5 * ((y_45_scale * (2.0 + (-6.17283950617284e-5 * (Math.pow(angle, 2.0) * Math.pow(Math.PI, 2.0))))) / (x_45_scale * (Math.cos(t_0) * Math.sin(t_0)))))) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan((-0.5 * (((((0.5 + (0.5 * Math.cos((2.0 * t_1)))) + Math.sqrt(Math.pow(t_2, 4.0))) * y_45_scale) / x_45_scale) / (Math.sin(t_1) * t_2)))) / Math.PI);
	}
	return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = 0.005555555555555556 * (angle * math.pi)
	t_1 = (0.005555555555555556 * angle) * math.pi
	t_2 = math.cos(t_1)
	tmp = 0
	if y_45_scale <= -2.9e-55:
		tmp = 180.0 * (math.atan((-0.5 * ((y_45_scale * (2.0 + (-6.17283950617284e-5 * (math.pow(angle, 2.0) * math.pow(math.pi, 2.0))))) / (x_45_scale * (math.cos(t_0) * math.sin(t_0)))))) / math.pi)
	else:
		tmp = 180.0 * (math.atan((-0.5 * (((((0.5 + (0.5 * math.cos((2.0 * t_1)))) + math.sqrt(math.pow(t_2, 4.0))) * y_45_scale) / x_45_scale) / (math.sin(t_1) * t_2)))) / math.pi)
	return tmp
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(0.005555555555555556 * Float64(angle * pi))
	t_1 = Float64(Float64(0.005555555555555556 * angle) * pi)
	t_2 = cos(t_1)
	tmp = 0.0
	if (y_45_scale <= -2.9e-55)
		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(2.0 + Float64(-6.17283950617284e-5 * Float64((angle ^ 2.0) * (pi ^ 2.0))))) / Float64(x_45_scale * Float64(cos(t_0) * sin(t_0)))))) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(Float64(Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * t_1)))) + sqrt((t_2 ^ 4.0))) * y_45_scale) / x_45_scale) / Float64(sin(t_1) * t_2)))) / pi));
	end
	return tmp
end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = 0.005555555555555556 * (angle * pi);
	t_1 = (0.005555555555555556 * angle) * pi;
	t_2 = cos(t_1);
	tmp = 0.0;
	if (y_45_scale <= -2.9e-55)
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (2.0 + (-6.17283950617284e-5 * ((angle ^ 2.0) * (pi ^ 2.0))))) / (x_45_scale * (cos(t_0) * sin(t_0)))))) / pi);
	else
		tmp = 180.0 * (atan((-0.5 * (((((0.5 + (0.5 * cos((2.0 * t_1)))) + sqrt((t_2 ^ 4.0))) * y_45_scale) / x_45_scale) / (sin(t_1) * t_2)))) / pi);
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, If[LessEqual[y$45$scale, -2.9e-55], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(y$45$scale * N[(2.0 + N[(-6.17283950617284e-5 * N[(N[Power[angle, 2.0], $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(N[(N[(N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[Power[t$95$2, 4.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * y$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision] / N[(N[Sin[t$95$1], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_2 := \cos t\_1\\
\mathbf{if}\;y-scale \leq -2.9 \cdot 10^{-55}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos t\_0 \cdot \sin t\_0\right)}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_1\right)\right) + \sqrt{{t\_2}^{4}}\right) \cdot y-scale}{x-scale}}{\sin t\_1 \cdot t\_2}\right)}{\pi}\\


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

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + \frac{-1}{16200} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
    8. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(2 + \frac{-1}{16200} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      6. lower-PI.f6437.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
    9. Applied rewrites37.9%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]

    if -2.9e-55 < y-scale

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

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

Alternative 6: 45.4% accurate, 3.8× speedup?

\[\begin{array}{l} t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\ t_1 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\ t_2 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ \mathbf{if}\;y-scale \leq -2.9 \cdot 10^{-55}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos t\_2 \cdot \sin t\_2\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\left(\sqrt{{\cos t\_1}^{4}} + \mathsf{fma}\left(\cos \left(t\_1 \cdot 2\right), 0.5, 0.5\right)\right) \cdot \frac{y-scale}{x-scale}}{\sin t\_0 \cdot \cos t\_0}\right)}{\pi}\\ \end{array} \]
(FPCore (a b angle x-scale y-scale)
  :precision binary64
  (let* ((t_0 (* (* 0.005555555555555556 angle) PI))
       (t_1 (* PI (* 0.005555555555555556 angle)))
       (t_2 (* 0.005555555555555556 (* angle PI))))
  (if (<= y-scale -2.9e-55)
    (*
     180.0
     (/
      (atan
       (*
        -0.5
        (/
         (*
          y-scale
          (+
           2.0
           (* -6.17283950617284e-5 (* (pow angle 2.0) (pow PI 2.0)))))
         (* x-scale (* (cos t_2) (sin t_2))))))
      PI))
    (*
     180.0
     (/
      (atan
       (*
        -0.5
        (/
         (*
          (+
           (sqrt (pow (cos t_1) 4.0))
           (fma (cos (* t_1 2.0)) 0.5 0.5))
          (/ y-scale x-scale))
         (* (sin t_0) (cos t_0)))))
      PI)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = (0.005555555555555556 * angle) * ((double) M_PI);
	double t_1 = ((double) M_PI) * (0.005555555555555556 * angle);
	double t_2 = 0.005555555555555556 * (angle * ((double) M_PI));
	double tmp;
	if (y_45_scale <= -2.9e-55) {
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (2.0 + (-6.17283950617284e-5 * (pow(angle, 2.0) * pow(((double) M_PI), 2.0))))) / (x_45_scale * (cos(t_2) * sin(t_2)))))) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan((-0.5 * (((sqrt(pow(cos(t_1), 4.0)) + fma(cos((t_1 * 2.0)), 0.5, 0.5)) * (y_45_scale / x_45_scale)) / (sin(t_0) * cos(t_0))))) / ((double) M_PI));
	}
	return tmp;
}
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(Float64(0.005555555555555556 * angle) * pi)
	t_1 = Float64(pi * Float64(0.005555555555555556 * angle))
	t_2 = Float64(0.005555555555555556 * Float64(angle * pi))
	tmp = 0.0
	if (y_45_scale <= -2.9e-55)
		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(2.0 + Float64(-6.17283950617284e-5 * Float64((angle ^ 2.0) * (pi ^ 2.0))))) / Float64(x_45_scale * Float64(cos(t_2) * sin(t_2)))))) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(Float64(sqrt((cos(t_1) ^ 4.0)) + fma(cos(Float64(t_1 * 2.0)), 0.5, 0.5)) * Float64(y_45_scale / x_45_scale)) / Float64(sin(t_0) * cos(t_0))))) / pi));
	end
	return tmp
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -2.9e-55], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(y$45$scale * N[(2.0 + N[(-6.17283950617284e-5 * N[(N[Power[angle, 2.0], $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[(N[Cos[t$95$2], $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(N[(N[Sqrt[N[Power[N[Cos[t$95$1], $MachinePrecision], 4.0], $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(t$95$1 * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5 + 0.5), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\right) \cdot \pi\\
t_1 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_2 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;y-scale \leq -2.9 \cdot 10^{-55}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos t\_2 \cdot \sin t\_2\right)}\right)}{\pi}\\

\mathbf{else}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\left(\sqrt{{\cos t\_1}^{4}} + \mathsf{fma}\left(\cos \left(t\_1 \cdot 2\right), 0.5, 0.5\right)\right) \cdot \frac{y-scale}{x-scale}}{\sin t\_0 \cdot \cos t\_0}\right)}{\pi}\\


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

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + \frac{-1}{16200} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
    8. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(2 + \frac{-1}{16200} \cdot \left({angle}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      6. lower-PI.f6437.9%

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
    9. Applied rewrites37.9%

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(2 + -6.17283950617284 \cdot 10^{-5} \cdot \left({angle}^{2} \cdot {\pi}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]

    if -2.9e-55 < y-scale

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{\frac{\left(\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right) \cdot \color{blue}{\cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)}}\right)}{\pi} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{\frac{\left(\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(2 \cdot \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)\right)\right) + \sqrt{{\cos \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right)}^{4}}\right) \cdot y-scale}{x-scale}}{\sin \left(\left(\frac{1}{180} \cdot angle\right) \cdot \pi\right) \cdot \cos \left(\color{blue}{\left(\frac{1}{180} \cdot angle\right)} \cdot \pi\right)}\right)}{\pi} \]
      3. associate-/l*N/A

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

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

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

Alternative 7: 45.2% accurate, 7.4× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|a\right| \leq 6.5 \cdot 10^{+49}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{1}^{4}} + {1}^{2}\right)}{x-scale \cdot \left(1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi}\\ \end{array} \]
(FPCore (a b angle x-scale y-scale)
  :precision binary64
  (if (<= (fabs a) 6.5e+49)
  (*
   180.0
   (/
    (atan
     (*
      -0.5
      (/
       (* y-scale (+ (sqrt (pow 1.0 4.0)) (pow 1.0 2.0)))
       (*
        x-scale
        (* 1.0 (sin (* 0.005555555555555556 (* angle PI))))))))
    PI))
  (*
   180.0
   (/
    (atan
     (* -180.0 (/ y-scale (* angle (log (pow (exp PI) x-scale))))))
    PI))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (fabs(a) <= 6.5e+49) {
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (sqrt(pow(1.0, 4.0)) + pow(1.0, 2.0))) / (x_45_scale * (1.0 * sin((0.005555555555555556 * (angle * ((double) M_PI))))))))) / ((double) M_PI));
	} else {
		tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * log(pow(exp(((double) M_PI)), x_45_scale)))))) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double tmp;
	if (Math.abs(a) <= 6.5e+49) {
		tmp = 180.0 * (Math.atan((-0.5 * ((y_45_scale * (Math.sqrt(Math.pow(1.0, 4.0)) + Math.pow(1.0, 2.0))) / (x_45_scale * (1.0 * Math.sin((0.005555555555555556 * (angle * Math.PI)))))))) / Math.PI);
	} else {
		tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * Math.log(Math.pow(Math.exp(Math.PI), x_45_scale)))))) / Math.PI);
	}
	return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale):
	tmp = 0
	if math.fabs(a) <= 6.5e+49:
		tmp = 180.0 * (math.atan((-0.5 * ((y_45_scale * (math.sqrt(math.pow(1.0, 4.0)) + math.pow(1.0, 2.0))) / (x_45_scale * (1.0 * math.sin((0.005555555555555556 * (angle * math.pi)))))))) / math.pi)
	else:
		tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * math.log(math.pow(math.exp(math.pi), x_45_scale)))))) / math.pi)
	return tmp
function code(a, b, angle, x_45_scale, y_45_scale)
	tmp = 0.0
	if (abs(a) <= 6.5e+49)
		tmp = Float64(180.0 * Float64(atan(Float64(-0.5 * Float64(Float64(y_45_scale * Float64(sqrt((1.0 ^ 4.0)) + (1.0 ^ 2.0))) / Float64(x_45_scale * Float64(1.0 * sin(Float64(0.005555555555555556 * Float64(angle * pi)))))))) / pi));
	else
		tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * log((exp(pi) ^ x_45_scale)))))) / pi));
	end
	return tmp
end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
	tmp = 0.0;
	if (abs(a) <= 6.5e+49)
		tmp = 180.0 * (atan((-0.5 * ((y_45_scale * (sqrt((1.0 ^ 4.0)) + (1.0 ^ 2.0))) / (x_45_scale * (1.0 * sin((0.005555555555555556 * (angle * pi)))))))) / pi);
	else
		tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * log((exp(pi) ^ x_45_scale)))))) / pi);
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[N[Abs[a], $MachinePrecision], 6.5e+49], N[(180.0 * N[(N[ArcTan[N[(-0.5 * N[(N[(y$45$scale * N[(N[Sqrt[N[Power[1.0, 4.0], $MachinePrecision]], $MachinePrecision] + N[Power[1.0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x$45$scale * N[(1.0 * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(angle * N[Log[N[Power[N[Exp[Pi], $MachinePrecision], x$45$scale], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|a\right| \leq 6.5 \cdot 10^{+49}:\\
\;\;\;\;180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{1}^{4}} + {1}^{2}\right)}{x-scale \cdot \left(1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 6.5000000000000005e49

    1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
    3. Applied rewrites24.4%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
    6. Applied rewrites44.0%

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

      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{1}^{4}} + {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
    8. Step-by-step derivation
      1. Applied rewrites43.7%

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

        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{1}^{4}} + {1}^{2}\right)}{x-scale \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\pi} \]
      3. Step-by-step derivation
        1. Applied rewrites43.6%

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

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

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

          if 6.5000000000000005e49 < a

          1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
          3. Step-by-step derivation
            1. Applied rewrites12.4%

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

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

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

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

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

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

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

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
              5. lower-PI.f6438.2%

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
            7. Applied rewrites38.2%

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
              3. add-log-expN/A

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \log \left(e^{\mathsf{PI}\left(\right)}\right)\right)}\right)}{\pi} \]
              4. log-pow-revN/A

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

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

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi} \]
              8. lower-exp.f6435.4%

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi} \]
            9. Applied rewrites35.4%

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

          Alternative 8: 43.9% accurate, 7.0× speedup?

          \[\begin{array}{l} t_0 := {\left(\left|b\right|\right)}^{2}\\ \mathbf{if}\;\left|b\right| \leq 3.7 \cdot 10^{-109}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi}\\ \mathbf{elif}\;\left|b\right| \leq 2.3 \cdot 10^{+24}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{y-scale \cdot \left(\sqrt{{\left(\left|b\right|\right)}^{4}} + t\_0\right)}{angle \cdot \left(x-scale \cdot \left(\pi \cdot \left(t\_0 - {a}^{2}\right)\right)\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi}\\ \end{array} \]
          (FPCore (a b angle x-scale y-scale)
            :precision binary64
            (let* ((t_0 (pow (fabs b) 2.0)))
            (if (<= (fabs b) 3.7e-109)
              (*
               180.0
               (/
                (atan
                 (* -180.0 (/ y-scale (* angle (log (pow (exp PI) x-scale))))))
                PI))
              (if (<= (fabs b) 2.3e+24)
                (*
                 180.0
                 (/
                  (atan
                   (*
                    -90.0
                    (/
                     (* y-scale (+ (sqrt (pow (fabs b) 4.0)) t_0))
                     (* angle (* x-scale (* PI (- t_0 (pow a 2.0))))))))
                  PI))
                (*
                 180.0
                 (/
                  (atan (* -90.0 (/ (* 2.0 (/ y-scale x-scale)) (* angle PI))))
                  PI))))))
          double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
          	double t_0 = pow(fabs(b), 2.0);
          	double tmp;
          	if (fabs(b) <= 3.7e-109) {
          		tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * log(pow(exp(((double) M_PI)), x_45_scale)))))) / ((double) M_PI));
          	} else if (fabs(b) <= 2.3e+24) {
          		tmp = 180.0 * (atan((-90.0 * ((y_45_scale * (sqrt(pow(fabs(b), 4.0)) + t_0)) / (angle * (x_45_scale * (((double) M_PI) * (t_0 - pow(a, 2.0)))))))) / ((double) M_PI));
          	} else {
          		tmp = 180.0 * (atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * ((double) M_PI))))) / ((double) M_PI));
          	}
          	return tmp;
          }
          
          public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
          	double t_0 = Math.pow(Math.abs(b), 2.0);
          	double tmp;
          	if (Math.abs(b) <= 3.7e-109) {
          		tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * Math.log(Math.pow(Math.exp(Math.PI), x_45_scale)))))) / Math.PI);
          	} else if (Math.abs(b) <= 2.3e+24) {
          		tmp = 180.0 * (Math.atan((-90.0 * ((y_45_scale * (Math.sqrt(Math.pow(Math.abs(b), 4.0)) + t_0)) / (angle * (x_45_scale * (Math.PI * (t_0 - Math.pow(a, 2.0)))))))) / Math.PI);
          	} else {
          		tmp = 180.0 * (Math.atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * Math.PI)))) / Math.PI);
          	}
          	return tmp;
          }
          
          def code(a, b, angle, x_45_scale, y_45_scale):
          	t_0 = math.pow(math.fabs(b), 2.0)
          	tmp = 0
          	if math.fabs(b) <= 3.7e-109:
          		tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * math.log(math.pow(math.exp(math.pi), x_45_scale)))))) / math.pi)
          	elif math.fabs(b) <= 2.3e+24:
          		tmp = 180.0 * (math.atan((-90.0 * ((y_45_scale * (math.sqrt(math.pow(math.fabs(b), 4.0)) + t_0)) / (angle * (x_45_scale * (math.pi * (t_0 - math.pow(a, 2.0)))))))) / math.pi)
          	else:
          		tmp = 180.0 * (math.atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * math.pi)))) / math.pi)
          	return tmp
          
          function code(a, b, angle, x_45_scale, y_45_scale)
          	t_0 = abs(b) ^ 2.0
          	tmp = 0.0
          	if (abs(b) <= 3.7e-109)
          		tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * log((exp(pi) ^ x_45_scale)))))) / pi));
          	elseif (abs(b) <= 2.3e+24)
          		tmp = Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(Float64(y_45_scale * Float64(sqrt((abs(b) ^ 4.0)) + t_0)) / Float64(angle * Float64(x_45_scale * Float64(pi * Float64(t_0 - (a ^ 2.0)))))))) / pi));
          	else
          		tmp = Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(Float64(2.0 * Float64(y_45_scale / x_45_scale)) / Float64(angle * pi)))) / pi));
          	end
          	return tmp
          end
          
          function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
          	t_0 = abs(b) ^ 2.0;
          	tmp = 0.0;
          	if (abs(b) <= 3.7e-109)
          		tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * log((exp(pi) ^ x_45_scale)))))) / pi);
          	elseif (abs(b) <= 2.3e+24)
          		tmp = 180.0 * (atan((-90.0 * ((y_45_scale * (sqrt((abs(b) ^ 4.0)) + t_0)) / (angle * (x_45_scale * (pi * (t_0 - (a ^ 2.0)))))))) / pi);
          	else
          		tmp = 180.0 * (atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * pi)))) / pi);
          	end
          	tmp_2 = tmp;
          end
          
          code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[Power[N[Abs[b], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 3.7e-109], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(angle * N[Log[N[Power[N[Exp[Pi], $MachinePrecision], x$45$scale], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[b], $MachinePrecision], 2.3e+24], N[(180.0 * N[(N[ArcTan[N[(-90.0 * N[(N[(y$45$scale * N[(N[Sqrt[N[Power[N[Abs[b], $MachinePrecision], 4.0], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / N[(angle * N[(x$45$scale * N[(Pi * N[(t$95$0 - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-90.0 * N[(N[(2.0 * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          t_0 := {\left(\left|b\right|\right)}^{2}\\
          \mathbf{if}\;\left|b\right| \leq 3.7 \cdot 10^{-109}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi}\\
          
          \mathbf{elif}\;\left|b\right| \leq 2.3 \cdot 10^{+24}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{y-scale \cdot \left(\sqrt{{\left(\left|b\right|\right)}^{4}} + t\_0\right)}{angle \cdot \left(x-scale \cdot \left(\pi \cdot \left(t\_0 - {a}^{2}\right)\right)\right)}\right)}{\pi}\\
          
          \mathbf{else}:\\
          \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if b < 3.6999999999999998e-109

            1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
            3. Step-by-step derivation
              1. Applied rewrites12.4%

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

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

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

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

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

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

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

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

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
                5. lower-PI.f6438.2%

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
              7. Applied rewrites38.2%

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

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
                3. add-log-expN/A

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \log \left(e^{\mathsf{PI}\left(\right)}\right)\right)}\right)}{\pi} \]
                4. log-pow-revN/A

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

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

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi} \]
                8. lower-exp.f6435.4%

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi} \]
              9. Applied rewrites35.4%

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

              if 3.6999999999999998e-109 < b < 2.2999999999999999e24

              1. Initial program 14.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. 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(\sqrt{{\left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}^{2}} + \left({a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)}\right)}}{\pi} \]
              3. Applied rewrites24.4%

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

                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-0.5 \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{\color{blue}{x-scale \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \pi\right)\right)\right)}}\right)}{\pi} \]
              5. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-1}{2} \cdot \frac{y-scale \cdot \left(\sqrt{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{4}} + {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}{x-scale \cdot \color{blue}{\left(\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)}}\right)}{\pi} \]
              6. Applied rewrites44.0%

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

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

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

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

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

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

              if 2.2999999999999999e24 < b

              1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
              3. Step-by-step derivation
                1. Applied rewrites12.4%

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

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

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

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

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

                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi} \]
                6. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi} \]
                  2. lower-/.f6439.7%

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

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

              Alternative 9: 42.5% accurate, 13.2× speedup?

              \[\begin{array}{l} \mathbf{if}\;\left|b\right| \leq 3.2 \cdot 10^{+36}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi}\\ \end{array} \]
              (FPCore (a b angle x-scale y-scale)
                :precision binary64
                (if (<= (fabs b) 3.2e+36)
                (*
                 180.0
                 (/
                  (atan
                   (* -180.0 (/ y-scale (* angle (log (pow (exp PI) x-scale))))))
                  PI))
                (*
                 180.0
                 (/
                  (atan (* -90.0 (/ (* 2.0 (/ y-scale x-scale)) (* angle PI))))
                  PI))))
              double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
              	double tmp;
              	if (fabs(b) <= 3.2e+36) {
              		tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * log(pow(exp(((double) M_PI)), x_45_scale)))))) / ((double) M_PI));
              	} else {
              		tmp = 180.0 * (atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * ((double) M_PI))))) / ((double) M_PI));
              	}
              	return tmp;
              }
              
              public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
              	double tmp;
              	if (Math.abs(b) <= 3.2e+36) {
              		tmp = 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * Math.log(Math.pow(Math.exp(Math.PI), x_45_scale)))))) / Math.PI);
              	} else {
              		tmp = 180.0 * (Math.atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * Math.PI)))) / Math.PI);
              	}
              	return tmp;
              }
              
              def code(a, b, angle, x_45_scale, y_45_scale):
              	tmp = 0
              	if math.fabs(b) <= 3.2e+36:
              		tmp = 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * math.log(math.pow(math.exp(math.pi), x_45_scale)))))) / math.pi)
              	else:
              		tmp = 180.0 * (math.atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * math.pi)))) / math.pi)
              	return tmp
              
              function code(a, b, angle, x_45_scale, y_45_scale)
              	tmp = 0.0
              	if (abs(b) <= 3.2e+36)
              		tmp = Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * log((exp(pi) ^ x_45_scale)))))) / pi));
              	else
              		tmp = Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(Float64(2.0 * Float64(y_45_scale / x_45_scale)) / Float64(angle * pi)))) / pi));
              	end
              	return tmp
              end
              
              function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
              	tmp = 0.0;
              	if (abs(b) <= 3.2e+36)
              		tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * log((exp(pi) ^ x_45_scale)))))) / pi);
              	else
              		tmp = 180.0 * (atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * pi)))) / pi);
              	end
              	tmp_2 = tmp;
              end
              
              code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[N[Abs[b], $MachinePrecision], 3.2e+36], N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(angle * N[Log[N[Power[N[Exp[Pi], $MachinePrecision], x$45$scale], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-90.0 * N[(N[(2.0 * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              \mathbf{if}\;\left|b\right| \leq 3.2 \cdot 10^{+36}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi}\\
              
              \mathbf{else}:\\
              \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi}\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if b < 3.1999999999999999e36

                1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
                3. Step-by-step derivation
                  1. Applied rewrites12.4%

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

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

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

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

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

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

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
                    5. lower-PI.f6438.2%

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                  7. Applied rewrites38.2%

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
                    3. add-log-expN/A

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \log \left(e^{\mathsf{PI}\left(\right)}\right)\right)}\right)}{\pi} \]
                    4. log-pow-revN/A

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi} \]
                    8. lower-exp.f6435.4%

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \log \left({\left(e^{\pi}\right)}^{x-scale}\right)}\right)}{\pi} \]
                  9. Applied rewrites35.4%

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

                  if 3.1999999999999999e36 < b

                  1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
                  3. Step-by-step derivation
                    1. Applied rewrites12.4%

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

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

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

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

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

                      \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi} \]
                    6. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi} \]
                      2. lower-/.f6439.7%

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

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

                  Alternative 10: 41.2% accurate, 14.8× speedup?

                  \[\begin{array}{l} \mathbf{if}\;\left|a\right| \leq 1.4 \cdot 10^{+64}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{\pi \cdot x-scale} \cdot \frac{y-scale}{angle}\right)}{\pi}\\ \mathbf{else}:\\ \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{x-scale \cdot \left(2 \cdot \frac{y-scale}{{x-scale}^{2}}\right)}{angle \cdot \pi}\right)}{\pi}\\ \end{array} \]
                  (FPCore (a b angle x-scale y-scale)
                    :precision binary64
                    (if (<= (fabs a) 1.4e+64)
                    (*
                     180.0
                     (/ (atan (* (/ -180.0 (* PI x-scale)) (/ y-scale angle))) PI))
                    (*
                     180.0
                     (/
                      (atan
                       (*
                        -90.0
                        (/
                         (* x-scale (* 2.0 (/ y-scale (pow x-scale 2.0))))
                         (* angle PI))))
                      PI))))
                  double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                  	double tmp;
                  	if (fabs(a) <= 1.4e+64) {
                  		tmp = 180.0 * (atan(((-180.0 / (((double) M_PI) * x_45_scale)) * (y_45_scale / angle))) / ((double) M_PI));
                  	} else {
                  		tmp = 180.0 * (atan((-90.0 * ((x_45_scale * (2.0 * (y_45_scale / pow(x_45_scale, 2.0)))) / (angle * ((double) M_PI))))) / ((double) M_PI));
                  	}
                  	return tmp;
                  }
                  
                  public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                  	double tmp;
                  	if (Math.abs(a) <= 1.4e+64) {
                  		tmp = 180.0 * (Math.atan(((-180.0 / (Math.PI * x_45_scale)) * (y_45_scale / angle))) / Math.PI);
                  	} else {
                  		tmp = 180.0 * (Math.atan((-90.0 * ((x_45_scale * (2.0 * (y_45_scale / Math.pow(x_45_scale, 2.0)))) / (angle * Math.PI)))) / Math.PI);
                  	}
                  	return tmp;
                  }
                  
                  def code(a, b, angle, x_45_scale, y_45_scale):
                  	tmp = 0
                  	if math.fabs(a) <= 1.4e+64:
                  		tmp = 180.0 * (math.atan(((-180.0 / (math.pi * x_45_scale)) * (y_45_scale / angle))) / math.pi)
                  	else:
                  		tmp = 180.0 * (math.atan((-90.0 * ((x_45_scale * (2.0 * (y_45_scale / math.pow(x_45_scale, 2.0)))) / (angle * math.pi)))) / math.pi)
                  	return tmp
                  
                  function code(a, b, angle, x_45_scale, y_45_scale)
                  	tmp = 0.0
                  	if (abs(a) <= 1.4e+64)
                  		tmp = Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / Float64(pi * x_45_scale)) * Float64(y_45_scale / angle))) / pi));
                  	else
                  		tmp = Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(Float64(x_45_scale * Float64(2.0 * Float64(y_45_scale / (x_45_scale ^ 2.0)))) / Float64(angle * pi)))) / pi));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
                  	tmp = 0.0;
                  	if (abs(a) <= 1.4e+64)
                  		tmp = 180.0 * (atan(((-180.0 / (pi * x_45_scale)) * (y_45_scale / angle))) / pi);
                  	else
                  		tmp = 180.0 * (atan((-90.0 * ((x_45_scale * (2.0 * (y_45_scale / (x_45_scale ^ 2.0)))) / (angle * pi)))) / pi);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[N[Abs[a], $MachinePrecision], 1.4e+64], N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision] * N[(y$45$scale / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(180.0 * N[(N[ArcTan[N[(-90.0 * N[(N[(x$45$scale * N[(2.0 * N[(y$45$scale / N[Power[x$45$scale, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  \mathbf{if}\;\left|a\right| \leq 1.4 \cdot 10^{+64}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} \left(\frac{-180}{\pi \cdot x-scale} \cdot \frac{y-scale}{angle}\right)}{\pi}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{x-scale \cdot \left(2 \cdot \frac{y-scale}{{x-scale}^{2}}\right)}{angle \cdot \pi}\right)}{\pi}\\
                  
                  
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if a < 1.4000000000000001e64

                    1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
                    3. Step-by-step derivation
                      1. Applied rewrites12.4%

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

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

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

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

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

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

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

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
                        5. lower-PI.f6438.2%

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                      7. Applied rewrites38.2%

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

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

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                        5. *-commutativeN/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot y-scale}{\left(x-scale \cdot \pi\right) \cdot angle}\right)}{\pi} \]
                        6. times-fracN/A

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{x-scale \cdot \pi} \cdot \frac{y-scale}{angle}\right)}{\pi} \]
                        8. lower-/.f64N/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{x-scale \cdot \pi} \cdot \frac{y-scale}{angle}\right)}{\pi} \]
                        9. lift-*.f64N/A

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{\pi \cdot x-scale} \cdot \frac{y-scale}{angle}\right)}{\pi} \]
                        11. lower-*.f64N/A

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{\pi \cdot x-scale} \cdot \frac{y-scale}{angle}\right)}{\pi} \]
                        12. lower-/.f6438.2%

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

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

                      if 1.4000000000000001e64 < a

                      1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
                      3. Step-by-step derivation
                        1. Applied rewrites12.4%

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

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

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

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{x-scale \cdot \left(2 \cdot \frac{y-scale}{{x-scale}^{2}}\right)}{angle \cdot \pi}\right)}{\pi} \]
                        6. Step-by-step derivation
                          1. lower-*.f64N/A

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

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{x-scale \cdot \left(2 \cdot \frac{y-scale}{{x-scale}^{2}}\right)}{angle \cdot \pi}\right)}{\pi} \]
                          3. lower-pow.f6440.0%

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{x-scale \cdot \left(2 \cdot \frac{y-scale}{{x-scale}^{2}}\right)}{angle \cdot \pi}\right)}{\pi} \]
                        7. Applied rewrites40.0%

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

                      Alternative 11: 39.7% accurate, 25.9× speedup?

                      \[180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi} \]
                      (FPCore (a b angle x-scale y-scale)
                        :precision binary64
                        (*
                       180.0
                       (/ (atan (* -90.0 (/ (* 2.0 (/ y-scale x-scale)) (* angle PI)))) PI)))
                      double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                      	return 180.0 * (atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * ((double) M_PI))))) / ((double) M_PI));
                      }
                      
                      public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                      	return 180.0 * (Math.atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * Math.PI)))) / Math.PI);
                      }
                      
                      def code(a, b, angle, x_45_scale, y_45_scale):
                      	return 180.0 * (math.atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * math.pi)))) / math.pi)
                      
                      function code(a, b, angle, x_45_scale, y_45_scale)
                      	return Float64(180.0 * Float64(atan(Float64(-90.0 * Float64(Float64(2.0 * Float64(y_45_scale / x_45_scale)) / Float64(angle * pi)))) / pi))
                      end
                      
                      function tmp = code(a, b, angle, x_45_scale, y_45_scale)
                      	tmp = 180.0 * (atan((-90.0 * ((2.0 * (y_45_scale / x_45_scale)) / (angle * pi)))) / pi);
                      end
                      
                      code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-90.0 * N[(N[(2.0 * N[(y$45$scale / x$45$scale), $MachinePrecision]), $MachinePrecision] / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
                      
                      180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi}
                      
                      Derivation
                      1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
                      3. Step-by-step derivation
                        1. Applied rewrites12.4%

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

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

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

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

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

                          \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi} \]
                        6. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-90 \cdot \frac{2 \cdot \frac{y-scale}{x-scale}}{angle \cdot \pi}\right)}{\pi} \]
                          2. lower-/.f6439.7%

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

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

                        Alternative 12: 39.6% accurate, 28.4× speedup?

                        \[180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi} \]
                        (FPCore (a b angle x-scale y-scale)
                          :precision binary64
                          (*
                         180.0
                         (/ (atan (* (/ -180.0 angle) (/ y-scale (* PI x-scale)))) PI)))
                        double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                        	return 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (((double) M_PI) * x_45_scale)))) / ((double) M_PI));
                        }
                        
                        public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                        	return 180.0 * (Math.atan(((-180.0 / angle) * (y_45_scale / (Math.PI * x_45_scale)))) / Math.PI);
                        }
                        
                        def code(a, b, angle, x_45_scale, y_45_scale):
                        	return 180.0 * (math.atan(((-180.0 / angle) * (y_45_scale / (math.pi * x_45_scale)))) / math.pi)
                        
                        function code(a, b, angle, x_45_scale, y_45_scale)
                        	return Float64(180.0 * Float64(atan(Float64(Float64(-180.0 / angle) * Float64(y_45_scale / Float64(pi * x_45_scale)))) / pi))
                        end
                        
                        function tmp = code(a, b, angle, x_45_scale, y_45_scale)
                        	tmp = 180.0 * (atan(((-180.0 / angle) * (y_45_scale / (pi * x_45_scale)))) / pi);
                        end
                        
                        code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 / angle), $MachinePrecision] * N[(y$45$scale / N[(Pi * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
                        
                        180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi}
                        
                        Derivation
                        1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
                        3. Step-by-step derivation
                          1. Applied rewrites12.4%

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

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

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

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

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

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

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

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

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
                            5. lower-PI.f6438.2%

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                          7. Applied rewrites38.2%

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

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

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

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                            5. times-fracN/A

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

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{x-scale \cdot \pi}\right)}{\pi} \]
                            8. lower-/.f6439.6%

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{x-scale \cdot \pi}\right)}{\pi} \]
                            9. lift-*.f64N/A

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

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi} \]
                            11. lower-*.f6439.6%

                              \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180}{angle} \cdot \frac{y-scale}{\pi \cdot x-scale}\right)}{\pi} \]
                          9. Applied rewrites39.6%

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

                          Alternative 13: 38.2% accurate, 29.2× speedup?

                          \[180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot y-scale}{\left(\pi \cdot x-scale\right) \cdot angle}\right)}{\pi} \]
                          (FPCore (a b angle x-scale y-scale)
                            :precision binary64
                            (*
                           180.0
                           (/ (atan (/ (* -180.0 y-scale) (* (* PI x-scale) angle))) PI)))
                          double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                          	return 180.0 * (atan(((-180.0 * y_45_scale) / ((((double) M_PI) * x_45_scale) * angle))) / ((double) M_PI));
                          }
                          
                          public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                          	return 180.0 * (Math.atan(((-180.0 * y_45_scale) / ((Math.PI * x_45_scale) * angle))) / Math.PI);
                          }
                          
                          def code(a, b, angle, x_45_scale, y_45_scale):
                          	return 180.0 * (math.atan(((-180.0 * y_45_scale) / ((math.pi * x_45_scale) * angle))) / math.pi)
                          
                          function code(a, b, angle, x_45_scale, y_45_scale)
                          	return Float64(180.0 * Float64(atan(Float64(Float64(-180.0 * y_45_scale) / Float64(Float64(pi * x_45_scale) * angle))) / pi))
                          end
                          
                          function tmp = code(a, b, angle, x_45_scale, y_45_scale)
                          	tmp = 180.0 * (atan(((-180.0 * y_45_scale) / ((pi * x_45_scale) * angle))) / pi);
                          end
                          
                          code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(N[(-180.0 * y$45$scale), $MachinePrecision] / N[(N[(Pi * x$45$scale), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
                          
                          180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot y-scale}{\left(\pi \cdot x-scale\right) \cdot angle}\right)}{\pi}
                          
                          Derivation
                          1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
                          3. Step-by-step derivation
                            1. Applied rewrites12.4%

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

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

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

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

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

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

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

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

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
                              5. lower-PI.f6438.2%

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                            7. Applied rewrites38.2%

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

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

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

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

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                              6. lift-*.f64N/A

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                              7. *-commutativeN/A

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot y-scale}{\left(x-scale \cdot \pi\right) \cdot angle}\right)}{\pi} \]
                              8. lower-*.f6438.2%

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot y-scale}{\left(x-scale \cdot \pi\right) \cdot angle}\right)}{\pi} \]
                              9. lift-*.f64N/A

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

                                \[\leadsto 180 \cdot \frac{\tan^{-1} \left(\frac{-180 \cdot y-scale}{\left(\pi \cdot x-scale\right) \cdot angle}\right)}{\pi} \]
                              11. lower-*.f6438.2%

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

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

                            Alternative 14: 38.2% accurate, 29.2× speedup?

                            \[180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot x-scale\right) \cdot \pi}\right)}{\pi} \]
                            (FPCore (a b angle x-scale y-scale)
                              :precision binary64
                              (*
                             180.0
                             (/ (atan (* -180.0 (/ y-scale (* (* angle x-scale) PI)))) PI)))
                            double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                            	return 180.0 * (atan((-180.0 * (y_45_scale / ((angle * x_45_scale) * ((double) M_PI))))) / ((double) M_PI));
                            }
                            
                            public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                            	return 180.0 * (Math.atan((-180.0 * (y_45_scale / ((angle * x_45_scale) * Math.PI)))) / Math.PI);
                            }
                            
                            def code(a, b, angle, x_45_scale, y_45_scale):
                            	return 180.0 * (math.atan((-180.0 * (y_45_scale / ((angle * x_45_scale) * math.pi)))) / math.pi)
                            
                            function code(a, b, angle, x_45_scale, y_45_scale)
                            	return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(Float64(angle * x_45_scale) * pi)))) / pi))
                            end
                            
                            function tmp = code(a, b, angle, x_45_scale, y_45_scale)
                            	tmp = 180.0 * (atan((-180.0 * (y_45_scale / ((angle * x_45_scale) * pi)))) / pi);
                            end
                            
                            code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(N[(angle * x$45$scale), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
                            
                            180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot x-scale\right) \cdot \pi}\right)}{\pi}
                            
                            Derivation
                            1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
                            3. Step-by-step derivation
                              1. Applied rewrites12.4%

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

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

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

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

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

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

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

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

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

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
                                5. lower-PI.f6438.2%

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                              7. Applied rewrites38.2%

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

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

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

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

                                  \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{\left(angle \cdot x-scale\right) \cdot \pi}\right)}{\pi} \]
                                5. lower-*.f6438.2%

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

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

                              Alternative 15: 38.2% accurate, 29.2× speedup?

                              \[180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                              (FPCore (a b angle x-scale y-scale)
                                :precision binary64
                                (*
                               180.0
                               (/ (atan (* -180.0 (/ y-scale (* angle (* x-scale PI))))) PI)))
                              double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                              	return 180.0 * (atan((-180.0 * (y_45_scale / (angle * (x_45_scale * ((double) M_PI)))))) / ((double) M_PI));
                              }
                              
                              public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
                              	return 180.0 * (Math.atan((-180.0 * (y_45_scale / (angle * (x_45_scale * Math.PI))))) / Math.PI);
                              }
                              
                              def code(a, b, angle, x_45_scale, y_45_scale):
                              	return 180.0 * (math.atan((-180.0 * (y_45_scale / (angle * (x_45_scale * math.pi))))) / math.pi)
                              
                              function code(a, b, angle, x_45_scale, y_45_scale)
                              	return Float64(180.0 * Float64(atan(Float64(-180.0 * Float64(y_45_scale / Float64(angle * Float64(x_45_scale * pi))))) / pi))
                              end
                              
                              function tmp = code(a, b, angle, x_45_scale, y_45_scale)
                              	tmp = 180.0 * (atan((-180.0 * (y_45_scale / (angle * (x_45_scale * pi))))) / pi);
                              end
                              
                              code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(180.0 * N[(N[ArcTan[N[(-180.0 * N[(y$45$scale / N[(angle * N[(x$45$scale * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]
                              
                              180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi}
                              
                              Derivation
                              1. Initial program 14.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. 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(\frac{{a}^{2}}{{y-scale}^{2}} - \left(\sqrt{{\left(\frac{{b}^{2}}{{x-scale}^{2}} - \frac{{a}^{2}}{{y-scale}^{2}}\right)}^{2}} + \frac{{b}^{2}}{{x-scale}^{2}}\right)\right)\right)}{angle \cdot \left(\pi \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right)}}{\pi} \]
                              3. Step-by-step derivation
                                1. Applied rewrites12.4%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \mathsf{PI}\left(\right)\right)}\right)}{\pi} \]
                                  5. lower-PI.f6438.2%

                                    \[\leadsto 180 \cdot \frac{\tan^{-1} \left(-180 \cdot \frac{y-scale}{angle \cdot \left(x-scale \cdot \pi\right)}\right)}{\pi} \]
                                7. Applied rewrites38.2%

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

                                Reproduce

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