Average Error: 40.8 → 6.4
Time: 1.3min
Precision: binary64
Cost: 1352
\[\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} \]
\[\begin{array}{l} t_0 := \frac{b}{\frac{y-scale}{\frac{a}{x-scale}}}\\ \mathbf{if}\;a \leq -1 \cdot 10^{+200}:\\ \;\;\;\;-4 \cdot \left(t_0 \cdot \frac{\frac{a}{x-scale}}{\frac{y-scale}{b}}\right)\\ \mathbf{elif}\;a \leq -1 \cdot 10^{+150}:\\ \;\;\;\;\left(\frac{a}{y-scale} \cdot \frac{a}{y-scale}\right) \cdot \left(-4 \cdot \left(\frac{b}{x-scale} \cdot \frac{b}{x-scale}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(t_0 \cdot t_0\right)\\ \end{array} \]
(FPCore (a b angle x-scale y-scale)
 :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))))
(FPCore (a b angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (/ b (/ y-scale (/ a x-scale)))))
   (if (<= a -1e+200)
     (* -4.0 (* t_0 (/ (/ a x-scale) (/ y-scale b))))
     (if (<= a -1e+150)
       (*
        (* (/ a y-scale) (/ a y-scale))
        (* -4.0 (* (/ b x-scale) (/ b x-scale))))
       (* -4.0 (* t_0 t_0))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	return ((((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(((angle / 180.0) * ((double) M_PI)))) * cos(((angle / 180.0) * ((double) M_PI)))) / x_45_scale) / y_45_scale) * (((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(((angle / 180.0) * ((double) M_PI)))) * cos(((angle / 180.0) * ((double) M_PI)))) / x_45_scale) / y_45_scale)) - ((4.0 * (((pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((angle / 180.0) * ((double) M_PI)))), 2.0)) / x_45_scale) / x_45_scale)) * (((pow((a * cos(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * sin(((angle / 180.0) * ((double) M_PI)))), 2.0)) / y_45_scale) / y_45_scale));
}
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	double t_0 = b / (y_45_scale / (a / x_45_scale));
	double tmp;
	if (a <= -1e+200) {
		tmp = -4.0 * (t_0 * ((a / x_45_scale) / (y_45_scale / b)));
	} else if (a <= -1e+150) {
		tmp = ((a / y_45_scale) * (a / y_45_scale)) * (-4.0 * ((b / x_45_scale) * (b / x_45_scale)));
	} else {
		tmp = -4.0 * (t_0 * t_0);
	}
	return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
	return ((((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(((angle / 180.0) * Math.PI))) * Math.cos(((angle / 180.0) * Math.PI))) / x_45_scale) / y_45_scale) * (((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(((angle / 180.0) * Math.PI))) * Math.cos(((angle / 180.0) * Math.PI))) / x_45_scale) / y_45_scale)) - ((4.0 * (((Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((angle / 180.0) * Math.PI))), 2.0)) / x_45_scale) / x_45_scale)) * (((Math.pow((a * Math.cos(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.sin(((angle / 180.0) * Math.PI))), 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 = b / (y_45_scale / (a / x_45_scale));
	double tmp;
	if (a <= -1e+200) {
		tmp = -4.0 * (t_0 * ((a / x_45_scale) / (y_45_scale / b)));
	} else if (a <= -1e+150) {
		tmp = ((a / y_45_scale) * (a / y_45_scale)) * (-4.0 * ((b / x_45_scale) * (b / x_45_scale)));
	} else {
		tmp = -4.0 * (t_0 * t_0);
	}
	return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale):
	return ((((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(((angle / 180.0) * math.pi))) * math.cos(((angle / 180.0) * math.pi))) / x_45_scale) / y_45_scale) * (((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(((angle / 180.0) * math.pi))) * math.cos(((angle / 180.0) * math.pi))) / x_45_scale) / y_45_scale)) - ((4.0 * (((math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(((angle / 180.0) * math.pi))), 2.0)) / x_45_scale) / x_45_scale)) * (((math.pow((a * math.cos(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.sin(((angle / 180.0) * math.pi))), 2.0)) / y_45_scale) / y_45_scale))
def code(a, b, angle, x_45_scale, y_45_scale):
	t_0 = b / (y_45_scale / (a / x_45_scale))
	tmp = 0
	if a <= -1e+200:
		tmp = -4.0 * (t_0 * ((a / x_45_scale) / (y_45_scale / b)))
	elif a <= -1e+150:
		tmp = ((a / y_45_scale) * (a / y_45_scale)) * (-4.0 * ((b / x_45_scale) * (b / x_45_scale)))
	else:
		tmp = -4.0 * (t_0 * t_0)
	return tmp
function code(a, b, angle, x_45_scale, y_45_scale)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(Float64(angle / 180.0) * pi))) * cos(Float64(Float64(angle / 180.0) * pi))) / x_45_scale) / y_45_scale) * Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(Float64(angle / 180.0) * pi))) * cos(Float64(Float64(angle / 180.0) * pi))) / x_45_scale) / y_45_scale)) - Float64(Float64(4.0 * Float64(Float64(Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale)) * Float64(Float64(Float64((Float64(a * cos(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale)))
end
function code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = Float64(b / Float64(y_45_scale / Float64(a / x_45_scale)))
	tmp = 0.0
	if (a <= -1e+200)
		tmp = Float64(-4.0 * Float64(t_0 * Float64(Float64(a / x_45_scale) / Float64(y_45_scale / b))));
	elseif (a <= -1e+150)
		tmp = Float64(Float64(Float64(a / y_45_scale) * Float64(a / y_45_scale)) * Float64(-4.0 * Float64(Float64(b / x_45_scale) * Float64(b / x_45_scale))));
	else
		tmp = Float64(-4.0 * Float64(t_0 * t_0));
	end
	return tmp
end
function tmp = code(a, b, angle, x_45_scale, y_45_scale)
	tmp = ((((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(((angle / 180.0) * pi))) * cos(((angle / 180.0) * pi))) / x_45_scale) / y_45_scale) * (((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(((angle / 180.0) * pi))) * cos(((angle / 180.0) * pi))) / x_45_scale) / y_45_scale)) - ((4.0 * (((((a * sin(((angle / 180.0) * pi))) ^ 2.0) + ((b * cos(((angle / 180.0) * pi))) ^ 2.0)) / x_45_scale) / x_45_scale)) * (((((a * cos(((angle / 180.0) * pi))) ^ 2.0) + ((b * sin(((angle / 180.0) * pi))) ^ 2.0)) / y_45_scale) / y_45_scale));
end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale)
	t_0 = b / (y_45_scale / (a / x_45_scale));
	tmp = 0.0;
	if (a <= -1e+200)
		tmp = -4.0 * (t_0 * ((a / x_45_scale) / (y_45_scale / b)));
	elseif (a <= -1e+150)
		tmp = ((a / y_45_scale) * (a / y_45_scale)) * (-4.0 * ((b / x_45_scale) * (b / x_45_scale)));
	else
		tmp = -4.0 * (t_0 * t_0);
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(N[(N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision] * N[(N[(N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * N[(N[(N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Power[N[(a * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(b / N[(y$45$scale / N[(a / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1e+200], N[(-4.0 * N[(t$95$0 * N[(N[(a / x$45$scale), $MachinePrecision] / N[(y$45$scale / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1e+150], N[(N[(N[(a / y$45$scale), $MachinePrecision] * N[(a / y$45$scale), $MachinePrecision]), $MachinePrecision] * N[(-4.0 * N[(N[(b / x$45$scale), $MachinePrecision] * N[(b / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\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}
\begin{array}{l}
t_0 := \frac{b}{\frac{y-scale}{\frac{a}{x-scale}}}\\
\mathbf{if}\;a \leq -1 \cdot 10^{+200}:\\
\;\;\;\;-4 \cdot \left(t_0 \cdot \frac{\frac{a}{x-scale}}{\frac{y-scale}{b}}\right)\\

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

\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t_0 \cdot t_0\right)\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if a < -9.9999999999999997e199

    1. Initial program 64.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. Taylor expanded in angle around 0 64.0

      \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
    3. Simplified64.0

      \[\leadsto \color{blue}{-4 \cdot \frac{b \cdot b}{\frac{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}{a \cdot a}}} \]
      Proof
      (*.f64 -4 (/.f64 (*.f64 b b) (/.f64 (*.f64 (*.f64 y-scale x-scale) (*.f64 y-scale x-scale)) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 b 2)) (/.f64 (*.f64 (*.f64 y-scale x-scale) (*.f64 y-scale x-scale)) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 y-scale y-scale) (*.f64 x-scale x-scale))) (*.f64 a a)))): 36 points increase in error, 4 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 y-scale 2)) (*.f64 x-scale x-scale)) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (*.f64 (pow.f64 y-scale 2) (Rewrite<= unpow2_binary64 (pow.f64 x-scale 2))) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)) (Rewrite<= unpow2_binary64 (pow.f64 a 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 b 2) (pow.f64 a 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2))))): 7 points increase in error, 6 points decrease in error
      (*.f64 -4 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 a 2) (pow.f64 b 2))) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)))): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr12.9

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

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

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

    if -9.9999999999999997e199 < a < -9.99999999999999981e149

    1. Initial program 62.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. Taylor expanded in angle around 0 62.8

      \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
    3. Simplified61.7

      \[\leadsto \color{blue}{-4 \cdot \frac{b \cdot b}{\frac{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}{a \cdot a}}} \]
      Proof
      (*.f64 -4 (/.f64 (*.f64 b b) (/.f64 (*.f64 (*.f64 y-scale x-scale) (*.f64 y-scale x-scale)) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 b 2)) (/.f64 (*.f64 (*.f64 y-scale x-scale) (*.f64 y-scale x-scale)) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 y-scale y-scale) (*.f64 x-scale x-scale))) (*.f64 a a)))): 36 points increase in error, 4 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 y-scale 2)) (*.f64 x-scale x-scale)) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (*.f64 (pow.f64 y-scale 2) (Rewrite<= unpow2_binary64 (pow.f64 x-scale 2))) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)) (Rewrite<= unpow2_binary64 (pow.f64 a 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 b 2) (pow.f64 a 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2))))): 7 points increase in error, 6 points decrease in error
      (*.f64 -4 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 a 2) (pow.f64 b 2))) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)))): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr6.8

      \[\leadsto -4 \cdot \color{blue}{\left(\frac{b}{\frac{y-scale}{\frac{a}{x-scale}}} \cdot \frac{b}{\frac{y-scale}{\frac{a}{x-scale}}}\right)} \]
    5. Taylor expanded in b around 0 62.8

      \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
    6. Simplified24.0

      \[\leadsto \color{blue}{\left(\frac{a}{y-scale} \cdot \frac{a}{y-scale}\right) \cdot \left(-4 \cdot \left(\frac{b}{x-scale} \cdot \frac{b}{x-scale}\right)\right)} \]
      Proof
      (*.f64 (*.f64 (/.f64 a y-scale) (/.f64 a y-scale)) (*.f64 -4 (*.f64 (/.f64 b x-scale) (/.f64 b x-scale)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 a a) (*.f64 y-scale y-scale))) (*.f64 -4 (*.f64 (/.f64 b x-scale) (/.f64 b x-scale)))): 59 points increase in error, 12 points decrease in error
      (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 a 2)) (*.f64 y-scale y-scale)) (*.f64 -4 (*.f64 (/.f64 b x-scale) (/.f64 b x-scale)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 a 2) (Rewrite<= unpow2_binary64 (pow.f64 y-scale 2))) (*.f64 -4 (*.f64 (/.f64 b x-scale) (/.f64 b x-scale)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 a 2) (pow.f64 y-scale 2)) (*.f64 -4 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 b b) (*.f64 x-scale x-scale))))): 42 points increase in error, 5 points decrease in error
      (*.f64 (/.f64 (pow.f64 a 2) (pow.f64 y-scale 2)) (*.f64 -4 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 b 2)) (*.f64 x-scale x-scale)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 a 2) (pow.f64 y-scale 2)) (*.f64 -4 (/.f64 (pow.f64 b 2) (Rewrite<= unpow2_binary64 (pow.f64 x-scale 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 a 2) (pow.f64 y-scale 2)) (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (pow.f64 b 2) (pow.f64 x-scale 2)) -4))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (/.f64 (pow.f64 a 2) (pow.f64 y-scale 2)) (/.f64 (pow.f64 b 2) (pow.f64 x-scale 2))) -4)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (pow.f64 a 2) (pow.f64 b 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)))) -4): 13 points increase in error, 12 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 -4 (/.f64 (*.f64 (pow.f64 a 2) (pow.f64 b 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2))))): 0 points increase in error, 0 points decrease in error

    if -9.99999999999999981e149 < a

    1. Initial program 38.8

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

      \[\leadsto \color{blue}{-4 \cdot \frac{{a}^{2} \cdot {b}^{2}}{{y-scale}^{2} \cdot {x-scale}^{2}}} \]
    3. Simplified28.9

      \[\leadsto \color{blue}{-4 \cdot \frac{b \cdot b}{\frac{\left(y-scale \cdot x-scale\right) \cdot \left(y-scale \cdot x-scale\right)}{a \cdot a}}} \]
      Proof
      (*.f64 -4 (/.f64 (*.f64 b b) (/.f64 (*.f64 (*.f64 y-scale x-scale) (*.f64 y-scale x-scale)) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 b 2)) (/.f64 (*.f64 (*.f64 y-scale x-scale) (*.f64 y-scale x-scale)) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 y-scale y-scale) (*.f64 x-scale x-scale))) (*.f64 a a)))): 36 points increase in error, 4 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 y-scale 2)) (*.f64 x-scale x-scale)) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (*.f64 (pow.f64 y-scale 2) (Rewrite<= unpow2_binary64 (pow.f64 x-scale 2))) (*.f64 a a)))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (/.f64 (pow.f64 b 2) (/.f64 (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)) (Rewrite<= unpow2_binary64 (pow.f64 a 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 -4 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 b 2) (pow.f64 a 2)) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2))))): 7 points increase in error, 6 points decrease in error
      (*.f64 -4 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 a 2) (pow.f64 b 2))) (*.f64 (pow.f64 y-scale 2) (pow.f64 x-scale 2)))): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr5.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{+200}:\\ \;\;\;\;-4 \cdot \left(\frac{b}{\frac{y-scale}{\frac{a}{x-scale}}} \cdot \frac{\frac{a}{x-scale}}{\frac{y-scale}{b}}\right)\\ \mathbf{elif}\;a \leq -1 \cdot 10^{+150}:\\ \;\;\;\;\left(\frac{a}{y-scale} \cdot \frac{a}{y-scale}\right) \cdot \left(-4 \cdot \left(\frac{b}{x-scale} \cdot \frac{b}{x-scale}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(\frac{b}{\frac{y-scale}{\frac{a}{x-scale}}} \cdot \frac{b}{\frac{y-scale}{\frac{a}{x-scale}}}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error7.9
Cost1616
\[\begin{array}{l} t_0 := -4 \cdot \left(\frac{b}{\frac{y-scale}{\frac{a}{x-scale}}} \cdot \frac{\frac{a}{x-scale}}{\frac{y-scale}{b}}\right)\\ \mathbf{if}\;a \leq -1 \cdot 10^{+200}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq -1 \cdot 10^{+150}:\\ \;\;\;\;\left(\frac{a}{y-scale} \cdot \frac{a}{y-scale}\right) \cdot \left(-4 \cdot \left(\frac{b}{x-scale} \cdot \frac{b}{x-scale}\right)\right)\\ \mathbf{elif}\;a \leq 2.755161035392787 \cdot 10^{-191}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 10^{+38}:\\ \;\;\;\;-4 \cdot \left(\left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right) \cdot \frac{b}{x-scale \cdot \frac{y-scale}{a}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error7.9
Cost1352
\[\begin{array}{l} t_0 := -4 \cdot \left(\frac{b}{\frac{y-scale}{\frac{a}{x-scale}}} \cdot \frac{\frac{a}{x-scale}}{\frac{y-scale}{b}}\right)\\ \mathbf{if}\;b \leq 7.429007657424178 \cdot 10^{-187}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 10^{+140}:\\ \;\;\;\;-4 \cdot \left(\frac{b}{\frac{y-scale \cdot x-scale}{a}} \cdot \frac{a}{y-scale \cdot \frac{x-scale}{b}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error7.5
Cost1352
\[\begin{array}{l} t_0 := -4 \cdot \left(\frac{b}{\frac{y-scale}{\frac{a}{x-scale}}} \cdot \frac{\frac{a}{x-scale}}{\frac{y-scale}{b}}\right)\\ \mathbf{if}\;a \leq 2.755161035392787 \cdot 10^{-191}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 10^{+38}:\\ \;\;\;\;-4 \cdot \left(\left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right) \cdot \frac{b}{x-scale \cdot \frac{y-scale}{a}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error6.5
Cost1352
\[\begin{array}{l} t_0 := \frac{b}{\frac{y-scale}{\frac{a}{x-scale}}}\\ \mathbf{if}\;a \leq -1 \cdot 10^{+200}:\\ \;\;\;\;-4 \cdot \left(t_0 \cdot \frac{\frac{a}{x-scale}}{\frac{y-scale}{b}}\right)\\ \mathbf{elif}\;a \leq -1 \cdot 10^{+150}:\\ \;\;\;\;\left(\frac{a}{y-scale} \cdot \frac{a}{y-scale}\right) \cdot \left(-4 \cdot \left(\frac{b}{x-scale} \cdot \frac{b}{x-scale}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(t_0 \cdot \left(b \cdot \frac{\frac{a}{x-scale}}{y-scale}\right)\right)\\ \end{array} \]
Alternative 5
Error7.4
Cost1088
\[-4 \cdot \left(\frac{b}{\frac{y-scale}{\frac{a}{x-scale}}} \cdot \frac{\frac{a}{x-scale}}{\frac{y-scale}{b}}\right) \]
Alternative 6
Error30.4
Cost64
\[0 \]

Error

Reproduce

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