
(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
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) y-scale) y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) x-scale) x-scale))
(t_5 (* (* b a) (* b (- a))))
(t_6 (/ (* 4.0 t_5) (pow (* x-scale y-scale) 2.0))))
(/
(-
(sqrt
(*
(* (* 2.0 t_6) t_5)
(+
(+ t_4 t_3)
(sqrt
(+
(pow (- t_4 t_3) 2.0)
(pow
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) t_2) x-scale)
y-scale)
2.0)))))))
t_6)))
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 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale;
double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale;
double t_5 = (b * a) * (b * -a);
double t_6 = (4.0 * t_5) / pow((x_45_scale * y_45_scale), 2.0);
return -sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + sqrt((pow((t_4 - t_3), 2.0) + pow((((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6;
}
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 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale;
double t_5 = (b * a) * (b * -a);
double t_6 = (4.0 * t_5) / Math.pow((x_45_scale * y_45_scale), 2.0);
return -Math.sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + Math.sqrt((Math.pow((t_4 - t_3), 2.0) + Math.pow((((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6;
}
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 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale t_5 = (b * a) * (b * -a) t_6 = (4.0 * t_5) / math.pow((x_45_scale * y_45_scale), 2.0) return -math.sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + math.sqrt((math.pow((t_4 - t_3), 2.0) + math.pow((((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6
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(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale) t_5 = Float64(Float64(b * a) * Float64(b * Float64(-a))) t_6 = Float64(Float64(4.0 * t_5) / (Float64(x_45_scale * y_45_scale) ^ 2.0)) return Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * t_6) * t_5) * Float64(Float64(t_4 + t_3) + sqrt(Float64((Float64(t_4 - t_3) ^ 2.0) + (Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale) ^ 2.0))))))) / t_6) 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 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale; t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale; t_5 = (b * a) * (b * -a); t_6 = (4.0 * t_5) / ((x_45_scale * y_45_scale) ^ 2.0); tmp = -sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + sqrt((((t_4 - t_3) ^ 2.0) + ((((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale) ^ 2.0)))))) / t_6; 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[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]}, Block[{t$95$4 = 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]}, Block[{t$95$5 = N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(4.0 * t$95$5), $MachinePrecision] / N[Power[N[(x$45$scale * y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(N[(2.0 * t$95$6), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(N[(t$95$4 + t$95$3), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(t$95$4 - t$95$3), $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] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$6), $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(a \cdot t_2\right)}^{2} + {\left(b \cdot t_1\right)}^{2}}{y-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t_1\right)}^{2} + {\left(b \cdot t_2\right)}^{2}}{x-scale}}{x-scale}\\
t_5 := \left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\\
t_6 := \frac{4 \cdot t_5}{{\left(x-scale \cdot y-scale\right)}^{2}}\\
\frac{-\sqrt{\left(\left(2 \cdot t_6\right) \cdot t_5\right) \cdot \left(\left(t_4 + t_3\right) + \sqrt{{\left(t_4 - t_3\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t_1\right) \cdot t_2}{x-scale}}{y-scale}\right)}^{2}}\right)}}{t_6}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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
(/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) y-scale) y-scale))
(t_4
(/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) x-scale) x-scale))
(t_5 (* (* b a) (* b (- a))))
(t_6 (/ (* 4.0 t_5) (pow (* x-scale y-scale) 2.0))))
(/
(-
(sqrt
(*
(* (* 2.0 t_6) t_5)
(+
(+ t_4 t_3)
(sqrt
(+
(pow (- t_4 t_3) 2.0)
(pow
(/
(/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) t_2) x-scale)
y-scale)
2.0)))))))
t_6)))
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 = ((pow((a * t_2), 2.0) + pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale;
double t_4 = ((pow((a * t_1), 2.0) + pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale;
double t_5 = (b * a) * (b * -a);
double t_6 = (4.0 * t_5) / pow((x_45_scale * y_45_scale), 2.0);
return -sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + sqrt((pow((t_4 - t_3), 2.0) + pow((((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6;
}
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 = ((Math.pow((a * t_2), 2.0) + Math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale;
double t_4 = ((Math.pow((a * t_1), 2.0) + Math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale;
double t_5 = (b * a) * (b * -a);
double t_6 = (4.0 * t_5) / Math.pow((x_45_scale * y_45_scale), 2.0);
return -Math.sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + Math.sqrt((Math.pow((t_4 - t_3), 2.0) + Math.pow((((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6;
}
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 = ((math.pow((a * t_2), 2.0) + math.pow((b * t_1), 2.0)) / y_45_scale) / y_45_scale t_4 = ((math.pow((a * t_1), 2.0) + math.pow((b * t_2), 2.0)) / x_45_scale) / x_45_scale t_5 = (b * a) * (b * -a) t_6 = (4.0 * t_5) / math.pow((x_45_scale * y_45_scale), 2.0) return -math.sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + math.sqrt((math.pow((t_4 - t_3), 2.0) + math.pow((((((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale), 2.0)))))) / t_6
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(a * t_2) ^ 2.0) + (Float64(b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale) t_4 = Float64(Float64(Float64((Float64(a * t_1) ^ 2.0) + (Float64(b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale) t_5 = Float64(Float64(b * a) * Float64(b * Float64(-a))) t_6 = Float64(Float64(4.0 * t_5) / (Float64(x_45_scale * y_45_scale) ^ 2.0)) return Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * t_6) * t_5) * Float64(Float64(t_4 + t_3) + sqrt(Float64((Float64(t_4 - t_3) ^ 2.0) + (Float64(Float64(Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale) ^ 2.0))))))) / t_6) 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 = ((((a * t_2) ^ 2.0) + ((b * t_1) ^ 2.0)) / y_45_scale) / y_45_scale; t_4 = ((((a * t_1) ^ 2.0) + ((b * t_2) ^ 2.0)) / x_45_scale) / x_45_scale; t_5 = (b * a) * (b * -a); t_6 = (4.0 * t_5) / ((x_45_scale * y_45_scale) ^ 2.0); tmp = -sqrt((((2.0 * t_6) * t_5) * ((t_4 + t_3) + sqrt((((t_4 - t_3) ^ 2.0) + ((((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * t_1) * t_2) / x_45_scale) / y_45_scale) ^ 2.0)))))) / t_6; 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[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]}, Block[{t$95$4 = 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]}, Block[{t$95$5 = N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(4.0 * t$95$5), $MachinePrecision] / N[Power[N[(x$45$scale * y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(N[(2.0 * t$95$6), $MachinePrecision] * t$95$5), $MachinePrecision] * N[(N[(t$95$4 + t$95$3), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(t$95$4 - t$95$3), $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] * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision] / x$45$scale), $MachinePrecision] / y$45$scale), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$6), $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(a \cdot t_2\right)}^{2} + {\left(b \cdot t_1\right)}^{2}}{y-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t_1\right)}^{2} + {\left(b \cdot t_2\right)}^{2}}{x-scale}}{x-scale}\\
t_5 := \left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\\
t_6 := \frac{4 \cdot t_5}{{\left(x-scale \cdot y-scale\right)}^{2}}\\
\frac{-\sqrt{\left(\left(2 \cdot t_6\right) \cdot t_5\right) \cdot \left(\left(t_4 + t_3\right) + \sqrt{{\left(t_4 - t_3\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t_1\right) \cdot t_2}{x-scale}}{y-scale}\right)}^{2}}\right)}}{t_6}
\end{array}
\end{array}
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle)))
(t_1 (* 0.005555555555555556 (* angle PI))))
(if (<= x-scale -1.52e+34)
(*
0.25
(*
(* x-scale (* y-scale (sqrt 8.0)))
(/
(-
(sqrt
(* 2.0 (+ (pow (* a (cos t_1)) 2.0) (pow (* b (sin t_1)) 2.0)))))
y-scale)))
(if (<= x-scale 4.4e+24)
(fabs (* 4.0 (* 0.25 (* y-scale b))))
(*
0.25
(*
(* (hypot (* a (cos t_0)) (* b (sin t_0))) (sqrt 2.0))
(* x-scale (sqrt 8.0))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
double t_1 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (x_45_scale <= -1.52e+34) {
tmp = 0.25 * ((x_45_scale * (y_45_scale * sqrt(8.0))) * (-sqrt((2.0 * (pow((a * cos(t_1)), 2.0) + pow((b * sin(t_1)), 2.0)))) / y_45_scale));
} else if (x_45_scale <= 4.4e+24) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((hypot((a * cos(t_0)), (b * sin(t_0))) * sqrt(2.0)) * (x_45_scale * sqrt(8.0)));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.PI * (0.005555555555555556 * angle);
double t_1 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (x_45_scale <= -1.52e+34) {
tmp = 0.25 * ((x_45_scale * (y_45_scale * Math.sqrt(8.0))) * (-Math.sqrt((2.0 * (Math.pow((a * Math.cos(t_1)), 2.0) + Math.pow((b * Math.sin(t_1)), 2.0)))) / y_45_scale));
} else if (x_45_scale <= 4.4e+24) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((Math.hypot((a * Math.cos(t_0)), (b * Math.sin(t_0))) * Math.sqrt(2.0)) * (x_45_scale * Math.sqrt(8.0)));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = math.pi * (0.005555555555555556 * angle) t_1 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if x_45_scale <= -1.52e+34: tmp = 0.25 * ((x_45_scale * (y_45_scale * math.sqrt(8.0))) * (-math.sqrt((2.0 * (math.pow((a * math.cos(t_1)), 2.0) + math.pow((b * math.sin(t_1)), 2.0)))) / y_45_scale)) elif x_45_scale <= 4.4e+24: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = 0.25 * ((math.hypot((a * math.cos(t_0)), (b * math.sin(t_0))) * math.sqrt(2.0)) * (x_45_scale * math.sqrt(8.0))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(pi * Float64(0.005555555555555556 * angle)) t_1 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (x_45_scale <= -1.52e+34) tmp = Float64(0.25 * Float64(Float64(x_45_scale * Float64(y_45_scale * sqrt(8.0))) * Float64(Float64(-sqrt(Float64(2.0 * Float64((Float64(a * cos(t_1)) ^ 2.0) + (Float64(b * sin(t_1)) ^ 2.0))))) / y_45_scale))); elseif (x_45_scale <= 4.4e+24) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = Float64(0.25 * Float64(Float64(hypot(Float64(a * cos(t_0)), Float64(b * sin(t_0))) * sqrt(2.0)) * Float64(x_45_scale * sqrt(8.0)))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = pi * (0.005555555555555556 * angle); t_1 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (x_45_scale <= -1.52e+34) tmp = 0.25 * ((x_45_scale * (y_45_scale * sqrt(8.0))) * (-sqrt((2.0 * (((a * cos(t_1)) ^ 2.0) + ((b * sin(t_1)) ^ 2.0)))) / y_45_scale)); elseif (x_45_scale <= 4.4e+24) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); else tmp = 0.25 * ((hypot((a * cos(t_0)), (b * sin(t_0))) * sqrt(2.0)) * (x_45_scale * sqrt(8.0))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -1.52e+34], N[(0.25 * N[(N[(x$45$scale * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-N[Sqrt[N[(2.0 * N[(N[Power[N[(a * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / y$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 4.4e+24], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.25 * N[(N[(N[Sqrt[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;x-scale \leq -1.52 \cdot 10^{+34}:\\
\;\;\;\;0.25 \cdot \left(\left(x-scale \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \frac{-\sqrt{2 \cdot \left({\left(a \cdot \cos t_1\right)}^{2} + {\left(b \cdot \sin t_1\right)}^{2}\right)}}{y-scale}\right)\\
\mathbf{elif}\;x-scale \leq 4.4 \cdot 10^{+24}:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(\mathsf{hypot}\left(a \cdot \cos t_0, b \cdot \sin t_0\right) \cdot \sqrt{2}\right) \cdot \left(x-scale \cdot \sqrt{8}\right)\right)\\
\end{array}
\end{array}
if x-scale < -1.52000000000000001e34Initial program 0.0%
Simplified0.4%
Taylor expanded in x-scale around inf 12.6%
Taylor expanded in y-scale around -inf 49.3%
mul-1-neg49.3%
associate-*l/49.3%
*-lft-identity49.3%
distribute-neg-frac49.3%
Simplified52.0%
if -1.52000000000000001e34 < x-scale < 4.40000000000000003e24Initial program 1.1%
Simplified2.7%
Taylor expanded in angle around 0 27.4%
add-exp-log26.3%
associate-*r*26.3%
sqrt-unprod26.3%
metadata-eval26.3%
metadata-eval26.3%
Applied egg-rr26.3%
rem-exp-log27.6%
add-sqr-sqrt27.0%
sqrt-unprod37.9%
pow237.9%
associate-*l*37.9%
Applied egg-rr37.9%
unpow237.9%
rem-sqrt-square44.6%
associate-*r*44.6%
associate-*l*44.6%
*-commutative44.6%
Simplified44.6%
if 4.40000000000000003e24 < x-scale Initial program 3.8%
Simplified3.9%
Taylor expanded in y-scale around 0 66.9%
Simplified72.4%
pow1/272.4%
*-commutative72.4%
pow-prod-down72.4%
pow-prod-down66.9%
unpow-prod-down66.7%
Applied egg-rr74.0%
Final simplification53.3%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle)))
(t_1 (* x-scale (sqrt 8.0))))
(if (<= x-scale -1.05e+23)
(*
0.25
(*
t_1
(* a (* (cos (* 0.005555555555555556 (* angle PI))) (- (sqrt 2.0))))))
(if (<= x-scale 4.2e+22)
(fabs (* 4.0 (* 0.25 (* y-scale b))))
(*
0.25
(* (* (hypot (* a (cos t_0)) (* b (sin t_0))) (sqrt 2.0)) t_1))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
double t_1 = x_45_scale * sqrt(8.0);
double tmp;
if (x_45_scale <= -1.05e+23) {
tmp = 0.25 * (t_1 * (a * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * -sqrt(2.0))));
} else if (x_45_scale <= 4.2e+22) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((hypot((a * cos(t_0)), (b * sin(t_0))) * sqrt(2.0)) * t_1);
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.PI * (0.005555555555555556 * angle);
double t_1 = x_45_scale * Math.sqrt(8.0);
double tmp;
if (x_45_scale <= -1.05e+23) {
tmp = 0.25 * (t_1 * (a * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * -Math.sqrt(2.0))));
} else if (x_45_scale <= 4.2e+22) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((Math.hypot((a * Math.cos(t_0)), (b * Math.sin(t_0))) * Math.sqrt(2.0)) * t_1);
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = math.pi * (0.005555555555555556 * angle) t_1 = x_45_scale * math.sqrt(8.0) tmp = 0 if x_45_scale <= -1.05e+23: tmp = 0.25 * (t_1 * (a * (math.cos((0.005555555555555556 * (angle * math.pi))) * -math.sqrt(2.0)))) elif x_45_scale <= 4.2e+22: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = 0.25 * ((math.hypot((a * math.cos(t_0)), (b * math.sin(t_0))) * math.sqrt(2.0)) * t_1) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(pi * Float64(0.005555555555555556 * angle)) t_1 = Float64(x_45_scale * sqrt(8.0)) tmp = 0.0 if (x_45_scale <= -1.05e+23) tmp = Float64(0.25 * Float64(t_1 * Float64(a * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(-sqrt(2.0)))))); elseif (x_45_scale <= 4.2e+22) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = Float64(0.25 * Float64(Float64(hypot(Float64(a * cos(t_0)), Float64(b * sin(t_0))) * sqrt(2.0)) * t_1)); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = pi * (0.005555555555555556 * angle); t_1 = x_45_scale * sqrt(8.0); tmp = 0.0; if (x_45_scale <= -1.05e+23) tmp = 0.25 * (t_1 * (a * (cos((0.005555555555555556 * (angle * pi))) * -sqrt(2.0)))); elseif (x_45_scale <= 4.2e+22) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); else tmp = 0.25 * ((hypot((a * cos(t_0)), (b * sin(t_0))) * sqrt(2.0)) * t_1); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -1.05e+23], N[(0.25 * N[(t$95$1 * N[(a * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 4.2e+22], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.25 * N[(N[(N[Sqrt[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := x-scale \cdot \sqrt{8}\\
\mathbf{if}\;x-scale \leq -1.05 \cdot 10^{+23}:\\
\;\;\;\;0.25 \cdot \left(t_1 \cdot \left(a \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-\sqrt{2}\right)\right)\right)\right)\\
\mathbf{elif}\;x-scale \leq 4.2 \cdot 10^{+22}:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(\mathsf{hypot}\left(a \cdot \cos t_0, b \cdot \sin t_0\right) \cdot \sqrt{2}\right) \cdot t_1\right)\\
\end{array}
\end{array}
if x-scale < -1.0500000000000001e23Initial program 0.0%
Simplified0.4%
Taylor expanded in y-scale around 0 1.0%
Simplified1.0%
Taylor expanded in a around -inf 19.2%
mul-1-neg19.2%
*-commutative19.2%
distribute-rgt-neg-in19.2%
*-commutative19.2%
Simplified19.2%
if -1.0500000000000001e23 < x-scale < 4.1999999999999996e22Initial program 1.1%
Simplified2.8%
Taylor expanded in angle around 0 28.3%
add-exp-log27.1%
associate-*r*27.1%
sqrt-unprod27.1%
metadata-eval27.1%
metadata-eval27.1%
Applied egg-rr27.1%
rem-exp-log28.4%
add-sqr-sqrt27.8%
sqrt-unprod39.3%
pow239.3%
associate-*l*39.3%
Applied egg-rr39.3%
unpow239.3%
rem-sqrt-square46.1%
associate-*r*46.1%
associate-*l*46.1%
*-commutative46.1%
Simplified46.1%
if 4.1999999999999996e22 < x-scale Initial program 3.8%
Simplified3.9%
Taylor expanded in y-scale around 0 66.9%
Simplified72.4%
pow1/272.4%
*-commutative72.4%
pow-prod-down72.4%
pow-prod-down66.9%
unpow-prod-down66.7%
Applied egg-rr74.0%
Final simplification44.5%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* x-scale (sqrt 8.0))))
(if (<= x-scale -3.1e+22)
(* 0.25 (* t_1 (* a (* (cos t_0) (- (sqrt 2.0))))))
(if (<= x-scale 16500.0)
(fabs (* 4.0 (* 0.25 (* y-scale b))))
(*
0.25
(* t_1 (sqrt (* 2.0 (+ (pow (* b (sin t_0)) 2.0) (pow a 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 = x_45_scale * sqrt(8.0);
double tmp;
if (x_45_scale <= -3.1e+22) {
tmp = 0.25 * (t_1 * (a * (cos(t_0) * -sqrt(2.0))));
} else if (x_45_scale <= 16500.0) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * (t_1 * sqrt((2.0 * (pow((b * sin(t_0)), 2.0) + pow(a, 2.0)))));
}
return tmp;
}
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 = x_45_scale * Math.sqrt(8.0);
double tmp;
if (x_45_scale <= -3.1e+22) {
tmp = 0.25 * (t_1 * (a * (Math.cos(t_0) * -Math.sqrt(2.0))));
} else if (x_45_scale <= 16500.0) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * (t_1 * Math.sqrt((2.0 * (Math.pow((b * Math.sin(t_0)), 2.0) + Math.pow(a, 2.0)))));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = x_45_scale * math.sqrt(8.0) tmp = 0 if x_45_scale <= -3.1e+22: tmp = 0.25 * (t_1 * (a * (math.cos(t_0) * -math.sqrt(2.0)))) elif x_45_scale <= 16500.0: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = 0.25 * (t_1 * math.sqrt((2.0 * (math.pow((b * math.sin(t_0)), 2.0) + math.pow(a, 2.0))))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(x_45_scale * sqrt(8.0)) tmp = 0.0 if (x_45_scale <= -3.1e+22) tmp = Float64(0.25 * Float64(t_1 * Float64(a * Float64(cos(t_0) * Float64(-sqrt(2.0)))))); elseif (x_45_scale <= 16500.0) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = Float64(0.25 * Float64(t_1 * sqrt(Float64(2.0 * Float64((Float64(b * sin(t_0)) ^ 2.0) + (a ^ 2.0)))))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = 0.005555555555555556 * (angle * pi); t_1 = x_45_scale * sqrt(8.0); tmp = 0.0; if (x_45_scale <= -3.1e+22) tmp = 0.25 * (t_1 * (a * (cos(t_0) * -sqrt(2.0)))); elseif (x_45_scale <= 16500.0) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); else tmp = 0.25 * (t_1 * sqrt((2.0 * (((b * sin(t_0)) ^ 2.0) + (a ^ 2.0))))); end tmp_2 = tmp; end
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[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -3.1e+22], N[(0.25 * N[(t$95$1 * N[(a * N[(N[Cos[t$95$0], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 16500.0], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.25 * N[(t$95$1 * N[Sqrt[N[(2.0 * N[(N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := x-scale \cdot \sqrt{8}\\
\mathbf{if}\;x-scale \leq -3.1 \cdot 10^{+22}:\\
\;\;\;\;0.25 \cdot \left(t_1 \cdot \left(a \cdot \left(\cos t_0 \cdot \left(-\sqrt{2}\right)\right)\right)\right)\\
\mathbf{elif}\;x-scale \leq 16500:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(t_1 \cdot \sqrt{2 \cdot \left({\left(b \cdot \sin t_0\right)}^{2} + {a}^{2}\right)}\right)\\
\end{array}
\end{array}
if x-scale < -3.1000000000000002e22Initial program 0.0%
Simplified0.4%
Taylor expanded in y-scale around 0 1.0%
Simplified1.0%
Taylor expanded in a around -inf 19.2%
mul-1-neg19.2%
*-commutative19.2%
distribute-rgt-neg-in19.2%
*-commutative19.2%
Simplified19.2%
if -3.1000000000000002e22 < x-scale < 16500Initial program 1.1%
Simplified2.9%
Taylor expanded in angle around 0 28.1%
add-exp-log26.9%
associate-*r*26.9%
sqrt-unprod26.9%
metadata-eval26.9%
metadata-eval26.9%
Applied egg-rr26.9%
rem-exp-log28.3%
add-sqr-sqrt27.7%
sqrt-unprod38.5%
pow238.5%
associate-*l*38.5%
Applied egg-rr38.5%
unpow238.5%
rem-sqrt-square45.6%
associate-*r*45.6%
associate-*l*45.6%
*-commutative45.6%
Simplified45.6%
if 16500 < x-scale Initial program 3.7%
Simplified3.8%
Taylor expanded in y-scale around 0 67.0%
Simplified72.2%
Taylor expanded in angle around 0 72.3%
Final simplification44.2%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(if (<= x-scale -2.2e+76)
(*
0.25
(*
a
(*
(* x-scale (cos (* PI (* 0.005555555555555556 angle))))
(* (sqrt 2.0) (- (sqrt 8.0))))))
(if (<= x-scale 2.2e+20)
(fabs (* 4.0 (* 0.25 (* y-scale b))))
(* 0.25 (* (* x-scale (sqrt 8.0)) (* a (sqrt 2.0)))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= -2.2e+76) {
tmp = 0.25 * (a * ((x_45_scale * cos((((double) M_PI) * (0.005555555555555556 * angle)))) * (sqrt(2.0) * -sqrt(8.0))));
} else if (x_45_scale <= 2.2e+20) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((x_45_scale * sqrt(8.0)) * (a * sqrt(2.0)));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= -2.2e+76) {
tmp = 0.25 * (a * ((x_45_scale * Math.cos((Math.PI * (0.005555555555555556 * angle)))) * (Math.sqrt(2.0) * -Math.sqrt(8.0))));
} else if (x_45_scale <= 2.2e+20) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((x_45_scale * Math.sqrt(8.0)) * (a * Math.sqrt(2.0)));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if x_45_scale <= -2.2e+76: tmp = 0.25 * (a * ((x_45_scale * math.cos((math.pi * (0.005555555555555556 * angle)))) * (math.sqrt(2.0) * -math.sqrt(8.0)))) elif x_45_scale <= 2.2e+20: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = 0.25 * ((x_45_scale * math.sqrt(8.0)) * (a * math.sqrt(2.0))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (x_45_scale <= -2.2e+76) tmp = Float64(0.25 * Float64(a * Float64(Float64(x_45_scale * cos(Float64(pi * Float64(0.005555555555555556 * angle)))) * Float64(sqrt(2.0) * Float64(-sqrt(8.0)))))); elseif (x_45_scale <= 2.2e+20) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = Float64(0.25 * Float64(Float64(x_45_scale * sqrt(8.0)) * Float64(a * sqrt(2.0)))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (x_45_scale <= -2.2e+76) tmp = 0.25 * (a * ((x_45_scale * cos((pi * (0.005555555555555556 * angle)))) * (sqrt(2.0) * -sqrt(8.0)))); elseif (x_45_scale <= 2.2e+20) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); else tmp = 0.25 * ((x_45_scale * sqrt(8.0)) * (a * sqrt(2.0))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[x$45$scale, -2.2e+76], N[(0.25 * N[(a * N[(N[(x$45$scale * N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[8.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 2.2e+20], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.25 * N[(N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision] * N[(a * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x-scale \leq -2.2 \cdot 10^{+76}:\\
\;\;\;\;0.25 \cdot \left(a \cdot \left(\left(x-scale \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right) \cdot \left(\sqrt{2} \cdot \left(-\sqrt{8}\right)\right)\right)\right)\\
\mathbf{elif}\;x-scale \leq 2.2 \cdot 10^{+20}:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \left(a \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if x-scale < -2.2e76Initial program 0.0%
Simplified0.4%
Taylor expanded in y-scale around 0 1.0%
Simplified1.0%
Taylor expanded in a around -inf 22.8%
mul-1-neg22.8%
associate-*r*22.8%
*-commutative22.8%
associate-*r*24.4%
*-commutative24.4%
Simplified24.4%
if -2.2e76 < x-scale < 2.2e20Initial program 1.0%
Simplified2.5%
Taylor expanded in angle around 0 27.0%
add-exp-log25.9%
associate-*r*25.9%
sqrt-unprod25.9%
metadata-eval25.9%
metadata-eval25.9%
Applied egg-rr25.9%
rem-exp-log27.2%
add-sqr-sqrt26.6%
sqrt-unprod36.7%
pow236.7%
associate-*l*36.7%
Applied egg-rr36.7%
unpow236.7%
rem-sqrt-square44.3%
associate-*r*44.3%
associate-*l*44.3%
*-commutative44.3%
Simplified44.3%
if 2.2e20 < x-scale Initial program 3.8%
Simplified3.9%
Taylor expanded in y-scale around 0 66.9%
Simplified72.4%
Taylor expanded in angle around 0 28.3%
*-commutative28.3%
Simplified28.3%
Final simplification36.1%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(if (<= x-scale -6.5e+23)
(*
0.25
(*
(* x-scale a)
(*
(cos (* 0.005555555555555556 (* angle PI)))
(* (sqrt 2.0) (- (sqrt 8.0))))))
(if (<= x-scale 3.2e+25)
(fabs (* 4.0 (* 0.25 (* y-scale b))))
(* 0.25 (* (* x-scale (sqrt 8.0)) (* a (sqrt 2.0)))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= -6.5e+23) {
tmp = 0.25 * ((x_45_scale * a) * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * (sqrt(2.0) * -sqrt(8.0))));
} else if (x_45_scale <= 3.2e+25) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((x_45_scale * sqrt(8.0)) * (a * sqrt(2.0)));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= -6.5e+23) {
tmp = 0.25 * ((x_45_scale * a) * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * (Math.sqrt(2.0) * -Math.sqrt(8.0))));
} else if (x_45_scale <= 3.2e+25) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((x_45_scale * Math.sqrt(8.0)) * (a * Math.sqrt(2.0)));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if x_45_scale <= -6.5e+23: tmp = 0.25 * ((x_45_scale * a) * (math.cos((0.005555555555555556 * (angle * math.pi))) * (math.sqrt(2.0) * -math.sqrt(8.0)))) elif x_45_scale <= 3.2e+25: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = 0.25 * ((x_45_scale * math.sqrt(8.0)) * (a * math.sqrt(2.0))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (x_45_scale <= -6.5e+23) tmp = Float64(0.25 * Float64(Float64(x_45_scale * a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(sqrt(2.0) * Float64(-sqrt(8.0)))))); elseif (x_45_scale <= 3.2e+25) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = Float64(0.25 * Float64(Float64(x_45_scale * sqrt(8.0)) * Float64(a * sqrt(2.0)))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (x_45_scale <= -6.5e+23) tmp = 0.25 * ((x_45_scale * a) * (cos((0.005555555555555556 * (angle * pi))) * (sqrt(2.0) * -sqrt(8.0)))); elseif (x_45_scale <= 3.2e+25) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); else tmp = 0.25 * ((x_45_scale * sqrt(8.0)) * (a * sqrt(2.0))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[x$45$scale, -6.5e+23], N[(0.25 * N[(N[(x$45$scale * a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[8.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 3.2e+25], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.25 * N[(N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision] * N[(a * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x-scale \leq -6.5 \cdot 10^{+23}:\\
\;\;\;\;0.25 \cdot \left(\left(x-scale \cdot a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sqrt{2} \cdot \left(-\sqrt{8}\right)\right)\right)\right)\\
\mathbf{elif}\;x-scale \leq 3.2 \cdot 10^{+25}:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \left(a \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if x-scale < -6.4999999999999996e23Initial program 0.0%
Simplified0.4%
Taylor expanded in y-scale around 0 1.0%
Simplified1.0%
Taylor expanded in a around -inf 19.1%
mul-1-neg19.1%
associate-*r*19.1%
distribute-lft-neg-in19.1%
Simplified19.1%
if -6.4999999999999996e23 < x-scale < 3.1999999999999999e25Initial program 1.1%
Simplified2.8%
Taylor expanded in angle around 0 28.3%
add-exp-log27.1%
associate-*r*27.1%
sqrt-unprod27.1%
metadata-eval27.1%
metadata-eval27.1%
Applied egg-rr27.1%
rem-exp-log28.4%
add-sqr-sqrt27.8%
sqrt-unprod39.3%
pow239.3%
associate-*l*39.3%
Applied egg-rr39.3%
unpow239.3%
rem-sqrt-square46.1%
associate-*r*46.1%
associate-*l*46.1%
*-commutative46.1%
Simplified46.1%
if 3.1999999999999999e25 < x-scale Initial program 3.8%
Simplified3.9%
Taylor expanded in y-scale around 0 66.9%
Simplified72.4%
Taylor expanded in angle around 0 28.3%
*-commutative28.3%
Simplified28.3%
Final simplification34.2%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* x-scale (sqrt 8.0))))
(if (<= x-scale -3e+22)
(*
0.25
(*
t_0
(* a (* (cos (* 0.005555555555555556 (* angle PI))) (- (sqrt 2.0))))))
(if (<= x-scale 3.2e+20)
(fabs (* 4.0 (* 0.25 (* y-scale b))))
(* 0.25 (* t_0 (* a (sqrt 2.0))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = x_45_scale * sqrt(8.0);
double tmp;
if (x_45_scale <= -3e+22) {
tmp = 0.25 * (t_0 * (a * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * -sqrt(2.0))));
} else if (x_45_scale <= 3.2e+20) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * (t_0 * (a * sqrt(2.0)));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = x_45_scale * Math.sqrt(8.0);
double tmp;
if (x_45_scale <= -3e+22) {
tmp = 0.25 * (t_0 * (a * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * -Math.sqrt(2.0))));
} else if (x_45_scale <= 3.2e+20) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * (t_0 * (a * Math.sqrt(2.0)));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = x_45_scale * math.sqrt(8.0) tmp = 0 if x_45_scale <= -3e+22: tmp = 0.25 * (t_0 * (a * (math.cos((0.005555555555555556 * (angle * math.pi))) * -math.sqrt(2.0)))) elif x_45_scale <= 3.2e+20: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = 0.25 * (t_0 * (a * math.sqrt(2.0))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(x_45_scale * sqrt(8.0)) tmp = 0.0 if (x_45_scale <= -3e+22) tmp = Float64(0.25 * Float64(t_0 * Float64(a * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(-sqrt(2.0)))))); elseif (x_45_scale <= 3.2e+20) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = Float64(0.25 * Float64(t_0 * Float64(a * sqrt(2.0)))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = x_45_scale * sqrt(8.0); tmp = 0.0; if (x_45_scale <= -3e+22) tmp = 0.25 * (t_0 * (a * (cos((0.005555555555555556 * (angle * pi))) * -sqrt(2.0)))); elseif (x_45_scale <= 3.2e+20) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); else tmp = 0.25 * (t_0 * (a * sqrt(2.0))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -3e+22], N[(0.25 * N[(t$95$0 * N[(a * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 3.2e+20], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.25 * N[(t$95$0 * N[(a * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x-scale \cdot \sqrt{8}\\
\mathbf{if}\;x-scale \leq -3 \cdot 10^{+22}:\\
\;\;\;\;0.25 \cdot \left(t_0 \cdot \left(a \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-\sqrt{2}\right)\right)\right)\right)\\
\mathbf{elif}\;x-scale \leq 3.2 \cdot 10^{+20}:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(t_0 \cdot \left(a \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if x-scale < -3e22Initial program 0.0%
Simplified0.4%
Taylor expanded in y-scale around 0 1.0%
Simplified1.0%
Taylor expanded in a around -inf 19.2%
mul-1-neg19.2%
*-commutative19.2%
distribute-rgt-neg-in19.2%
*-commutative19.2%
Simplified19.2%
if -3e22 < x-scale < 3.2e20Initial program 1.1%
Simplified2.8%
Taylor expanded in angle around 0 28.3%
add-exp-log27.1%
associate-*r*27.1%
sqrt-unprod27.1%
metadata-eval27.1%
metadata-eval27.1%
Applied egg-rr27.1%
rem-exp-log28.4%
add-sqr-sqrt27.8%
sqrt-unprod39.3%
pow239.3%
associate-*l*39.3%
Applied egg-rr39.3%
unpow239.3%
rem-sqrt-square46.1%
associate-*r*46.1%
associate-*l*46.1%
*-commutative46.1%
Simplified46.1%
if 3.2e20 < x-scale Initial program 3.8%
Simplified3.9%
Taylor expanded in y-scale around 0 66.9%
Simplified72.4%
Taylor expanded in angle around 0 28.3%
*-commutative28.3%
Simplified28.3%
Final simplification34.2%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(if (<= x-scale -3.3e+181)
(*
0.25
(*
(* 4.0 (sin (* PI (* 0.005555555555555556 angle))))
(* (log (exp x-scale)) (- b))))
(if (<= x-scale 8.5e+21)
(fabs (* 4.0 (* 0.25 (* y-scale b))))
(* 0.25 (* (* x-scale (sqrt 8.0)) (* a (sqrt 2.0)))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= -3.3e+181) {
tmp = 0.25 * ((4.0 * sin((((double) M_PI) * (0.005555555555555556 * angle)))) * (log(exp(x_45_scale)) * -b));
} else if (x_45_scale <= 8.5e+21) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((x_45_scale * sqrt(8.0)) * (a * sqrt(2.0)));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= -3.3e+181) {
tmp = 0.25 * ((4.0 * Math.sin((Math.PI * (0.005555555555555556 * angle)))) * (Math.log(Math.exp(x_45_scale)) * -b));
} else if (x_45_scale <= 8.5e+21) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((x_45_scale * Math.sqrt(8.0)) * (a * Math.sqrt(2.0)));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if x_45_scale <= -3.3e+181: tmp = 0.25 * ((4.0 * math.sin((math.pi * (0.005555555555555556 * angle)))) * (math.log(math.exp(x_45_scale)) * -b)) elif x_45_scale <= 8.5e+21: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = 0.25 * ((x_45_scale * math.sqrt(8.0)) * (a * math.sqrt(2.0))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (x_45_scale <= -3.3e+181) tmp = Float64(0.25 * Float64(Float64(4.0 * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) * Float64(log(exp(x_45_scale)) * Float64(-b)))); elseif (x_45_scale <= 8.5e+21) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = Float64(0.25 * Float64(Float64(x_45_scale * sqrt(8.0)) * Float64(a * sqrt(2.0)))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (x_45_scale <= -3.3e+181) tmp = 0.25 * ((4.0 * sin((pi * (0.005555555555555556 * angle)))) * (log(exp(x_45_scale)) * -b)); elseif (x_45_scale <= 8.5e+21) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); else tmp = 0.25 * ((x_45_scale * sqrt(8.0)) * (a * sqrt(2.0))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[x$45$scale, -3.3e+181], N[(0.25 * N[(N[(4.0 * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Log[N[Exp[x$45$scale], $MachinePrecision]], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 8.5e+21], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.25 * N[(N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision] * N[(a * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x-scale \leq -3.3 \cdot 10^{+181}:\\
\;\;\;\;0.25 \cdot \left(\left(4 \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right) \cdot \left(\log \left(e^{x-scale}\right) \cdot \left(-b\right)\right)\right)\\
\mathbf{elif}\;x-scale \leq 8.5 \cdot 10^{+21}:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \left(a \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if x-scale < -3.30000000000000017e181Initial program 0.0%
Simplified0.3%
Taylor expanded in y-scale around 0 0.8%
Simplified0.7%
Taylor expanded in b around -inf 12.9%
mul-1-neg12.9%
associate-*r*9.7%
associate-*r*9.9%
*-commutative9.9%
Simplified9.9%
add-log-exp15.4%
exp-prod15.3%
*-commutative15.3%
exp-prod15.4%
associate-*r*22.4%
sqrt-unprod22.4%
metadata-eval22.4%
metadata-eval22.4%
Applied egg-rr22.4%
log-pow22.4%
*-commutative22.4%
associate-*l*15.4%
log-pow15.4%
Simplified15.4%
if -3.30000000000000017e181 < x-scale < 8.5e21Initial program 0.8%
Simplified2.2%
Taylor expanded in angle around 0 25.4%
add-exp-log24.3%
associate-*r*24.3%
sqrt-unprod24.3%
metadata-eval24.3%
metadata-eval24.3%
Applied egg-rr24.3%
rem-exp-log25.6%
add-sqr-sqrt25.0%
sqrt-unprod35.4%
pow235.4%
associate-*l*35.4%
Applied egg-rr35.4%
unpow235.4%
rem-sqrt-square41.6%
associate-*r*41.6%
associate-*l*41.6%
*-commutative41.6%
Simplified41.6%
if 8.5e21 < x-scale Initial program 3.8%
Simplified3.9%
Taylor expanded in y-scale around 0 66.9%
Simplified72.4%
Taylor expanded in angle around 0 28.3%
*-commutative28.3%
Simplified28.3%
Final simplification35.6%
(FPCore (a b angle x-scale y-scale) :precision binary64 (if (<= x-scale 2.75e+20) (fabs (* 4.0 (* 0.25 (* y-scale b)))) (* 0.25 (* a (* x-scale (* (sqrt 8.0) (sqrt 2.0)))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= 2.75e+20) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * (a * (x_45_scale * (sqrt(8.0) * sqrt(2.0))));
}
return tmp;
}
real(8) function code(a, b, angle, x_45scale, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale
real(8), intent (in) :: y_45scale
real(8) :: tmp
if (x_45scale <= 2.75d+20) then
tmp = abs((4.0d0 * (0.25d0 * (y_45scale * b))))
else
tmp = 0.25d0 * (a * (x_45scale * (sqrt(8.0d0) * sqrt(2.0d0))))
end if
code = tmp
end function
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= 2.75e+20) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * (a * (x_45_scale * (Math.sqrt(8.0) * Math.sqrt(2.0))));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if x_45_scale <= 2.75e+20: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = 0.25 * (a * (x_45_scale * (math.sqrt(8.0) * math.sqrt(2.0)))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (x_45_scale <= 2.75e+20) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = Float64(0.25 * Float64(a * Float64(x_45_scale * Float64(sqrt(8.0) * sqrt(2.0))))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (x_45_scale <= 2.75e+20) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); else tmp = 0.25 * (a * (x_45_scale * (sqrt(8.0) * sqrt(2.0)))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[x$45$scale, 2.75e+20], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.25 * N[(a * N[(x$45$scale * N[(N[Sqrt[8.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x-scale \leq 2.75 \cdot 10^{+20}:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(a \cdot \left(x-scale \cdot \left(\sqrt{8} \cdot \sqrt{2}\right)\right)\right)\\
\end{array}
\end{array}
if x-scale < 2.75e20Initial program 0.7%
Simplified1.9%
Taylor expanded in angle around 0 22.0%
add-exp-log21.0%
associate-*r*21.0%
sqrt-unprod21.0%
metadata-eval21.0%
metadata-eval21.0%
Applied egg-rr21.0%
rem-exp-log22.2%
add-sqr-sqrt21.6%
sqrt-unprod32.7%
pow232.7%
associate-*l*32.7%
Applied egg-rr32.7%
unpow232.7%
rem-sqrt-square37.6%
associate-*r*37.6%
associate-*l*37.6%
*-commutative37.6%
Simplified37.6%
if 2.75e20 < x-scale Initial program 3.8%
Simplified3.9%
Taylor expanded in y-scale around 0 66.9%
Simplified72.4%
Taylor expanded in angle around 0 28.2%
Final simplification35.5%
(FPCore (a b angle x-scale y-scale) :precision binary64 (if (<= x-scale 9.5e+24) (fabs (* 4.0 (* 0.25 (* y-scale b)))) (* 0.25 (* a (* (sqrt 8.0) (* x-scale (sqrt 2.0)))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= 9.5e+24) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * (a * (sqrt(8.0) * (x_45_scale * sqrt(2.0))));
}
return tmp;
}
real(8) function code(a, b, angle, x_45scale, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale
real(8), intent (in) :: y_45scale
real(8) :: tmp
if (x_45scale <= 9.5d+24) then
tmp = abs((4.0d0 * (0.25d0 * (y_45scale * b))))
else
tmp = 0.25d0 * (a * (sqrt(8.0d0) * (x_45scale * sqrt(2.0d0))))
end if
code = tmp
end function
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= 9.5e+24) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * (a * (Math.sqrt(8.0) * (x_45_scale * Math.sqrt(2.0))));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if x_45_scale <= 9.5e+24: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = 0.25 * (a * (math.sqrt(8.0) * (x_45_scale * math.sqrt(2.0)))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (x_45_scale <= 9.5e+24) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = Float64(0.25 * Float64(a * Float64(sqrt(8.0) * Float64(x_45_scale * sqrt(2.0))))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (x_45_scale <= 9.5e+24) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); else tmp = 0.25 * (a * (sqrt(8.0) * (x_45_scale * sqrt(2.0)))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[x$45$scale, 9.5e+24], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.25 * N[(a * N[(N[Sqrt[8.0], $MachinePrecision] * N[(x$45$scale * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x-scale \leq 9.5 \cdot 10^{+24}:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(a \cdot \left(\sqrt{8} \cdot \left(x-scale \cdot \sqrt{2}\right)\right)\right)\\
\end{array}
\end{array}
if x-scale < 9.5000000000000001e24Initial program 0.7%
Simplified1.9%
Taylor expanded in angle around 0 22.0%
add-exp-log21.0%
associate-*r*21.0%
sqrt-unprod21.0%
metadata-eval21.0%
metadata-eval21.0%
Applied egg-rr21.0%
rem-exp-log22.2%
add-sqr-sqrt21.6%
sqrt-unprod32.7%
pow232.7%
associate-*l*32.7%
Applied egg-rr32.7%
unpow232.7%
rem-sqrt-square37.6%
associate-*r*37.6%
associate-*l*37.6%
*-commutative37.6%
Simplified37.6%
if 9.5000000000000001e24 < x-scale Initial program 3.8%
Simplified3.9%
Taylor expanded in y-scale around 0 66.9%
Simplified72.4%
add-cbrt-cube68.0%
pow1/367.3%
Applied egg-rr67.4%
Taylor expanded in angle around 0 28.2%
associate-*r*28.2%
Simplified28.2%
Final simplification35.5%
(FPCore (a b angle x-scale y-scale) :precision binary64 (if (<= x-scale 2.35e+25) (fabs (* 4.0 (* 0.25 (* y-scale b)))) (* 0.25 (* (* x-scale (sqrt 8.0)) (* a (sqrt 2.0))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= 2.35e+25) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((x_45_scale * sqrt(8.0)) * (a * sqrt(2.0)));
}
return tmp;
}
real(8) function code(a, b, angle, x_45scale, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale
real(8), intent (in) :: y_45scale
real(8) :: tmp
if (x_45scale <= 2.35d+25) then
tmp = abs((4.0d0 * (0.25d0 * (y_45scale * b))))
else
tmp = 0.25d0 * ((x_45scale * sqrt(8.0d0)) * (a * sqrt(2.0d0)))
end if
code = tmp
end function
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= 2.35e+25) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = 0.25 * ((x_45_scale * Math.sqrt(8.0)) * (a * Math.sqrt(2.0)));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if x_45_scale <= 2.35e+25: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = 0.25 * ((x_45_scale * math.sqrt(8.0)) * (a * math.sqrt(2.0))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (x_45_scale <= 2.35e+25) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = Float64(0.25 * Float64(Float64(x_45_scale * sqrt(8.0)) * Float64(a * sqrt(2.0)))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (x_45_scale <= 2.35e+25) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); else tmp = 0.25 * ((x_45_scale * sqrt(8.0)) * (a * sqrt(2.0))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[x$45$scale, 2.35e+25], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(0.25 * N[(N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision] * N[(a * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x-scale \leq 2.35 \cdot 10^{+25}:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \left(a \cdot \sqrt{2}\right)\right)\\
\end{array}
\end{array}
if x-scale < 2.3499999999999999e25Initial program 0.7%
Simplified1.9%
Taylor expanded in angle around 0 22.0%
add-exp-log21.0%
associate-*r*21.0%
sqrt-unprod21.0%
metadata-eval21.0%
metadata-eval21.0%
Applied egg-rr21.0%
rem-exp-log22.2%
add-sqr-sqrt21.6%
sqrt-unprod32.7%
pow232.7%
associate-*l*32.7%
Applied egg-rr32.7%
unpow232.7%
rem-sqrt-square37.6%
associate-*r*37.6%
associate-*l*37.6%
*-commutative37.6%
Simplified37.6%
if 2.3499999999999999e25 < x-scale Initial program 3.8%
Simplified3.9%
Taylor expanded in y-scale around 0 66.9%
Simplified72.4%
Taylor expanded in angle around 0 28.3%
*-commutative28.3%
Simplified28.3%
Final simplification35.5%
(FPCore (a b angle x-scale y-scale) :precision binary64 (if (<= x-scale 5.6e+230) (fabs (* 4.0 (* 0.25 (* y-scale b)))) (log1p (expm1 (* 0.25 (* 4.0 (* y-scale b)))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= 5.6e+230) {
tmp = fabs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = log1p(expm1((0.25 * (4.0 * (y_45_scale * b)))));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (x_45_scale <= 5.6e+230) {
tmp = Math.abs((4.0 * (0.25 * (y_45_scale * b))));
} else {
tmp = Math.log1p(Math.expm1((0.25 * (4.0 * (y_45_scale * b)))));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if x_45_scale <= 5.6e+230: tmp = math.fabs((4.0 * (0.25 * (y_45_scale * b)))) else: tmp = math.log1p(math.expm1((0.25 * (4.0 * (y_45_scale * b))))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (x_45_scale <= 5.6e+230) tmp = abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))); else tmp = log1p(expm1(Float64(0.25 * Float64(4.0 * Float64(y_45_scale * b))))); end return tmp end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[x$45$scale, 5.6e+230], N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Log[1 + N[(Exp[N[(0.25 * N[(4.0 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x-scale \leq 5.6 \cdot 10^{+230}:\\
\;\;\;\;\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(0.25 \cdot \left(4 \cdot \left(y-scale \cdot b\right)\right)\right)\right)\\
\end{array}
\end{array}
if x-scale < 5.6000000000000004e230Initial program 1.1%
Simplified2.6%
Taylor expanded in angle around 0 20.3%
add-exp-log19.3%
associate-*r*19.3%
sqrt-unprod19.3%
metadata-eval19.3%
metadata-eval19.3%
Applied egg-rr19.3%
rem-exp-log20.5%
add-sqr-sqrt19.9%
sqrt-unprod32.2%
pow232.2%
associate-*l*32.2%
Applied egg-rr32.2%
unpow232.2%
rem-sqrt-square36.8%
associate-*r*36.8%
associate-*l*36.8%
*-commutative36.8%
Simplified36.8%
if 5.6000000000000004e230 < x-scale Initial program 4.3%
Simplified0.0%
Taylor expanded in angle around 0 6.8%
log1p-expm1-u36.0%
associate-*r*36.0%
sqrt-unprod36.0%
metadata-eval36.0%
metadata-eval36.0%
Applied egg-rr36.0%
Final simplification36.7%
(FPCore (a b angle x-scale y-scale) :precision binary64 (fabs (* 4.0 (* 0.25 (* y-scale b)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return fabs((4.0 * (0.25 * (y_45_scale * b))));
}
real(8) function code(a, b, angle, x_45scale, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale
real(8), intent (in) :: y_45scale
code = abs((4.0d0 * (0.25d0 * (y_45scale * b))))
end function
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return Math.abs((4.0 * (0.25 * (y_45_scale * b))));
}
def code(a, b, angle, x_45_scale, y_45_scale): return math.fabs((4.0 * (0.25 * (y_45_scale * b))))
function code(a, b, angle, x_45_scale, y_45_scale) return abs(Float64(4.0 * Float64(0.25 * Float64(y_45_scale * b)))) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) tmp = abs((4.0 * (0.25 * (y_45_scale * b)))); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[Abs[N[(4.0 * N[(0.25 * N[(y$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|4 \cdot \left(0.25 \cdot \left(y-scale \cdot b\right)\right)\right|
\end{array}
Initial program 1.4%
Simplified2.4%
Taylor expanded in angle around 0 19.1%
add-exp-log18.2%
associate-*r*18.2%
sqrt-unprod18.2%
metadata-eval18.2%
metadata-eval18.2%
Applied egg-rr18.2%
rem-exp-log19.3%
add-sqr-sqrt18.7%
sqrt-unprod31.1%
pow231.1%
associate-*l*31.1%
Applied egg-rr31.1%
unpow231.1%
rem-sqrt-square34.5%
associate-*r*34.5%
associate-*l*34.5%
*-commutative34.5%
Simplified34.5%
Final simplification34.5%
(FPCore (a b angle x-scale y-scale) :precision binary64 (* y-scale b))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return y_45_scale * b;
}
real(8) function code(a, b, angle, x_45scale, y_45scale)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8), intent (in) :: x_45scale
real(8), intent (in) :: y_45scale
code = y_45scale * b
end function
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return y_45_scale * b;
}
def code(a, b, angle, x_45_scale, y_45_scale): return y_45_scale * b
function code(a, b, angle, x_45_scale, y_45_scale) return Float64(y_45_scale * b) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) tmp = y_45_scale * b; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(y$45$scale * b), $MachinePrecision]
\begin{array}{l}
\\
y-scale \cdot b
\end{array}
Initial program 1.4%
Simplified2.4%
Taylor expanded in angle around 0 19.1%
add-exp-log18.2%
associate-*r*18.2%
sqrt-unprod18.2%
metadata-eval18.2%
metadata-eval18.2%
Applied egg-rr18.2%
Taylor expanded in b around 0 19.3%
Final simplification19.3%
herbie shell --seed 2023337
(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))))