Simplification of discriminant from scale-rotated-ellipse

Percentage Accurate: 25.8% → 93.4%
Time: 2.0min
Alternatives: 7
Speedup: 1693.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ t_1 := \sin t\_0\\ t_2 := \cos t\_0\\ t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\\ t\_3 \cdot t\_3 - \left(4 \cdot \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\right) \cdot \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale} \end{array} \end{array} \]
(FPCore (a b angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) PI))
        (t_1 (sin t_0))
        (t_2 (cos t_0))
        (t_3
         (/
          (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) t_2) x-scale)
          y-scale)))
   (-
    (* t_3 t_3)
    (*
     (*
      4.0
      (/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) x-scale) x-scale))
     (/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) y-scale) y-scale)))))
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 = sin(t_0);
	double t_2 = cos(t_0);
	double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale;
	return (t_3 * t_3) - ((4.0 * (((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale));
}
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.sin(t_0);
	double t_2 = Math.cos(t_0);
	double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale;
	return (t_3 * t_3) - ((4.0 * (((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale));
}
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = (angle / 180.0) * math.pi
	t_1 = math.sin(t_0)
	t_2 = math.cos(t_0)
	t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale
	return (t_3 * t_3) - ((4.0 * (((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale))
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(Float64(angle / 180.0) * pi)
	t_1 = sin(t_0)
	t_2 = cos(t_0)
	t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale)
	return Float64(Float64(t_3 * t_3) - Float64(Float64(4.0 * Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale)) * Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale)))
end
function tmp = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = (angle / 180.0) * pi;
	t_1 = sin(t_0);
	t_2 = cos(t_0);
	t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale;
	tmp = (t_3 * t_3) - ((4.0 * (((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale)) * (((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale));
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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[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$1), $MachinePrecision] * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, N[(N[(t$95$3 * t$95$3), $MachinePrecision] - N[(N[(4.0 * 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] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] * 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] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\\
t\_3 \cdot t\_3 - \left(4 \cdot \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\right) \cdot \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale}
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 7 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: 25.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \pi\\ t_1 := \sin t\_0\\ t_2 := \cos t\_0\\ t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\\ t\_3 \cdot t\_3 - \left(4 \cdot \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\right) \cdot \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale} \end{array} \end{array} \]
(FPCore (a b angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) PI))
        (t_1 (sin t_0))
        (t_2 (cos t_0))
        (t_3
         (/
          (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) t_2) x-scale)
          y-scale)))
   (-
    (* t_3 t_3)
    (*
     (*
      4.0
      (/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) x-scale) x-scale))
     (/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) y-scale) y-scale)))))
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 = sin(t_0);
	double t_2 = cos(t_0);
	double t_3 = ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale;
	return (t_3 * t_3) - ((4.0 * (((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale));
}
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.sin(t_0);
	double t_2 = Math.cos(t_0);
	double t_3 = ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale;
	return (t_3 * t_3) - ((4.0 * (((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale));
}
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = (angle / 180.0) * math.pi
	t_1 = math.sin(t_0)
	t_2 = math.cos(t_0)
	t_3 = ((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale
	return (t_3 * t_3) - ((4.0 * (((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale)) * (((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale))
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(Float64(angle / 180.0) * pi)
	t_1 = sin(t_0)
	t_2 = cos(t_0)
	t_3 = Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale)
	return Float64(Float64(t_3 * t_3) - Float64(Float64(4.0 * Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale)) * Float64(Float64(Float64((Float64(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale)))
end
function tmp = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = (angle / 180.0) * pi;
	t_1 = sin(t_0);
	t_2 = cos(t_0);
	t_3 = ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale;
	tmp = (t_3 * t_3) - ((4.0 * (((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale)) * (((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale));
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[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[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$1), $MachinePrecision] * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]}, N[(N[(t$95$3 * t$95$3), $MachinePrecision] - N[(N[(4.0 * 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] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] * 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] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\\
t\_3 \cdot t\_3 - \left(4 \cdot \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\right) \cdot \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale}
\end{array}
\end{array}

Alternative 1: 93.4% accurate, 76.9× speedup?

\[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ \begin{array}{l} \mathbf{if}\;y-scale\_m \leq 1.58 \cdot 10^{-254}:\\ \;\;\;\;\frac{-4}{x-scale} \cdot \left(\frac{b}{y-scale\_m} \cdot \left(a \cdot \left(b \cdot \frac{\frac{a}{x-scale}}{y-scale\_m}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-4 \cdot \left(b \cdot a\right)}{y-scale\_m \cdot x-scale} \cdot \frac{b \cdot a}{y-scale\_m \cdot x-scale}\\ \end{array} \end{array} \]
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b angle x-scale y-scale_m)
 :precision binary64
 (if (<= y-scale_m 1.58e-254)
   (*
    (/ -4.0 x-scale)
    (* (/ b y-scale_m) (* a (* b (/ (/ a x-scale) y-scale_m)))))
   (*
    (/ (* -4.0 (* b a)) (* y-scale_m x-scale))
    (/ (* b a) (* y-scale_m x-scale)))))
y-scale_m = fabs(y_45_scale);
double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	double tmp;
	if (y_45_scale_m <= 1.58e-254) {
		tmp = (-4.0 / x_45_scale) * ((b / y_45_scale_m) * (a * (b * ((a / x_45_scale) / y_45_scale_m))));
	} else {
		tmp = ((-4.0 * (b * a)) / (y_45_scale_m * x_45_scale)) * ((b * a) / (y_45_scale_m * x_45_scale));
	}
	return tmp;
}
y-scale_m = abs(y_45scale)
real(8) function code(a, b, angle, x_45scale, y_45scale_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    real(8), intent (in) :: x_45scale
    real(8), intent (in) :: y_45scale_m
    real(8) :: tmp
    if (y_45scale_m <= 1.58d-254) then
        tmp = ((-4.0d0) / x_45scale) * ((b / y_45scale_m) * (a * (b * ((a / x_45scale) / y_45scale_m))))
    else
        tmp = (((-4.0d0) * (b * a)) / (y_45scale_m * x_45scale)) * ((b * a) / (y_45scale_m * x_45scale))
    end if
    code = tmp
end function
y-scale_m = Math.abs(y_45_scale);
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	double tmp;
	if (y_45_scale_m <= 1.58e-254) {
		tmp = (-4.0 / x_45_scale) * ((b / y_45_scale_m) * (a * (b * ((a / x_45_scale) / y_45_scale_m))));
	} else {
		tmp = ((-4.0 * (b * a)) / (y_45_scale_m * x_45_scale)) * ((b * a) / (y_45_scale_m * x_45_scale));
	}
	return tmp;
}
y-scale_m = math.fabs(y_45_scale)
def code(a, b, angle, x_45_scale, y_45_scale_m):
	tmp = 0
	if y_45_scale_m <= 1.58e-254:
		tmp = (-4.0 / x_45_scale) * ((b / y_45_scale_m) * (a * (b * ((a / x_45_scale) / y_45_scale_m))))
	else:
		tmp = ((-4.0 * (b * a)) / (y_45_scale_m * x_45_scale)) * ((b * a) / (y_45_scale_m * x_45_scale))
	return tmp
y-scale_m = abs(y_45_scale)
function code(a, b, angle, x_45_scale, y_45_scale_m)
	tmp = 0.0
	if (y_45_scale_m <= 1.58e-254)
		tmp = Float64(Float64(-4.0 / x_45_scale) * Float64(Float64(b / y_45_scale_m) * Float64(a * Float64(b * Float64(Float64(a / x_45_scale) / y_45_scale_m)))));
	else
		tmp = Float64(Float64(Float64(-4.0 * Float64(b * a)) / Float64(y_45_scale_m * x_45_scale)) * Float64(Float64(b * a) / Float64(y_45_scale_m * x_45_scale)));
	end
	return tmp
end
y-scale_m = abs(y_45_scale);
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale_m)
	tmp = 0.0;
	if (y_45_scale_m <= 1.58e-254)
		tmp = (-4.0 / x_45_scale) * ((b / y_45_scale_m) * (a * (b * ((a / x_45_scale) / y_45_scale_m))));
	else
		tmp = ((-4.0 * (b * a)) / (y_45_scale_m * x_45_scale)) * ((b * a) / (y_45_scale_m * x_45_scale));
	end
	tmp_2 = tmp;
end
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale$95$m_] := If[LessEqual[y$45$scale$95$m, 1.58e-254], N[(N[(-4.0 / x$45$scale), $MachinePrecision] * N[(N[(b / y$45$scale$95$m), $MachinePrecision] * N[(a * N[(b * N[(N[(a / x$45$scale), $MachinePrecision] / y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-4.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] / N[(y$45$scale$95$m * x$45$scale), $MachinePrecision]), $MachinePrecision] * N[(N[(b * a), $MachinePrecision] / N[(y$45$scale$95$m * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y-scale_m = \left|y-scale\right|

\\
\begin{array}{l}
\mathbf{if}\;y-scale\_m \leq 1.58 \cdot 10^{-254}:\\
\;\;\;\;\frac{-4}{x-scale} \cdot \left(\frac{b}{y-scale\_m} \cdot \left(a \cdot \left(b \cdot \frac{\frac{a}{x-scale}}{y-scale\_m}\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{-4 \cdot \left(b \cdot a\right)}{y-scale\_m \cdot x-scale} \cdot \frac{b \cdot a}{y-scale\_m \cdot x-scale}\\


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

    1. Initial program 21.4%

      \[\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} \cdot \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} - \left(4 \cdot \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) \cdot \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} \]
    2. Simplified15.5%

      \[\leadsto \color{blue}{\frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} \cdot \frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} - 4 \cdot \left(\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}^{2}} \cdot \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}^{2}}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in angle around 0 42.9%

      \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r/42.9%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left({a}^{2} \cdot {b}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
      2. *-commutative42.9%

        \[\leadsto \frac{-4 \cdot \color{blue}{\left({b}^{2} \cdot {a}^{2}\right)}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      3. *-commutative42.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
      4. unpow242.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot y-scale\right)} \cdot {x-scale}^{2}} \]
      5. unpow242.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\left(y-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}} \]
      6. swap-sqr53.2%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}} \]
      7. unpow253.2%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{\left(y-scale \cdot x-scale\right)}^{2}}} \]
      8. *-commutative53.2%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\color{blue}{\left(x-scale \cdot y-scale\right)}}^{2}} \]
    6. Simplified53.2%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    7. Step-by-step derivation
      1. div-inv53.1%

        \[\leadsto \color{blue}{\left(-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
      2. pow-prod-down74.7%

        \[\leadsto \left(-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}} \]
      3. pow-flip74.8%

        \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot \color{blue}{{\left(x-scale \cdot y-scale\right)}^{\left(-2\right)}} \]
      4. metadata-eval74.8%

        \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{-2}} \]
    8. Applied egg-rr74.8%

      \[\leadsto \color{blue}{\left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2}} \]
    9. Step-by-step derivation
      1. unpow274.8%

        \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
    10. Applied egg-rr74.8%

      \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
    11. Step-by-step derivation
      1. *-commutative74.8%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(y-scale \cdot x-scale\right)}}^{-2} \]
      2. unpow-prod-down59.0%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
    12. Applied egg-rr59.0%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
    13. Step-by-step derivation
      1. pow-prod-down74.8%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{{\left(y-scale \cdot x-scale\right)}^{-2}} \]
      2. *-commutative74.8%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(x-scale \cdot y-scale\right)}}^{-2} \]
      3. metadata-eval74.8%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{\left(-2\right)}} \]
      4. pow-flip74.7%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
      5. pow274.7%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \frac{1}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      6. div-inv74.8%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      7. associate-/r*81.1%

        \[\leadsto \color{blue}{\frac{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      8. pow281.1%

        \[\leadsto \frac{\frac{-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
      9. div-inv81.1%

        \[\leadsto \color{blue}{\frac{-4 \cdot {\left(b \cdot a\right)}^{2}}{x-scale \cdot y-scale} \cdot \frac{1}{x-scale \cdot y-scale}} \]
      10. clear-num81.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \cdot \frac{1}{x-scale \cdot y-scale} \]
      11. frac-times81.2%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
      12. metadata-eval81.2%

        \[\leadsto \frac{\color{blue}{1}}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)} \]
    14. Applied egg-rr81.2%

      \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
    15. Step-by-step derivation
      1. associate-*l/74.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \]
      2. pow274.8%

        \[\leadsto \frac{1}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}}} \]
      3. clear-num74.8%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      4. associate-/l/81.1%

        \[\leadsto \color{blue}{\frac{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      5. associate-/l*81.1%

        \[\leadsto \frac{\color{blue}{-4 \cdot \frac{\left(b \cdot a\right) \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale}}}{x-scale \cdot y-scale} \]
      6. times-frac79.1%

        \[\leadsto \color{blue}{\frac{-4}{x-scale} \cdot \frac{\frac{\left(b \cdot a\right) \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale}}{y-scale}} \]
      7. div-inv79.1%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) \cdot \frac{1}{x-scale \cdot y-scale}}}{y-scale} \]
      8. *-commutative79.1%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) \cdot \frac{1}{\color{blue}{y-scale \cdot x-scale}}}{y-scale} \]
      9. associate-/l/79.1%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) \cdot \color{blue}{\frac{\frac{1}{x-scale}}{y-scale}}}{y-scale} \]
      10. associate-/l/79.1%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) \cdot \color{blue}{\frac{1}{y-scale \cdot x-scale}}}{y-scale} \]
      11. *-commutative79.1%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) \cdot \frac{1}{\color{blue}{x-scale \cdot y-scale}}}{y-scale} \]
      12. div-inv79.1%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\color{blue}{\frac{\left(b \cdot a\right) \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale}}}{y-scale} \]
      13. pow279.1%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\frac{\color{blue}{{\left(b \cdot a\right)}^{2}}}{x-scale \cdot y-scale}}{y-scale} \]
    16. Applied egg-rr79.1%

      \[\leadsto \color{blue}{\frac{-4}{x-scale} \cdot \frac{\frac{{\left(b \cdot a\right)}^{2}}{x-scale \cdot y-scale}}{y-scale}} \]
    17. Step-by-step derivation
      1. associate-/l/74.3%

        \[\leadsto \frac{-4}{x-scale} \cdot \color{blue}{\frac{{\left(b \cdot a\right)}^{2}}{y-scale \cdot \left(x-scale \cdot y-scale\right)}} \]
      2. pow274.3%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\color{blue}{\left(b \cdot a\right) \cdot \left(b \cdot a\right)}}{y-scale \cdot \left(x-scale \cdot y-scale\right)} \]
      3. associate-*l*73.5%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\color{blue}{b \cdot \left(a \cdot \left(b \cdot a\right)\right)}}{y-scale \cdot \left(x-scale \cdot y-scale\right)} \]
      4. times-frac79.1%

        \[\leadsto \frac{-4}{x-scale} \cdot \color{blue}{\left(\frac{b}{y-scale} \cdot \frac{a \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale}\right)} \]
    18. Applied egg-rr79.1%

      \[\leadsto \frac{-4}{x-scale} \cdot \color{blue}{\left(\frac{b}{y-scale} \cdot \frac{a \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale}\right)} \]
    19. Step-by-step derivation
      1. associate-/l*83.8%

        \[\leadsto \frac{-4}{x-scale} \cdot \left(\frac{b}{y-scale} \cdot \color{blue}{\left(a \cdot \frac{b \cdot a}{x-scale \cdot y-scale}\right)}\right) \]
      2. associate-/l*85.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \left(\frac{b}{y-scale} \cdot \left(a \cdot \color{blue}{\left(b \cdot \frac{a}{x-scale \cdot y-scale}\right)}\right)\right) \]
      3. *-commutative85.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \left(\frac{b}{y-scale} \cdot \left(a \cdot \left(b \cdot \frac{a}{\color{blue}{y-scale \cdot x-scale}}\right)\right)\right) \]
      4. associate-/l/88.7%

        \[\leadsto \frac{-4}{x-scale} \cdot \left(\frac{b}{y-scale} \cdot \left(a \cdot \left(b \cdot \color{blue}{\frac{\frac{a}{x-scale}}{y-scale}}\right)\right)\right) \]
    20. Simplified88.7%

      \[\leadsto \frac{-4}{x-scale} \cdot \color{blue}{\left(\frac{b}{y-scale} \cdot \left(a \cdot \left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right)\right)\right)} \]

    if 1.58000000000000002e-254 < y-scale

    1. Initial program 27.0%

      \[\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} \cdot \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} - \left(4 \cdot \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) \cdot \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} \]
    2. Simplified24.4%

      \[\leadsto \color{blue}{\frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} \cdot \frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} - 4 \cdot \left(\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}^{2}} \cdot \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}^{2}}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in angle around 0 47.2%

      \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r/47.2%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left({a}^{2} \cdot {b}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
      2. *-commutative47.2%

        \[\leadsto \frac{-4 \cdot \color{blue}{\left({b}^{2} \cdot {a}^{2}\right)}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      3. *-commutative47.2%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
      4. unpow247.2%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot y-scale\right)} \cdot {x-scale}^{2}} \]
      5. unpow247.2%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\left(y-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}} \]
      6. swap-sqr55.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}} \]
      7. unpow255.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{\left(y-scale \cdot x-scale\right)}^{2}}} \]
      8. *-commutative55.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\color{blue}{\left(x-scale \cdot y-scale\right)}}^{2}} \]
    6. Simplified55.9%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    7. Step-by-step derivation
      1. div-inv55.9%

        \[\leadsto \color{blue}{\left(-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
      2. pow-prod-down73.3%

        \[\leadsto \left(-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}} \]
      3. pow-flip73.3%

        \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot \color{blue}{{\left(x-scale \cdot y-scale\right)}^{\left(-2\right)}} \]
      4. metadata-eval73.3%

        \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{-2}} \]
    8. Applied egg-rr73.3%

      \[\leadsto \color{blue}{\left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2}} \]
    9. Step-by-step derivation
      1. unpow273.3%

        \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
    10. Applied egg-rr73.3%

      \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
    11. Step-by-step derivation
      1. *-commutative73.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(y-scale \cdot x-scale\right)}}^{-2} \]
      2. unpow-prod-down59.8%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
    12. Applied egg-rr59.8%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
    13. Step-by-step derivation
      1. pow-prod-down73.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{{\left(y-scale \cdot x-scale\right)}^{-2}} \]
      2. *-commutative73.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(x-scale \cdot y-scale\right)}}^{-2} \]
      3. metadata-eval73.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{\left(-2\right)}} \]
      4. pow-flip73.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
      5. pow273.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \frac{1}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      6. div-inv73.3%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      7. associate-/r*78.4%

        \[\leadsto \color{blue}{\frac{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      8. pow278.4%

        \[\leadsto \frac{\frac{-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
      9. div-inv78.4%

        \[\leadsto \color{blue}{\frac{-4 \cdot {\left(b \cdot a\right)}^{2}}{x-scale \cdot y-scale} \cdot \frac{1}{x-scale \cdot y-scale}} \]
      10. clear-num78.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \cdot \frac{1}{x-scale \cdot y-scale} \]
      11. frac-times78.4%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
      12. metadata-eval78.4%

        \[\leadsto \frac{\color{blue}{1}}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)} \]
    14. Applied egg-rr78.4%

      \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
    15. Step-by-step derivation
      1. associate-*l/73.3%

        \[\leadsto \frac{1}{\color{blue}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \]
      2. pow273.3%

        \[\leadsto \frac{1}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}}} \]
      3. clear-num73.3%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      4. associate-*r*73.3%

        \[\leadsto \frac{\color{blue}{\left(-4 \cdot \left(b \cdot a\right)\right) \cdot \left(b \cdot a\right)}}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)} \]
      5. times-frac94.2%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
    16. Applied egg-rr94.2%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y-scale \leq 1.58 \cdot 10^{-254}:\\ \;\;\;\;\frac{-4}{x-scale} \cdot \left(\frac{b}{y-scale} \cdot \left(a \cdot \left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-4 \cdot \left(b \cdot a\right)}{y-scale \cdot x-scale} \cdot \frac{b \cdot a}{y-scale \cdot x-scale}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 93.9% accurate, 15.4× speedup?

\[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ {\left(b \cdot \frac{\frac{a}{y-scale\_m}}{x-scale}\right)}^{2} \cdot -4 \end{array} \]
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b angle x-scale y-scale_m)
 :precision binary64
 (* (pow (* b (/ (/ a y-scale_m) x-scale)) 2.0) -4.0))
y-scale_m = fabs(y_45_scale);
double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	return pow((b * ((a / y_45_scale_m) / x_45_scale)), 2.0) * -4.0;
}
y-scale_m = abs(y_45scale)
real(8) function code(a, b, angle, x_45scale, y_45scale_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    real(8), intent (in) :: x_45scale
    real(8), intent (in) :: y_45scale_m
    code = ((b * ((a / y_45scale_m) / x_45scale)) ** 2.0d0) * (-4.0d0)
end function
y-scale_m = Math.abs(y_45_scale);
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	return Math.pow((b * ((a / y_45_scale_m) / x_45_scale)), 2.0) * -4.0;
}
y-scale_m = math.fabs(y_45_scale)
def code(a, b, angle, x_45_scale, y_45_scale_m):
	return math.pow((b * ((a / y_45_scale_m) / x_45_scale)), 2.0) * -4.0
y-scale_m = abs(y_45_scale)
function code(a, b, angle, x_45_scale, y_45_scale_m)
	return Float64((Float64(b * Float64(Float64(a / y_45_scale_m) / x_45_scale)) ^ 2.0) * -4.0)
end
y-scale_m = abs(y_45_scale);
function tmp = code(a, b, angle, x_45_scale, y_45_scale_m)
	tmp = ((b * ((a / y_45_scale_m) / x_45_scale)) ^ 2.0) * -4.0;
end
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale$95$m_] := N[(N[Power[N[(b * N[(N[(a / y$45$scale$95$m), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -4.0), $MachinePrecision]
\begin{array}{l}
y-scale_m = \left|y-scale\right|

\\
{\left(b \cdot \frac{\frac{a}{y-scale\_m}}{x-scale}\right)}^{2} \cdot -4
\end{array}
Derivation
  1. Initial program 24.0%

    \[\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} \cdot \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} - \left(4 \cdot \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) \cdot \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} \]
  2. Simplified19.6%

    \[\leadsto \color{blue}{\frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} \cdot \frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} - 4 \cdot \left(\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}^{2}} \cdot \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}^{2}}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in angle around 0 44.9%

    \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
  5. Step-by-step derivation
    1. associate-*r/44.9%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left({a}^{2} \cdot {b}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
    2. *-commutative44.9%

      \[\leadsto \frac{-4 \cdot \color{blue}{\left({b}^{2} \cdot {a}^{2}\right)}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
    3. *-commutative44.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
    4. unpow244.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot y-scale\right)} \cdot {x-scale}^{2}} \]
    5. unpow244.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\left(y-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}} \]
    6. swap-sqr54.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}} \]
    7. unpow254.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{\left(y-scale \cdot x-scale\right)}^{2}}} \]
    8. *-commutative54.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\color{blue}{\left(x-scale \cdot y-scale\right)}}^{2}} \]
  6. Simplified54.4%

    \[\leadsto \color{blue}{\frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
  7. Step-by-step derivation
    1. div-inv54.4%

      \[\leadsto \color{blue}{\left(-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    2. pow-prod-down74.1%

      \[\leadsto \left(-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}} \]
    3. pow-flip74.1%

      \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot \color{blue}{{\left(x-scale \cdot y-scale\right)}^{\left(-2\right)}} \]
    4. metadata-eval74.1%

      \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{-2}} \]
  8. Applied egg-rr74.1%

    \[\leadsto \color{blue}{\left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2}} \]
  9. Step-by-step derivation
    1. unpow274.1%

      \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
  10. Applied egg-rr74.1%

    \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
  11. Step-by-step derivation
    1. *-commutative74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(y-scale \cdot x-scale\right)}}^{-2} \]
    2. unpow-prod-down59.4%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
  12. Applied egg-rr59.4%

    \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
  13. Step-by-step derivation
    1. pow-prod-down74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{{\left(y-scale \cdot x-scale\right)}^{-2}} \]
    2. *-commutative74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(x-scale \cdot y-scale\right)}}^{-2} \]
    3. metadata-eval74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{\left(-2\right)}} \]
    4. pow-flip74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    5. pow274.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \frac{1}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    6. div-inv74.1%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    7. associate-/r*79.9%

      \[\leadsto \color{blue}{\frac{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
    8. pow279.9%

      \[\leadsto \frac{\frac{-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
    9. div-inv79.8%

      \[\leadsto \color{blue}{\frac{-4 \cdot {\left(b \cdot a\right)}^{2}}{x-scale \cdot y-scale} \cdot \frac{1}{x-scale \cdot y-scale}} \]
    10. clear-num79.8%

      \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \cdot \frac{1}{x-scale \cdot y-scale} \]
    11. frac-times79.9%

      \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
    12. metadata-eval79.9%

      \[\leadsto \frac{\color{blue}{1}}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)} \]
  14. Applied egg-rr79.9%

    \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
  15. Step-by-step derivation
    1. associate-*l/74.1%

      \[\leadsto \frac{1}{\color{blue}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \]
    2. pow274.1%

      \[\leadsto \frac{1}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}}} \]
    3. clear-num74.1%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    4. associate-*r*74.1%

      \[\leadsto \frac{\color{blue}{\left(-4 \cdot \left(b \cdot a\right)\right) \cdot \left(b \cdot a\right)}}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)} \]
    5. times-frac92.3%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
  16. Applied egg-rr92.3%

    \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
  17. Step-by-step derivation
    1. pow192.3%

      \[\leadsto \color{blue}{{\left(\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}\right)}^{1}} \]
  18. Applied egg-rr0.0%

    \[\leadsto \color{blue}{{\left({\left(\frac{\left(b \cdot a\right) \cdot \sqrt{-4}}{x-scale \cdot y-scale}\right)}^{2}\right)}^{1}} \]
  19. Step-by-step derivation
    1. unpow10.0%

      \[\leadsto \color{blue}{{\left(\frac{\left(b \cdot a\right) \cdot \sqrt{-4}}{x-scale \cdot y-scale}\right)}^{2}} \]
    2. *-lft-identity0.0%

      \[\leadsto {\left(\frac{\color{blue}{1 \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)}}{x-scale \cdot y-scale}\right)}^{2} \]
    3. associate-*l/0.0%

      \[\leadsto {\color{blue}{\left(\frac{1}{x-scale \cdot y-scale} \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)\right)}}^{2} \]
    4. unpow20.0%

      \[\leadsto \color{blue}{\left(\frac{1}{x-scale \cdot y-scale} \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)\right) \cdot \left(\frac{1}{x-scale \cdot y-scale} \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)\right)} \]
    5. associate-*r*0.0%

      \[\leadsto \color{blue}{\left(\left(\frac{1}{x-scale \cdot y-scale} \cdot \left(b \cdot a\right)\right) \cdot \sqrt{-4}\right)} \cdot \left(\frac{1}{x-scale \cdot y-scale} \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)\right) \]
    6. *-commutative0.0%

      \[\leadsto \left(\color{blue}{\left(\left(b \cdot a\right) \cdot \frac{1}{x-scale \cdot y-scale}\right)} \cdot \sqrt{-4}\right) \cdot \left(\frac{1}{x-scale \cdot y-scale} \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)\right) \]
    7. associate-*r/0.0%

      \[\leadsto \left(\color{blue}{\frac{\left(b \cdot a\right) \cdot 1}{x-scale \cdot y-scale}} \cdot \sqrt{-4}\right) \cdot \left(\frac{1}{x-scale \cdot y-scale} \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)\right) \]
    8. *-rgt-identity0.0%

      \[\leadsto \left(\frac{\color{blue}{b \cdot a}}{x-scale \cdot y-scale} \cdot \sqrt{-4}\right) \cdot \left(\frac{1}{x-scale \cdot y-scale} \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)\right) \]
    9. associate-/l*0.0%

      \[\leadsto \left(\color{blue}{\left(b \cdot \frac{a}{x-scale \cdot y-scale}\right)} \cdot \sqrt{-4}\right) \cdot \left(\frac{1}{x-scale \cdot y-scale} \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)\right) \]
    10. *-commutative0.0%

      \[\leadsto \left(\left(b \cdot \frac{a}{\color{blue}{y-scale \cdot x-scale}}\right) \cdot \sqrt{-4}\right) \cdot \left(\frac{1}{x-scale \cdot y-scale} \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)\right) \]
    11. associate-/l/0.0%

      \[\leadsto \left(\left(b \cdot \color{blue}{\frac{\frac{a}{x-scale}}{y-scale}}\right) \cdot \sqrt{-4}\right) \cdot \left(\frac{1}{x-scale \cdot y-scale} \cdot \left(\left(b \cdot a\right) \cdot \sqrt{-4}\right)\right) \]
    12. associate-*r*0.0%

      \[\leadsto \left(\left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right) \cdot \sqrt{-4}\right) \cdot \color{blue}{\left(\left(\frac{1}{x-scale \cdot y-scale} \cdot \left(b \cdot a\right)\right) \cdot \sqrt{-4}\right)} \]
    13. *-commutative0.0%

      \[\leadsto \left(\left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right) \cdot \sqrt{-4}\right) \cdot \left(\color{blue}{\left(\left(b \cdot a\right) \cdot \frac{1}{x-scale \cdot y-scale}\right)} \cdot \sqrt{-4}\right) \]
    14. associate-*r/0.0%

      \[\leadsto \left(\left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right) \cdot \sqrt{-4}\right) \cdot \left(\color{blue}{\frac{\left(b \cdot a\right) \cdot 1}{x-scale \cdot y-scale}} \cdot \sqrt{-4}\right) \]
    15. *-rgt-identity0.0%

      \[\leadsto \left(\left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right) \cdot \sqrt{-4}\right) \cdot \left(\frac{\color{blue}{b \cdot a}}{x-scale \cdot y-scale} \cdot \sqrt{-4}\right) \]
    16. associate-/l*0.0%

      \[\leadsto \left(\left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right) \cdot \sqrt{-4}\right) \cdot \left(\color{blue}{\left(b \cdot \frac{a}{x-scale \cdot y-scale}\right)} \cdot \sqrt{-4}\right) \]
    17. *-commutative0.0%

      \[\leadsto \left(\left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right) \cdot \sqrt{-4}\right) \cdot \left(\left(b \cdot \frac{a}{\color{blue}{y-scale \cdot x-scale}}\right) \cdot \sqrt{-4}\right) \]
    18. associate-/l/0.0%

      \[\leadsto \left(\left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right) \cdot \sqrt{-4}\right) \cdot \left(\left(b \cdot \color{blue}{\frac{\frac{a}{x-scale}}{y-scale}}\right) \cdot \sqrt{-4}\right) \]
  20. Simplified93.7%

    \[\leadsto \color{blue}{{\left(b \cdot \frac{\frac{a}{y-scale}}{x-scale}\right)}^{2} \cdot -4} \]
  21. Add Preprocessing

Alternative 3: 89.1% accurate, 76.9× speedup?

\[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ \begin{array}{l} \mathbf{if}\;angle \leq 3.2 \cdot 10^{+37}:\\ \;\;\;\;\left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale\_m}\right)\right) \cdot \frac{\frac{b \cdot a}{x-scale}}{y-scale\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{x-scale} \cdot \left(b \cdot \left(\frac{a}{y-scale\_m} \cdot \left(b \cdot \frac{\frac{a}{y-scale\_m}}{x-scale}\right)\right)\right)\\ \end{array} \end{array} \]
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b angle x-scale y-scale_m)
 :precision binary64
 (if (<= angle 3.2e+37)
   (*
    (* (/ -4.0 x-scale) (* b (/ a y-scale_m)))
    (/ (/ (* b a) x-scale) y-scale_m))
   (*
    (/ -4.0 x-scale)
    (* b (* (/ a y-scale_m) (* b (/ (/ a y-scale_m) x-scale)))))))
y-scale_m = fabs(y_45_scale);
double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	double tmp;
	if (angle <= 3.2e+37) {
		tmp = ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (((b * a) / x_45_scale) / y_45_scale_m);
	} else {
		tmp = (-4.0 / x_45_scale) * (b * ((a / y_45_scale_m) * (b * ((a / y_45_scale_m) / x_45_scale))));
	}
	return tmp;
}
y-scale_m = abs(y_45scale)
real(8) function code(a, b, angle, x_45scale, y_45scale_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    real(8), intent (in) :: x_45scale
    real(8), intent (in) :: y_45scale_m
    real(8) :: tmp
    if (angle <= 3.2d+37) then
        tmp = (((-4.0d0) / x_45scale) * (b * (a / y_45scale_m))) * (((b * a) / x_45scale) / y_45scale_m)
    else
        tmp = ((-4.0d0) / x_45scale) * (b * ((a / y_45scale_m) * (b * ((a / y_45scale_m) / x_45scale))))
    end if
    code = tmp
end function
y-scale_m = Math.abs(y_45_scale);
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	double tmp;
	if (angle <= 3.2e+37) {
		tmp = ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (((b * a) / x_45_scale) / y_45_scale_m);
	} else {
		tmp = (-4.0 / x_45_scale) * (b * ((a / y_45_scale_m) * (b * ((a / y_45_scale_m) / x_45_scale))));
	}
	return tmp;
}
y-scale_m = math.fabs(y_45_scale)
def code(a, b, angle, x_45_scale, y_45_scale_m):
	tmp = 0
	if angle <= 3.2e+37:
		tmp = ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (((b * a) / x_45_scale) / y_45_scale_m)
	else:
		tmp = (-4.0 / x_45_scale) * (b * ((a / y_45_scale_m) * (b * ((a / y_45_scale_m) / x_45_scale))))
	return tmp
y-scale_m = abs(y_45_scale)
function code(a, b, angle, x_45_scale, y_45_scale_m)
	tmp = 0.0
	if (angle <= 3.2e+37)
		tmp = Float64(Float64(Float64(-4.0 / x_45_scale) * Float64(b * Float64(a / y_45_scale_m))) * Float64(Float64(Float64(b * a) / x_45_scale) / y_45_scale_m));
	else
		tmp = Float64(Float64(-4.0 / x_45_scale) * Float64(b * Float64(Float64(a / y_45_scale_m) * Float64(b * Float64(Float64(a / y_45_scale_m) / x_45_scale)))));
	end
	return tmp
end
y-scale_m = abs(y_45_scale);
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale_m)
	tmp = 0.0;
	if (angle <= 3.2e+37)
		tmp = ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (((b * a) / x_45_scale) / y_45_scale_m);
	else
		tmp = (-4.0 / x_45_scale) * (b * ((a / y_45_scale_m) * (b * ((a / y_45_scale_m) / x_45_scale))));
	end
	tmp_2 = tmp;
end
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale$95$m_] := If[LessEqual[angle, 3.2e+37], N[(N[(N[(-4.0 / x$45$scale), $MachinePrecision] * N[(b * N[(a / y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(b * a), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 / x$45$scale), $MachinePrecision] * N[(b * N[(N[(a / y$45$scale$95$m), $MachinePrecision] * N[(b * N[(N[(a / y$45$scale$95$m), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y-scale_m = \left|y-scale\right|

\\
\begin{array}{l}
\mathbf{if}\;angle \leq 3.2 \cdot 10^{+37}:\\
\;\;\;\;\left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale\_m}\right)\right) \cdot \frac{\frac{b \cdot a}{x-scale}}{y-scale\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{-4}{x-scale} \cdot \left(b \cdot \left(\frac{a}{y-scale\_m} \cdot \left(b \cdot \frac{\frac{a}{y-scale\_m}}{x-scale}\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if angle < 3.20000000000000014e37

    1. Initial program 24.3%

      \[\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} \cdot \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} - \left(4 \cdot \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) \cdot \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} \]
    2. Simplified18.8%

      \[\leadsto \color{blue}{\frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} \cdot \frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} - 4 \cdot \left(\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}^{2}} \cdot \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}^{2}}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in angle around 0 41.9%

      \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r/41.9%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left({a}^{2} \cdot {b}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
      2. *-commutative41.9%

        \[\leadsto \frac{-4 \cdot \color{blue}{\left({b}^{2} \cdot {a}^{2}\right)}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      3. *-commutative41.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
      4. unpow241.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot y-scale\right)} \cdot {x-scale}^{2}} \]
      5. unpow241.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\left(y-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}} \]
      6. swap-sqr50.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}} \]
      7. unpow250.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{\left(y-scale \cdot x-scale\right)}^{2}}} \]
      8. *-commutative50.9%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\color{blue}{\left(x-scale \cdot y-scale\right)}}^{2}} \]
    6. Simplified50.9%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    7. Step-by-step derivation
      1. div-inv50.9%

        \[\leadsto \color{blue}{\left(-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
      2. pow-prod-down72.4%

        \[\leadsto \left(-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}} \]
      3. pow-flip72.5%

        \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot \color{blue}{{\left(x-scale \cdot y-scale\right)}^{\left(-2\right)}} \]
      4. metadata-eval72.5%

        \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{-2}} \]
    8. Applied egg-rr72.5%

      \[\leadsto \color{blue}{\left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2}} \]
    9. Step-by-step derivation
      1. unpow272.5%

        \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
    10. Applied egg-rr72.5%

      \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
    11. Step-by-step derivation
      1. *-commutative72.5%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(y-scale \cdot x-scale\right)}}^{-2} \]
      2. unpow-prod-down58.7%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
    12. Applied egg-rr58.7%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
    13. Step-by-step derivation
      1. pow-prod-down72.5%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{{\left(y-scale \cdot x-scale\right)}^{-2}} \]
      2. *-commutative72.5%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(x-scale \cdot y-scale\right)}}^{-2} \]
      3. metadata-eval72.5%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{\left(-2\right)}} \]
      4. pow-flip72.4%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
      5. pow272.4%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \frac{1}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      6. div-inv72.4%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      7. associate-/r*78.7%

        \[\leadsto \color{blue}{\frac{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      8. pow278.7%

        \[\leadsto \frac{\frac{-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
      9. div-inv78.7%

        \[\leadsto \color{blue}{\frac{-4 \cdot {\left(b \cdot a\right)}^{2}}{x-scale \cdot y-scale} \cdot \frac{1}{x-scale \cdot y-scale}} \]
      10. clear-num78.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \cdot \frac{1}{x-scale \cdot y-scale} \]
      11. frac-times78.8%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
      12. metadata-eval78.8%

        \[\leadsto \frac{\color{blue}{1}}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)} \]
    14. Applied egg-rr78.8%

      \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
    15. Step-by-step derivation
      1. associate-*l/72.5%

        \[\leadsto \frac{1}{\color{blue}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \]
      2. pow272.5%

        \[\leadsto \frac{1}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}}} \]
      3. clear-num72.4%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      4. associate-*r*72.4%

        \[\leadsto \frac{\color{blue}{\left(-4 \cdot \left(b \cdot a\right)\right) \cdot \left(b \cdot a\right)}}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)} \]
      5. times-frac91.3%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
    16. Applied egg-rr91.3%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
    17. Step-by-step derivation
      1. times-frac88.8%

        \[\leadsto \color{blue}{\left(\frac{-4}{x-scale} \cdot \frac{b \cdot a}{y-scale}\right)} \cdot \frac{b \cdot a}{x-scale \cdot y-scale} \]
      2. associate-/l*86.9%

        \[\leadsto \left(\frac{-4}{x-scale} \cdot \color{blue}{\left(b \cdot \frac{a}{y-scale}\right)}\right) \cdot \frac{b \cdot a}{x-scale \cdot y-scale} \]
      3. associate-/l*88.1%

        \[\leadsto \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \color{blue}{\left(b \cdot \frac{a}{x-scale \cdot y-scale}\right)} \]
    18. Simplified88.1%

      \[\leadsto \color{blue}{\left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \left(b \cdot \frac{a}{x-scale \cdot y-scale}\right)} \]
    19. Step-by-step derivation
      1. associate-*r/86.9%

        \[\leadsto \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \color{blue}{\frac{b \cdot a}{x-scale \cdot y-scale}} \]
      2. associate-/r*90.0%

        \[\leadsto \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \color{blue}{\frac{\frac{b \cdot a}{x-scale}}{y-scale}} \]
    20. Applied egg-rr90.0%

      \[\leadsto \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \color{blue}{\frac{\frac{b \cdot a}{x-scale}}{y-scale}} \]

    if 3.20000000000000014e37 < angle

    1. Initial program 22.7%

      \[\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} \cdot \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} - \left(4 \cdot \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) \cdot \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} \]
    2. Simplified22.6%

      \[\leadsto \color{blue}{\frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} \cdot \frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} - 4 \cdot \left(\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}^{2}} \cdot \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}^{2}}\right)} \]
    3. Add Preprocessing
    4. Taylor expanded in angle around 0 56.3%

      \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r/56.3%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left({a}^{2} \cdot {b}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
      2. *-commutative56.3%

        \[\leadsto \frac{-4 \cdot \color{blue}{\left({b}^{2} \cdot {a}^{2}\right)}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      3. *-commutative56.3%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
      4. unpow256.3%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot y-scale\right)} \cdot {x-scale}^{2}} \]
      5. unpow256.3%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\left(y-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}} \]
      6. swap-sqr67.6%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}} \]
      7. unpow267.6%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{\left(y-scale \cdot x-scale\right)}^{2}}} \]
      8. *-commutative67.6%

        \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\color{blue}{\left(x-scale \cdot y-scale\right)}}^{2}} \]
    6. Simplified67.6%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    7. Step-by-step derivation
      1. div-inv67.6%

        \[\leadsto \color{blue}{\left(-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
      2. pow-prod-down80.3%

        \[\leadsto \left(-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}} \]
      3. pow-flip80.3%

        \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot \color{blue}{{\left(x-scale \cdot y-scale\right)}^{\left(-2\right)}} \]
      4. metadata-eval80.3%

        \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{-2}} \]
    8. Applied egg-rr80.3%

      \[\leadsto \color{blue}{\left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2}} \]
    9. Step-by-step derivation
      1. unpow280.3%

        \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
    10. Applied egg-rr80.3%

      \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
    11. Step-by-step derivation
      1. *-commutative80.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(y-scale \cdot x-scale\right)}}^{-2} \]
      2. unpow-prod-down62.0%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
    12. Applied egg-rr62.0%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
    13. Step-by-step derivation
      1. pow-prod-down80.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{{\left(y-scale \cdot x-scale\right)}^{-2}} \]
      2. *-commutative80.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(x-scale \cdot y-scale\right)}}^{-2} \]
      3. metadata-eval80.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{\left(-2\right)}} \]
      4. pow-flip80.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
      5. pow280.3%

        \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \frac{1}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      6. div-inv80.3%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      7. associate-/r*84.0%

        \[\leadsto \color{blue}{\frac{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      8. pow284.0%

        \[\leadsto \frac{\frac{-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
      9. div-inv84.1%

        \[\leadsto \color{blue}{\frac{-4 \cdot {\left(b \cdot a\right)}^{2}}{x-scale \cdot y-scale} \cdot \frac{1}{x-scale \cdot y-scale}} \]
      10. clear-num84.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \cdot \frac{1}{x-scale \cdot y-scale} \]
      11. frac-times84.1%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
      12. metadata-eval84.1%

        \[\leadsto \frac{\color{blue}{1}}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)} \]
    14. Applied egg-rr84.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
    15. Step-by-step derivation
      1. associate-*l/80.3%

        \[\leadsto \frac{1}{\color{blue}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \]
      2. pow280.3%

        \[\leadsto \frac{1}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}}} \]
      3. clear-num80.3%

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      4. associate-/l/84.0%

        \[\leadsto \color{blue}{\frac{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      5. associate-/l*84.0%

        \[\leadsto \frac{\color{blue}{-4 \cdot \frac{\left(b \cdot a\right) \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale}}}{x-scale \cdot y-scale} \]
      6. times-frac82.4%

        \[\leadsto \color{blue}{\frac{-4}{x-scale} \cdot \frac{\frac{\left(b \cdot a\right) \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale}}{y-scale}} \]
      7. div-inv82.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) \cdot \frac{1}{x-scale \cdot y-scale}}}{y-scale} \]
      8. *-commutative82.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) \cdot \frac{1}{\color{blue}{y-scale \cdot x-scale}}}{y-scale} \]
      9. associate-/l/82.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) \cdot \color{blue}{\frac{\frac{1}{x-scale}}{y-scale}}}{y-scale} \]
      10. associate-/l/82.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) \cdot \color{blue}{\frac{1}{y-scale \cdot x-scale}}}{y-scale} \]
      11. *-commutative82.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right) \cdot \frac{1}{\color{blue}{x-scale \cdot y-scale}}}{y-scale} \]
      12. div-inv82.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\color{blue}{\frac{\left(b \cdot a\right) \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale}}}{y-scale} \]
      13. pow282.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\frac{\color{blue}{{\left(b \cdot a\right)}^{2}}}{x-scale \cdot y-scale}}{y-scale} \]
    16. Applied egg-rr82.4%

      \[\leadsto \color{blue}{\frac{-4}{x-scale} \cdot \frac{\frac{{\left(b \cdot a\right)}^{2}}{x-scale \cdot y-scale}}{y-scale}} \]
    17. Step-by-step derivation
      1. associate-/l/80.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \color{blue}{\frac{{\left(b \cdot a\right)}^{2}}{y-scale \cdot \left(x-scale \cdot y-scale\right)}} \]
      2. pow280.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \frac{\color{blue}{\left(b \cdot a\right) \cdot \left(b \cdot a\right)}}{y-scale \cdot \left(x-scale \cdot y-scale\right)} \]
      3. times-frac91.8%

        \[\leadsto \frac{-4}{x-scale} \cdot \color{blue}{\left(\frac{b \cdot a}{y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}\right)} \]
      4. associate-*r/88.3%

        \[\leadsto \frac{-4}{x-scale} \cdot \left(\color{blue}{\left(b \cdot \frac{a}{y-scale}\right)} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}\right) \]
      5. associate-*r/88.4%

        \[\leadsto \frac{-4}{x-scale} \cdot \left(\left(b \cdot \frac{a}{y-scale}\right) \cdot \color{blue}{\left(b \cdot \frac{a}{x-scale \cdot y-scale}\right)}\right) \]
      6. associate-/r*85.0%

        \[\leadsto \frac{-4}{x-scale} \cdot \left(\left(b \cdot \frac{a}{y-scale}\right) \cdot \left(b \cdot \color{blue}{\frac{\frac{a}{x-scale}}{y-scale}}\right)\right) \]
    18. Applied egg-rr85.0%

      \[\leadsto \frac{-4}{x-scale} \cdot \color{blue}{\left(\left(b \cdot \frac{a}{y-scale}\right) \cdot \left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right)\right)} \]
    19. Step-by-step derivation
      1. associate-*l*85.0%

        \[\leadsto \frac{-4}{x-scale} \cdot \color{blue}{\left(b \cdot \left(\frac{a}{y-scale} \cdot \left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right)\right)\right)} \]
      2. associate-/l/88.5%

        \[\leadsto \frac{-4}{x-scale} \cdot \left(b \cdot \left(\frac{a}{y-scale} \cdot \left(b \cdot \color{blue}{\frac{a}{y-scale \cdot x-scale}}\right)\right)\right) \]
      3. *-commutative88.5%

        \[\leadsto \frac{-4}{x-scale} \cdot \left(b \cdot \left(\frac{a}{y-scale} \cdot \left(b \cdot \frac{a}{\color{blue}{x-scale \cdot y-scale}}\right)\right)\right) \]
      4. associate-/l/90.3%

        \[\leadsto \frac{-4}{x-scale} \cdot \left(b \cdot \left(\frac{a}{y-scale} \cdot \left(b \cdot \color{blue}{\frac{\frac{a}{y-scale}}{x-scale}}\right)\right)\right) \]
    20. Simplified90.3%

      \[\leadsto \frac{-4}{x-scale} \cdot \color{blue}{\left(b \cdot \left(\frac{a}{y-scale} \cdot \left(b \cdot \frac{\frac{a}{y-scale}}{x-scale}\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 89.2% accurate, 99.6× speedup?

\[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale\_m}\right)\right) \cdot \frac{\frac{b \cdot a}{x-scale}}{y-scale\_m} \end{array} \]
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b angle x-scale y-scale_m)
 :precision binary64
 (*
  (* (/ -4.0 x-scale) (* b (/ a y-scale_m)))
  (/ (/ (* b a) x-scale) y-scale_m)))
y-scale_m = fabs(y_45_scale);
double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	return ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (((b * a) / x_45_scale) / y_45_scale_m);
}
y-scale_m = abs(y_45scale)
real(8) function code(a, b, angle, x_45scale, y_45scale_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    real(8), intent (in) :: x_45scale
    real(8), intent (in) :: y_45scale_m
    code = (((-4.0d0) / x_45scale) * (b * (a / y_45scale_m))) * (((b * a) / x_45scale) / y_45scale_m)
end function
y-scale_m = Math.abs(y_45_scale);
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	return ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (((b * a) / x_45_scale) / y_45_scale_m);
}
y-scale_m = math.fabs(y_45_scale)
def code(a, b, angle, x_45_scale, y_45_scale_m):
	return ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (((b * a) / x_45_scale) / y_45_scale_m)
y-scale_m = abs(y_45_scale)
function code(a, b, angle, x_45_scale, y_45_scale_m)
	return Float64(Float64(Float64(-4.0 / x_45_scale) * Float64(b * Float64(a / y_45_scale_m))) * Float64(Float64(Float64(b * a) / x_45_scale) / y_45_scale_m))
end
y-scale_m = abs(y_45_scale);
function tmp = code(a, b, angle, x_45_scale, y_45_scale_m)
	tmp = ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (((b * a) / x_45_scale) / y_45_scale_m);
end
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale$95$m_] := N[(N[(N[(-4.0 / x$45$scale), $MachinePrecision] * N[(b * N[(a / y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(b * a), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y-scale_m = \left|y-scale\right|

\\
\left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale\_m}\right)\right) \cdot \frac{\frac{b \cdot a}{x-scale}}{y-scale\_m}
\end{array}
Derivation
  1. Initial program 24.0%

    \[\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} \cdot \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} - \left(4 \cdot \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) \cdot \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} \]
  2. Simplified19.6%

    \[\leadsto \color{blue}{\frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} \cdot \frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} - 4 \cdot \left(\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}^{2}} \cdot \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}^{2}}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in angle around 0 44.9%

    \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
  5. Step-by-step derivation
    1. associate-*r/44.9%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left({a}^{2} \cdot {b}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
    2. *-commutative44.9%

      \[\leadsto \frac{-4 \cdot \color{blue}{\left({b}^{2} \cdot {a}^{2}\right)}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
    3. *-commutative44.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
    4. unpow244.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot y-scale\right)} \cdot {x-scale}^{2}} \]
    5. unpow244.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\left(y-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}} \]
    6. swap-sqr54.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}} \]
    7. unpow254.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{\left(y-scale \cdot x-scale\right)}^{2}}} \]
    8. *-commutative54.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\color{blue}{\left(x-scale \cdot y-scale\right)}}^{2}} \]
  6. Simplified54.4%

    \[\leadsto \color{blue}{\frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
  7. Step-by-step derivation
    1. div-inv54.4%

      \[\leadsto \color{blue}{\left(-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    2. pow-prod-down74.1%

      \[\leadsto \left(-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}} \]
    3. pow-flip74.1%

      \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot \color{blue}{{\left(x-scale \cdot y-scale\right)}^{\left(-2\right)}} \]
    4. metadata-eval74.1%

      \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{-2}} \]
  8. Applied egg-rr74.1%

    \[\leadsto \color{blue}{\left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2}} \]
  9. Step-by-step derivation
    1. unpow274.1%

      \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
  10. Applied egg-rr74.1%

    \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
  11. Step-by-step derivation
    1. *-commutative74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(y-scale \cdot x-scale\right)}}^{-2} \]
    2. unpow-prod-down59.4%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
  12. Applied egg-rr59.4%

    \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
  13. Step-by-step derivation
    1. pow-prod-down74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{{\left(y-scale \cdot x-scale\right)}^{-2}} \]
    2. *-commutative74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(x-scale \cdot y-scale\right)}}^{-2} \]
    3. metadata-eval74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{\left(-2\right)}} \]
    4. pow-flip74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    5. pow274.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \frac{1}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    6. div-inv74.1%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    7. associate-/r*79.9%

      \[\leadsto \color{blue}{\frac{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
    8. pow279.9%

      \[\leadsto \frac{\frac{-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
    9. div-inv79.8%

      \[\leadsto \color{blue}{\frac{-4 \cdot {\left(b \cdot a\right)}^{2}}{x-scale \cdot y-scale} \cdot \frac{1}{x-scale \cdot y-scale}} \]
    10. clear-num79.8%

      \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \cdot \frac{1}{x-scale \cdot y-scale} \]
    11. frac-times79.9%

      \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
    12. metadata-eval79.9%

      \[\leadsto \frac{\color{blue}{1}}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)} \]
  14. Applied egg-rr79.9%

    \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
  15. Step-by-step derivation
    1. associate-*l/74.1%

      \[\leadsto \frac{1}{\color{blue}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \]
    2. pow274.1%

      \[\leadsto \frac{1}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}}} \]
    3. clear-num74.1%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    4. associate-*r*74.1%

      \[\leadsto \frac{\color{blue}{\left(-4 \cdot \left(b \cdot a\right)\right) \cdot \left(b \cdot a\right)}}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)} \]
    5. times-frac92.3%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
  16. Applied egg-rr92.3%

    \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
  17. Step-by-step derivation
    1. times-frac90.0%

      \[\leadsto \color{blue}{\left(\frac{-4}{x-scale} \cdot \frac{b \cdot a}{y-scale}\right)} \cdot \frac{b \cdot a}{x-scale \cdot y-scale} \]
    2. associate-/l*87.8%

      \[\leadsto \left(\frac{-4}{x-scale} \cdot \color{blue}{\left(b \cdot \frac{a}{y-scale}\right)}\right) \cdot \frac{b \cdot a}{x-scale \cdot y-scale} \]
    3. associate-/l*88.7%

      \[\leadsto \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \color{blue}{\left(b \cdot \frac{a}{x-scale \cdot y-scale}\right)} \]
  18. Simplified88.7%

    \[\leadsto \color{blue}{\left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \left(b \cdot \frac{a}{x-scale \cdot y-scale}\right)} \]
  19. Step-by-step derivation
    1. associate-*r/87.8%

      \[\leadsto \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \color{blue}{\frac{b \cdot a}{x-scale \cdot y-scale}} \]
    2. associate-/r*89.4%

      \[\leadsto \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \color{blue}{\frac{\frac{b \cdot a}{x-scale}}{y-scale}} \]
  20. Applied egg-rr89.4%

    \[\leadsto \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \color{blue}{\frac{\frac{b \cdot a}{x-scale}}{y-scale}} \]
  21. Add Preprocessing

Alternative 5: 89.2% accurate, 99.6× speedup?

\[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale\_m}\right)\right) \cdot \left(b \cdot \frac{a}{y-scale\_m \cdot x-scale}\right) \end{array} \]
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b angle x-scale y-scale_m)
 :precision binary64
 (*
  (* (/ -4.0 x-scale) (* b (/ a y-scale_m)))
  (* b (/ a (* y-scale_m x-scale)))))
y-scale_m = fabs(y_45_scale);
double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	return ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (b * (a / (y_45_scale_m * x_45_scale)));
}
y-scale_m = abs(y_45scale)
real(8) function code(a, b, angle, x_45scale, y_45scale_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    real(8), intent (in) :: x_45scale
    real(8), intent (in) :: y_45scale_m
    code = (((-4.0d0) / x_45scale) * (b * (a / y_45scale_m))) * (b * (a / (y_45scale_m * x_45scale)))
end function
y-scale_m = Math.abs(y_45_scale);
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	return ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (b * (a / (y_45_scale_m * x_45_scale)));
}
y-scale_m = math.fabs(y_45_scale)
def code(a, b, angle, x_45_scale, y_45_scale_m):
	return ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (b * (a / (y_45_scale_m * x_45_scale)))
y-scale_m = abs(y_45_scale)
function code(a, b, angle, x_45_scale, y_45_scale_m)
	return Float64(Float64(Float64(-4.0 / x_45_scale) * Float64(b * Float64(a / y_45_scale_m))) * Float64(b * Float64(a / Float64(y_45_scale_m * x_45_scale))))
end
y-scale_m = abs(y_45_scale);
function tmp = code(a, b, angle, x_45_scale, y_45_scale_m)
	tmp = ((-4.0 / x_45_scale) * (b * (a / y_45_scale_m))) * (b * (a / (y_45_scale_m * x_45_scale)));
end
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale$95$m_] := N[(N[(N[(-4.0 / x$45$scale), $MachinePrecision] * N[(b * N[(a / y$45$scale$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * N[(a / N[(y$45$scale$95$m * x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y-scale_m = \left|y-scale\right|

\\
\left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale\_m}\right)\right) \cdot \left(b \cdot \frac{a}{y-scale\_m \cdot x-scale}\right)
\end{array}
Derivation
  1. Initial program 24.0%

    \[\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} \cdot \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} - \left(4 \cdot \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) \cdot \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} \]
  2. Simplified19.6%

    \[\leadsto \color{blue}{\frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} \cdot \frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} - 4 \cdot \left(\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}^{2}} \cdot \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}^{2}}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in angle around 0 44.9%

    \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
  5. Step-by-step derivation
    1. associate-*r/44.9%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left({a}^{2} \cdot {b}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
    2. *-commutative44.9%

      \[\leadsto \frac{-4 \cdot \color{blue}{\left({b}^{2} \cdot {a}^{2}\right)}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
    3. *-commutative44.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
    4. unpow244.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot y-scale\right)} \cdot {x-scale}^{2}} \]
    5. unpow244.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\left(y-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}} \]
    6. swap-sqr54.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}} \]
    7. unpow254.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{\left(y-scale \cdot x-scale\right)}^{2}}} \]
    8. *-commutative54.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\color{blue}{\left(x-scale \cdot y-scale\right)}}^{2}} \]
  6. Simplified54.4%

    \[\leadsto \color{blue}{\frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
  7. Step-by-step derivation
    1. div-inv54.4%

      \[\leadsto \color{blue}{\left(-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    2. pow-prod-down74.1%

      \[\leadsto \left(-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}} \]
    3. pow-flip74.1%

      \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot \color{blue}{{\left(x-scale \cdot y-scale\right)}^{\left(-2\right)}} \]
    4. metadata-eval74.1%

      \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{-2}} \]
  8. Applied egg-rr74.1%

    \[\leadsto \color{blue}{\left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2}} \]
  9. Step-by-step derivation
    1. unpow274.1%

      \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
  10. Applied egg-rr74.1%

    \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
  11. Step-by-step derivation
    1. *-commutative74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(y-scale \cdot x-scale\right)}}^{-2} \]
    2. unpow-prod-down59.4%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
  12. Applied egg-rr59.4%

    \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
  13. Step-by-step derivation
    1. pow-prod-down74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{{\left(y-scale \cdot x-scale\right)}^{-2}} \]
    2. *-commutative74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(x-scale \cdot y-scale\right)}}^{-2} \]
    3. metadata-eval74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{\left(-2\right)}} \]
    4. pow-flip74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    5. pow274.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \frac{1}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    6. div-inv74.1%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    7. associate-/r*79.9%

      \[\leadsto \color{blue}{\frac{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
    8. pow279.9%

      \[\leadsto \frac{\frac{-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
    9. div-inv79.8%

      \[\leadsto \color{blue}{\frac{-4 \cdot {\left(b \cdot a\right)}^{2}}{x-scale \cdot y-scale} \cdot \frac{1}{x-scale \cdot y-scale}} \]
    10. clear-num79.8%

      \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \cdot \frac{1}{x-scale \cdot y-scale} \]
    11. frac-times79.9%

      \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
    12. metadata-eval79.9%

      \[\leadsto \frac{\color{blue}{1}}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)} \]
  14. Applied egg-rr79.9%

    \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
  15. Step-by-step derivation
    1. associate-*l/74.1%

      \[\leadsto \frac{1}{\color{blue}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \]
    2. pow274.1%

      \[\leadsto \frac{1}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}}} \]
    3. clear-num74.1%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    4. associate-*r*74.1%

      \[\leadsto \frac{\color{blue}{\left(-4 \cdot \left(b \cdot a\right)\right) \cdot \left(b \cdot a\right)}}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)} \]
    5. times-frac92.3%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
  16. Applied egg-rr92.3%

    \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
  17. Step-by-step derivation
    1. times-frac90.0%

      \[\leadsto \color{blue}{\left(\frac{-4}{x-scale} \cdot \frac{b \cdot a}{y-scale}\right)} \cdot \frac{b \cdot a}{x-scale \cdot y-scale} \]
    2. associate-/l*87.8%

      \[\leadsto \left(\frac{-4}{x-scale} \cdot \color{blue}{\left(b \cdot \frac{a}{y-scale}\right)}\right) \cdot \frac{b \cdot a}{x-scale \cdot y-scale} \]
    3. associate-/l*88.7%

      \[\leadsto \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \color{blue}{\left(b \cdot \frac{a}{x-scale \cdot y-scale}\right)} \]
  18. Simplified88.7%

    \[\leadsto \color{blue}{\left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \left(b \cdot \frac{a}{x-scale \cdot y-scale}\right)} \]
  19. Final simplification88.7%

    \[\leadsto \left(\frac{-4}{x-scale} \cdot \left(b \cdot \frac{a}{y-scale}\right)\right) \cdot \left(b \cdot \frac{a}{y-scale \cdot x-scale}\right) \]
  20. Add Preprocessing

Alternative 6: 88.1% accurate, 99.6× speedup?

\[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ \frac{b \cdot a}{y-scale\_m \cdot x-scale} \cdot \left(\frac{a}{y-scale\_m} \cdot \left(b \cdot \frac{-4}{x-scale}\right)\right) \end{array} \]
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b angle x-scale y-scale_m)
 :precision binary64
 (*
  (/ (* b a) (* y-scale_m x-scale))
  (* (/ a y-scale_m) (* b (/ -4.0 x-scale)))))
y-scale_m = fabs(y_45_scale);
double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	return ((b * a) / (y_45_scale_m * x_45_scale)) * ((a / y_45_scale_m) * (b * (-4.0 / x_45_scale)));
}
y-scale_m = abs(y_45scale)
real(8) function code(a, b, angle, x_45scale, y_45scale_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    real(8), intent (in) :: x_45scale
    real(8), intent (in) :: y_45scale_m
    code = ((b * a) / (y_45scale_m * x_45scale)) * ((a / y_45scale_m) * (b * ((-4.0d0) / x_45scale)))
end function
y-scale_m = Math.abs(y_45_scale);
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	return ((b * a) / (y_45_scale_m * x_45_scale)) * ((a / y_45_scale_m) * (b * (-4.0 / x_45_scale)));
}
y-scale_m = math.fabs(y_45_scale)
def code(a, b, angle, x_45_scale, y_45_scale_m):
	return ((b * a) / (y_45_scale_m * x_45_scale)) * ((a / y_45_scale_m) * (b * (-4.0 / x_45_scale)))
y-scale_m = abs(y_45_scale)
function code(a, b, angle, x_45_scale, y_45_scale_m)
	return Float64(Float64(Float64(b * a) / Float64(y_45_scale_m * x_45_scale)) * Float64(Float64(a / y_45_scale_m) * Float64(b * Float64(-4.0 / x_45_scale))))
end
y-scale_m = abs(y_45_scale);
function tmp = code(a, b, angle, x_45_scale, y_45_scale_m)
	tmp = ((b * a) / (y_45_scale_m * x_45_scale)) * ((a / y_45_scale_m) * (b * (-4.0 / x_45_scale)));
end
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale$95$m_] := N[(N[(N[(b * a), $MachinePrecision] / N[(y$45$scale$95$m * x$45$scale), $MachinePrecision]), $MachinePrecision] * N[(N[(a / y$45$scale$95$m), $MachinePrecision] * N[(b * N[(-4.0 / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y-scale_m = \left|y-scale\right|

\\
\frac{b \cdot a}{y-scale\_m \cdot x-scale} \cdot \left(\frac{a}{y-scale\_m} \cdot \left(b \cdot \frac{-4}{x-scale}\right)\right)
\end{array}
Derivation
  1. Initial program 24.0%

    \[\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} \cdot \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} - \left(4 \cdot \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) \cdot \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} \]
  2. Simplified19.6%

    \[\leadsto \color{blue}{\frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} \cdot \frac{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}{y-scale \cdot x-scale} - 4 \cdot \left(\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}^{2}} \cdot \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}^{2}}\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in angle around 0 44.9%

    \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
  5. Step-by-step derivation
    1. associate-*r/44.9%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left({a}^{2} \cdot {b}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
    2. *-commutative44.9%

      \[\leadsto \frac{-4 \cdot \color{blue}{\left({b}^{2} \cdot {a}^{2}\right)}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
    3. *-commutative44.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
    4. unpow244.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot y-scale\right)} \cdot {x-scale}^{2}} \]
    5. unpow244.9%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\left(y-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot x-scale\right)}} \]
    6. swap-sqr54.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}} \]
    7. unpow254.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{\color{blue}{{\left(y-scale \cdot x-scale\right)}^{2}}} \]
    8. *-commutative54.4%

      \[\leadsto \frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\color{blue}{\left(x-scale \cdot y-scale\right)}}^{2}} \]
  6. Simplified54.4%

    \[\leadsto \color{blue}{\frac{-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
  7. Step-by-step derivation
    1. div-inv54.4%

      \[\leadsto \color{blue}{\left(-4 \cdot \left({b}^{2} \cdot {a}^{2}\right)\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    2. pow-prod-down74.1%

      \[\leadsto \left(-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}\right) \cdot \frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}} \]
    3. pow-flip74.1%

      \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot \color{blue}{{\left(x-scale \cdot y-scale\right)}^{\left(-2\right)}} \]
    4. metadata-eval74.1%

      \[\leadsto \left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{-2}} \]
  8. Applied egg-rr74.1%

    \[\leadsto \color{blue}{\left(-4 \cdot {\left(b \cdot a\right)}^{2}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2}} \]
  9. Step-by-step derivation
    1. unpow274.1%

      \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
  10. Applied egg-rr74.1%

    \[\leadsto \left(-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}\right) \cdot {\left(x-scale \cdot y-scale\right)}^{-2} \]
  11. Step-by-step derivation
    1. *-commutative74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(y-scale \cdot x-scale\right)}}^{-2} \]
    2. unpow-prod-down59.4%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
  12. Applied egg-rr59.4%

    \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\left({y-scale}^{-2} \cdot {x-scale}^{-2}\right)} \]
  13. Step-by-step derivation
    1. pow-prod-down74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{{\left(y-scale \cdot x-scale\right)}^{-2}} \]
    2. *-commutative74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\color{blue}{\left(x-scale \cdot y-scale\right)}}^{-2} \]
    3. metadata-eval74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot {\left(x-scale \cdot y-scale\right)}^{\color{blue}{\left(-2\right)}} \]
    4. pow-flip74.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \color{blue}{\frac{1}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    5. pow274.1%

      \[\leadsto \left(-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)\right) \cdot \frac{1}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    6. div-inv74.1%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    7. associate-/r*79.9%

      \[\leadsto \color{blue}{\frac{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
    8. pow279.9%

      \[\leadsto \frac{\frac{-4 \cdot \color{blue}{{\left(b \cdot a\right)}^{2}}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
    9. div-inv79.8%

      \[\leadsto \color{blue}{\frac{-4 \cdot {\left(b \cdot a\right)}^{2}}{x-scale \cdot y-scale} \cdot \frac{1}{x-scale \cdot y-scale}} \]
    10. clear-num79.8%

      \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \cdot \frac{1}{x-scale \cdot y-scale} \]
    11. frac-times79.9%

      \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
    12. metadata-eval79.9%

      \[\leadsto \frac{\color{blue}{1}}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)} \]
  14. Applied egg-rr79.9%

    \[\leadsto \color{blue}{\frac{1}{\frac{x-scale \cdot y-scale}{-4 \cdot {\left(b \cdot a\right)}^{2}} \cdot \left(x-scale \cdot y-scale\right)}} \]
  15. Step-by-step derivation
    1. associate-*l/74.1%

      \[\leadsto \frac{1}{\color{blue}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot {\left(b \cdot a\right)}^{2}}}} \]
    2. pow274.1%

      \[\leadsto \frac{1}{\frac{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}{-4 \cdot \color{blue}{\left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}}} \]
    3. clear-num74.1%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right)}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
    4. associate-*r*74.1%

      \[\leadsto \frac{\color{blue}{\left(-4 \cdot \left(b \cdot a\right)\right) \cdot \left(b \cdot a\right)}}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)} \]
    5. times-frac92.3%

      \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
  16. Applied egg-rr92.3%

    \[\leadsto \color{blue}{\frac{-4 \cdot \left(b \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot a}{x-scale \cdot y-scale}} \]
  17. Step-by-step derivation
    1. times-frac90.0%

      \[\leadsto \color{blue}{\left(\frac{-4}{x-scale} \cdot \frac{b \cdot a}{y-scale}\right)} \cdot \frac{b \cdot a}{x-scale \cdot y-scale} \]
    2. associate-*r/87.8%

      \[\leadsto \left(\frac{-4}{x-scale} \cdot \color{blue}{\left(b \cdot \frac{a}{y-scale}\right)}\right) \cdot \frac{b \cdot a}{x-scale \cdot y-scale} \]
    3. associate-*r*86.5%

      \[\leadsto \color{blue}{\left(\left(\frac{-4}{x-scale} \cdot b\right) \cdot \frac{a}{y-scale}\right)} \cdot \frac{b \cdot a}{x-scale \cdot y-scale} \]
  18. Applied egg-rr86.5%

    \[\leadsto \color{blue}{\left(\left(\frac{-4}{x-scale} \cdot b\right) \cdot \frac{a}{y-scale}\right)} \cdot \frac{b \cdot a}{x-scale \cdot y-scale} \]
  19. Final simplification86.5%

    \[\leadsto \frac{b \cdot a}{y-scale \cdot x-scale} \cdot \left(\frac{a}{y-scale} \cdot \left(b \cdot \frac{-4}{x-scale}\right)\right) \]
  20. Add Preprocessing

Alternative 7: 35.4% accurate, 1693.0× speedup?

\[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ 0 \end{array} \]
y-scale_m = (fabs.f64 y-scale)
(FPCore (a b angle x-scale y-scale_m) :precision binary64 0.0)
y-scale_m = fabs(y_45_scale);
double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	return 0.0;
}
y-scale_m = abs(y_45scale)
real(8) function code(a, b, angle, x_45scale, y_45scale_m)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    real(8), intent (in) :: x_45scale
    real(8), intent (in) :: y_45scale_m
    code = 0.0d0
end function
y-scale_m = Math.abs(y_45_scale);
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale_m) {
	return 0.0;
}
y-scale_m = math.fabs(y_45_scale)
def code(a, b, angle, x_45_scale, y_45_scale_m):
	return 0.0
y-scale_m = abs(y_45_scale)
function code(a, b, angle, x_45_scale, y_45_scale_m)
	return 0.0
end
y-scale_m = abs(y_45_scale);
function tmp = code(a, b, angle, x_45_scale, y_45_scale_m)
	tmp = 0.0;
end
y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale$95$m_] := 0.0
\begin{array}{l}
y-scale_m = \left|y-scale\right|

\\
0
\end{array}
Derivation
  1. Initial program 24.0%

    \[\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} \cdot \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} - \left(4 \cdot \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) \cdot \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} \]
  2. Simplified21.3%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\cos \left(\frac{angle \cdot \pi}{180}\right) \cdot \frac{\left({b}^{2} - {a}^{2}\right) \cdot \left(2 \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}{x-scale \cdot y-scale}, \cos \left(\frac{angle \cdot \pi}{180}\right) \cdot \frac{\left({b}^{2} - {a}^{2}\right) \cdot \left(2 \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}{x-scale \cdot y-scale}, \frac{{\left(a \cdot \cos \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2}}{{y-scale}^{2}} \cdot \left(\frac{{\left(a \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2}}{{x-scale}^{2}} \cdot -4\right)\right)} \]
  3. Add Preprocessing
  4. Taylor expanded in b around 0 22.4%

    \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{4} \cdot \left({\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}} + 4 \cdot \frac{{a}^{4} \cdot \left({\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}}} \]
  5. Step-by-step derivation
    1. distribute-rgt-out22.4%

      \[\leadsto \color{blue}{\frac{{a}^{4} \cdot \left({\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}} \cdot \left(-4 + 4\right)} \]
    2. metadata-eval22.4%

      \[\leadsto \frac{{a}^{4} \cdot \left({\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}{{x-scale}^{2} \cdot {y-scale}^{2}} \cdot \color{blue}{0} \]
    3. mul0-rgt34.7%

      \[\leadsto \color{blue}{0} \]
  6. Simplified34.7%

    \[\leadsto \color{blue}{0} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2024107 
(FPCore (a b angle x-scale y-scale)
  :name "Simplification of discriminant from scale-rotated-ellipse"
  :precision binary64
  (- (* (/ (/ (* (* (* 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 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI))) (cos (* (/ angle 180.0) PI))) x-scale) y-scale)) (* (* 4.0 (/ (/ (+ (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))))