| Alternative 1 | |
|---|---|
| Error | 51.4 |
| Cost | 14292 |
(FPCore (a b angle x-scale y-scale)
:precision binary64
(/
(-
(sqrt
(*
(*
(* 2.0 (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0)))
(* (* b a) (* b (- a))))
(+
(+
(/
(/
(+
(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))
(sqrt
(+
(pow
(-
(/
(/
(+
(pow (* a (sin (* (/ angle 180.0) PI))) 2.0)
(pow (* b (cos (* (/ angle 180.0) PI))) 2.0))
x-scale)
x-scale)
(/
(/
(+
(pow (* a (cos (* (/ angle 180.0) PI))) 2.0)
(pow (* b (sin (* (/ angle 180.0) PI))) 2.0))
y-scale)
y-scale))
2.0)
(pow
(/
(/
(*
(*
(* 2.0 (- (pow b 2.0) (pow a 2.0)))
(sin (* (/ angle 180.0) PI)))
(cos (* (/ angle 180.0) PI)))
x-scale)
y-scale)
2.0)))))))
(/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0))))(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* PI (* 0.005555555555555556 angle))))
(if (<= x-scale -3.3e-93)
(*
0.25
(*
-1.0
(*
(* (sqrt 2.0) (* x-scale (sqrt 8.0)))
(sqrt
(+
(* (pow a 2.0) (pow (cos t_0) 2.0))
(* (pow b 2.0) (pow (sin t_0) 2.0)))))))
(if (<= x-scale 8.2e-104)
(*
0.25
(-
(*
(cos (* PI (* angle 0.005555555555555556)))
(* b (* 4.0 y-scale)))))
(*
0.25
(*
x-scale
(sqrt
(*
8.0
(*
2.0
(+ (pow (* (cos t_1) a) 2.0) (pow (* (sin t_1) b) 2.0)))))))))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return -sqrt((((2.0 * ((4.0 * ((b * a) * (b * -a))) / pow((x_45_scale * y_45_scale), 2.0))) * ((b * a) * (b * -a))) * (((((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)) + sqrt((pow(((((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)), 2.0) + pow((((((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)))))) / ((4.0 * ((b * a) * (b * -a))) / pow((x_45_scale * y_45_scale), 2.0));
}
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = ((double) M_PI) * (0.005555555555555556 * angle);
double tmp;
if (x_45_scale <= -3.3e-93) {
tmp = 0.25 * (-1.0 * ((sqrt(2.0) * (x_45_scale * sqrt(8.0))) * sqrt(((pow(a, 2.0) * pow(cos(t_0), 2.0)) + (pow(b, 2.0) * pow(sin(t_0), 2.0))))));
} else if (x_45_scale <= 8.2e-104) {
tmp = 0.25 * -(cos((((double) M_PI) * (angle * 0.005555555555555556))) * (b * (4.0 * y_45_scale)));
} else {
tmp = 0.25 * (x_45_scale * sqrt((8.0 * (2.0 * (pow((cos(t_1) * a), 2.0) + pow((sin(t_1) * b), 2.0))))));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return -Math.sqrt((((2.0 * ((4.0 * ((b * a) * (b * -a))) / Math.pow((x_45_scale * y_45_scale), 2.0))) * ((b * a) * (b * -a))) * (((((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)) + Math.sqrt((Math.pow(((((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)), 2.0) + Math.pow((((((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)))))) / ((4.0 * ((b * a) * (b * -a))) / Math.pow((x_45_scale * y_45_scale), 2.0));
}
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.PI * (0.005555555555555556 * angle);
double tmp;
if (x_45_scale <= -3.3e-93) {
tmp = 0.25 * (-1.0 * ((Math.sqrt(2.0) * (x_45_scale * Math.sqrt(8.0))) * Math.sqrt(((Math.pow(a, 2.0) * Math.pow(Math.cos(t_0), 2.0)) + (Math.pow(b, 2.0) * Math.pow(Math.sin(t_0), 2.0))))));
} else if (x_45_scale <= 8.2e-104) {
tmp = 0.25 * -(Math.cos((Math.PI * (angle * 0.005555555555555556))) * (b * (4.0 * y_45_scale)));
} else {
tmp = 0.25 * (x_45_scale * Math.sqrt((8.0 * (2.0 * (Math.pow((Math.cos(t_1) * a), 2.0) + Math.pow((Math.sin(t_1) * b), 2.0))))));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): return -math.sqrt((((2.0 * ((4.0 * ((b * a) * (b * -a))) / math.pow((x_45_scale * y_45_scale), 2.0))) * ((b * a) * (b * -a))) * (((((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)) + math.sqrt((math.pow(((((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)), 2.0) + math.pow((((((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)))))) / ((4.0 * ((b * a) * (b * -a))) / math.pow((x_45_scale * y_45_scale), 2.0))
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.pi * (0.005555555555555556 * angle) tmp = 0 if x_45_scale <= -3.3e-93: tmp = 0.25 * (-1.0 * ((math.sqrt(2.0) * (x_45_scale * math.sqrt(8.0))) * math.sqrt(((math.pow(a, 2.0) * math.pow(math.cos(t_0), 2.0)) + (math.pow(b, 2.0) * math.pow(math.sin(t_0), 2.0)))))) elif x_45_scale <= 8.2e-104: tmp = 0.25 * -(math.cos((math.pi * (angle * 0.005555555555555556))) * (b * (4.0 * y_45_scale))) else: tmp = 0.25 * (x_45_scale * math.sqrt((8.0 * (2.0 * (math.pow((math.cos(t_1) * a), 2.0) + math.pow((math.sin(t_1) * b), 2.0)))))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) return Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * Float64(Float64(4.0 * Float64(Float64(b * a) * Float64(b * Float64(-a)))) / (Float64(x_45_scale * y_45_scale) ^ 2.0))) * Float64(Float64(b * a) * Float64(b * Float64(-a)))) * Float64(Float64(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)) + sqrt(Float64((Float64(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)) ^ 2.0) + (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) ^ 2.0))))))) / Float64(Float64(4.0 * Float64(Float64(b * a) * Float64(b * Float64(-a)))) / (Float64(x_45_scale * y_45_scale) ^ 2.0))) end
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(pi * Float64(0.005555555555555556 * angle)) tmp = 0.0 if (x_45_scale <= -3.3e-93) tmp = Float64(0.25 * Float64(-1.0 * Float64(Float64(sqrt(2.0) * Float64(x_45_scale * sqrt(8.0))) * sqrt(Float64(Float64((a ^ 2.0) * (cos(t_0) ^ 2.0)) + Float64((b ^ 2.0) * (sin(t_0) ^ 2.0))))))); elseif (x_45_scale <= 8.2e-104) tmp = Float64(0.25 * Float64(-Float64(cos(Float64(pi * Float64(angle * 0.005555555555555556))) * Float64(b * Float64(4.0 * y_45_scale))))); else tmp = Float64(0.25 * Float64(x_45_scale * sqrt(Float64(8.0 * Float64(2.0 * Float64((Float64(cos(t_1) * a) ^ 2.0) + (Float64(sin(t_1) * b) ^ 2.0))))))); end return tmp end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) tmp = -sqrt((((2.0 * ((4.0 * ((b * a) * (b * -a))) / ((x_45_scale * y_45_scale) ^ 2.0))) * ((b * a) * (b * -a))) * (((((((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)) + sqrt(((((((((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)) ^ 2.0) + ((((((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)))))) / ((4.0 * ((b * a) * (b * -a))) / ((x_45_scale * y_45_scale) ^ 2.0)); end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); t_1 = pi * (0.005555555555555556 * angle); tmp = 0.0; if (x_45_scale <= -3.3e-93) tmp = 0.25 * (-1.0 * ((sqrt(2.0) * (x_45_scale * sqrt(8.0))) * sqrt((((a ^ 2.0) * (cos(t_0) ^ 2.0)) + ((b ^ 2.0) * (sin(t_0) ^ 2.0)))))); elseif (x_45_scale <= 8.2e-104) tmp = 0.25 * -(cos((pi * (angle * 0.005555555555555556))) * (b * (4.0 * y_45_scale))); else tmp = 0.25 * (x_45_scale * sqrt((8.0 * (2.0 * (((cos(t_1) * a) ^ 2.0) + ((sin(t_1) * b) ^ 2.0)))))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[((-N[Sqrt[N[(N[(N[(2.0 * N[(N[(4.0 * N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[(x$45$scale * y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(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] + 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] + N[Sqrt[N[(N[Power[N[(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] - 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], 2.0], $MachinePrecision] + N[Power[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], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(4.0 * N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[(x$45$scale * y$45$scale), $MachinePrecision], 2.0], $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[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -3.3e-93], N[(0.25 * N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[N[Cos[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] * N[Power[N[Sin[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 8.2e-104], N[(0.25 * (-N[(N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b * N[(4.0 * y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(0.25 * N[(x$45$scale * N[Sqrt[N[(8.0 * N[(2.0 * N[(N[Power[N[(N[Cos[t$95$1], $MachinePrecision] * a), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Sin[t$95$1], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}}
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
\mathbf{if}\;x-scale \leq -3.3 \cdot 10^{-93}:\\
\;\;\;\;0.25 \cdot \left(-1 \cdot \left(\left(\sqrt{2} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{{a}^{2} \cdot {\cos t_0}^{2} + {b}^{2} \cdot {\sin t_0}^{2}}\right)\right)\\
\mathbf{elif}\;x-scale \leq 8.2 \cdot 10^{-104}:\\
\;\;\;\;0.25 \cdot \left(-\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(b \cdot \left(4 \cdot y-scale\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(x-scale \cdot \sqrt{8 \cdot \left(2 \cdot \left({\left(\cos t_1 \cdot a\right)}^{2} + {\left(\sin t_1 \cdot b\right)}^{2}\right)\right)}\right)\\
\end{array}
Results
if x-scale < -3.3000000000000001e-93Initial program 63.2
Simplified63.1
[Start]63.2 | \[ \frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}}
\] |
|---|
Taylor expanded in x-scale around inf 60.2
Simplified59.8
[Start]60.2 | \[ 0.25 \cdot \left(\left(y-scale \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \frac{{a}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{y-scale}^{2}} + 2 \cdot \frac{{b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{y-scale}^{2}}}\right)
\] |
|---|---|
rational_best-simplify-47 [=>]60.2 | \[ 0.25 \cdot \left(\left(y-scale \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left(\frac{{b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{y-scale}^{2}} + \frac{{a}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{y-scale}^{2}}\right)}}\right)
\] |
rational_best-simplify-1 [=>]60.2 | \[ 0.25 \cdot \left(\left(y-scale \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \color{blue}{\left(\frac{{a}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{y-scale}^{2}} + \frac{{b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{y-scale}^{2}}\right)}}\right)
\] |
exponential-simplify-27 [=>]60.2 | \[ 0.25 \cdot \left(\left(y-scale \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left(\frac{\color{blue}{{\left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot a\right)}^{2}}}{{y-scale}^{2}} + \frac{{b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}{{y-scale}^{2}}\right)}\right)
\] |
Taylor expanded in y-scale around -inf 46.3
if -3.3000000000000001e-93 < x-scale < 8.19999999999999968e-104Initial program 63.8
Simplified63.8
[Start]63.8 | \[ \frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}}
\] |
|---|
Taylor expanded in x-scale around 0 53.1
Simplified51.3
[Start]53.1 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{{b}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} + \left(2 \cdot \left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right) + {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {b}^{2}\right)}\right)
\] |
|---|---|
rational_best-simplify-2 [<=]53.1 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{\color{blue}{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {b}^{2}} + \left(2 \cdot \left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right) + {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {b}^{2}\right)}\right)
\] |
exponential-simplify-27 [=>]53.1 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{\color{blue}{{\left(b \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}} + \left(2 \cdot \left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right) + {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {b}^{2}\right)}\right)
\] |
rational_best-simplify-1 [=>]53.1 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{{\left(b \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} + \color{blue}{\left({\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {b}^{2} + 2 \cdot \left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}}\right)
\] |
exponential-simplify-27 [=>]53.1 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{{\left(b \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} + \left(\color{blue}{{\left(b \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}} + 2 \cdot \left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}\right)
\] |
Taylor expanded in angle around inf 53.1
Simplified51.3
[Start]53.1 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right) + 2 \cdot \left({\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {b}^{2}\right)}\right)
\] |
|---|---|
rational_best-simplify-1 [=>]53.1 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{\color{blue}{2 \cdot \left({\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} \cdot {b}^{2}\right) + 2 \cdot \left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}}\right)
\] |
rational_best-simplify-2 [=>]53.1 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \color{blue}{\left({b}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)} + 2 \cdot \left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}\right)
\] |
rational_best-simplify-47 [=>]53.1 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}}\right)
\] |
exponential-simplify-27 [=>]51.3 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left(\color{blue}{{\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot a\right)}^{2}} + {b}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}\right)
\] |
trig-simplify-13 [=>]51.3 | \[ 0.25 \cdot \left(\left(y-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \color{blue}{\left({b}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} + {\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot a\right)}^{2}\right)}}\right)
\] |
Taylor expanded in b around -inf 50.0
Simplified49.8
[Start]50.0 | \[ 0.25 \cdot \left(-1 \cdot \left(\sqrt{2} \cdot \left(y-scale \cdot \left(b \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sqrt{8}\right)\right)\right)\right)\right)
\] |
|---|---|
rational_best-simplify-2 [=>]50.0 | \[ 0.25 \cdot \color{blue}{\left(\left(\sqrt{2} \cdot \left(y-scale \cdot \left(b \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sqrt{8}\right)\right)\right)\right) \cdot -1\right)}
\] |
rational_best-simplify-44 [<=]50.0 | \[ 0.25 \cdot \left(\color{blue}{\left(y-scale \cdot \left(\sqrt{2} \cdot \left(b \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sqrt{8}\right)\right)\right)\right)} \cdot -1\right)
\] |
rational_best-simplify-12 [=>]50.0 | \[ 0.25 \cdot \color{blue}{\left(-y-scale \cdot \left(\sqrt{2} \cdot \left(b \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sqrt{8}\right)\right)\right)\right)}
\] |
rational_best-simplify-2 [=>]50.0 | \[ 0.25 \cdot \left(-y-scale \cdot \color{blue}{\left(\left(b \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \sqrt{8}\right)\right) \cdot \sqrt{2}\right)}\right)
\] |
rational_best-simplify-44 [<=]50.0 | \[ 0.25 \cdot \left(-y-scale \cdot \left(\color{blue}{\left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b \cdot \sqrt{8}\right)\right)} \cdot \sqrt{2}\right)\right)
\] |
rational_best-simplify-2 [<=]50.0 | \[ 0.25 \cdot \left(-y-scale \cdot \color{blue}{\left(\sqrt{2} \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b \cdot \sqrt{8}\right)\right)\right)}\right)
\] |
rational_best-simplify-44 [=>]50.0 | \[ 0.25 \cdot \left(-y-scale \cdot \color{blue}{\left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sqrt{2} \cdot \left(b \cdot \sqrt{8}\right)\right)\right)}\right)
\] |
rational_best-simplify-44 [=>]50.0 | \[ 0.25 \cdot \left(-\color{blue}{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \left(b \cdot \sqrt{8}\right)\right)\right)}\right)
\] |
if 8.19999999999999968e-104 < x-scale Initial program 63.1
Simplified63.0
[Start]63.1 | \[ \frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}}
\] |
|---|
Taylor expanded in y-scale around 0 46.9
Simplified44.1
[Start]46.9 | \[ 0.25 \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)}\right)
\] |
|---|---|
rational_best-simplify-2 [=>]46.9 | \[ 0.25 \cdot \color{blue}{\left(\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)} \cdot \left(x-scale \cdot \sqrt{8}\right)\right)}
\] |
rational_best-simplify-44 [=>]46.9 | \[ 0.25 \cdot \color{blue}{\left(x-scale \cdot \left(\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)} \cdot \sqrt{8}\right)\right)}
\] |
exponential-simplify-19 [=>]46.8 | \[ 0.25 \cdot \left(x-scale \cdot \color{blue}{\sqrt{8 \cdot \left(2 \cdot \left({a}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}}\right)
\] |
rational_best-simplify-47 [=>]46.8 | \[ 0.25 \cdot \left(x-scale \cdot \sqrt{8 \cdot \color{blue}{\left(2 \cdot \left({b}^{2} \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2} + {a}^{2} \cdot {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\right)\right)}}\right)
\] |
Final simplification47.0
| Alternative 1 | |
|---|---|
| Error | 51.4 |
| Cost | 14292 |
| Alternative 2 | |
|---|---|
| Error | 51.4 |
| Cost | 14292 |
| Alternative 3 | |
|---|---|
| Error | 51.5 |
| Cost | 14292 |
| Alternative 4 | |
|---|---|
| Error | 51.4 |
| Cost | 14228 |
| Alternative 5 | |
|---|---|
| Error | 51.4 |
| Cost | 13964 |
| Alternative 6 | |
|---|---|
| Error | 51.4 |
| Cost | 13964 |
| Alternative 7 | |
|---|---|
| Error | 51.4 |
| Cost | 1040 |
| Alternative 8 | |
|---|---|
| Error | 51.6 |
| Cost | 844 |
| Alternative 9 | |
|---|---|
| Error | 53.8 |
| Cost | 520 |
| Alternative 10 | |
|---|---|
| Error | 53.9 |
| Cost | 192 |
herbie shell --seed 2023092
(FPCore (a b angle x-scale y-scale)
:name "a from scale-rotated-ellipse"
:precision binary64
(/ (- (sqrt (* (* (* 2.0 (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0))) (* (* b a) (* b (- a)))) (+ (+ (/ (/ (+ (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)) (sqrt (+ (pow (- (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)) x-scale) x-scale) (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) PI))) 2.0) (pow (* b (sin (* (/ angle 180.0) PI))) 2.0)) y-scale) y-scale)) 2.0) (pow (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) PI))) (cos (* (/ angle 180.0) PI))) x-scale) y-scale) 2.0))))))) (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0))))