Average Error: 40.6 → 28.8
Time: 1.3min
Precision: binary64
\[\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 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ t_1 := \cos t_0\\ t_2 := \sin t_0\\ t_3 := \frac{\frac{\left(\frac{{t_1}^{4}}{y-scale} \cdot \frac{\left(a \cdot a\right) \cdot \left(b \cdot b\right)}{y-scale}\right) \cdot -4 - \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {t_2}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{t_1}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {t_2}^{2}\right)\right)}{{y-scale}^{2}}\right)}{x-scale}}{x-scale}\\ \mathbf{if}\;a \leq -6.23095968638436 \cdot 10^{+117}:\\ \;\;\;\;0\\ \mathbf{elif}\;a \leq -18583950342857.074:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 1.10619655335694 \cdot 10^{-159}:\\ \;\;\;\;0\\ \mathbf{elif}\;a \leq 3.5193137662112773 \cdot 10^{+146}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;0\\ \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 (* 0.005555555555555556 (* angle PI)))
        (t_1 (cos t_0))
        (t_2 (sin t_0))
        (t_3
         (/
          (/
           (-
            (*
             (* (/ (pow t_1 4.0) y-scale) (/ (* (* a a) (* b b)) y-scale))
             -4.0)
            (+
             (*
              4.0
              (/
               (* (pow a 2.0) (* (pow b 2.0) (pow t_2 4.0)))
               (pow y-scale 2.0)))
             (*
              8.0
              (/
               (* (pow t_1 2.0) (* (pow a 2.0) (* (pow b 2.0) (pow t_2 2.0))))
               (pow y-scale 2.0)))))
           x-scale)
          x-scale)))
   (if (<= a -6.23095968638436e+117)
     0.0
     (if (<= a -18583950342857.074)
       t_3
       (if (<= a 1.10619655335694e-159)
         0.0
         (if (<= a 3.5193137662112773e+146) t_3 0.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 = 0.005555555555555556 * (angle * ((double) M_PI));
	double t_1 = cos(t_0);
	double t_2 = sin(t_0);
	double t_3 = (((((pow(t_1, 4.0) / y_45_scale) * (((a * a) * (b * b)) / y_45_scale)) * -4.0) - ((4.0 * ((pow(a, 2.0) * (pow(b, 2.0) * pow(t_2, 4.0))) / pow(y_45_scale, 2.0))) + (8.0 * ((pow(t_1, 2.0) * (pow(a, 2.0) * (pow(b, 2.0) * pow(t_2, 2.0)))) / pow(y_45_scale, 2.0))))) / x_45_scale) / x_45_scale;
	double tmp;
	if (a <= -6.23095968638436e+117) {
		tmp = 0.0;
	} else if (a <= -18583950342857.074) {
		tmp = t_3;
	} else if (a <= 1.10619655335694e-159) {
		tmp = 0.0;
	} else if (a <= 3.5193137662112773e+146) {
		tmp = t_3;
	} else {
		tmp = 0.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 = 0.005555555555555556 * (angle * Math.PI);
	double t_1 = Math.cos(t_0);
	double t_2 = Math.sin(t_0);
	double t_3 = (((((Math.pow(t_1, 4.0) / y_45_scale) * (((a * a) * (b * b)) / y_45_scale)) * -4.0) - ((4.0 * ((Math.pow(a, 2.0) * (Math.pow(b, 2.0) * Math.pow(t_2, 4.0))) / Math.pow(y_45_scale, 2.0))) + (8.0 * ((Math.pow(t_1, 2.0) * (Math.pow(a, 2.0) * (Math.pow(b, 2.0) * Math.pow(t_2, 2.0)))) / Math.pow(y_45_scale, 2.0))))) / x_45_scale) / x_45_scale;
	double tmp;
	if (a <= -6.23095968638436e+117) {
		tmp = 0.0;
	} else if (a <= -18583950342857.074) {
		tmp = t_3;
	} else if (a <= 1.10619655335694e-159) {
		tmp = 0.0;
	} else if (a <= 3.5193137662112773e+146) {
		tmp = t_3;
	} else {
		tmp = 0.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 = 0.005555555555555556 * (angle * math.pi)
	t_1 = math.cos(t_0)
	t_2 = math.sin(t_0)
	t_3 = (((((math.pow(t_1, 4.0) / y_45_scale) * (((a * a) * (b * b)) / y_45_scale)) * -4.0) - ((4.0 * ((math.pow(a, 2.0) * (math.pow(b, 2.0) * math.pow(t_2, 4.0))) / math.pow(y_45_scale, 2.0))) + (8.0 * ((math.pow(t_1, 2.0) * (math.pow(a, 2.0) * (math.pow(b, 2.0) * math.pow(t_2, 2.0)))) / math.pow(y_45_scale, 2.0))))) / x_45_scale) / x_45_scale
	tmp = 0
	if a <= -6.23095968638436e+117:
		tmp = 0.0
	elif a <= -18583950342857.074:
		tmp = t_3
	elif a <= 1.10619655335694e-159:
		tmp = 0.0
	elif a <= 3.5193137662112773e+146:
		tmp = t_3
	else:
		tmp = 0.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(0.005555555555555556 * Float64(angle * pi))
	t_1 = cos(t_0)
	t_2 = sin(t_0)
	t_3 = Float64(Float64(Float64(Float64(Float64(Float64((t_1 ^ 4.0) / y_45_scale) * Float64(Float64(Float64(a * a) * Float64(b * b)) / y_45_scale)) * -4.0) - Float64(Float64(4.0 * Float64(Float64((a ^ 2.0) * Float64((b ^ 2.0) * (t_2 ^ 4.0))) / (y_45_scale ^ 2.0))) + Float64(8.0 * Float64(Float64((t_1 ^ 2.0) * Float64((a ^ 2.0) * Float64((b ^ 2.0) * (t_2 ^ 2.0)))) / (y_45_scale ^ 2.0))))) / x_45_scale) / x_45_scale)
	tmp = 0.0
	if (a <= -6.23095968638436e+117)
		tmp = 0.0;
	elseif (a <= -18583950342857.074)
		tmp = t_3;
	elseif (a <= 1.10619655335694e-159)
		tmp = 0.0;
	elseif (a <= 3.5193137662112773e+146)
		tmp = t_3;
	else
		tmp = 0.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 = 0.005555555555555556 * (angle * pi);
	t_1 = cos(t_0);
	t_2 = sin(t_0);
	t_3 = ((((((t_1 ^ 4.0) / y_45_scale) * (((a * a) * (b * b)) / y_45_scale)) * -4.0) - ((4.0 * (((a ^ 2.0) * ((b ^ 2.0) * (t_2 ^ 4.0))) / (y_45_scale ^ 2.0))) + (8.0 * (((t_1 ^ 2.0) * ((a ^ 2.0) * ((b ^ 2.0) * (t_2 ^ 2.0)))) / (y_45_scale ^ 2.0))))) / x_45_scale) / x_45_scale;
	tmp = 0.0;
	if (a <= -6.23095968638436e+117)
		tmp = 0.0;
	elseif (a <= -18583950342857.074)
		tmp = t_3;
	elseif (a <= 1.10619655335694e-159)
		tmp = 0.0;
	elseif (a <= 3.5193137662112773e+146)
		tmp = t_3;
	else
		tmp = 0.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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(N[(N[Power[t$95$1, 4.0], $MachinePrecision] / y$45$scale), $MachinePrecision] * N[(N[(N[(a * a), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] / y$45$scale), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision] - N[(N[(4.0 * N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[b, 2.0], $MachinePrecision] * N[Power[t$95$2, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[y$45$scale, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(8.0 * N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[b, 2.0], $MachinePrecision] * N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[y$45$scale, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision] / x$45$scale), $MachinePrecision]}, If[LessEqual[a, -6.23095968638436e+117], 0.0, If[LessEqual[a, -18583950342857.074], t$95$3, If[LessEqual[a, 1.10619655335694e-159], 0.0, If[LessEqual[a, 3.5193137662112773e+146], t$95$3, 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}
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t_0\\
t_2 := \sin t_0\\
t_3 := \frac{\frac{\left(\frac{{t_1}^{4}}{y-scale} \cdot \frac{\left(a \cdot a\right) \cdot \left(b \cdot b\right)}{y-scale}\right) \cdot -4 - \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {t_2}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{t_1}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {t_2}^{2}\right)\right)}{{y-scale}^{2}}\right)}{x-scale}}{x-scale}\\
\mathbf{if}\;a \leq -6.23095968638436 \cdot 10^{+117}:\\
\;\;\;\;0\\

\mathbf{elif}\;a \leq -18583950342857.074:\\
\;\;\;\;t_3\\

\mathbf{elif}\;a \leq 1.10619655335694 \cdot 10^{-159}:\\
\;\;\;\;0\\

\mathbf{elif}\;a \leq 3.5193137662112773 \cdot 10^{+146}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;0\\


\end{array}

Error

Bits error versus a

Bits error versus b

Bits error versus angle

Bits error versus x-scale

Bits error versus y-scale

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if a < -6.2309596863843603e117 or -18583950342857.0742 < a < 1.10619655335693999e-159 or 3.51931376621127728e146 < a

    1. Initial program 40.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 b around 0 40.7

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

      \[\leadsto \color{blue}{0} \]

    if -6.2309596863843603e117 < a < -18583950342857.0742 or 1.10619655335693999e-159 < a < 3.51931376621127728e146

    1. Initial program 40.2

      \[\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale} \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 x-scale around 0 33.9

      \[\leadsto \color{blue}{-1 \cdot \frac{4 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4} \cdot \left({a}^{2} \cdot {b}^{2}\right)}{{y-scale}^{2}} + \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{{y-scale}^{2}}\right)}{{x-scale}^{2}}} \]
    3. Applied add-sqr-sqrt_binary6448.4

      \[\leadsto -1 \cdot \frac{4 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4} \cdot \left({a}^{2} \cdot {b}^{2}\right)}{{\color{blue}{\left(\sqrt{y-scale} \cdot \sqrt{y-scale}\right)}}^{2}} + \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{{y-scale}^{2}}\right)}{{x-scale}^{2}} \]
    4. Applied unpow-prod-down_binary6448.4

      \[\leadsto -1 \cdot \frac{4 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4} \cdot \left({a}^{2} \cdot {b}^{2}\right)}{\color{blue}{{\left(\sqrt{y-scale}\right)}^{2} \cdot {\left(\sqrt{y-scale}\right)}^{2}}} + \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{{y-scale}^{2}}\right)}{{x-scale}^{2}} \]
    5. Applied times-frac_binary6448.1

      \[\leadsto -1 \cdot \frac{4 \cdot \color{blue}{\left(\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}}{{\left(\sqrt{y-scale}\right)}^{2}} \cdot \frac{{a}^{2} \cdot {b}^{2}}{{\left(\sqrt{y-scale}\right)}^{2}}\right)} + \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{{y-scale}^{2}}\right)}{{x-scale}^{2}} \]
    6. Simplified48.1

      \[\leadsto -1 \cdot \frac{4 \cdot \left(\color{blue}{\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}}{y-scale}} \cdot \frac{{a}^{2} \cdot {b}^{2}}{{\left(\sqrt{y-scale}\right)}^{2}}\right) + \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{{y-scale}^{2}}\right)}{{x-scale}^{2}} \]
    7. Simplified33.4

      \[\leadsto -1 \cdot \frac{4 \cdot \left(\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}}{y-scale} \cdot \color{blue}{\frac{\left(a \cdot a\right) \cdot \left(b \cdot b\right)}{y-scale}}\right) + \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{{y-scale}^{2}}\right)}{{x-scale}^{2}} \]
    8. Applied unpow2_binary6433.4

      \[\leadsto -1 \cdot \frac{4 \cdot \left(\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}}{y-scale} \cdot \frac{\left(a \cdot a\right) \cdot \left(b \cdot b\right)}{y-scale}\right) + \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{{y-scale}^{2}}\right)}{\color{blue}{x-scale \cdot x-scale}} \]
    9. Applied associate-/r*_binary6430.0

      \[\leadsto -1 \cdot \color{blue}{\frac{\frac{4 \cdot \left(\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}}{y-scale} \cdot \frac{\left(a \cdot a\right) \cdot \left(b \cdot b\right)}{y-scale}\right) + \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{{y-scale}^{2}}\right)}{x-scale}}{x-scale}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification28.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.23095968638436 \cdot 10^{+117}:\\ \;\;\;\;0\\ \mathbf{elif}\;a \leq -18583950342857.074:\\ \;\;\;\;\frac{\frac{\left(\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}}{y-scale} \cdot \frac{\left(a \cdot a\right) \cdot \left(b \cdot b\right)}{y-scale}\right) \cdot -4 - \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{{y-scale}^{2}}\right)}{x-scale}}{x-scale}\\ \mathbf{elif}\;a \leq 1.10619655335694 \cdot 10^{-159}:\\ \;\;\;\;0\\ \mathbf{elif}\;a \leq 3.5193137662112773 \cdot 10^{+146}:\\ \;\;\;\;\frac{\frac{\left(\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}}{y-scale} \cdot \frac{\left(a \cdot a\right) \cdot \left(b \cdot b\right)}{y-scale}\right) \cdot -4 - \left(4 \cdot \frac{{a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{4}\right)}{{y-scale}^{2}} + 8 \cdot \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot \left({a}^{2} \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}{{y-scale}^{2}}\right)}{x-scale}}{x-scale}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]

Reproduce

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