Simplification of discriminant from scale-rotated-ellipse

Percentage Accurate: 25.6% → 85.7%
Time: 27.6s
Alternatives: 8
Speedup: 1905.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 8 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.6% 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: 85.7% accurate, 32.3× speedup?

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

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

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


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

    1. Initial program 32.9%

      \[\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. Add Preprocessing
    3. Taylor expanded in angle around 0

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      6. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      13. lower-*.f64N/A

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

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

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      2. lift-*.f64N/A

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot x-scale\right) \cdot \left(y-scale \cdot y-scale\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\left(x-scale \cdot x-scale\right) \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}} \]
      6. unswap-sqrN/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      7. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot y-scale\right)} \cdot \left(x-scale \cdot y-scale\right)} \]
      8. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\left(x-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot y-scale\right)}} \]
      9. times-fracN/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
      11. lower-/.f64N/A

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

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{\color{blue}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{\color{blue}{x-scale \cdot y-scale}}\right) \]
      5. lift-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \color{blue}{\frac{b}{x-scale \cdot y-scale}}\right) \]
      6. lift-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\color{blue}{\frac{b}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      7. lift-/.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\frac{b \cdot \frac{b}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      9. lift-/.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{\frac{b \cdot b}{x-scale \cdot y-scale}}}{x-scale \cdot y-scale} \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\frac{\color{blue}{b \cdot b}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
      12. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot b}{x-scale \cdot y-scale}} \]
      15. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale}} \cdot \frac{b \cdot b}{x-scale \cdot y-scale} \]
      16. lift-/.f64N/A

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

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

        \[\leadsto \left(\frac{\color{blue}{\left(-4 \cdot a\right) \cdot a}}{x-scale \cdot y-scale} \cdot b\right) \cdot \frac{b}{x-scale \cdot y-scale} \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(\color{blue}{\left(\left(-4 \cdot a\right) \cdot \frac{a}{x-scale \cdot y-scale}\right)} \cdot b\right) \cdot \frac{b}{x-scale \cdot y-scale} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(-4 \cdot a\right) \cdot \frac{a}{x-scale \cdot y-scale}\right)} \cdot b\right) \cdot \frac{b}{x-scale \cdot y-scale} \]
      5. lower-*.f64N/A

        \[\leadsto \left(\left(\color{blue}{\left(-4 \cdot a\right)} \cdot \frac{a}{x-scale \cdot y-scale}\right) \cdot b\right) \cdot \frac{b}{x-scale \cdot y-scale} \]
      6. lower-/.f6487.8

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

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

    if 1.46e115 < b

    1. Initial program 2.5%

      \[\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. Add Preprocessing
    3. Taylor expanded in angle around 0

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      6. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      13. lower-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      15. lower-*.f6435.6

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      2. lift-*.f64N/A

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot x-scale\right) \cdot \left(y-scale \cdot y-scale\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\left(x-scale \cdot x-scale\right) \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}} \]
      6. unswap-sqrN/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      7. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot y-scale\right)} \cdot \left(x-scale \cdot y-scale\right)} \]
      8. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\left(x-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot y-scale\right)}} \]
      9. times-fracN/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
      11. lower-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\color{blue}{\frac{b}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      12. lower-/.f6472.8

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{\color{blue}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{\color{blue}{x-scale \cdot y-scale}}\right) \]
      5. lift-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \color{blue}{\frac{b}{x-scale \cdot y-scale}}\right) \]
      6. lift-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\color{blue}{\frac{b}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      7. lift-/.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\frac{b \cdot \frac{b}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      9. lift-/.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{\frac{b \cdot b}{x-scale \cdot y-scale}}}{x-scale \cdot y-scale} \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\frac{\color{blue}{b \cdot b}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
      12. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot b}{x-scale \cdot y-scale}} \]
      15. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale}} \cdot \frac{b \cdot b}{x-scale \cdot y-scale} \]
      16. lift-/.f64N/A

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

      \[\leadsto \color{blue}{\left(\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale} \cdot b\right) \cdot \frac{b}{x-scale \cdot y-scale}} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\frac{-4 \cdot \color{blue}{\left(a \cdot a\right)}}{x-scale \cdot y-scale} \cdot b\right) \cdot \frac{b}{x-scale \cdot y-scale} \]
      2. lift-*.f64N/A

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

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

        \[\leadsto \left(\color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale}} \cdot b\right) \cdot \frac{b}{x-scale \cdot y-scale} \]
      5. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale} \cdot b\right)} \cdot \frac{b}{x-scale \cdot y-scale} \]
      6. lift-*.f64N/A

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

        \[\leadsto \left(\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale} \cdot b\right) \cdot \color{blue}{\frac{\mathsf{neg}\left(b\right)}{\mathsf{neg}\left(x-scale \cdot y-scale\right)}} \]
      8. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\left(\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale} \cdot b\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(x-scale \cdot y-scale\right)}} \]
      9. lower-/.f64N/A

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

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

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

Alternative 2: 81.2% accurate, 29.3× speedup?

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

\\
\begin{array}{l}
t_0 := b\_m \cdot \left(a \cdot \left(a \cdot \frac{b\_m \cdot -4}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}\right)\right)\\
\mathbf{if}\;y-scale \leq 2.9 \cdot 10^{-158}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y-scale \leq 5 \cdot 10^{+162}:\\
\;\;\;\;b\_m \cdot \left(a \cdot \frac{\frac{-4 \cdot \left(b\_m \cdot a\right)}{x-scale \cdot \left(y-scale \cdot y-scale\right)}}{x-scale}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y-scale < 2.8999999999999998e-158 or 4.9999999999999997e162 < y-scale

    1. Initial program 29.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. Add Preprocessing
    3. Taylor expanded in angle around 0

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      6. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      13. lower-*.f64N/A

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

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

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{b \cdot b}}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \color{blue}{\left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
      6. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
      7. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)} \]
      9. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right) \]
      10. lift-*.f64N/A

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

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

        \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
      13. lower-*.f64N/A

        \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
      14. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
      15. lower-/.f6461.9

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

      \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
      2. lift-*.f64N/A

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

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

        \[\leadsto b \cdot \left(\color{blue}{\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
      5. lift-*.f64N/A

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

        \[\leadsto b \cdot \color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot \left(a \cdot a\right)\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
      9. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
      10. lower-*.f64N/A

        \[\leadsto b \cdot \left(\color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right)} \cdot a\right) \]
      11. lift-/.f64N/A

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

        \[\leadsto b \cdot \left(\left(\color{blue}{\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \cdot a\right) \]
      13. lower-/.f64N/A

        \[\leadsto b \cdot \left(\left(\color{blue}{\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \cdot a\right) \]
      14. lower-*.f6471.9

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

      \[\leadsto b \cdot \color{blue}{\left(\left(\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot a\right) \cdot a\right)} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

        \[\leadsto b \cdot \left(\left(\frac{b \cdot -4}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \cdot a\right) \cdot a\right) \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot \left(\left(\frac{b \cdot -4}{\color{blue}{\left(x-scale \cdot y-scale\right)} \cdot \left(x-scale \cdot y-scale\right)} \cdot a\right) \cdot a\right) \]
      6. lift-*.f64N/A

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

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

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

    if 2.8999999999999998e-158 < y-scale < 4.9999999999999997e162

    1. Initial program 24.6%

      \[\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. Add Preprocessing
    3. Taylor expanded in angle around 0

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      6. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      13. lower-*.f64N/A

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

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

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{b \cdot b}}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \color{blue}{\left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
      6. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
      7. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)} \]
      9. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right) \]
      10. lift-*.f64N/A

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

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

        \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
      13. lower-*.f64N/A

        \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
      14. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
      15. lower-/.f6464.8

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

      \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
      2. lift-*.f64N/A

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

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

        \[\leadsto b \cdot \left(\color{blue}{\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
      5. lift-*.f64N/A

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

        \[\leadsto b \cdot \color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot \left(a \cdot a\right)\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
      9. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
      10. lower-*.f64N/A

        \[\leadsto b \cdot \left(\color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right)} \cdot a\right) \]
      11. lift-/.f64N/A

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

        \[\leadsto b \cdot \left(\left(\color{blue}{\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \cdot a\right) \]
      13. lower-/.f64N/A

        \[\leadsto b \cdot \left(\left(\color{blue}{\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \cdot a\right) \]
      14. lower-*.f6473.7

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

      \[\leadsto b \cdot \color{blue}{\left(\left(\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot a\right) \cdot a\right)} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto b \cdot \left(\left(\frac{\color{blue}{b \cdot -4}}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot a\right) \cdot a\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto b \cdot \left(\left(\frac{b \cdot -4}{x-scale \cdot \color{blue}{\left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \cdot a\right) \]
      4. lift-*.f64N/A

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

        \[\leadsto b \cdot \left(\color{blue}{\frac{\left(b \cdot -4\right) \cdot a}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \]
      6. lift-*.f64N/A

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

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

        \[\leadsto b \cdot \left(\color{blue}{\frac{\frac{\left(b \cdot -4\right) \cdot a}{x-scale \cdot \left(y-scale \cdot y-scale\right)}}{x-scale}} \cdot a\right) \]
      9. lower-/.f64N/A

        \[\leadsto b \cdot \left(\color{blue}{\frac{\frac{\left(b \cdot -4\right) \cdot a}{x-scale \cdot \left(y-scale \cdot y-scale\right)}}{x-scale}} \cdot a\right) \]
      10. lower-/.f64N/A

        \[\leadsto b \cdot \left(\frac{\color{blue}{\frac{\left(b \cdot -4\right) \cdot a}{x-scale \cdot \left(y-scale \cdot y-scale\right)}}}{x-scale} \cdot a\right) \]
      11. lift-*.f64N/A

        \[\leadsto b \cdot \left(\frac{\frac{\color{blue}{\left(b \cdot -4\right)} \cdot a}{x-scale \cdot \left(y-scale \cdot y-scale\right)}}{x-scale} \cdot a\right) \]
      12. *-commutativeN/A

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

        \[\leadsto b \cdot \left(\frac{\frac{\color{blue}{-4 \cdot \left(b \cdot a\right)}}{x-scale \cdot \left(y-scale \cdot y-scale\right)}}{x-scale} \cdot a\right) \]
      14. *-commutativeN/A

        \[\leadsto b \cdot \left(\frac{\frac{-4 \cdot \color{blue}{\left(a \cdot b\right)}}{x-scale \cdot \left(y-scale \cdot y-scale\right)}}{x-scale} \cdot a\right) \]
      15. lower-*.f64N/A

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

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

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

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

Alternative 3: 80.1% accurate, 32.3× speedup?

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

\\
\begin{array}{l}
t_0 := b\_m \cdot \left(a \cdot \left(a \cdot \frac{b\_m \cdot -4}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}\right)\right)\\
\mathbf{if}\;x-scale \leq 2.1 \cdot 10^{-134}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x-scale \leq 2 \cdot 10^{+105}:\\
\;\;\;\;\left(b\_m \cdot a\right) \cdot \frac{-4 \cdot \left(b\_m \cdot a\right)}{y-scale \cdot \left(y-scale \cdot \left(x-scale \cdot x-scale\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x-scale < 2.0999999999999999e-134 or 1.9999999999999999e105 < x-scale

    1. Initial program 27.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. Add Preprocessing
    3. Taylor expanded in angle around 0

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      6. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      13. lower-*.f64N/A

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

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

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{b \cdot b}}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \color{blue}{\left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
      6. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
      7. lift-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)} \]
      9. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right) \]
      10. lift-*.f64N/A

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

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

        \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
      13. lower-*.f64N/A

        \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
      14. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
      15. lower-/.f6457.9

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

      \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
      2. lift-*.f64N/A

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

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

        \[\leadsto b \cdot \left(\color{blue}{\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
      5. lift-*.f64N/A

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

        \[\leadsto b \cdot \color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot \left(a \cdot a\right)\right)} \]
      7. lift-*.f64N/A

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

        \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
      9. lower-*.f64N/A

        \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
      10. lower-*.f64N/A

        \[\leadsto b \cdot \left(\color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right)} \cdot a\right) \]
      11. lift-/.f64N/A

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

        \[\leadsto b \cdot \left(\left(\color{blue}{\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \cdot a\right) \]
      13. lower-/.f64N/A

        \[\leadsto b \cdot \left(\left(\color{blue}{\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \cdot a\right) \]
      14. lower-*.f6468.9

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

      \[\leadsto b \cdot \color{blue}{\left(\left(\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot a\right) \cdot a\right)} \]
    10. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

        \[\leadsto b \cdot \left(\left(\frac{b \cdot -4}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \cdot a\right) \cdot a\right) \]
      5. lift-*.f64N/A

        \[\leadsto b \cdot \left(\left(\frac{b \cdot -4}{\color{blue}{\left(x-scale \cdot y-scale\right)} \cdot \left(x-scale \cdot y-scale\right)} \cdot a\right) \cdot a\right) \]
      6. lift-*.f64N/A

        \[\leadsto b \cdot \left(\left(\frac{b \cdot -4}{\left(x-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot y-scale\right)}} \cdot a\right) \cdot a\right) \]
      7. lower-*.f6476.6

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

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

    if 2.0999999999999999e-134 < x-scale < 1.9999999999999999e105

    1. Initial program 30.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. Add Preprocessing
    3. Taylor expanded in angle around 0

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      6. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      13. lower-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      15. lower-*.f6466.7

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      2. lift-*.f64N/A

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot x-scale\right) \cdot \left(y-scale \cdot y-scale\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\left(x-scale \cdot x-scale\right) \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}} \]
      6. unswap-sqrN/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      7. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot y-scale\right)} \cdot \left(x-scale \cdot y-scale\right)} \]
      8. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\left(x-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot y-scale\right)}} \]
      9. times-fracN/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
      11. lower-/.f64N/A

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

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{\color{blue}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{\color{blue}{x-scale \cdot y-scale}}\right) \]
      5. lift-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \color{blue}{\frac{b}{x-scale \cdot y-scale}}\right) \]
      6. lift-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\color{blue}{\frac{b}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      7. lift-/.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\frac{b \cdot \frac{b}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      9. lift-/.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{\frac{b \cdot b}{x-scale \cdot y-scale}}}{x-scale \cdot y-scale} \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\frac{\color{blue}{b \cdot b}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
      12. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot b}{x-scale \cdot y-scale}} \]
      15. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale}} \cdot \frac{b \cdot b}{x-scale \cdot y-scale} \]
      16. lift-/.f64N/A

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

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

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

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

Alternative 4: 82.7% accurate, 32.3× speedup?

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

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

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


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

    1. Initial program 30.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. Add Preprocessing
    3. Taylor expanded in angle around 0

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      6. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      13. lower-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      15. lower-*.f6453.9

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      2. lift-*.f64N/A

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot x-scale\right) \cdot \left(y-scale \cdot y-scale\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\left(x-scale \cdot x-scale\right) \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}} \]
      6. unswap-sqrN/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      7. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot y-scale\right)} \cdot \left(x-scale \cdot y-scale\right)} \]
      8. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\left(x-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot y-scale\right)}} \]
      9. times-fracN/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
      11. lower-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\color{blue}{\frac{b}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      12. lower-/.f6476.6

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{\color{blue}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{\color{blue}{x-scale \cdot y-scale}}\right) \]
      5. lift-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \color{blue}{\frac{b}{x-scale \cdot y-scale}}\right) \]
      6. lift-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\color{blue}{\frac{b}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      7. lift-/.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\frac{b \cdot \frac{b}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      9. lift-/.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{\frac{b \cdot b}{x-scale \cdot y-scale}}}{x-scale \cdot y-scale} \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\frac{\color{blue}{b \cdot b}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
      12. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot b}{x-scale \cdot y-scale}} \]
      15. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale}} \cdot \frac{b \cdot b}{x-scale \cdot y-scale} \]
      16. lift-/.f64N/A

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

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

        \[\leadsto \left(\frac{\color{blue}{\left(-4 \cdot a\right) \cdot a}}{x-scale \cdot y-scale} \cdot b\right) \cdot \frac{b}{x-scale \cdot y-scale} \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(\color{blue}{\left(\left(-4 \cdot a\right) \cdot \frac{a}{x-scale \cdot y-scale}\right)} \cdot b\right) \cdot \frac{b}{x-scale \cdot y-scale} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\color{blue}{\left(\left(-4 \cdot a\right) \cdot \frac{a}{x-scale \cdot y-scale}\right)} \cdot b\right) \cdot \frac{b}{x-scale \cdot y-scale} \]
      5. lower-*.f64N/A

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

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

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

    if 5.19999999999999988e220 < b

    1. Initial program 0.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. Add Preprocessing
    3. Taylor expanded in angle around 0

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
      6. lower-*.f64N/A

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

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

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

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      12. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
      13. lower-*.f64N/A

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

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

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

      \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
      2. lift-*.f64N/A

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

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot x-scale\right) \cdot \left(y-scale \cdot y-scale\right)}} \]
      5. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\left(x-scale \cdot x-scale\right) \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}} \]
      6. unswap-sqrN/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \]
      7. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{\left(x-scale \cdot y-scale\right)} \cdot \left(x-scale \cdot y-scale\right)} \]
      8. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\left(x-scale \cdot y-scale\right) \cdot \color{blue}{\left(x-scale \cdot y-scale\right)}} \]
      9. times-fracN/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
      11. lower-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\color{blue}{\frac{b}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      12. lower-/.f6463.5

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      2. lift-*.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{\color{blue}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      4. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \frac{b}{\color{blue}{x-scale \cdot y-scale}}\right) \]
      5. lift-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\frac{b}{x-scale \cdot y-scale} \cdot \color{blue}{\frac{b}{x-scale \cdot y-scale}}\right) \]
      6. lift-/.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \left(\color{blue}{\frac{b}{x-scale \cdot y-scale}} \cdot \frac{b}{x-scale \cdot y-scale}\right) \]
      7. lift-/.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \color{blue}{\frac{b \cdot \frac{b}{x-scale \cdot y-scale}}{x-scale \cdot y-scale}} \]
      9. lift-/.f64N/A

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

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{\frac{b \cdot b}{x-scale \cdot y-scale}}}{x-scale \cdot y-scale} \]
      11. lift-*.f64N/A

        \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\frac{\color{blue}{b \cdot b}}{x-scale \cdot y-scale}}{x-scale \cdot y-scale} \]
      12. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale} \cdot \frac{b \cdot b}{x-scale \cdot y-scale}} \]
      15. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{-4 \cdot \left(a \cdot a\right)}{x-scale \cdot y-scale}} \cdot \frac{b \cdot b}{x-scale \cdot y-scale} \]
      16. lift-/.f64N/A

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

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

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

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

Alternative 5: 79.0% accurate, 40.5× speedup?

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

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

    \[\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. Add Preprocessing
  3. Taylor expanded in angle around 0

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

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

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

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

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

      \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
    6. lower-*.f64N/A

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

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

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

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

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
    12. lower-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
    13. lower-*.f64N/A

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
    15. lower-*.f6453.0

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

    \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
    2. lift-*.f64N/A

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{b \cdot b}}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
    4. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \color{blue}{\left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    7. lift-/.f64N/A

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

      \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)} \]
    9. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right) \]
    10. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    13. lower-*.f64N/A

      \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    14. lower-*.f64N/A

      \[\leadsto b \cdot \color{blue}{\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    15. lower-/.f6462.7

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

    \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
  8. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
    2. lift-*.f64N/A

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

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

      \[\leadsto b \cdot \left(\color{blue}{\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
    5. lift-*.f64N/A

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

      \[\leadsto b \cdot \color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot \left(a \cdot a\right)\right)} \]
    7. lift-*.f64N/A

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

      \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
    9. lower-*.f64N/A

      \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
    10. lower-*.f64N/A

      \[\leadsto b \cdot \left(\color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right)} \cdot a\right) \]
    11. lift-/.f64N/A

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

      \[\leadsto b \cdot \left(\left(\color{blue}{\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \cdot a\right) \]
    13. lower-/.f64N/A

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

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

    \[\leadsto b \cdot \color{blue}{\left(\left(\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot a\right) \cdot a\right)} \]
  10. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

      \[\leadsto b \cdot \left(\left(\frac{b \cdot -4}{\color{blue}{\left(x-scale \cdot y-scale\right) \cdot \left(x-scale \cdot y-scale\right)}} \cdot a\right) \cdot a\right) \]
    5. lift-*.f64N/A

      \[\leadsto b \cdot \left(\left(\frac{b \cdot -4}{\color{blue}{\left(x-scale \cdot y-scale\right)} \cdot \left(x-scale \cdot y-scale\right)} \cdot a\right) \cdot a\right) \]
    6. lift-*.f64N/A

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

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

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

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

Alternative 6: 76.4% accurate, 40.5× speedup?

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

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

    \[\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. Add Preprocessing
  3. Taylor expanded in angle around 0

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

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

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

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

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

      \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
    6. lower-*.f64N/A

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

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

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

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

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
    12. lower-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
    13. lower-*.f64N/A

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
    15. lower-*.f6453.0

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

    \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
    2. lift-*.f64N/A

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{b \cdot b}}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
    4. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \color{blue}{\left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    7. lift-/.f64N/A

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

      \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)} \]
    9. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right) \]
    10. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    13. lower-*.f64N/A

      \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    14. lower-*.f64N/A

      \[\leadsto b \cdot \color{blue}{\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    15. lower-/.f6462.7

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

    \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
  8. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
    2. lift-*.f64N/A

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

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

      \[\leadsto b \cdot \left(\color{blue}{\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
    5. lift-*.f64N/A

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

      \[\leadsto b \cdot \color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot \left(a \cdot a\right)\right)} \]
    7. lift-*.f64N/A

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

      \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
    9. lower-*.f64N/A

      \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
    10. lower-*.f64N/A

      \[\leadsto b \cdot \left(\color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right)} \cdot a\right) \]
    11. lift-/.f64N/A

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

      \[\leadsto b \cdot \left(\left(\color{blue}{\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \cdot a\right) \]
    13. lower-/.f64N/A

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

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

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

      \[\leadsto b \cdot \left(\left(\frac{b \cdot -4}{x-scale \cdot \color{blue}{\left(\left(x-scale \cdot y-scale\right) \cdot y-scale\right)}} \cdot a\right) \cdot a\right) \]
    2. lift-*.f64N/A

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

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

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

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

Alternative 7: 69.4% accurate, 40.5× speedup?

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

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

    \[\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. Add Preprocessing
  3. Taylor expanded in angle around 0

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

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

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

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

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

      \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{{b}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} \]
    6. lower-*.f64N/A

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

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

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

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

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
    12. lower-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot {y-scale}^{2}\right)}} \]
    13. lower-*.f64N/A

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
    15. lower-*.f6453.0

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

    \[\leadsto \color{blue}{\left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \color{blue}{\left(a \cdot a\right)}\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
    2. lift-*.f64N/A

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

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{\color{blue}{b \cdot b}}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \]
    4. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{x-scale \cdot \color{blue}{\left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    6. lift-*.f64N/A

      \[\leadsto \left(-4 \cdot \left(a \cdot a\right)\right) \cdot \frac{b \cdot b}{\color{blue}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \]
    7. lift-/.f64N/A

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

      \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)} \]
    9. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{b \cdot b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right) \]
    10. lift-*.f64N/A

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

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

      \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    13. lower-*.f64N/A

      \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    14. lower-*.f64N/A

      \[\leadsto b \cdot \color{blue}{\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
    15. lower-/.f6462.7

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

    \[\leadsto \color{blue}{b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right)} \]
  8. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto b \cdot \left(\frac{b}{x-scale \cdot \left(x-scale \cdot \color{blue}{\left(y-scale \cdot y-scale\right)}\right)} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
    2. lift-*.f64N/A

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

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

      \[\leadsto b \cdot \left(\color{blue}{\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot \left(-4 \cdot \left(a \cdot a\right)\right)\right) \]
    5. lift-*.f64N/A

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

      \[\leadsto b \cdot \color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot \left(a \cdot a\right)\right)} \]
    7. lift-*.f64N/A

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

      \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
    9. lower-*.f64N/A

      \[\leadsto b \cdot \color{blue}{\left(\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right) \cdot a\right)} \]
    10. lower-*.f64N/A

      \[\leadsto b \cdot \left(\color{blue}{\left(\left(\frac{b}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)} \cdot -4\right) \cdot a\right)} \cdot a\right) \]
    11. lift-/.f64N/A

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

      \[\leadsto b \cdot \left(\left(\color{blue}{\frac{b \cdot -4}{x-scale \cdot \left(x-scale \cdot \left(y-scale \cdot y-scale\right)\right)}} \cdot a\right) \cdot a\right) \]
    13. lower-/.f64N/A

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

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

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

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

Alternative 8: 35.5% accurate, 1905.0× speedup?

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

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

    \[\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. Add Preprocessing
  3. Taylor expanded in angle around 0

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale} \cdot \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \frac{\frac{1}{90}}{x-scale \cdot y-scale}\right) - \left(4 \cdot \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale}\right) \cdot \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale} \]
    11. difference-of-squaresN/A

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

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

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

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

      \[\leadsto \frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale} \cdot \left(\left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \color{blue}{\frac{\frac{1}{90}}{x-scale \cdot y-scale}}\right) - \left(4 \cdot \frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale}\right) \cdot \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale} \]
    16. lower-*.f6428.7

      \[\leadsto \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 \left(\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{0.011111111111111112}{\color{blue}{x-scale \cdot y-scale}}\right) - \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} \]
  5. Applied rewrites28.7%

    \[\leadsto \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 \color{blue}{\left(\left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \frac{0.011111111111111112}{x-scale \cdot y-scale}\right)} - \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} \]
  6. Applied rewrites31.0%

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

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

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

      \[\leadsto \frac{\color{blue}{{b}^{4}} \cdot \left(\frac{1}{90} \cdot \frac{angle \cdot \left(\mathsf{PI}\left(\right) \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}{{x-scale}^{2} \cdot y-scale} - 4 \cdot \frac{\left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}{{x-scale}^{2} \cdot y-scale}\right)}{y-scale} \]
    3. sub-negN/A

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

      \[\leadsto \frac{{b}^{4} \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{90}, \frac{angle \cdot \left(\mathsf{PI}\left(\right) \cdot \sin \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}{{x-scale}^{2} \cdot y-scale}, \mathsf{neg}\left(4 \cdot \frac{\left(\frac{1}{2} + \frac{-1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(\frac{1}{2} + \frac{1}{2} \cdot \cos \left(\frac{1}{90} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}{{x-scale}^{2} \cdot y-scale}\right)\right)}}{y-scale} \]
  9. Applied rewrites35.5%

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

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

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

      \[\leadsto \color{blue}{\left({angle}^{2} \cdot {b}^{4}\right) \cdot \frac{\frac{-1}{8100} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{{x-scale}^{2} \cdot y-scale} + \frac{1}{8100} \cdot \frac{{\mathsf{PI}\left(\right)}^{2}}{{x-scale}^{2} \cdot y-scale}}{y-scale}} \]
    3. distribute-rgt-outN/A

      \[\leadsto \left({angle}^{2} \cdot {b}^{4}\right) \cdot \frac{\color{blue}{\frac{{\mathsf{PI}\left(\right)}^{2}}{{x-scale}^{2} \cdot y-scale} \cdot \left(\frac{-1}{8100} + \frac{1}{8100}\right)}}{y-scale} \]
    4. metadata-evalN/A

      \[\leadsto \left({angle}^{2} \cdot {b}^{4}\right) \cdot \frac{\frac{{\mathsf{PI}\left(\right)}^{2}}{{x-scale}^{2} \cdot y-scale} \cdot \color{blue}{0}}{y-scale} \]
    5. mul0-rgtN/A

      \[\leadsto \left({angle}^{2} \cdot {b}^{4}\right) \cdot \frac{\color{blue}{0}}{y-scale} \]
    6. div0N/A

      \[\leadsto \left({angle}^{2} \cdot {b}^{4}\right) \cdot \color{blue}{0} \]
    7. mul0-rgt40.9

      \[\leadsto \color{blue}{0} \]
  12. Applied rewrites40.9%

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

Reproduce

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