
(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 18 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 (* 0.25 (* y-scale (sqrt 8.0))))
(t_1 (- (sqrt 2.0)))
(t_2 (* 0.005555555555555556 (* angle PI)))
(t_3 (* a (sin t_2)))
(t_4 (cos t_2))
(t_5 (* b t_4))
(t_6 (* 0.25 (* x-scale (sqrt 8.0))))
(t_7 (* t_6 (* t_4 (* a t_1)))))
(if (<= y-scale -1.1e-34)
(*
(* 0.25 (* (* y-scale x-scale) (sqrt 8.0)))
(* (hypot t_3 t_5) (/ t_1 x-scale)))
(if (<= y-scale -2e-275)
t_7
(if (<= y-scale 1.6e-265)
(* t_6 (* (sqrt 2.0) (* a t_4)))
(if (<= y-scale 2.5e-228)
t_7
(if (<= y-scale 18500000000000.0)
(* t_0 (sqrt (* 2.0 (+ (pow t_5 2.0) (pow t_3 2.0)))))
(*
t_0
(*
(pow 2.0 0.25)
(*
(pow 2.0 0.25)
(hypot
(* a (sin (* PI (* 0.005555555555555556 angle))))
b)))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.25 * (y_45_scale * sqrt(8.0));
double t_1 = -sqrt(2.0);
double t_2 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_3 = a * sin(t_2);
double t_4 = cos(t_2);
double t_5 = b * t_4;
double t_6 = 0.25 * (x_45_scale * sqrt(8.0));
double t_7 = t_6 * (t_4 * (a * t_1));
double tmp;
if (y_45_scale <= -1.1e-34) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * sqrt(8.0))) * (hypot(t_3, t_5) * (t_1 / x_45_scale));
} else if (y_45_scale <= -2e-275) {
tmp = t_7;
} else if (y_45_scale <= 1.6e-265) {
tmp = t_6 * (sqrt(2.0) * (a * t_4));
} else if (y_45_scale <= 2.5e-228) {
tmp = t_7;
} else if (y_45_scale <= 18500000000000.0) {
tmp = t_0 * sqrt((2.0 * (pow(t_5, 2.0) + pow(t_3, 2.0))));
} else {
tmp = t_0 * (pow(2.0, 0.25) * (pow(2.0, 0.25) * hypot((a * sin((((double) M_PI) * (0.005555555555555556 * angle)))), b)));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.25 * (y_45_scale * Math.sqrt(8.0));
double t_1 = -Math.sqrt(2.0);
double t_2 = 0.005555555555555556 * (angle * Math.PI);
double t_3 = a * Math.sin(t_2);
double t_4 = Math.cos(t_2);
double t_5 = b * t_4;
double t_6 = 0.25 * (x_45_scale * Math.sqrt(8.0));
double t_7 = t_6 * (t_4 * (a * t_1));
double tmp;
if (y_45_scale <= -1.1e-34) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * Math.sqrt(8.0))) * (Math.hypot(t_3, t_5) * (t_1 / x_45_scale));
} else if (y_45_scale <= -2e-275) {
tmp = t_7;
} else if (y_45_scale <= 1.6e-265) {
tmp = t_6 * (Math.sqrt(2.0) * (a * t_4));
} else if (y_45_scale <= 2.5e-228) {
tmp = t_7;
} else if (y_45_scale <= 18500000000000.0) {
tmp = t_0 * Math.sqrt((2.0 * (Math.pow(t_5, 2.0) + Math.pow(t_3, 2.0))));
} else {
tmp = t_0 * (Math.pow(2.0, 0.25) * (Math.pow(2.0, 0.25) * Math.hypot((a * Math.sin((Math.PI * (0.005555555555555556 * angle)))), b)));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = 0.25 * (y_45_scale * math.sqrt(8.0)) t_1 = -math.sqrt(2.0) t_2 = 0.005555555555555556 * (angle * math.pi) t_3 = a * math.sin(t_2) t_4 = math.cos(t_2) t_5 = b * t_4 t_6 = 0.25 * (x_45_scale * math.sqrt(8.0)) t_7 = t_6 * (t_4 * (a * t_1)) tmp = 0 if y_45_scale <= -1.1e-34: tmp = (0.25 * ((y_45_scale * x_45_scale) * math.sqrt(8.0))) * (math.hypot(t_3, t_5) * (t_1 / x_45_scale)) elif y_45_scale <= -2e-275: tmp = t_7 elif y_45_scale <= 1.6e-265: tmp = t_6 * (math.sqrt(2.0) * (a * t_4)) elif y_45_scale <= 2.5e-228: tmp = t_7 elif y_45_scale <= 18500000000000.0: tmp = t_0 * math.sqrt((2.0 * (math.pow(t_5, 2.0) + math.pow(t_3, 2.0)))) else: tmp = t_0 * (math.pow(2.0, 0.25) * (math.pow(2.0, 0.25) * math.hypot((a * math.sin((math.pi * (0.005555555555555556 * angle)))), b))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) t_1 = Float64(-sqrt(2.0)) t_2 = Float64(0.005555555555555556 * Float64(angle * pi)) t_3 = Float64(a * sin(t_2)) t_4 = cos(t_2) t_5 = Float64(b * t_4) t_6 = Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) t_7 = Float64(t_6 * Float64(t_4 * Float64(a * t_1))) tmp = 0.0 if (y_45_scale <= -1.1e-34) tmp = Float64(Float64(0.25 * Float64(Float64(y_45_scale * x_45_scale) * sqrt(8.0))) * Float64(hypot(t_3, t_5) * Float64(t_1 / x_45_scale))); elseif (y_45_scale <= -2e-275) tmp = t_7; elseif (y_45_scale <= 1.6e-265) tmp = Float64(t_6 * Float64(sqrt(2.0) * Float64(a * t_4))); elseif (y_45_scale <= 2.5e-228) tmp = t_7; elseif (y_45_scale <= 18500000000000.0) tmp = Float64(t_0 * sqrt(Float64(2.0 * Float64((t_5 ^ 2.0) + (t_3 ^ 2.0))))); else tmp = Float64(t_0 * Float64((2.0 ^ 0.25) * Float64((2.0 ^ 0.25) * hypot(Float64(a * sin(Float64(pi * Float64(0.005555555555555556 * angle)))), b)))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = 0.25 * (y_45_scale * sqrt(8.0)); t_1 = -sqrt(2.0); t_2 = 0.005555555555555556 * (angle * pi); t_3 = a * sin(t_2); t_4 = cos(t_2); t_5 = b * t_4; t_6 = 0.25 * (x_45_scale * sqrt(8.0)); t_7 = t_6 * (t_4 * (a * t_1)); tmp = 0.0; if (y_45_scale <= -1.1e-34) tmp = (0.25 * ((y_45_scale * x_45_scale) * sqrt(8.0))) * (hypot(t_3, t_5) * (t_1 / x_45_scale)); elseif (y_45_scale <= -2e-275) tmp = t_7; elseif (y_45_scale <= 1.6e-265) tmp = t_6 * (sqrt(2.0) * (a * t_4)); elseif (y_45_scale <= 2.5e-228) tmp = t_7; elseif (y_45_scale <= 18500000000000.0) tmp = t_0 * sqrt((2.0 * ((t_5 ^ 2.0) + (t_3 ^ 2.0)))); else tmp = t_0 * ((2.0 ^ 0.25) * ((2.0 ^ 0.25) * hypot((a * sin((pi * (0.005555555555555556 * angle)))), b))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[Sqrt[2.0], $MachinePrecision])}, Block[{t$95$2 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(a * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$2], $MachinePrecision]}, Block[{t$95$5 = N[(b * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 * N[(t$95$4 * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -1.1e-34], N[(N[(0.25 * N[(N[(y$45$scale * x$45$scale), $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[t$95$3 ^ 2 + t$95$5 ^ 2], $MachinePrecision] * N[(t$95$1 / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -2e-275], t$95$7, If[LessEqual[y$45$scale, 1.6e-265], N[(t$95$6 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(a * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, 2.5e-228], t$95$7, If[LessEqual[y$45$scale, 18500000000000.0], N[(t$95$0 * N[Sqrt[N[(2.0 * N[(N[Power[t$95$5, 2.0], $MachinePrecision] + N[Power[t$95$3, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[Power[2.0, 0.25], $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * N[Sqrt[N[(a * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2 + b ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\\
t_1 := -\sqrt{2}\\
t_2 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_3 := a \cdot \sin t_2\\
t_4 := \cos t_2\\
t_5 := b \cdot t_4\\
t_6 := 0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\\
t_7 := t_6 \cdot \left(t_4 \cdot \left(a \cdot t_1\right)\right)\\
\mathbf{if}\;y-scale \leq -1.1 \cdot 10^{-34}:\\
\;\;\;\;\left(0.25 \cdot \left(\left(y-scale \cdot x-scale\right) \cdot \sqrt{8}\right)\right) \cdot \left(\mathsf{hypot}\left(t_3, t_5\right) \cdot \frac{t_1}{x-scale}\right)\\
\mathbf{elif}\;y-scale \leq -2 \cdot 10^{-275}:\\
\;\;\;\;t_7\\
\mathbf{elif}\;y-scale \leq 1.6 \cdot 10^{-265}:\\
\;\;\;\;t_6 \cdot \left(\sqrt{2} \cdot \left(a \cdot t_4\right)\right)\\
\mathbf{elif}\;y-scale \leq 2.5 \cdot 10^{-228}:\\
\;\;\;\;t_7\\
\mathbf{elif}\;y-scale \leq 18500000000000:\\
\;\;\;\;t_0 \cdot \sqrt{2 \cdot \left({t_5}^{2} + {t_3}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left({2}^{0.25} \cdot \left({2}^{0.25} \cdot \mathsf{hypot}\left(a \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right), b\right)\right)\right)\\
\end{array}
\end{array}
if y-scale < -1.0999999999999999e-34Initial program 2.8%
Taylor expanded in y-scale around inf 11.5%
associate-*r*11.5%
associate-*r*11.5%
*-commutative11.5%
distribute-lft-out11.5%
+-commutative11.5%
Simplified14.7%
Taylor expanded in x-scale around -inf 39.2%
mul-1-neg39.2%
*-commutative39.2%
distribute-rgt-neg-in39.2%
Simplified49.8%
if -1.0999999999999999e-34 < y-scale < -1.99999999999999987e-275 or 1.6e-265 < y-scale < 2.49999999999999986e-228Initial program 0.6%
Taylor expanded in y-scale around 0 18.2%
associate-*r*18.2%
distribute-lft-out18.2%
fma-def18.2%
Simplified18.2%
Taylor expanded in a around -inf 28.7%
mul-1-neg28.7%
associate-*r*28.7%
distribute-lft-neg-in28.7%
Simplified28.7%
if -1.99999999999999987e-275 < y-scale < 1.6e-265Initial program 6.5%
Taylor expanded in y-scale around 0 19.2%
associate-*r*19.2%
distribute-lft-out19.2%
fma-def19.2%
Simplified19.2%
Taylor expanded in a around inf 36.8%
if 2.49999999999999986e-228 < y-scale < 1.85e13Initial program 0.3%
Taylor expanded in x-scale around 0 41.9%
associate-*r*41.9%
distribute-lft-out41.9%
*-commutative41.9%
Simplified41.9%
*-un-lft-identity41.9%
*-commutative41.9%
*-commutative41.9%
Applied egg-rr41.9%
*-lft-identity41.9%
*-commutative41.9%
associate-*r*41.8%
*-commutative41.8%
associate-*r*42.0%
Simplified42.0%
if 1.85e13 < y-scale Initial program 3.1%
Taylor expanded in x-scale around 0 54.9%
associate-*r*54.9%
distribute-lft-out54.9%
*-commutative54.9%
Simplified58.3%
Taylor expanded in angle around 0 58.4%
pow1/258.4%
unpow258.4%
*-rgt-identity58.4%
*-rgt-identity58.4%
Applied egg-rr58.4%
unpow-prod-down58.3%
pow1/258.3%
add-sqr-sqrt58.4%
associate-*l*58.4%
pow1/258.4%
sqrt-pow158.4%
metadata-eval58.4%
pow1/258.4%
sqrt-pow158.4%
metadata-eval58.4%
pow1/258.4%
unpow258.4%
hypot-def66.2%
Applied egg-rr66.2%
Final simplification46.6%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.25 (* y-scale (sqrt 8.0))))
(t_1 (- (sqrt 2.0)))
(t_2 (* 0.005555555555555556 (* angle PI)))
(t_3 (* 0.25 (* x-scale (sqrt 8.0))))
(t_4 (cos t_2))
(t_5 (* t_3 (* t_4 (* a t_1))))
(t_6 (* a (sin (* PI (* 0.005555555555555556 angle))))))
(if (<= y-scale -1.08e-35)
(*
(* 0.25 (* (* y-scale x-scale) (sqrt 8.0)))
(* (hypot (* a (sin t_2)) (* b t_4)) (/ t_1 x-scale)))
(if (<= y-scale -1.46e-279)
t_5
(if (<= y-scale 2.4e-259)
(* t_3 (* (sqrt 2.0) (* a t_4)))
(if (<= y-scale 8.8e-225)
t_5
(if (<= y-scale 7800000000000.0)
(* t_0 (pow (* 2.0 (+ (pow t_6 2.0) (* b b))) 0.5))
(* t_0 (* (pow 2.0 0.25) (* (pow 2.0 0.25) (hypot t_6 b)))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.25 * (y_45_scale * sqrt(8.0));
double t_1 = -sqrt(2.0);
double t_2 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_3 = 0.25 * (x_45_scale * sqrt(8.0));
double t_4 = cos(t_2);
double t_5 = t_3 * (t_4 * (a * t_1));
double t_6 = a * sin((((double) M_PI) * (0.005555555555555556 * angle)));
double tmp;
if (y_45_scale <= -1.08e-35) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * sqrt(8.0))) * (hypot((a * sin(t_2)), (b * t_4)) * (t_1 / x_45_scale));
} else if (y_45_scale <= -1.46e-279) {
tmp = t_5;
} else if (y_45_scale <= 2.4e-259) {
tmp = t_3 * (sqrt(2.0) * (a * t_4));
} else if (y_45_scale <= 8.8e-225) {
tmp = t_5;
} else if (y_45_scale <= 7800000000000.0) {
tmp = t_0 * pow((2.0 * (pow(t_6, 2.0) + (b * b))), 0.5);
} else {
tmp = t_0 * (pow(2.0, 0.25) * (pow(2.0, 0.25) * hypot(t_6, b)));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.25 * (y_45_scale * Math.sqrt(8.0));
double t_1 = -Math.sqrt(2.0);
double t_2 = 0.005555555555555556 * (angle * Math.PI);
double t_3 = 0.25 * (x_45_scale * Math.sqrt(8.0));
double t_4 = Math.cos(t_2);
double t_5 = t_3 * (t_4 * (a * t_1));
double t_6 = a * Math.sin((Math.PI * (0.005555555555555556 * angle)));
double tmp;
if (y_45_scale <= -1.08e-35) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * Math.sqrt(8.0))) * (Math.hypot((a * Math.sin(t_2)), (b * t_4)) * (t_1 / x_45_scale));
} else if (y_45_scale <= -1.46e-279) {
tmp = t_5;
} else if (y_45_scale <= 2.4e-259) {
tmp = t_3 * (Math.sqrt(2.0) * (a * t_4));
} else if (y_45_scale <= 8.8e-225) {
tmp = t_5;
} else if (y_45_scale <= 7800000000000.0) {
tmp = t_0 * Math.pow((2.0 * (Math.pow(t_6, 2.0) + (b * b))), 0.5);
} else {
tmp = t_0 * (Math.pow(2.0, 0.25) * (Math.pow(2.0, 0.25) * Math.hypot(t_6, b)));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = 0.25 * (y_45_scale * math.sqrt(8.0)) t_1 = -math.sqrt(2.0) t_2 = 0.005555555555555556 * (angle * math.pi) t_3 = 0.25 * (x_45_scale * math.sqrt(8.0)) t_4 = math.cos(t_2) t_5 = t_3 * (t_4 * (a * t_1)) t_6 = a * math.sin((math.pi * (0.005555555555555556 * angle))) tmp = 0 if y_45_scale <= -1.08e-35: tmp = (0.25 * ((y_45_scale * x_45_scale) * math.sqrt(8.0))) * (math.hypot((a * math.sin(t_2)), (b * t_4)) * (t_1 / x_45_scale)) elif y_45_scale <= -1.46e-279: tmp = t_5 elif y_45_scale <= 2.4e-259: tmp = t_3 * (math.sqrt(2.0) * (a * t_4)) elif y_45_scale <= 8.8e-225: tmp = t_5 elif y_45_scale <= 7800000000000.0: tmp = t_0 * math.pow((2.0 * (math.pow(t_6, 2.0) + (b * b))), 0.5) else: tmp = t_0 * (math.pow(2.0, 0.25) * (math.pow(2.0, 0.25) * math.hypot(t_6, b))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) t_1 = Float64(-sqrt(2.0)) t_2 = Float64(0.005555555555555556 * Float64(angle * pi)) t_3 = Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) t_4 = cos(t_2) t_5 = Float64(t_3 * Float64(t_4 * Float64(a * t_1))) t_6 = Float64(a * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) tmp = 0.0 if (y_45_scale <= -1.08e-35) tmp = Float64(Float64(0.25 * Float64(Float64(y_45_scale * x_45_scale) * sqrt(8.0))) * Float64(hypot(Float64(a * sin(t_2)), Float64(b * t_4)) * Float64(t_1 / x_45_scale))); elseif (y_45_scale <= -1.46e-279) tmp = t_5; elseif (y_45_scale <= 2.4e-259) tmp = Float64(t_3 * Float64(sqrt(2.0) * Float64(a * t_4))); elseif (y_45_scale <= 8.8e-225) tmp = t_5; elseif (y_45_scale <= 7800000000000.0) tmp = Float64(t_0 * (Float64(2.0 * Float64((t_6 ^ 2.0) + Float64(b * b))) ^ 0.5)); else tmp = Float64(t_0 * Float64((2.0 ^ 0.25) * Float64((2.0 ^ 0.25) * hypot(t_6, b)))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = 0.25 * (y_45_scale * sqrt(8.0)); t_1 = -sqrt(2.0); t_2 = 0.005555555555555556 * (angle * pi); t_3 = 0.25 * (x_45_scale * sqrt(8.0)); t_4 = cos(t_2); t_5 = t_3 * (t_4 * (a * t_1)); t_6 = a * sin((pi * (0.005555555555555556 * angle))); tmp = 0.0; if (y_45_scale <= -1.08e-35) tmp = (0.25 * ((y_45_scale * x_45_scale) * sqrt(8.0))) * (hypot((a * sin(t_2)), (b * t_4)) * (t_1 / x_45_scale)); elseif (y_45_scale <= -1.46e-279) tmp = t_5; elseif (y_45_scale <= 2.4e-259) tmp = t_3 * (sqrt(2.0) * (a * t_4)); elseif (y_45_scale <= 8.8e-225) tmp = t_5; elseif (y_45_scale <= 7800000000000.0) tmp = t_0 * ((2.0 * ((t_6 ^ 2.0) + (b * b))) ^ 0.5); else tmp = t_0 * ((2.0 ^ 0.25) * ((2.0 ^ 0.25) * hypot(t_6, b))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[Sqrt[2.0], $MachinePrecision])}, Block[{t$95$2 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Cos[t$95$2], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 * N[(t$95$4 * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(a * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -1.08e-35], N[(N[(0.25 * N[(N[(y$45$scale * x$45$scale), $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(a * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * t$95$4), $MachinePrecision] ^ 2], $MachinePrecision] * N[(t$95$1 / x$45$scale), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -1.46e-279], t$95$5, If[LessEqual[y$45$scale, 2.4e-259], N[(t$95$3 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(a * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, 8.8e-225], t$95$5, If[LessEqual[y$45$scale, 7800000000000.0], N[(t$95$0 * N[Power[N[(2.0 * N[(N[Power[t$95$6, 2.0], $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[Power[2.0, 0.25], $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * N[Sqrt[t$95$6 ^ 2 + b ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\\
t_1 := -\sqrt{2}\\
t_2 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_3 := 0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\\
t_4 := \cos t_2\\
t_5 := t_3 \cdot \left(t_4 \cdot \left(a \cdot t_1\right)\right)\\
t_6 := a \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\\
\mathbf{if}\;y-scale \leq -1.08 \cdot 10^{-35}:\\
\;\;\;\;\left(0.25 \cdot \left(\left(y-scale \cdot x-scale\right) \cdot \sqrt{8}\right)\right) \cdot \left(\mathsf{hypot}\left(a \cdot \sin t_2, b \cdot t_4\right) \cdot \frac{t_1}{x-scale}\right)\\
\mathbf{elif}\;y-scale \leq -1.46 \cdot 10^{-279}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y-scale \leq 2.4 \cdot 10^{-259}:\\
\;\;\;\;t_3 \cdot \left(\sqrt{2} \cdot \left(a \cdot t_4\right)\right)\\
\mathbf{elif}\;y-scale \leq 8.8 \cdot 10^{-225}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y-scale \leq 7800000000000:\\
\;\;\;\;t_0 \cdot {\left(2 \cdot \left({t_6}^{2} + b \cdot b\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left({2}^{0.25} \cdot \left({2}^{0.25} \cdot \mathsf{hypot}\left(t_6, b\right)\right)\right)\\
\end{array}
\end{array}
if y-scale < -1.08000000000000003e-35Initial program 2.8%
Taylor expanded in y-scale around inf 11.5%
associate-*r*11.5%
associate-*r*11.5%
*-commutative11.5%
distribute-lft-out11.5%
+-commutative11.5%
Simplified14.7%
Taylor expanded in x-scale around -inf 39.2%
mul-1-neg39.2%
*-commutative39.2%
distribute-rgt-neg-in39.2%
Simplified49.8%
if -1.08000000000000003e-35 < y-scale < -1.46000000000000005e-279 or 2.4000000000000001e-259 < y-scale < 8.8e-225Initial program 0.6%
Taylor expanded in y-scale around 0 18.2%
associate-*r*18.2%
distribute-lft-out18.2%
fma-def18.2%
Simplified18.2%
Taylor expanded in a around -inf 28.7%
mul-1-neg28.7%
associate-*r*28.7%
distribute-lft-neg-in28.7%
Simplified28.7%
if -1.46000000000000005e-279 < y-scale < 2.4000000000000001e-259Initial program 6.5%
Taylor expanded in y-scale around 0 19.2%
associate-*r*19.2%
distribute-lft-out19.2%
fma-def19.2%
Simplified19.2%
Taylor expanded in a around inf 36.8%
if 8.8e-225 < y-scale < 7.8e12Initial program 0.3%
Taylor expanded in x-scale around 0 41.9%
associate-*r*41.9%
distribute-lft-out41.9%
*-commutative41.9%
Simplified41.9%
Taylor expanded in angle around 0 41.9%
pow1/241.9%
unpow241.9%
*-rgt-identity41.9%
*-rgt-identity41.9%
Applied egg-rr41.9%
if 7.8e12 < y-scale Initial program 3.1%
Taylor expanded in x-scale around 0 54.9%
associate-*r*54.9%
distribute-lft-out54.9%
*-commutative54.9%
Simplified58.3%
Taylor expanded in angle around 0 58.4%
pow1/258.4%
unpow258.4%
*-rgt-identity58.4%
*-rgt-identity58.4%
Applied egg-rr58.4%
unpow-prod-down58.3%
pow1/258.3%
add-sqr-sqrt58.4%
associate-*l*58.4%
pow1/258.4%
sqrt-pow158.4%
metadata-eval58.4%
pow1/258.4%
sqrt-pow158.4%
metadata-eval58.4%
pow1/258.4%
unpow258.4%
hypot-def66.2%
Applied egg-rr66.2%
Final simplification46.6%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (cos t_0))
(t_2 (* b (sqrt 2.0)))
(t_3 (* y-scale (sqrt 8.0)))
(t_4 (* a (sin (* PI (* 0.005555555555555556 angle)))))
(t_5 (* 0.25 t_3))
(t_6 (* 0.25 (* x-scale (sqrt 8.0))))
(t_7 (* t_6 (* t_1 (* a (- (sqrt 2.0)))))))
(if (<= y-scale -1.65e+232)
(* (* 0.25 (cbrt (pow t_3 3.0))) (* t_1 t_2))
(if (<= y-scale -6.2e+36)
(* t_5 (* (sqrt 2.0) (- b)))
(if (<= y-scale -1.1e-34)
(* (* 0.25 (* (* y-scale x-scale) (sqrt 8.0))) (/ t_2 x-scale))
(if (<= y-scale -2.1e-166)
t_7
(if (<= y-scale -2.25e-198)
(* t_6 (* (sqrt 2.0) (* (sin t_0) (- b))))
(if (<= y-scale -3.7e-280)
t_7
(if (<= y-scale 5.8e-266)
(* t_6 (* (sqrt 2.0) (* a t_1)))
(if (<= y-scale 14200000000000.0)
(* t_5 (pow (* 2.0 (+ (pow t_4 2.0) (* b b))) 0.5))
(*
t_5
(*
(pow 2.0 0.25)
(* (pow 2.0 0.25) (hypot t_4 b))))))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double t_2 = b * sqrt(2.0);
double t_3 = y_45_scale * sqrt(8.0);
double t_4 = a * sin((((double) M_PI) * (0.005555555555555556 * angle)));
double t_5 = 0.25 * t_3;
double t_6 = 0.25 * (x_45_scale * sqrt(8.0));
double t_7 = t_6 * (t_1 * (a * -sqrt(2.0)));
double tmp;
if (y_45_scale <= -1.65e+232) {
tmp = (0.25 * cbrt(pow(t_3, 3.0))) * (t_1 * t_2);
} else if (y_45_scale <= -6.2e+36) {
tmp = t_5 * (sqrt(2.0) * -b);
} else if (y_45_scale <= -1.1e-34) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * sqrt(8.0))) * (t_2 / x_45_scale);
} else if (y_45_scale <= -2.1e-166) {
tmp = t_7;
} else if (y_45_scale <= -2.25e-198) {
tmp = t_6 * (sqrt(2.0) * (sin(t_0) * -b));
} else if (y_45_scale <= -3.7e-280) {
tmp = t_7;
} else if (y_45_scale <= 5.8e-266) {
tmp = t_6 * (sqrt(2.0) * (a * t_1));
} else if (y_45_scale <= 14200000000000.0) {
tmp = t_5 * pow((2.0 * (pow(t_4, 2.0) + (b * b))), 0.5);
} else {
tmp = t_5 * (pow(2.0, 0.25) * (pow(2.0, 0.25) * hypot(t_4, b)));
}
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 = Math.cos(t_0);
double t_2 = b * Math.sqrt(2.0);
double t_3 = y_45_scale * Math.sqrt(8.0);
double t_4 = a * Math.sin((Math.PI * (0.005555555555555556 * angle)));
double t_5 = 0.25 * t_3;
double t_6 = 0.25 * (x_45_scale * Math.sqrt(8.0));
double t_7 = t_6 * (t_1 * (a * -Math.sqrt(2.0)));
double tmp;
if (y_45_scale <= -1.65e+232) {
tmp = (0.25 * Math.cbrt(Math.pow(t_3, 3.0))) * (t_1 * t_2);
} else if (y_45_scale <= -6.2e+36) {
tmp = t_5 * (Math.sqrt(2.0) * -b);
} else if (y_45_scale <= -1.1e-34) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * Math.sqrt(8.0))) * (t_2 / x_45_scale);
} else if (y_45_scale <= -2.1e-166) {
tmp = t_7;
} else if (y_45_scale <= -2.25e-198) {
tmp = t_6 * (Math.sqrt(2.0) * (Math.sin(t_0) * -b));
} else if (y_45_scale <= -3.7e-280) {
tmp = t_7;
} else if (y_45_scale <= 5.8e-266) {
tmp = t_6 * (Math.sqrt(2.0) * (a * t_1));
} else if (y_45_scale <= 14200000000000.0) {
tmp = t_5 * Math.pow((2.0 * (Math.pow(t_4, 2.0) + (b * b))), 0.5);
} else {
tmp = t_5 * (Math.pow(2.0, 0.25) * (Math.pow(2.0, 0.25) * Math.hypot(t_4, b)));
}
return tmp;
}
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) t_2 = Float64(b * sqrt(2.0)) t_3 = Float64(y_45_scale * sqrt(8.0)) t_4 = Float64(a * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) t_5 = Float64(0.25 * t_3) t_6 = Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) t_7 = Float64(t_6 * Float64(t_1 * Float64(a * Float64(-sqrt(2.0))))) tmp = 0.0 if (y_45_scale <= -1.65e+232) tmp = Float64(Float64(0.25 * cbrt((t_3 ^ 3.0))) * Float64(t_1 * t_2)); elseif (y_45_scale <= -6.2e+36) tmp = Float64(t_5 * Float64(sqrt(2.0) * Float64(-b))); elseif (y_45_scale <= -1.1e-34) tmp = Float64(Float64(0.25 * Float64(Float64(y_45_scale * x_45_scale) * sqrt(8.0))) * Float64(t_2 / x_45_scale)); elseif (y_45_scale <= -2.1e-166) tmp = t_7; elseif (y_45_scale <= -2.25e-198) tmp = Float64(t_6 * Float64(sqrt(2.0) * Float64(sin(t_0) * Float64(-b)))); elseif (y_45_scale <= -3.7e-280) tmp = t_7; elseif (y_45_scale <= 5.8e-266) tmp = Float64(t_6 * Float64(sqrt(2.0) * Float64(a * t_1))); elseif (y_45_scale <= 14200000000000.0) tmp = Float64(t_5 * (Float64(2.0 * Float64((t_4 ^ 2.0) + Float64(b * b))) ^ 0.5)); else tmp = Float64(t_5 * Float64((2.0 ^ 0.25) * Float64((2.0 ^ 0.25) * hypot(t_4, b)))); end return 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[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(a * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(0.25 * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 * N[(t$95$1 * N[(a * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -1.65e+232], N[(N[(0.25 * N[Power[N[Power[t$95$3, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -6.2e+36], N[(t$95$5 * N[(N[Sqrt[2.0], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -1.1e-34], N[(N[(0.25 * N[(N[(y$45$scale * x$45$scale), $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / x$45$scale), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -2.1e-166], t$95$7, If[LessEqual[y$45$scale, -2.25e-198], N[(t$95$6 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -3.7e-280], t$95$7, If[LessEqual[y$45$scale, 5.8e-266], N[(t$95$6 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, 14200000000000.0], N[(t$95$5 * N[Power[N[(2.0 * N[(N[Power[t$95$4, 2.0], $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(t$95$5 * N[(N[Power[2.0, 0.25], $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * N[Sqrt[t$95$4 ^ 2 + b ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t_0\\
t_2 := b \cdot \sqrt{2}\\
t_3 := y-scale \cdot \sqrt{8}\\
t_4 := a \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\\
t_5 := 0.25 \cdot t_3\\
t_6 := 0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\\
t_7 := t_6 \cdot \left(t_1 \cdot \left(a \cdot \left(-\sqrt{2}\right)\right)\right)\\
\mathbf{if}\;y-scale \leq -1.65 \cdot 10^{+232}:\\
\;\;\;\;\left(0.25 \cdot \sqrt[3]{{t_3}^{3}}\right) \cdot \left(t_1 \cdot t_2\right)\\
\mathbf{elif}\;y-scale \leq -6.2 \cdot 10^{+36}:\\
\;\;\;\;t_5 \cdot \left(\sqrt{2} \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y-scale \leq -1.1 \cdot 10^{-34}:\\
\;\;\;\;\left(0.25 \cdot \left(\left(y-scale \cdot x-scale\right) \cdot \sqrt{8}\right)\right) \cdot \frac{t_2}{x-scale}\\
\mathbf{elif}\;y-scale \leq -2.1 \cdot 10^{-166}:\\
\;\;\;\;t_7\\
\mathbf{elif}\;y-scale \leq -2.25 \cdot 10^{-198}:\\
\;\;\;\;t_6 \cdot \left(\sqrt{2} \cdot \left(\sin t_0 \cdot \left(-b\right)\right)\right)\\
\mathbf{elif}\;y-scale \leq -3.7 \cdot 10^{-280}:\\
\;\;\;\;t_7\\
\mathbf{elif}\;y-scale \leq 5.8 \cdot 10^{-266}:\\
\;\;\;\;t_6 \cdot \left(\sqrt{2} \cdot \left(a \cdot t_1\right)\right)\\
\mathbf{elif}\;y-scale \leq 14200000000000:\\
\;\;\;\;t_5 \cdot {\left(2 \cdot \left({t_4}^{2} + b \cdot b\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;t_5 \cdot \left({2}^{0.25} \cdot \left({2}^{0.25} \cdot \mathsf{hypot}\left(t_4, b\right)\right)\right)\\
\end{array}
\end{array}
if y-scale < -1.65e232Initial program 0.0%
Taylor expanded in x-scale around 0 0.0%
associate-*r*0.0%
distribute-lft-out0.0%
*-commutative0.0%
Simplified0.1%
Taylor expanded in a around 0 51.0%
associate-*r*51.0%
Simplified51.0%
add-cbrt-cube59.9%
Applied egg-rr59.9%
associate-*l*59.9%
cube-unmult59.9%
Simplified59.9%
if -1.65e232 < y-scale < -6.1999999999999999e36Initial program 4.2%
Taylor expanded in x-scale around 0 0.6%
associate-*r*0.6%
distribute-lft-out0.6%
*-commutative0.6%
Simplified0.6%
Taylor expanded in angle around 0 0.6%
Taylor expanded in b around -inf 32.7%
mul-1-neg32.7%
distribute-rgt-neg-in32.7%
Simplified32.7%
if -6.1999999999999999e36 < y-scale < -1.0999999999999999e-34Initial program 2.4%
Taylor expanded in y-scale around inf 13.8%
associate-*r*13.8%
associate-*r*13.8%
*-commutative13.8%
distribute-lft-out13.8%
+-commutative13.8%
Simplified13.8%
Taylor expanded in angle around 0 25.9%
if -1.0999999999999999e-34 < y-scale < -2.0999999999999999e-166 or -2.2499999999999999e-198 < y-scale < -3.6999999999999998e-280Initial program 0.6%
Taylor expanded in y-scale around 0 18.4%
associate-*r*18.4%
distribute-lft-out18.4%
fma-def18.4%
Simplified18.4%
Taylor expanded in a around -inf 28.8%
mul-1-neg28.8%
associate-*r*28.8%
distribute-lft-neg-in28.8%
Simplified28.8%
if -2.0999999999999999e-166 < y-scale < -2.2499999999999999e-198Initial program 0.5%
Taylor expanded in y-scale around 0 24.3%
associate-*r*24.3%
distribute-lft-out24.3%
fma-def24.3%
Simplified24.3%
Taylor expanded in b around -inf 35.4%
mul-1-neg35.4%
distribute-rgt-neg-in35.4%
*-commutative35.4%
Simplified35.4%
if -3.6999999999999998e-280 < y-scale < 5.79999999999999991e-266Initial program 6.9%
Taylor expanded in y-scale around 0 20.4%
associate-*r*20.4%
distribute-lft-out20.4%
fma-def20.4%
Simplified20.4%
Taylor expanded in a around inf 38.7%
if 5.79999999999999991e-266 < y-scale < 1.42e13Initial program 0.3%
Taylor expanded in x-scale around 0 41.9%
associate-*r*41.9%
distribute-lft-out41.9%
*-commutative41.9%
Simplified41.9%
Taylor expanded in angle around 0 41.9%
pow1/241.9%
unpow241.9%
*-rgt-identity41.9%
*-rgt-identity41.9%
Applied egg-rr41.9%
if 1.42e13 < y-scale Initial program 3.1%
Taylor expanded in x-scale around 0 54.9%
associate-*r*54.9%
distribute-lft-out54.9%
*-commutative54.9%
Simplified58.3%
Taylor expanded in angle around 0 58.4%
pow1/258.4%
unpow258.4%
*-rgt-identity58.4%
*-rgt-identity58.4%
Applied egg-rr58.4%
unpow-prod-down58.3%
pow1/258.3%
add-sqr-sqrt58.4%
associate-*l*58.4%
pow1/258.4%
sqrt-pow158.4%
metadata-eval58.4%
pow1/258.4%
sqrt-pow158.4%
metadata-eval58.4%
pow1/258.4%
unpow258.4%
hypot-def66.2%
Applied egg-rr66.2%
Final simplification43.8%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (sin (* PI (* 0.005555555555555556 angle))))
(t_1 (* 0.25 (* x-scale (sqrt 8.0)))))
(if (<= x-scale -5.5e+166)
(*
t_1
(* (cos (* 0.005555555555555556 (* angle PI))) (* a (- (sqrt 2.0)))))
(if (<= x-scale -1.05e+73)
(*
t_1
(*
(* a (sqrt 2.0))
(+ 1.0 (* -1.54320987654321e-5 (* (* angle angle) (pow PI 2.0))))))
(if (<= x-scale 1.05e-82)
(*
(* 0.25 (* y-scale (sqrt 8.0)))
(* (pow 2.0 0.25) (* (pow 2.0 0.25) (hypot (* a t_0) b))))
(*
t_1
(sqrt (* 2.0 (fma (* a a) 1.0 (* (* b b) (pow t_0 2.0)))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = sin((((double) M_PI) * (0.005555555555555556 * angle)));
double t_1 = 0.25 * (x_45_scale * sqrt(8.0));
double tmp;
if (x_45_scale <= -5.5e+166) {
tmp = t_1 * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * (a * -sqrt(2.0)));
} else if (x_45_scale <= -1.05e+73) {
tmp = t_1 * ((a * sqrt(2.0)) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * pow(((double) M_PI), 2.0)))));
} else if (x_45_scale <= 1.05e-82) {
tmp = (0.25 * (y_45_scale * sqrt(8.0))) * (pow(2.0, 0.25) * (pow(2.0, 0.25) * hypot((a * t_0), b)));
} else {
tmp = t_1 * sqrt((2.0 * fma((a * a), 1.0, ((b * b) * pow(t_0, 2.0)))));
}
return tmp;
}
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = sin(Float64(pi * Float64(0.005555555555555556 * angle))) t_1 = Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) tmp = 0.0 if (x_45_scale <= -5.5e+166) tmp = Float64(t_1 * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(a * Float64(-sqrt(2.0))))); elseif (x_45_scale <= -1.05e+73) tmp = Float64(t_1 * Float64(Float64(a * sqrt(2.0)) * Float64(1.0 + Float64(-1.54320987654321e-5 * Float64(Float64(angle * angle) * (pi ^ 2.0)))))); elseif (x_45_scale <= 1.05e-82) tmp = Float64(Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) * Float64((2.0 ^ 0.25) * Float64((2.0 ^ 0.25) * hypot(Float64(a * t_0), b)))); else tmp = Float64(t_1 * sqrt(Float64(2.0 * fma(Float64(a * a), 1.0, Float64(Float64(b * b) * (t_0 ^ 2.0)))))); end return tmp end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -5.5e+166], N[(t$95$1 * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, -1.05e+73], N[(t$95$1 * N[(N[(a * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-1.54320987654321e-5 * N[(N[(angle * angle), $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 1.05e-82], N[(N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * N[(N[Power[2.0, 0.25], $MachinePrecision] * N[Sqrt[N[(a * t$95$0), $MachinePrecision] ^ 2 + b ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sqrt[N[(2.0 * N[(N[(a * a), $MachinePrecision] * 1.0 + N[(N[(b * b), $MachinePrecision] * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\\
t_1 := 0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\\
\mathbf{if}\;x-scale \leq -5.5 \cdot 10^{+166}:\\
\;\;\;\;t_1 \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(-\sqrt{2}\right)\right)\right)\\
\mathbf{elif}\;x-scale \leq -1.05 \cdot 10^{+73}:\\
\;\;\;\;t_1 \cdot \left(\left(a \cdot \sqrt{2}\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot {\pi}^{2}\right)\right)\right)\\
\mathbf{elif}\;x-scale \leq 1.05 \cdot 10^{-82}:\\
\;\;\;\;\left(0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \left({2}^{0.25} \cdot \left({2}^{0.25} \cdot \mathsf{hypot}\left(a \cdot t_0, b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sqrt{2 \cdot \mathsf{fma}\left(a \cdot a, 1, \left(b \cdot b\right) \cdot {t_0}^{2}\right)}\\
\end{array}
\end{array}
if x-scale < -5.50000000000000008e166Initial program 0.4%
Taylor expanded in y-scale around 0 0.5%
associate-*r*0.5%
distribute-lft-out0.5%
fma-def0.5%
Simplified0.5%
Taylor expanded in a around -inf 42.2%
mul-1-neg42.2%
associate-*r*42.2%
distribute-lft-neg-in42.2%
Simplified42.2%
if -5.50000000000000008e166 < x-scale < -1.0500000000000001e73Initial program 2.1%
Taylor expanded in y-scale around 0 0.5%
associate-*r*0.5%
distribute-lft-out0.5%
fma-def0.5%
Simplified0.5%
Taylor expanded in a around inf 30.6%
associate-*r*30.6%
Simplified30.6%
Taylor expanded in angle around 0 46.1%
unpow246.1%
Simplified46.1%
if -1.0500000000000001e73 < x-scale < 1.05e-82Initial program 2.6%
Taylor expanded in x-scale around 0 24.9%
associate-*r*24.9%
distribute-lft-out24.9%
*-commutative24.9%
Simplified26.6%
Taylor expanded in angle around 0 26.7%
pow1/226.7%
unpow226.7%
*-rgt-identity26.7%
*-rgt-identity26.7%
Applied egg-rr26.7%
unpow-prod-down26.6%
pow1/226.6%
add-sqr-sqrt26.7%
associate-*l*26.7%
pow1/226.7%
sqrt-pow126.7%
metadata-eval26.7%
pow1/226.7%
sqrt-pow126.7%
metadata-eval26.7%
pow1/226.7%
unpow226.7%
hypot-def32.0%
Applied egg-rr32.0%
if 1.05e-82 < x-scale Initial program 2.0%
Taylor expanded in y-scale around 0 44.9%
associate-*r*44.9%
distribute-lft-out44.9%
fma-def44.9%
Simplified45.0%
Taylor expanded in angle around 0 44.8%
Final simplification38.3%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (cos t_0))
(t_2 (* b (sqrt 2.0)))
(t_3 (* y-scale (sqrt 8.0)))
(t_4 (* a (sin (* PI (* 0.005555555555555556 angle)))))
(t_5 (* 0.25 t_3))
(t_6 (* 0.25 (* x-scale (sqrt 8.0))))
(t_7 (* t_6 (* t_1 (* a (- (sqrt 2.0)))))))
(if (<= y-scale -2.25e+232)
(* (* 0.25 (cbrt (pow t_3 3.0))) (* t_1 t_2))
(if (<= y-scale -8.5e+35)
(* t_5 (* (sqrt 2.0) (- b)))
(if (<= y-scale -1.1e-34)
(* (* 0.25 (* (* y-scale x-scale) (sqrt 8.0))) (/ t_2 x-scale))
(if (<= y-scale -2.7e-166)
t_7
(if (<= y-scale -3.4e-197)
(* t_6 (* (sqrt 2.0) (* (sin t_0) (- b))))
(if (<= y-scale -5.8e-276)
t_7
(if (<= y-scale 9.5e-267)
(* t_6 (* (sqrt 2.0) (* a t_1)))
(if (<= y-scale 9e+49)
(* t_5 (pow (* 2.0 (+ (pow t_4 2.0) (* b b))) 0.5))
(* t_5 (* (sqrt 2.0) (hypot t_4 b)))))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double t_2 = b * sqrt(2.0);
double t_3 = y_45_scale * sqrt(8.0);
double t_4 = a * sin((((double) M_PI) * (0.005555555555555556 * angle)));
double t_5 = 0.25 * t_3;
double t_6 = 0.25 * (x_45_scale * sqrt(8.0));
double t_7 = t_6 * (t_1 * (a * -sqrt(2.0)));
double tmp;
if (y_45_scale <= -2.25e+232) {
tmp = (0.25 * cbrt(pow(t_3, 3.0))) * (t_1 * t_2);
} else if (y_45_scale <= -8.5e+35) {
tmp = t_5 * (sqrt(2.0) * -b);
} else if (y_45_scale <= -1.1e-34) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * sqrt(8.0))) * (t_2 / x_45_scale);
} else if (y_45_scale <= -2.7e-166) {
tmp = t_7;
} else if (y_45_scale <= -3.4e-197) {
tmp = t_6 * (sqrt(2.0) * (sin(t_0) * -b));
} else if (y_45_scale <= -5.8e-276) {
tmp = t_7;
} else if (y_45_scale <= 9.5e-267) {
tmp = t_6 * (sqrt(2.0) * (a * t_1));
} else if (y_45_scale <= 9e+49) {
tmp = t_5 * pow((2.0 * (pow(t_4, 2.0) + (b * b))), 0.5);
} else {
tmp = t_5 * (sqrt(2.0) * hypot(t_4, b));
}
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 = Math.cos(t_0);
double t_2 = b * Math.sqrt(2.0);
double t_3 = y_45_scale * Math.sqrt(8.0);
double t_4 = a * Math.sin((Math.PI * (0.005555555555555556 * angle)));
double t_5 = 0.25 * t_3;
double t_6 = 0.25 * (x_45_scale * Math.sqrt(8.0));
double t_7 = t_6 * (t_1 * (a * -Math.sqrt(2.0)));
double tmp;
if (y_45_scale <= -2.25e+232) {
tmp = (0.25 * Math.cbrt(Math.pow(t_3, 3.0))) * (t_1 * t_2);
} else if (y_45_scale <= -8.5e+35) {
tmp = t_5 * (Math.sqrt(2.0) * -b);
} else if (y_45_scale <= -1.1e-34) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * Math.sqrt(8.0))) * (t_2 / x_45_scale);
} else if (y_45_scale <= -2.7e-166) {
tmp = t_7;
} else if (y_45_scale <= -3.4e-197) {
tmp = t_6 * (Math.sqrt(2.0) * (Math.sin(t_0) * -b));
} else if (y_45_scale <= -5.8e-276) {
tmp = t_7;
} else if (y_45_scale <= 9.5e-267) {
tmp = t_6 * (Math.sqrt(2.0) * (a * t_1));
} else if (y_45_scale <= 9e+49) {
tmp = t_5 * Math.pow((2.0 * (Math.pow(t_4, 2.0) + (b * b))), 0.5);
} else {
tmp = t_5 * (Math.sqrt(2.0) * Math.hypot(t_4, b));
}
return tmp;
}
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) t_2 = Float64(b * sqrt(2.0)) t_3 = Float64(y_45_scale * sqrt(8.0)) t_4 = Float64(a * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) t_5 = Float64(0.25 * t_3) t_6 = Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) t_7 = Float64(t_6 * Float64(t_1 * Float64(a * Float64(-sqrt(2.0))))) tmp = 0.0 if (y_45_scale <= -2.25e+232) tmp = Float64(Float64(0.25 * cbrt((t_3 ^ 3.0))) * Float64(t_1 * t_2)); elseif (y_45_scale <= -8.5e+35) tmp = Float64(t_5 * Float64(sqrt(2.0) * Float64(-b))); elseif (y_45_scale <= -1.1e-34) tmp = Float64(Float64(0.25 * Float64(Float64(y_45_scale * x_45_scale) * sqrt(8.0))) * Float64(t_2 / x_45_scale)); elseif (y_45_scale <= -2.7e-166) tmp = t_7; elseif (y_45_scale <= -3.4e-197) tmp = Float64(t_6 * Float64(sqrt(2.0) * Float64(sin(t_0) * Float64(-b)))); elseif (y_45_scale <= -5.8e-276) tmp = t_7; elseif (y_45_scale <= 9.5e-267) tmp = Float64(t_6 * Float64(sqrt(2.0) * Float64(a * t_1))); elseif (y_45_scale <= 9e+49) tmp = Float64(t_5 * (Float64(2.0 * Float64((t_4 ^ 2.0) + Float64(b * b))) ^ 0.5)); else tmp = Float64(t_5 * Float64(sqrt(2.0) * hypot(t_4, b))); end return 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[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(a * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(0.25 * t$95$3), $MachinePrecision]}, Block[{t$95$6 = N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 * N[(t$95$1 * N[(a * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -2.25e+232], N[(N[(0.25 * N[Power[N[Power[t$95$3, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -8.5e+35], N[(t$95$5 * N[(N[Sqrt[2.0], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -1.1e-34], N[(N[(0.25 * N[(N[(y$45$scale * x$45$scale), $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / x$45$scale), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -2.7e-166], t$95$7, If[LessEqual[y$45$scale, -3.4e-197], N[(t$95$6 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -5.8e-276], t$95$7, If[LessEqual[y$45$scale, 9.5e-267], N[(t$95$6 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, 9e+49], N[(t$95$5 * N[Power[N[(2.0 * N[(N[Power[t$95$4, 2.0], $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(t$95$5 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[t$95$4 ^ 2 + b ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t_0\\
t_2 := b \cdot \sqrt{2}\\
t_3 := y-scale \cdot \sqrt{8}\\
t_4 := a \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\\
t_5 := 0.25 \cdot t_3\\
t_6 := 0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\\
t_7 := t_6 \cdot \left(t_1 \cdot \left(a \cdot \left(-\sqrt{2}\right)\right)\right)\\
\mathbf{if}\;y-scale \leq -2.25 \cdot 10^{+232}:\\
\;\;\;\;\left(0.25 \cdot \sqrt[3]{{t_3}^{3}}\right) \cdot \left(t_1 \cdot t_2\right)\\
\mathbf{elif}\;y-scale \leq -8.5 \cdot 10^{+35}:\\
\;\;\;\;t_5 \cdot \left(\sqrt{2} \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y-scale \leq -1.1 \cdot 10^{-34}:\\
\;\;\;\;\left(0.25 \cdot \left(\left(y-scale \cdot x-scale\right) \cdot \sqrt{8}\right)\right) \cdot \frac{t_2}{x-scale}\\
\mathbf{elif}\;y-scale \leq -2.7 \cdot 10^{-166}:\\
\;\;\;\;t_7\\
\mathbf{elif}\;y-scale \leq -3.4 \cdot 10^{-197}:\\
\;\;\;\;t_6 \cdot \left(\sqrt{2} \cdot \left(\sin t_0 \cdot \left(-b\right)\right)\right)\\
\mathbf{elif}\;y-scale \leq -5.8 \cdot 10^{-276}:\\
\;\;\;\;t_7\\
\mathbf{elif}\;y-scale \leq 9.5 \cdot 10^{-267}:\\
\;\;\;\;t_6 \cdot \left(\sqrt{2} \cdot \left(a \cdot t_1\right)\right)\\
\mathbf{elif}\;y-scale \leq 9 \cdot 10^{+49}:\\
\;\;\;\;t_5 \cdot {\left(2 \cdot \left({t_4}^{2} + b \cdot b\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;t_5 \cdot \left(\sqrt{2} \cdot \mathsf{hypot}\left(t_4, b\right)\right)\\
\end{array}
\end{array}
if y-scale < -2.2499999999999999e232Initial program 0.0%
Taylor expanded in x-scale around 0 0.0%
associate-*r*0.0%
distribute-lft-out0.0%
*-commutative0.0%
Simplified0.1%
Taylor expanded in a around 0 51.0%
associate-*r*51.0%
Simplified51.0%
add-cbrt-cube59.9%
Applied egg-rr59.9%
associate-*l*59.9%
cube-unmult59.9%
Simplified59.9%
if -2.2499999999999999e232 < y-scale < -8.4999999999999995e35Initial program 4.2%
Taylor expanded in x-scale around 0 0.6%
associate-*r*0.6%
distribute-lft-out0.6%
*-commutative0.6%
Simplified0.6%
Taylor expanded in angle around 0 0.6%
Taylor expanded in b around -inf 32.7%
mul-1-neg32.7%
distribute-rgt-neg-in32.7%
Simplified32.7%
if -8.4999999999999995e35 < y-scale < -1.0999999999999999e-34Initial program 2.4%
Taylor expanded in y-scale around inf 13.8%
associate-*r*13.8%
associate-*r*13.8%
*-commutative13.8%
distribute-lft-out13.8%
+-commutative13.8%
Simplified13.8%
Taylor expanded in angle around 0 25.9%
if -1.0999999999999999e-34 < y-scale < -2.70000000000000006e-166 or -3.3999999999999998e-197 < y-scale < -5.79999999999999975e-276Initial program 0.6%
Taylor expanded in y-scale around 0 18.4%
associate-*r*18.4%
distribute-lft-out18.4%
fma-def18.4%
Simplified18.4%
Taylor expanded in a around -inf 28.8%
mul-1-neg28.8%
associate-*r*28.8%
distribute-lft-neg-in28.8%
Simplified28.8%
if -2.70000000000000006e-166 < y-scale < -3.3999999999999998e-197Initial program 0.5%
Taylor expanded in y-scale around 0 24.3%
associate-*r*24.3%
distribute-lft-out24.3%
fma-def24.3%
Simplified24.3%
Taylor expanded in b around -inf 35.4%
mul-1-neg35.4%
distribute-rgt-neg-in35.4%
*-commutative35.4%
Simplified35.4%
if -5.79999999999999975e-276 < y-scale < 9.49999999999999985e-267Initial program 6.9%
Taylor expanded in y-scale around 0 20.4%
associate-*r*20.4%
distribute-lft-out20.4%
fma-def20.4%
Simplified20.4%
Taylor expanded in a around inf 38.7%
if 9.49999999999999985e-267 < y-scale < 8.99999999999999965e49Initial program 0.3%
Taylor expanded in x-scale around 0 40.6%
associate-*r*40.6%
distribute-lft-out40.6%
*-commutative40.6%
Simplified40.5%
Taylor expanded in angle around 0 40.6%
pow1/240.6%
unpow240.6%
*-rgt-identity40.6%
*-rgt-identity40.6%
Applied egg-rr40.6%
if 8.99999999999999965e49 < y-scale Initial program 3.6%
Taylor expanded in x-scale around 0 58.6%
associate-*r*58.6%
distribute-lft-out58.6%
*-commutative58.6%
Simplified62.6%
Taylor expanded in angle around 0 62.7%
pow1/262.7%
unpow262.7%
*-rgt-identity62.7%
*-rgt-identity62.7%
Applied egg-rr62.7%
pow1/262.7%
*-commutative62.7%
sqrt-prod62.6%
unpow262.6%
hypot-def71.6%
Applied egg-rr71.6%
Final simplification43.7%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (cos (* 0.005555555555555556 (* angle PI))))
(t_1 (* 0.25 (* y-scale (sqrt 8.0))))
(t_2 (* 0.25 (* x-scale (sqrt 8.0))))
(t_3 (* t_2 (* (sqrt 2.0) (* a t_0))))
(t_4 (* t_2 (* t_0 (* a (- (sqrt 2.0))))))
(t_5 (* a (sin (* PI (* 0.005555555555555556 angle))))))
(if (<= y-scale -4.2e+232)
(* 0.25 (* y-scale (pow (cbrt (* b (* (sqrt 8.0) (sqrt 2.0)))) 3.0)))
(if (<= y-scale -5.8e+37)
(* t_1 (* (sqrt 2.0) (- b)))
(if (<= y-scale -6.1e-37)
(*
(* 0.25 (* (* y-scale x-scale) (sqrt 8.0)))
(/ (* b (sqrt 2.0)) x-scale))
(if (<= y-scale -7.8e-104)
t_3
(if (<= y-scale -8.5e-277)
t_4
(if (<= y-scale 4.4e-261)
t_3
(if (<= y-scale 9.5e-222)
t_4
(if (<= y-scale 6e+51)
(* t_1 (pow (* 2.0 (+ (pow t_5 2.0) (* b b))) 0.5))
(* t_1 (* (sqrt 2.0) (hypot t_5 b)))))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = cos((0.005555555555555556 * (angle * ((double) M_PI))));
double t_1 = 0.25 * (y_45_scale * sqrt(8.0));
double t_2 = 0.25 * (x_45_scale * sqrt(8.0));
double t_3 = t_2 * (sqrt(2.0) * (a * t_0));
double t_4 = t_2 * (t_0 * (a * -sqrt(2.0)));
double t_5 = a * sin((((double) M_PI) * (0.005555555555555556 * angle)));
double tmp;
if (y_45_scale <= -4.2e+232) {
tmp = 0.25 * (y_45_scale * pow(cbrt((b * (sqrt(8.0) * sqrt(2.0)))), 3.0));
} else if (y_45_scale <= -5.8e+37) {
tmp = t_1 * (sqrt(2.0) * -b);
} else if (y_45_scale <= -6.1e-37) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * sqrt(8.0))) * ((b * sqrt(2.0)) / x_45_scale);
} else if (y_45_scale <= -7.8e-104) {
tmp = t_3;
} else if (y_45_scale <= -8.5e-277) {
tmp = t_4;
} else if (y_45_scale <= 4.4e-261) {
tmp = t_3;
} else if (y_45_scale <= 9.5e-222) {
tmp = t_4;
} else if (y_45_scale <= 6e+51) {
tmp = t_1 * pow((2.0 * (pow(t_5, 2.0) + (b * b))), 0.5);
} else {
tmp = t_1 * (sqrt(2.0) * hypot(t_5, b));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.cos((0.005555555555555556 * (angle * Math.PI)));
double t_1 = 0.25 * (y_45_scale * Math.sqrt(8.0));
double t_2 = 0.25 * (x_45_scale * Math.sqrt(8.0));
double t_3 = t_2 * (Math.sqrt(2.0) * (a * t_0));
double t_4 = t_2 * (t_0 * (a * -Math.sqrt(2.0)));
double t_5 = a * Math.sin((Math.PI * (0.005555555555555556 * angle)));
double tmp;
if (y_45_scale <= -4.2e+232) {
tmp = 0.25 * (y_45_scale * Math.pow(Math.cbrt((b * (Math.sqrt(8.0) * Math.sqrt(2.0)))), 3.0));
} else if (y_45_scale <= -5.8e+37) {
tmp = t_1 * (Math.sqrt(2.0) * -b);
} else if (y_45_scale <= -6.1e-37) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * Math.sqrt(8.0))) * ((b * Math.sqrt(2.0)) / x_45_scale);
} else if (y_45_scale <= -7.8e-104) {
tmp = t_3;
} else if (y_45_scale <= -8.5e-277) {
tmp = t_4;
} else if (y_45_scale <= 4.4e-261) {
tmp = t_3;
} else if (y_45_scale <= 9.5e-222) {
tmp = t_4;
} else if (y_45_scale <= 6e+51) {
tmp = t_1 * Math.pow((2.0 * (Math.pow(t_5, 2.0) + (b * b))), 0.5);
} else {
tmp = t_1 * (Math.sqrt(2.0) * Math.hypot(t_5, b));
}
return tmp;
}
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = cos(Float64(0.005555555555555556 * Float64(angle * pi))) t_1 = Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) t_2 = Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) t_3 = Float64(t_2 * Float64(sqrt(2.0) * Float64(a * t_0))) t_4 = Float64(t_2 * Float64(t_0 * Float64(a * Float64(-sqrt(2.0))))) t_5 = Float64(a * sin(Float64(pi * Float64(0.005555555555555556 * angle)))) tmp = 0.0 if (y_45_scale <= -4.2e+232) tmp = Float64(0.25 * Float64(y_45_scale * (cbrt(Float64(b * Float64(sqrt(8.0) * sqrt(2.0)))) ^ 3.0))); elseif (y_45_scale <= -5.8e+37) tmp = Float64(t_1 * Float64(sqrt(2.0) * Float64(-b))); elseif (y_45_scale <= -6.1e-37) tmp = Float64(Float64(0.25 * Float64(Float64(y_45_scale * x_45_scale) * sqrt(8.0))) * Float64(Float64(b * sqrt(2.0)) / x_45_scale)); elseif (y_45_scale <= -7.8e-104) tmp = t_3; elseif (y_45_scale <= -8.5e-277) tmp = t_4; elseif (y_45_scale <= 4.4e-261) tmp = t_3; elseif (y_45_scale <= 9.5e-222) tmp = t_4; elseif (y_45_scale <= 6e+51) tmp = Float64(t_1 * (Float64(2.0 * Float64((t_5 ^ 2.0) + Float64(b * b))) ^ 0.5)); else tmp = Float64(t_1 * Float64(sqrt(2.0) * hypot(t_5, b))); end return tmp end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * N[(t$95$0 * N[(a * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(a * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -4.2e+232], N[(0.25 * N[(y$45$scale * N[Power[N[Power[N[(b * N[(N[Sqrt[8.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -5.8e+37], N[(t$95$1 * N[(N[Sqrt[2.0], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -6.1e-37], N[(N[(0.25 * N[(N[(y$45$scale * x$45$scale), $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -7.8e-104], t$95$3, If[LessEqual[y$45$scale, -8.5e-277], t$95$4, If[LessEqual[y$45$scale, 4.4e-261], t$95$3, If[LessEqual[y$45$scale, 9.5e-222], t$95$4, If[LessEqual[y$45$scale, 6e+51], N[(t$95$1 * N[Power[N[(2.0 * N[(N[Power[t$95$5, 2.0], $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[t$95$5 ^ 2 + b ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
t_1 := 0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\\
t_2 := 0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\\
t_3 := t_2 \cdot \left(\sqrt{2} \cdot \left(a \cdot t_0\right)\right)\\
t_4 := t_2 \cdot \left(t_0 \cdot \left(a \cdot \left(-\sqrt{2}\right)\right)\right)\\
t_5 := a \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\\
\mathbf{if}\;y-scale \leq -4.2 \cdot 10^{+232}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot {\left(\sqrt[3]{b \cdot \left(\sqrt{8} \cdot \sqrt{2}\right)}\right)}^{3}\right)\\
\mathbf{elif}\;y-scale \leq -5.8 \cdot 10^{+37}:\\
\;\;\;\;t_1 \cdot \left(\sqrt{2} \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y-scale \leq -6.1 \cdot 10^{-37}:\\
\;\;\;\;\left(0.25 \cdot \left(\left(y-scale \cdot x-scale\right) \cdot \sqrt{8}\right)\right) \cdot \frac{b \cdot \sqrt{2}}{x-scale}\\
\mathbf{elif}\;y-scale \leq -7.8 \cdot 10^{-104}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y-scale \leq -8.5 \cdot 10^{-277}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y-scale \leq 4.4 \cdot 10^{-261}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y-scale \leq 9.5 \cdot 10^{-222}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y-scale \leq 6 \cdot 10^{+51}:\\
\;\;\;\;t_1 \cdot {\left(2 \cdot \left({t_5}^{2} + b \cdot b\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(\sqrt{2} \cdot \mathsf{hypot}\left(t_5, b\right)\right)\\
\end{array}
\end{array}
if y-scale < -4.19999999999999982e232Initial program 0.0%
Taylor expanded in angle around 0 52.3%
associate-*r*52.3%
associate-*r*52.0%
Simplified52.0%
Taylor expanded in y-scale around 0 52.3%
add-cube-cbrt52.1%
pow352.1%
*-commutative52.1%
associate-*l*52.4%
Applied egg-rr52.4%
if -4.19999999999999982e232 < y-scale < -5.79999999999999957e37Initial program 4.2%
Taylor expanded in x-scale around 0 0.6%
associate-*r*0.6%
distribute-lft-out0.6%
*-commutative0.6%
Simplified0.6%
Taylor expanded in angle around 0 0.6%
Taylor expanded in b around -inf 32.7%
mul-1-neg32.7%
distribute-rgt-neg-in32.7%
Simplified32.7%
if -5.79999999999999957e37 < y-scale < -6.1000000000000003e-37Initial program 2.2%
Taylor expanded in y-scale around inf 12.9%
associate-*r*12.9%
associate-*r*12.9%
*-commutative12.9%
distribute-lft-out12.9%
+-commutative12.9%
Simplified12.9%
Taylor expanded in angle around 0 23.9%
if -6.1000000000000003e-37 < y-scale < -7.8000000000000004e-104 or -8.4999999999999998e-277 < y-scale < 4.4000000000000003e-261Initial program 3.6%
Taylor expanded in y-scale around 0 20.6%
associate-*r*20.6%
distribute-lft-out20.6%
fma-def20.6%
Simplified20.6%
Taylor expanded in a around inf 31.3%
if -7.8000000000000004e-104 < y-scale < -8.4999999999999998e-277 or 4.4000000000000003e-261 < y-scale < 9.5000000000000002e-222Initial program 0.7%
Taylor expanded in y-scale around 0 17.0%
associate-*r*17.0%
distribute-lft-out17.0%
fma-def17.0%
Simplified17.0%
Taylor expanded in a around -inf 33.3%
mul-1-neg33.3%
associate-*r*33.4%
distribute-lft-neg-in33.4%
Simplified33.4%
if 9.5000000000000002e-222 < y-scale < 6e51Initial program 0.2%
Taylor expanded in x-scale around 0 41.1%
associate-*r*41.1%
distribute-lft-out41.1%
*-commutative41.1%
Simplified41.0%
Taylor expanded in angle around 0 41.1%
pow1/241.1%
unpow241.1%
*-rgt-identity41.1%
*-rgt-identity41.1%
Applied egg-rr41.1%
if 6e51 < y-scale Initial program 3.7%
Taylor expanded in x-scale around 0 58.7%
associate-*r*58.7%
distribute-lft-out58.7%
*-commutative58.7%
Simplified62.7%
Taylor expanded in angle around 0 62.9%
pow1/262.9%
unpow262.9%
*-rgt-identity62.9%
*-rgt-identity62.9%
Applied egg-rr62.9%
pow1/262.9%
*-commutative62.9%
sqrt-prod62.8%
unpow262.8%
hypot-def72.1%
Applied egg-rr72.1%
Final simplification43.1%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (cos t_0))
(t_2 (* 0.25 (* x-scale (sqrt 8.0))))
(t_3 (* t_2 (* (sqrt 2.0) (* a t_1))))
(t_4 (* 0.25 (* y-scale (sqrt 8.0))))
(t_5 (* t_2 (* t_1 (* a (- (sqrt 2.0)))))))
(if (<= y-scale -1.4e+233)
(* 0.25 (* y-scale (pow (cbrt (* b (* (sqrt 8.0) (sqrt 2.0)))) 3.0)))
(if (<= y-scale -1.05e+37)
(* t_4 (* (sqrt 2.0) (- b)))
(if (<= y-scale -4.3e-36)
(*
(* 0.25 (* (* y-scale x-scale) (sqrt 8.0)))
(/ (* b (sqrt 2.0)) x-scale))
(if (<= y-scale -1.45e-103)
t_3
(if (<= y-scale -1.75e-280)
t_5
(if (<= y-scale 4.2e-260)
t_3
(if (<= y-scale 2.6e-222)
t_5
(if (<= y-scale 3.8e+52)
(* t_4 (sqrt (* 2.0 (+ (* b b) (pow (* a (sin t_0)) 2.0)))))
(*
t_4
(*
(sqrt 2.0)
(hypot
(* a (sin (* PI (* 0.005555555555555556 angle))))
b)))))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double t_2 = 0.25 * (x_45_scale * sqrt(8.0));
double t_3 = t_2 * (sqrt(2.0) * (a * t_1));
double t_4 = 0.25 * (y_45_scale * sqrt(8.0));
double t_5 = t_2 * (t_1 * (a * -sqrt(2.0)));
double tmp;
if (y_45_scale <= -1.4e+233) {
tmp = 0.25 * (y_45_scale * pow(cbrt((b * (sqrt(8.0) * sqrt(2.0)))), 3.0));
} else if (y_45_scale <= -1.05e+37) {
tmp = t_4 * (sqrt(2.0) * -b);
} else if (y_45_scale <= -4.3e-36) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * sqrt(8.0))) * ((b * sqrt(2.0)) / x_45_scale);
} else if (y_45_scale <= -1.45e-103) {
tmp = t_3;
} else if (y_45_scale <= -1.75e-280) {
tmp = t_5;
} else if (y_45_scale <= 4.2e-260) {
tmp = t_3;
} else if (y_45_scale <= 2.6e-222) {
tmp = t_5;
} else if (y_45_scale <= 3.8e+52) {
tmp = t_4 * sqrt((2.0 * ((b * b) + pow((a * sin(t_0)), 2.0))));
} else {
tmp = t_4 * (sqrt(2.0) * hypot((a * sin((((double) M_PI) * (0.005555555555555556 * angle)))), b));
}
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 = Math.cos(t_0);
double t_2 = 0.25 * (x_45_scale * Math.sqrt(8.0));
double t_3 = t_2 * (Math.sqrt(2.0) * (a * t_1));
double t_4 = 0.25 * (y_45_scale * Math.sqrt(8.0));
double t_5 = t_2 * (t_1 * (a * -Math.sqrt(2.0)));
double tmp;
if (y_45_scale <= -1.4e+233) {
tmp = 0.25 * (y_45_scale * Math.pow(Math.cbrt((b * (Math.sqrt(8.0) * Math.sqrt(2.0)))), 3.0));
} else if (y_45_scale <= -1.05e+37) {
tmp = t_4 * (Math.sqrt(2.0) * -b);
} else if (y_45_scale <= -4.3e-36) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * Math.sqrt(8.0))) * ((b * Math.sqrt(2.0)) / x_45_scale);
} else if (y_45_scale <= -1.45e-103) {
tmp = t_3;
} else if (y_45_scale <= -1.75e-280) {
tmp = t_5;
} else if (y_45_scale <= 4.2e-260) {
tmp = t_3;
} else if (y_45_scale <= 2.6e-222) {
tmp = t_5;
} else if (y_45_scale <= 3.8e+52) {
tmp = t_4 * Math.sqrt((2.0 * ((b * b) + Math.pow((a * Math.sin(t_0)), 2.0))));
} else {
tmp = t_4 * (Math.sqrt(2.0) * Math.hypot((a * Math.sin((Math.PI * (0.005555555555555556 * angle)))), b));
}
return tmp;
}
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) t_2 = Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) t_3 = Float64(t_2 * Float64(sqrt(2.0) * Float64(a * t_1))) t_4 = Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) t_5 = Float64(t_2 * Float64(t_1 * Float64(a * Float64(-sqrt(2.0))))) tmp = 0.0 if (y_45_scale <= -1.4e+233) tmp = Float64(0.25 * Float64(y_45_scale * (cbrt(Float64(b * Float64(sqrt(8.0) * sqrt(2.0)))) ^ 3.0))); elseif (y_45_scale <= -1.05e+37) tmp = Float64(t_4 * Float64(sqrt(2.0) * Float64(-b))); elseif (y_45_scale <= -4.3e-36) tmp = Float64(Float64(0.25 * Float64(Float64(y_45_scale * x_45_scale) * sqrt(8.0))) * Float64(Float64(b * sqrt(2.0)) / x_45_scale)); elseif (y_45_scale <= -1.45e-103) tmp = t_3; elseif (y_45_scale <= -1.75e-280) tmp = t_5; elseif (y_45_scale <= 4.2e-260) tmp = t_3; elseif (y_45_scale <= 2.6e-222) tmp = t_5; elseif (y_45_scale <= 3.8e+52) tmp = Float64(t_4 * sqrt(Float64(2.0 * Float64(Float64(b * b) + (Float64(a * sin(t_0)) ^ 2.0))))); else tmp = Float64(t_4 * Float64(sqrt(2.0) * hypot(Float64(a * sin(Float64(pi * Float64(0.005555555555555556 * angle)))), b))); end return 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[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * N[(t$95$1 * N[(a * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -1.4e+233], N[(0.25 * N[(y$45$scale * N[Power[N[Power[N[(b * N[(N[Sqrt[8.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -1.05e+37], N[(t$95$4 * N[(N[Sqrt[2.0], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -4.3e-36], N[(N[(0.25 * N[(N[(y$45$scale * x$45$scale), $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -1.45e-103], t$95$3, If[LessEqual[y$45$scale, -1.75e-280], t$95$5, If[LessEqual[y$45$scale, 4.2e-260], t$95$3, If[LessEqual[y$45$scale, 2.6e-222], t$95$5, If[LessEqual[y$45$scale, 3.8e+52], N[(t$95$4 * N[Sqrt[N[(2.0 * N[(N[(b * b), $MachinePrecision] + N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(a * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2 + b ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t_0\\
t_2 := 0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\\
t_3 := t_2 \cdot \left(\sqrt{2} \cdot \left(a \cdot t_1\right)\right)\\
t_4 := 0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\\
t_5 := t_2 \cdot \left(t_1 \cdot \left(a \cdot \left(-\sqrt{2}\right)\right)\right)\\
\mathbf{if}\;y-scale \leq -1.4 \cdot 10^{+233}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot {\left(\sqrt[3]{b \cdot \left(\sqrt{8} \cdot \sqrt{2}\right)}\right)}^{3}\right)\\
\mathbf{elif}\;y-scale \leq -1.05 \cdot 10^{+37}:\\
\;\;\;\;t_4 \cdot \left(\sqrt{2} \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y-scale \leq -4.3 \cdot 10^{-36}:\\
\;\;\;\;\left(0.25 \cdot \left(\left(y-scale \cdot x-scale\right) \cdot \sqrt{8}\right)\right) \cdot \frac{b \cdot \sqrt{2}}{x-scale}\\
\mathbf{elif}\;y-scale \leq -1.45 \cdot 10^{-103}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y-scale \leq -1.75 \cdot 10^{-280}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y-scale \leq 4.2 \cdot 10^{-260}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y-scale \leq 2.6 \cdot 10^{-222}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y-scale \leq 3.8 \cdot 10^{+52}:\\
\;\;\;\;t_4 \cdot \sqrt{2 \cdot \left(b \cdot b + {\left(a \cdot \sin t_0\right)}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \left(\sqrt{2} \cdot \mathsf{hypot}\left(a \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right), b\right)\right)\\
\end{array}
\end{array}
if y-scale < -1.40000000000000005e233Initial program 0.0%
Taylor expanded in angle around 0 52.3%
associate-*r*52.3%
associate-*r*52.0%
Simplified52.0%
Taylor expanded in y-scale around 0 52.3%
add-cube-cbrt52.1%
pow352.1%
*-commutative52.1%
associate-*l*52.4%
Applied egg-rr52.4%
if -1.40000000000000005e233 < y-scale < -1.0500000000000001e37Initial program 4.2%
Taylor expanded in x-scale around 0 0.6%
associate-*r*0.6%
distribute-lft-out0.6%
*-commutative0.6%
Simplified0.6%
Taylor expanded in angle around 0 0.6%
Taylor expanded in b around -inf 32.7%
mul-1-neg32.7%
distribute-rgt-neg-in32.7%
Simplified32.7%
if -1.0500000000000001e37 < y-scale < -4.3000000000000002e-36Initial program 2.2%
Taylor expanded in y-scale around inf 12.9%
associate-*r*12.9%
associate-*r*12.9%
*-commutative12.9%
distribute-lft-out12.9%
+-commutative12.9%
Simplified12.9%
Taylor expanded in angle around 0 23.9%
if -4.3000000000000002e-36 < y-scale < -1.4499999999999999e-103 or -1.75e-280 < y-scale < 4.20000000000000009e-260Initial program 3.6%
Taylor expanded in y-scale around 0 20.6%
associate-*r*20.6%
distribute-lft-out20.6%
fma-def20.6%
Simplified20.6%
Taylor expanded in a around inf 31.3%
if -1.4499999999999999e-103 < y-scale < -1.75e-280 or 4.20000000000000009e-260 < y-scale < 2.5999999999999998e-222Initial program 0.7%
Taylor expanded in y-scale around 0 17.0%
associate-*r*17.0%
distribute-lft-out17.0%
fma-def17.0%
Simplified17.0%
Taylor expanded in a around -inf 33.3%
mul-1-neg33.3%
associate-*r*33.4%
distribute-lft-neg-in33.4%
Simplified33.4%
if 2.5999999999999998e-222 < y-scale < 3.8e52Initial program 0.2%
Taylor expanded in x-scale around 0 41.1%
associate-*r*41.1%
distribute-lft-out41.1%
*-commutative41.1%
Simplified41.0%
Taylor expanded in angle around 0 41.1%
*-un-lft-identity41.1%
unpow241.1%
*-rgt-identity41.1%
*-rgt-identity41.1%
Applied egg-rr41.1%
*-lft-identity41.1%
unpow241.1%
+-commutative41.1%
unpow241.1%
*-commutative41.1%
associate-*r*41.0%
Simplified41.0%
if 3.8e52 < y-scale Initial program 3.7%
Taylor expanded in x-scale around 0 58.7%
associate-*r*58.7%
distribute-lft-out58.7%
*-commutative58.7%
Simplified62.7%
Taylor expanded in angle around 0 62.9%
pow1/262.9%
unpow262.9%
*-rgt-identity62.9%
*-rgt-identity62.9%
Applied egg-rr62.9%
pow1/262.9%
*-commutative62.9%
sqrt-prod62.8%
unpow262.8%
hypot-def72.1%
Applied egg-rr72.1%
Final simplification43.1%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (cos t_0))
(t_2 (* 0.25 (* x-scale (sqrt 8.0))))
(t_3 (* t_2 (* (sqrt 2.0) (* a t_1))))
(t_4 (* 0.25 (* y-scale (sqrt 8.0))))
(t_5 (* t_2 (* t_1 (* a (- (sqrt 2.0)))))))
(if (<= y-scale -2.7e+232)
(* 0.25 (* y-scale (pow (cbrt (* b (* (sqrt 8.0) (sqrt 2.0)))) 3.0)))
(if (<= y-scale -1.3e+37)
(* t_4 (* (sqrt 2.0) (- b)))
(if (<= y-scale -3.9e-36)
(*
(* 0.25 (* (* y-scale x-scale) (sqrt 8.0)))
(/ (* b (sqrt 2.0)) x-scale))
(if (<= y-scale -1.9e-103)
t_3
(if (<= y-scale -4.5e-280)
t_5
(if (<= y-scale 4.9e-259)
t_3
(if (<= y-scale 9.2e-220)
t_5
(if (<= y-scale 15600000000000.0)
(* t_4 (pow (* 2.0 (+ (* b b) (pow (* a t_0) 2.0))) 0.5))
(*
t_4
(*
(sqrt 2.0)
(hypot
(* a (sin (* PI (* 0.005555555555555556 angle))))
b)))))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double t_2 = 0.25 * (x_45_scale * sqrt(8.0));
double t_3 = t_2 * (sqrt(2.0) * (a * t_1));
double t_4 = 0.25 * (y_45_scale * sqrt(8.0));
double t_5 = t_2 * (t_1 * (a * -sqrt(2.0)));
double tmp;
if (y_45_scale <= -2.7e+232) {
tmp = 0.25 * (y_45_scale * pow(cbrt((b * (sqrt(8.0) * sqrt(2.0)))), 3.0));
} else if (y_45_scale <= -1.3e+37) {
tmp = t_4 * (sqrt(2.0) * -b);
} else if (y_45_scale <= -3.9e-36) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * sqrt(8.0))) * ((b * sqrt(2.0)) / x_45_scale);
} else if (y_45_scale <= -1.9e-103) {
tmp = t_3;
} else if (y_45_scale <= -4.5e-280) {
tmp = t_5;
} else if (y_45_scale <= 4.9e-259) {
tmp = t_3;
} else if (y_45_scale <= 9.2e-220) {
tmp = t_5;
} else if (y_45_scale <= 15600000000000.0) {
tmp = t_4 * pow((2.0 * ((b * b) + pow((a * t_0), 2.0))), 0.5);
} else {
tmp = t_4 * (sqrt(2.0) * hypot((a * sin((((double) M_PI) * (0.005555555555555556 * angle)))), b));
}
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 = Math.cos(t_0);
double t_2 = 0.25 * (x_45_scale * Math.sqrt(8.0));
double t_3 = t_2 * (Math.sqrt(2.0) * (a * t_1));
double t_4 = 0.25 * (y_45_scale * Math.sqrt(8.0));
double t_5 = t_2 * (t_1 * (a * -Math.sqrt(2.0)));
double tmp;
if (y_45_scale <= -2.7e+232) {
tmp = 0.25 * (y_45_scale * Math.pow(Math.cbrt((b * (Math.sqrt(8.0) * Math.sqrt(2.0)))), 3.0));
} else if (y_45_scale <= -1.3e+37) {
tmp = t_4 * (Math.sqrt(2.0) * -b);
} else if (y_45_scale <= -3.9e-36) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * Math.sqrt(8.0))) * ((b * Math.sqrt(2.0)) / x_45_scale);
} else if (y_45_scale <= -1.9e-103) {
tmp = t_3;
} else if (y_45_scale <= -4.5e-280) {
tmp = t_5;
} else if (y_45_scale <= 4.9e-259) {
tmp = t_3;
} else if (y_45_scale <= 9.2e-220) {
tmp = t_5;
} else if (y_45_scale <= 15600000000000.0) {
tmp = t_4 * Math.pow((2.0 * ((b * b) + Math.pow((a * t_0), 2.0))), 0.5);
} else {
tmp = t_4 * (Math.sqrt(2.0) * Math.hypot((a * Math.sin((Math.PI * (0.005555555555555556 * angle)))), b));
}
return tmp;
}
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) t_2 = Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) t_3 = Float64(t_2 * Float64(sqrt(2.0) * Float64(a * t_1))) t_4 = Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) t_5 = Float64(t_2 * Float64(t_1 * Float64(a * Float64(-sqrt(2.0))))) tmp = 0.0 if (y_45_scale <= -2.7e+232) tmp = Float64(0.25 * Float64(y_45_scale * (cbrt(Float64(b * Float64(sqrt(8.0) * sqrt(2.0)))) ^ 3.0))); elseif (y_45_scale <= -1.3e+37) tmp = Float64(t_4 * Float64(sqrt(2.0) * Float64(-b))); elseif (y_45_scale <= -3.9e-36) tmp = Float64(Float64(0.25 * Float64(Float64(y_45_scale * x_45_scale) * sqrt(8.0))) * Float64(Float64(b * sqrt(2.0)) / x_45_scale)); elseif (y_45_scale <= -1.9e-103) tmp = t_3; elseif (y_45_scale <= -4.5e-280) tmp = t_5; elseif (y_45_scale <= 4.9e-259) tmp = t_3; elseif (y_45_scale <= 9.2e-220) tmp = t_5; elseif (y_45_scale <= 15600000000000.0) tmp = Float64(t_4 * (Float64(2.0 * Float64(Float64(b * b) + (Float64(a * t_0) ^ 2.0))) ^ 0.5)); else tmp = Float64(t_4 * Float64(sqrt(2.0) * hypot(Float64(a * sin(Float64(pi * Float64(0.005555555555555556 * angle)))), b))); end return 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[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * N[(t$95$1 * N[(a * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -2.7e+232], N[(0.25 * N[(y$45$scale * N[Power[N[Power[N[(b * N[(N[Sqrt[8.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -1.3e+37], N[(t$95$4 * N[(N[Sqrt[2.0], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -3.9e-36], N[(N[(0.25 * N[(N[(y$45$scale * x$45$scale), $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -1.9e-103], t$95$3, If[LessEqual[y$45$scale, -4.5e-280], t$95$5, If[LessEqual[y$45$scale, 4.9e-259], t$95$3, If[LessEqual[y$45$scale, 9.2e-220], t$95$5, If[LessEqual[y$45$scale, 15600000000000.0], N[(t$95$4 * N[Power[N[(2.0 * N[(N[(b * b), $MachinePrecision] + N[Power[N[(a * t$95$0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(a * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2 + b ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t_0\\
t_2 := 0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\\
t_3 := t_2 \cdot \left(\sqrt{2} \cdot \left(a \cdot t_1\right)\right)\\
t_4 := 0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\\
t_5 := t_2 \cdot \left(t_1 \cdot \left(a \cdot \left(-\sqrt{2}\right)\right)\right)\\
\mathbf{if}\;y-scale \leq -2.7 \cdot 10^{+232}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot {\left(\sqrt[3]{b \cdot \left(\sqrt{8} \cdot \sqrt{2}\right)}\right)}^{3}\right)\\
\mathbf{elif}\;y-scale \leq -1.3 \cdot 10^{+37}:\\
\;\;\;\;t_4 \cdot \left(\sqrt{2} \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y-scale \leq -3.9 \cdot 10^{-36}:\\
\;\;\;\;\left(0.25 \cdot \left(\left(y-scale \cdot x-scale\right) \cdot \sqrt{8}\right)\right) \cdot \frac{b \cdot \sqrt{2}}{x-scale}\\
\mathbf{elif}\;y-scale \leq -1.9 \cdot 10^{-103}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y-scale \leq -4.5 \cdot 10^{-280}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y-scale \leq 4.9 \cdot 10^{-259}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y-scale \leq 9.2 \cdot 10^{-220}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y-scale \leq 15600000000000:\\
\;\;\;\;t_4 \cdot {\left(2 \cdot \left(b \cdot b + {\left(a \cdot t_0\right)}^{2}\right)\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \left(\sqrt{2} \cdot \mathsf{hypot}\left(a \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right), b\right)\right)\\
\end{array}
\end{array}
if y-scale < -2.7000000000000001e232Initial program 0.0%
Taylor expanded in angle around 0 52.3%
associate-*r*52.3%
associate-*r*52.0%
Simplified52.0%
Taylor expanded in y-scale around 0 52.3%
add-cube-cbrt52.1%
pow352.1%
*-commutative52.1%
associate-*l*52.4%
Applied egg-rr52.4%
if -2.7000000000000001e232 < y-scale < -1.3e37Initial program 4.2%
Taylor expanded in x-scale around 0 0.6%
associate-*r*0.6%
distribute-lft-out0.6%
*-commutative0.6%
Simplified0.6%
Taylor expanded in angle around 0 0.6%
Taylor expanded in b around -inf 32.7%
mul-1-neg32.7%
distribute-rgt-neg-in32.7%
Simplified32.7%
if -1.3e37 < y-scale < -3.9000000000000001e-36Initial program 2.2%
Taylor expanded in y-scale around inf 12.9%
associate-*r*12.9%
associate-*r*12.9%
*-commutative12.9%
distribute-lft-out12.9%
+-commutative12.9%
Simplified12.9%
Taylor expanded in angle around 0 23.9%
if -3.9000000000000001e-36 < y-scale < -1.9e-103 or -4.4999999999999996e-280 < y-scale < 4.90000000000000023e-259Initial program 3.6%
Taylor expanded in y-scale around 0 20.6%
associate-*r*20.6%
distribute-lft-out20.6%
fma-def20.6%
Simplified20.6%
Taylor expanded in a around inf 31.3%
if -1.9e-103 < y-scale < -4.4999999999999996e-280 or 4.90000000000000023e-259 < y-scale < 9.19999999999999922e-220Initial program 0.7%
Taylor expanded in y-scale around 0 16.8%
associate-*r*16.8%
distribute-lft-out16.8%
fma-def16.8%
Simplified16.8%
Taylor expanded in a around -inf 32.6%
mul-1-neg32.6%
associate-*r*32.7%
distribute-lft-neg-in32.7%
Simplified32.7%
if 9.19999999999999922e-220 < y-scale < 1.56e13Initial program 0.3%
Taylor expanded in x-scale around 0 42.3%
associate-*r*42.3%
distribute-lft-out42.3%
*-commutative42.3%
Simplified42.3%
Taylor expanded in angle around 0 42.3%
pow1/242.3%
unpow242.3%
*-rgt-identity42.3%
*-rgt-identity42.3%
Applied egg-rr42.3%
Taylor expanded in angle around 0 41.5%
if 1.56e13 < y-scale Initial program 3.1%
Taylor expanded in x-scale around 0 54.9%
associate-*r*54.9%
distribute-lft-out54.9%
*-commutative54.9%
Simplified58.3%
Taylor expanded in angle around 0 58.4%
pow1/258.4%
unpow258.4%
*-rgt-identity58.4%
*-rgt-identity58.4%
Applied egg-rr58.4%
pow1/258.4%
*-commutative58.4%
sqrt-prod58.3%
unpow258.3%
hypot-def66.0%
Applied egg-rr66.0%
Final simplification42.9%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (cos t_0))
(t_2 (* 0.25 (* x-scale (sqrt 8.0))))
(t_3 (* t_2 (* (sqrt 2.0) (* a t_1))))
(t_4 (* 0.25 (* y-scale (sqrt 8.0))))
(t_5 (* t_2 (* t_1 (* a (- (sqrt 2.0)))))))
(if (<= y-scale -6.5e+232)
(* 0.25 (* y-scale (pow (cbrt (* b (* (sqrt 8.0) (sqrt 2.0)))) 3.0)))
(if (<= y-scale -3.7e+37)
(* t_4 (* (sqrt 2.0) (- b)))
(if (<= y-scale -2.25e-37)
(*
(* 0.25 (* (* y-scale x-scale) (sqrt 8.0)))
(/ (* b (sqrt 2.0)) x-scale))
(if (<= y-scale -6.6e-105)
t_3
(if (<= y-scale -5.4e-279)
t_5
(if (<= y-scale 4.7e-256)
t_3
(if (<= y-scale 3.95e-221)
t_5
(*
t_4
(pow (* 2.0 (+ (* b b) (pow (* a t_0) 2.0))) 0.5)))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double t_2 = 0.25 * (x_45_scale * sqrt(8.0));
double t_3 = t_2 * (sqrt(2.0) * (a * t_1));
double t_4 = 0.25 * (y_45_scale * sqrt(8.0));
double t_5 = t_2 * (t_1 * (a * -sqrt(2.0)));
double tmp;
if (y_45_scale <= -6.5e+232) {
tmp = 0.25 * (y_45_scale * pow(cbrt((b * (sqrt(8.0) * sqrt(2.0)))), 3.0));
} else if (y_45_scale <= -3.7e+37) {
tmp = t_4 * (sqrt(2.0) * -b);
} else if (y_45_scale <= -2.25e-37) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * sqrt(8.0))) * ((b * sqrt(2.0)) / x_45_scale);
} else if (y_45_scale <= -6.6e-105) {
tmp = t_3;
} else if (y_45_scale <= -5.4e-279) {
tmp = t_5;
} else if (y_45_scale <= 4.7e-256) {
tmp = t_3;
} else if (y_45_scale <= 3.95e-221) {
tmp = t_5;
} else {
tmp = t_4 * pow((2.0 * ((b * b) + pow((a * t_0), 2.0))), 0.5);
}
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 = Math.cos(t_0);
double t_2 = 0.25 * (x_45_scale * Math.sqrt(8.0));
double t_3 = t_2 * (Math.sqrt(2.0) * (a * t_1));
double t_4 = 0.25 * (y_45_scale * Math.sqrt(8.0));
double t_5 = t_2 * (t_1 * (a * -Math.sqrt(2.0)));
double tmp;
if (y_45_scale <= -6.5e+232) {
tmp = 0.25 * (y_45_scale * Math.pow(Math.cbrt((b * (Math.sqrt(8.0) * Math.sqrt(2.0)))), 3.0));
} else if (y_45_scale <= -3.7e+37) {
tmp = t_4 * (Math.sqrt(2.0) * -b);
} else if (y_45_scale <= -2.25e-37) {
tmp = (0.25 * ((y_45_scale * x_45_scale) * Math.sqrt(8.0))) * ((b * Math.sqrt(2.0)) / x_45_scale);
} else if (y_45_scale <= -6.6e-105) {
tmp = t_3;
} else if (y_45_scale <= -5.4e-279) {
tmp = t_5;
} else if (y_45_scale <= 4.7e-256) {
tmp = t_3;
} else if (y_45_scale <= 3.95e-221) {
tmp = t_5;
} else {
tmp = t_4 * Math.pow((2.0 * ((b * b) + Math.pow((a * t_0), 2.0))), 0.5);
}
return tmp;
}
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) t_2 = Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) t_3 = Float64(t_2 * Float64(sqrt(2.0) * Float64(a * t_1))) t_4 = Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) t_5 = Float64(t_2 * Float64(t_1 * Float64(a * Float64(-sqrt(2.0))))) tmp = 0.0 if (y_45_scale <= -6.5e+232) tmp = Float64(0.25 * Float64(y_45_scale * (cbrt(Float64(b * Float64(sqrt(8.0) * sqrt(2.0)))) ^ 3.0))); elseif (y_45_scale <= -3.7e+37) tmp = Float64(t_4 * Float64(sqrt(2.0) * Float64(-b))); elseif (y_45_scale <= -2.25e-37) tmp = Float64(Float64(0.25 * Float64(Float64(y_45_scale * x_45_scale) * sqrt(8.0))) * Float64(Float64(b * sqrt(2.0)) / x_45_scale)); elseif (y_45_scale <= -6.6e-105) tmp = t_3; elseif (y_45_scale <= -5.4e-279) tmp = t_5; elseif (y_45_scale <= 4.7e-256) tmp = t_3; elseif (y_45_scale <= 3.95e-221) tmp = t_5; else tmp = Float64(t_4 * (Float64(2.0 * Float64(Float64(b * b) + (Float64(a * t_0) ^ 2.0))) ^ 0.5)); end return 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[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * N[(t$95$1 * N[(a * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$45$scale, -6.5e+232], N[(0.25 * N[(y$45$scale * N[Power[N[Power[N[(b * N[(N[Sqrt[8.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -3.7e+37], N[(t$95$4 * N[(N[Sqrt[2.0], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -2.25e-37], N[(N[(0.25 * N[(N[(y$45$scale * x$45$scale), $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, -6.6e-105], t$95$3, If[LessEqual[y$45$scale, -5.4e-279], t$95$5, If[LessEqual[y$45$scale, 4.7e-256], t$95$3, If[LessEqual[y$45$scale, 3.95e-221], t$95$5, N[(t$95$4 * N[Power[N[(2.0 * N[(N[(b * b), $MachinePrecision] + N[Power[N[(a * t$95$0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t_0\\
t_2 := 0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\\
t_3 := t_2 \cdot \left(\sqrt{2} \cdot \left(a \cdot t_1\right)\right)\\
t_4 := 0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\\
t_5 := t_2 \cdot \left(t_1 \cdot \left(a \cdot \left(-\sqrt{2}\right)\right)\right)\\
\mathbf{if}\;y-scale \leq -6.5 \cdot 10^{+232}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot {\left(\sqrt[3]{b \cdot \left(\sqrt{8} \cdot \sqrt{2}\right)}\right)}^{3}\right)\\
\mathbf{elif}\;y-scale \leq -3.7 \cdot 10^{+37}:\\
\;\;\;\;t_4 \cdot \left(\sqrt{2} \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y-scale \leq -2.25 \cdot 10^{-37}:\\
\;\;\;\;\left(0.25 \cdot \left(\left(y-scale \cdot x-scale\right) \cdot \sqrt{8}\right)\right) \cdot \frac{b \cdot \sqrt{2}}{x-scale}\\
\mathbf{elif}\;y-scale \leq -6.6 \cdot 10^{-105}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y-scale \leq -5.4 \cdot 10^{-279}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;y-scale \leq 4.7 \cdot 10^{-256}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y-scale \leq 3.95 \cdot 10^{-221}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot {\left(2 \cdot \left(b \cdot b + {\left(a \cdot t_0\right)}^{2}\right)\right)}^{0.5}\\
\end{array}
\end{array}
if y-scale < -6.50000000000000016e232Initial program 0.0%
Taylor expanded in angle around 0 52.3%
associate-*r*52.3%
associate-*r*52.0%
Simplified52.0%
Taylor expanded in y-scale around 0 52.3%
add-cube-cbrt52.1%
pow352.1%
*-commutative52.1%
associate-*l*52.4%
Applied egg-rr52.4%
if -6.50000000000000016e232 < y-scale < -3.6999999999999999e37Initial program 4.2%
Taylor expanded in x-scale around 0 0.6%
associate-*r*0.6%
distribute-lft-out0.6%
*-commutative0.6%
Simplified0.6%
Taylor expanded in angle around 0 0.6%
Taylor expanded in b around -inf 32.7%
mul-1-neg32.7%
distribute-rgt-neg-in32.7%
Simplified32.7%
if -3.6999999999999999e37 < y-scale < -2.2500000000000002e-37Initial program 2.2%
Taylor expanded in y-scale around inf 12.9%
associate-*r*12.9%
associate-*r*12.9%
*-commutative12.9%
distribute-lft-out12.9%
+-commutative12.9%
Simplified12.9%
Taylor expanded in angle around 0 23.9%
if -2.2500000000000002e-37 < y-scale < -6.5999999999999997e-105 or -5.4000000000000003e-279 < y-scale < 4.69999999999999982e-256Initial program 3.6%
Taylor expanded in y-scale around 0 20.6%
associate-*r*20.6%
distribute-lft-out20.6%
fma-def20.6%
Simplified20.6%
Taylor expanded in a around inf 31.3%
if -6.5999999999999997e-105 < y-scale < -5.4000000000000003e-279 or 4.69999999999999982e-256 < y-scale < 3.9500000000000002e-221Initial program 0.7%
Taylor expanded in y-scale around 0 16.8%
associate-*r*16.8%
distribute-lft-out16.8%
fma-def16.8%
Simplified16.8%
Taylor expanded in a around -inf 32.6%
mul-1-neg32.6%
associate-*r*32.7%
distribute-lft-neg-in32.7%
Simplified32.7%
if 3.9500000000000002e-221 < y-scale Initial program 1.9%
Taylor expanded in x-scale around 0 49.9%
associate-*r*49.9%
distribute-lft-out49.9%
*-commutative49.9%
Simplified51.8%
Taylor expanded in angle around 0 51.9%
pow1/251.9%
unpow251.9%
*-rgt-identity51.9%
*-rgt-identity51.9%
Applied egg-rr51.9%
Taylor expanded in angle around 0 50.2%
Final simplification40.3%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* 0.25 (* y-scale (sqrt (* (* b b) 16.0))))))
(if (<= b -2.35e+27)
t_0
(if (<= b 310000000.0)
(*
(* 0.25 (* x-scale (sqrt 8.0)))
(* (cos (* 0.005555555555555556 (* angle PI))) (* a (- (sqrt 2.0)))))
(if (<= b 1.05e+66)
(* 0.25 (* (sqrt 2.0) (* y-scale (log (exp (* (sqrt 8.0) b))))))
(if (<= b 6e+236)
(*
(* -0.25 (* y-scale (* (sqrt 8.0) (* x-scale b))))
(/ (sqrt 2.0) x-scale))
(if (<= b 3e+254)
t_0
(*
(* 0.25 (* y-scale (sqrt 8.0)))
(*
(* b (sqrt 2.0))
(cos (* angle (* 0.005555555555555556 PI))))))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.25 * (y_45_scale * sqrt(((b * b) * 16.0)));
double tmp;
if (b <= -2.35e+27) {
tmp = t_0;
} else if (b <= 310000000.0) {
tmp = (0.25 * (x_45_scale * sqrt(8.0))) * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * (a * -sqrt(2.0)));
} else if (b <= 1.05e+66) {
tmp = 0.25 * (sqrt(2.0) * (y_45_scale * log(exp((sqrt(8.0) * b)))));
} else if (b <= 6e+236) {
tmp = (-0.25 * (y_45_scale * (sqrt(8.0) * (x_45_scale * b)))) * (sqrt(2.0) / x_45_scale);
} else if (b <= 3e+254) {
tmp = t_0;
} else {
tmp = (0.25 * (y_45_scale * sqrt(8.0))) * ((b * sqrt(2.0)) * cos((angle * (0.005555555555555556 * ((double) M_PI)))));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = 0.25 * (y_45_scale * Math.sqrt(((b * b) * 16.0)));
double tmp;
if (b <= -2.35e+27) {
tmp = t_0;
} else if (b <= 310000000.0) {
tmp = (0.25 * (x_45_scale * Math.sqrt(8.0))) * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * (a * -Math.sqrt(2.0)));
} else if (b <= 1.05e+66) {
tmp = 0.25 * (Math.sqrt(2.0) * (y_45_scale * Math.log(Math.exp((Math.sqrt(8.0) * b)))));
} else if (b <= 6e+236) {
tmp = (-0.25 * (y_45_scale * (Math.sqrt(8.0) * (x_45_scale * b)))) * (Math.sqrt(2.0) / x_45_scale);
} else if (b <= 3e+254) {
tmp = t_0;
} else {
tmp = (0.25 * (y_45_scale * Math.sqrt(8.0))) * ((b * Math.sqrt(2.0)) * Math.cos((angle * (0.005555555555555556 * Math.PI))));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = 0.25 * (y_45_scale * math.sqrt(((b * b) * 16.0))) tmp = 0 if b <= -2.35e+27: tmp = t_0 elif b <= 310000000.0: tmp = (0.25 * (x_45_scale * math.sqrt(8.0))) * (math.cos((0.005555555555555556 * (angle * math.pi))) * (a * -math.sqrt(2.0))) elif b <= 1.05e+66: tmp = 0.25 * (math.sqrt(2.0) * (y_45_scale * math.log(math.exp((math.sqrt(8.0) * b))))) elif b <= 6e+236: tmp = (-0.25 * (y_45_scale * (math.sqrt(8.0) * (x_45_scale * b)))) * (math.sqrt(2.0) / x_45_scale) elif b <= 3e+254: tmp = t_0 else: tmp = (0.25 * (y_45_scale * math.sqrt(8.0))) * ((b * math.sqrt(2.0)) * math.cos((angle * (0.005555555555555556 * math.pi)))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(0.25 * Float64(y_45_scale * sqrt(Float64(Float64(b * b) * 16.0)))) tmp = 0.0 if (b <= -2.35e+27) tmp = t_0; elseif (b <= 310000000.0) tmp = Float64(Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(a * Float64(-sqrt(2.0))))); elseif (b <= 1.05e+66) tmp = Float64(0.25 * Float64(sqrt(2.0) * Float64(y_45_scale * log(exp(Float64(sqrt(8.0) * b)))))); elseif (b <= 6e+236) tmp = Float64(Float64(-0.25 * Float64(y_45_scale * Float64(sqrt(8.0) * Float64(x_45_scale * b)))) * Float64(sqrt(2.0) / x_45_scale)); elseif (b <= 3e+254) tmp = t_0; else tmp = Float64(Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) * Float64(Float64(b * sqrt(2.0)) * cos(Float64(angle * Float64(0.005555555555555556 * pi))))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = 0.25 * (y_45_scale * sqrt(((b * b) * 16.0))); tmp = 0.0; if (b <= -2.35e+27) tmp = t_0; elseif (b <= 310000000.0) tmp = (0.25 * (x_45_scale * sqrt(8.0))) * (cos((0.005555555555555556 * (angle * pi))) * (a * -sqrt(2.0))); elseif (b <= 1.05e+66) tmp = 0.25 * (sqrt(2.0) * (y_45_scale * log(exp((sqrt(8.0) * b))))); elseif (b <= 6e+236) tmp = (-0.25 * (y_45_scale * (sqrt(8.0) * (x_45_scale * b)))) * (sqrt(2.0) / x_45_scale); elseif (b <= 3e+254) tmp = t_0; else tmp = (0.25 * (y_45_scale * sqrt(8.0))) * ((b * sqrt(2.0)) * cos((angle * (0.005555555555555556 * pi)))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(0.25 * N[(y$45$scale * N[Sqrt[N[(N[(b * b), $MachinePrecision] * 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.35e+27], t$95$0, If[LessEqual[b, 310000000.0], N[(N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.05e+66], N[(0.25 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(y$45$scale * N[Log[N[Exp[N[(N[Sqrt[8.0], $MachinePrecision] * b), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e+236], N[(N[(-0.25 * N[(y$45$scale * N[(N[Sqrt[8.0], $MachinePrecision] * N[(x$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e+254], t$95$0, N[(N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(b * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.25 \cdot \left(y-scale \cdot \sqrt{\left(b \cdot b\right) \cdot 16}\right)\\
\mathbf{if}\;b \leq -2.35 \cdot 10^{+27}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;b \leq 310000000:\\
\;\;\;\;\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(a \cdot \left(-\sqrt{2}\right)\right)\right)\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{+66}:\\
\;\;\;\;0.25 \cdot \left(\sqrt{2} \cdot \left(y-scale \cdot \log \left(e^{\sqrt{8} \cdot b}\right)\right)\right)\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+236}:\\
\;\;\;\;\left(-0.25 \cdot \left(y-scale \cdot \left(\sqrt{8} \cdot \left(x-scale \cdot b\right)\right)\right)\right) \cdot \frac{\sqrt{2}}{x-scale}\\
\mathbf{elif}\;b \leq 3 \cdot 10^{+254}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \left(\left(b \cdot \sqrt{2}\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < -2.34999999999999988e27 or 5.9999999999999996e236 < b < 3.00000000000000007e254Initial program 3.6%
Taylor expanded in angle around 0 21.0%
associate-*r*21.0%
associate-*r*20.9%
Simplified20.9%
Taylor expanded in y-scale around 0 21.0%
add-sqr-sqrt4.6%
sqrt-unprod37.2%
swap-sqr37.2%
add-sqr-sqrt37.3%
swap-sqr37.2%
add-sqr-sqrt37.3%
Applied egg-rr37.3%
*-commutative37.3%
unpow237.3%
associate-*l*37.3%
unpow237.3%
metadata-eval37.3%
Simplified37.3%
if -2.34999999999999988e27 < b < 3.1e8Initial program 1.4%
Taylor expanded in y-scale around 0 21.2%
associate-*r*21.2%
distribute-lft-out21.2%
fma-def21.2%
Simplified21.2%
Taylor expanded in a around -inf 27.1%
mul-1-neg27.1%
associate-*r*27.2%
distribute-lft-neg-in27.2%
Simplified27.2%
if 3.1e8 < b < 1.05000000000000003e66Initial program 0.7%
Taylor expanded in angle around 0 17.7%
add-log-exp51.6%
Applied egg-rr51.6%
if 1.05000000000000003e66 < b < 5.9999999999999996e236Initial program 0.5%
Taylor expanded in b around -inf 17.5%
associate-*r*17.5%
associate-*r*17.5%
Simplified17.5%
Taylor expanded in angle around 0 28.6%
if 3.00000000000000007e254 < b Initial program 12.5%
Taylor expanded in x-scale around 0 14.5%
associate-*r*14.5%
distribute-lft-out14.5%
*-commutative14.5%
Simplified14.5%
Taylor expanded in a around 0 30.1%
associate-*r*30.1%
Simplified30.1%
associate-*r*30.1%
*-commutative30.1%
expm1-log1p-u15.4%
expm1-udef15.4%
Applied egg-rr15.4%
expm1-def15.4%
expm1-log1p30.1%
associate-*r*30.3%
Simplified30.3%
Final simplification31.5%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (cos (* 0.005555555555555556 (* angle PI)))))
(if (<= b -9.5e+29)
(* 0.25 (* y-scale (sqrt (* (* b b) 16.0))))
(if (<= b 260000000.0)
(* (* 0.25 (* x-scale (sqrt 8.0))) (* t_0 (* a (- (sqrt 2.0)))))
(if (<= b 8.6e+64)
(* 0.25 (* (sqrt 2.0) (* y-scale (log (exp (* (sqrt 8.0) b))))))
(*
(* -0.25 (* y-scale (* (sqrt 8.0) (* x-scale b))))
(/ (* t_0 (sqrt 2.0)) x-scale)))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = cos((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (b <= -9.5e+29) {
tmp = 0.25 * (y_45_scale * sqrt(((b * b) * 16.0)));
} else if (b <= 260000000.0) {
tmp = (0.25 * (x_45_scale * sqrt(8.0))) * (t_0 * (a * -sqrt(2.0)));
} else if (b <= 8.6e+64) {
tmp = 0.25 * (sqrt(2.0) * (y_45_scale * log(exp((sqrt(8.0) * b)))));
} else {
tmp = (-0.25 * (y_45_scale * (sqrt(8.0) * (x_45_scale * b)))) * ((t_0 * sqrt(2.0)) / x_45_scale);
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.cos((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (b <= -9.5e+29) {
tmp = 0.25 * (y_45_scale * Math.sqrt(((b * b) * 16.0)));
} else if (b <= 260000000.0) {
tmp = (0.25 * (x_45_scale * Math.sqrt(8.0))) * (t_0 * (a * -Math.sqrt(2.0)));
} else if (b <= 8.6e+64) {
tmp = 0.25 * (Math.sqrt(2.0) * (y_45_scale * Math.log(Math.exp((Math.sqrt(8.0) * b)))));
} else {
tmp = (-0.25 * (y_45_scale * (Math.sqrt(8.0) * (x_45_scale * b)))) * ((t_0 * Math.sqrt(2.0)) / x_45_scale);
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = math.cos((0.005555555555555556 * (angle * math.pi))) tmp = 0 if b <= -9.5e+29: tmp = 0.25 * (y_45_scale * math.sqrt(((b * b) * 16.0))) elif b <= 260000000.0: tmp = (0.25 * (x_45_scale * math.sqrt(8.0))) * (t_0 * (a * -math.sqrt(2.0))) elif b <= 8.6e+64: tmp = 0.25 * (math.sqrt(2.0) * (y_45_scale * math.log(math.exp((math.sqrt(8.0) * b))))) else: tmp = (-0.25 * (y_45_scale * (math.sqrt(8.0) * (x_45_scale * b)))) * ((t_0 * math.sqrt(2.0)) / x_45_scale) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = cos(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (b <= -9.5e+29) tmp = Float64(0.25 * Float64(y_45_scale * sqrt(Float64(Float64(b * b) * 16.0)))); elseif (b <= 260000000.0) tmp = Float64(Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) * Float64(t_0 * Float64(a * Float64(-sqrt(2.0))))); elseif (b <= 8.6e+64) tmp = Float64(0.25 * Float64(sqrt(2.0) * Float64(y_45_scale * log(exp(Float64(sqrt(8.0) * b)))))); else tmp = Float64(Float64(-0.25 * Float64(y_45_scale * Float64(sqrt(8.0) * Float64(x_45_scale * b)))) * Float64(Float64(t_0 * sqrt(2.0)) / x_45_scale)); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = cos((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (b <= -9.5e+29) tmp = 0.25 * (y_45_scale * sqrt(((b * b) * 16.0))); elseif (b <= 260000000.0) tmp = (0.25 * (x_45_scale * sqrt(8.0))) * (t_0 * (a * -sqrt(2.0))); elseif (b <= 8.6e+64) tmp = 0.25 * (sqrt(2.0) * (y_45_scale * log(exp((sqrt(8.0) * b))))); else tmp = (-0.25 * (y_45_scale * (sqrt(8.0) * (x_45_scale * b)))) * ((t_0 * sqrt(2.0)) / x_45_scale); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -9.5e+29], N[(0.25 * N[(y$45$scale * N[Sqrt[N[(N[(b * b), $MachinePrecision] * 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 260000000.0], N[(N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(a * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.6e+64], N[(0.25 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(y$45$scale * N[Log[N[Exp[N[(N[Sqrt[8.0], $MachinePrecision] * b), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.25 * N[(y$45$scale * N[(N[Sqrt[8.0], $MachinePrecision] * N[(x$45$scale * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / x$45$scale), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;b \leq -9.5 \cdot 10^{+29}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot \sqrt{\left(b \cdot b\right) \cdot 16}\right)\\
\mathbf{elif}\;b \leq 260000000:\\
\;\;\;\;\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \left(t_0 \cdot \left(a \cdot \left(-\sqrt{2}\right)\right)\right)\\
\mathbf{elif}\;b \leq 8.6 \cdot 10^{+64}:\\
\;\;\;\;0.25 \cdot \left(\sqrt{2} \cdot \left(y-scale \cdot \log \left(e^{\sqrt{8} \cdot b}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-0.25 \cdot \left(y-scale \cdot \left(\sqrt{8} \cdot \left(x-scale \cdot b\right)\right)\right)\right) \cdot \frac{t_0 \cdot \sqrt{2}}{x-scale}\\
\end{array}
\end{array}
if b < -9.5000000000000003e29Initial program 2.3%
Taylor expanded in angle around 0 18.0%
associate-*r*18.0%
associate-*r*18.0%
Simplified18.0%
Taylor expanded in y-scale around 0 18.0%
add-sqr-sqrt0.0%
sqrt-unprod34.0%
swap-sqr34.0%
add-sqr-sqrt34.0%
swap-sqr34.0%
add-sqr-sqrt34.1%
Applied egg-rr34.1%
*-commutative34.1%
unpow234.1%
associate-*l*34.1%
unpow234.1%
metadata-eval34.1%
Simplified34.1%
if -9.5000000000000003e29 < b < 2.6e8Initial program 1.4%
Taylor expanded in y-scale around 0 21.2%
associate-*r*21.2%
distribute-lft-out21.2%
fma-def21.2%
Simplified21.2%
Taylor expanded in a around -inf 27.1%
mul-1-neg27.1%
associate-*r*27.2%
distribute-lft-neg-in27.2%
Simplified27.2%
if 2.6e8 < b < 8.5999999999999995e64Initial program 0.7%
Taylor expanded in angle around 0 17.7%
add-log-exp51.6%
Applied egg-rr51.6%
if 8.5999999999999995e64 < b Initial program 4.0%
Taylor expanded in b around -inf 22.3%
associate-*r*22.3%
associate-*r*22.3%
Simplified22.3%
Taylor expanded in y-scale around inf 30.7%
Final simplification31.0%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (sqrt 8.0) b)))
(if (<= x-scale -2.1e+93)
(* 0.25 (* (sqrt 2.0) (* y-scale (log (exp t_0)))))
(if (<= x-scale -1.1e-259)
(* 0.25 (* y-scale (* (sqrt 2.0) t_0)))
(if (<= x-scale 1600000000.0)
(* (* 0.25 (* y-scale (sqrt 8.0))) (* (sqrt 2.0) (- 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 t_0 = sqrt(8.0) * b;
double tmp;
if (x_45_scale <= -2.1e+93) {
tmp = 0.25 * (sqrt(2.0) * (y_45_scale * log(exp(t_0))));
} else if (x_45_scale <= -1.1e-259) {
tmp = 0.25 * (y_45_scale * (sqrt(2.0) * t_0));
} else if (x_45_scale <= 1600000000.0) {
tmp = (0.25 * (y_45_scale * sqrt(8.0))) * (sqrt(2.0) * -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) :: t_0
real(8) :: tmp
t_0 = sqrt(8.0d0) * b
if (x_45scale <= (-2.1d+93)) then
tmp = 0.25d0 * (sqrt(2.0d0) * (y_45scale * log(exp(t_0))))
else if (x_45scale <= (-1.1d-259)) then
tmp = 0.25d0 * (y_45scale * (sqrt(2.0d0) * t_0))
else if (x_45scale <= 1600000000.0d0) then
tmp = (0.25d0 * (y_45scale * sqrt(8.0d0))) * (sqrt(2.0d0) * -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 t_0 = Math.sqrt(8.0) * b;
double tmp;
if (x_45_scale <= -2.1e+93) {
tmp = 0.25 * (Math.sqrt(2.0) * (y_45_scale * Math.log(Math.exp(t_0))));
} else if (x_45_scale <= -1.1e-259) {
tmp = 0.25 * (y_45_scale * (Math.sqrt(2.0) * t_0));
} else if (x_45_scale <= 1600000000.0) {
tmp = (0.25 * (y_45_scale * Math.sqrt(8.0))) * (Math.sqrt(2.0) * -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): t_0 = math.sqrt(8.0) * b tmp = 0 if x_45_scale <= -2.1e+93: tmp = 0.25 * (math.sqrt(2.0) * (y_45_scale * math.log(math.exp(t_0)))) elif x_45_scale <= -1.1e-259: tmp = 0.25 * (y_45_scale * (math.sqrt(2.0) * t_0)) elif x_45_scale <= 1600000000.0: tmp = (0.25 * (y_45_scale * math.sqrt(8.0))) * (math.sqrt(2.0) * -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) t_0 = Float64(sqrt(8.0) * b) tmp = 0.0 if (x_45_scale <= -2.1e+93) tmp = Float64(0.25 * Float64(sqrt(2.0) * Float64(y_45_scale * log(exp(t_0))))); elseif (x_45_scale <= -1.1e-259) tmp = Float64(0.25 * Float64(y_45_scale * Float64(sqrt(2.0) * t_0))); elseif (x_45_scale <= 1600000000.0) tmp = Float64(Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) * Float64(sqrt(2.0) * Float64(-b))); else tmp = Float64(Float64(0.25 * 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) t_0 = sqrt(8.0) * b; tmp = 0.0; if (x_45_scale <= -2.1e+93) tmp = 0.25 * (sqrt(2.0) * (y_45_scale * log(exp(t_0)))); elseif (x_45_scale <= -1.1e-259) tmp = 0.25 * (y_45_scale * (sqrt(2.0) * t_0)); elseif (x_45_scale <= 1600000000.0) tmp = (0.25 * (y_45_scale * sqrt(8.0))) * (sqrt(2.0) * -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_] := Block[{t$95$0 = N[(N[Sqrt[8.0], $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[x$45$scale, -2.1e+93], N[(0.25 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(y$45$scale * N[Log[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, -1.1e-259], N[(0.25 * N[(y$45$scale * N[(N[Sqrt[2.0], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 1600000000.0], N[(N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision], N[(N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{8} \cdot b\\
\mathbf{if}\;x-scale \leq -2.1 \cdot 10^{+93}:\\
\;\;\;\;0.25 \cdot \left(\sqrt{2} \cdot \left(y-scale \cdot \log \left(e^{t_0}\right)\right)\right)\\
\mathbf{elif}\;x-scale \leq -1.1 \cdot 10^{-259}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot t_0\right)\right)\\
\mathbf{elif}\;x-scale \leq 1600000000:\\
\;\;\;\;\left(0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \left(\sqrt{2} \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \left(a \cdot \sqrt{2}\right)\\
\end{array}
\end{array}
if x-scale < -2.0999999999999998e93Initial program 1.3%
Taylor expanded in angle around 0 5.6%
add-log-exp28.3%
Applied egg-rr28.3%
if -2.0999999999999998e93 < x-scale < -1.10000000000000005e-259Initial program 1.7%
Taylor expanded in angle around 0 24.3%
associate-*r*24.3%
associate-*r*24.2%
Simplified24.2%
Taylor expanded in y-scale around 0 24.3%
if -1.10000000000000005e-259 < x-scale < 1.6e9Initial program 2.6%
Taylor expanded in x-scale around 0 20.1%
associate-*r*20.1%
distribute-lft-out20.1%
*-commutative20.1%
Simplified22.5%
Taylor expanded in angle around 0 22.5%
Taylor expanded in b around -inf 22.7%
mul-1-neg22.7%
distribute-rgt-neg-in22.7%
Simplified22.7%
if 1.6e9 < x-scale Initial program 3.2%
Taylor expanded in y-scale around 0 53.6%
associate-*r*53.6%
distribute-lft-out53.6%
fma-def53.6%
Simplified53.7%
Taylor expanded in angle around 0 30.4%
Final simplification25.6%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (* 0.25 (* x-scale (sqrt 8.0))) (* a (sqrt 2.0)))))
(if (<= x-scale -5.3e+54)
t_0
(if (<= x-scale -1.5e-260)
(* 0.25 (* y-scale (* (sqrt 2.0) (* (sqrt 8.0) b))))
(if (<= x-scale 1500000000.0)
(* (* 0.25 (* y-scale (sqrt 8.0))) (* (sqrt 2.0) (- b)))
t_0)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = (0.25 * (x_45_scale * sqrt(8.0))) * (a * sqrt(2.0));
double tmp;
if (x_45_scale <= -5.3e+54) {
tmp = t_0;
} else if (x_45_scale <= -1.5e-260) {
tmp = 0.25 * (y_45_scale * (sqrt(2.0) * (sqrt(8.0) * b)));
} else if (x_45_scale <= 1500000000.0) {
tmp = (0.25 * (y_45_scale * sqrt(8.0))) * (sqrt(2.0) * -b);
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (0.25d0 * (x_45scale * sqrt(8.0d0))) * (a * sqrt(2.0d0))
if (x_45scale <= (-5.3d+54)) then
tmp = t_0
else if (x_45scale <= (-1.5d-260)) then
tmp = 0.25d0 * (y_45scale * (sqrt(2.0d0) * (sqrt(8.0d0) * b)))
else if (x_45scale <= 1500000000.0d0) then
tmp = (0.25d0 * (y_45scale * sqrt(8.0d0))) * (sqrt(2.0d0) * -b)
else
tmp = t_0
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 t_0 = (0.25 * (x_45_scale * Math.sqrt(8.0))) * (a * Math.sqrt(2.0));
double tmp;
if (x_45_scale <= -5.3e+54) {
tmp = t_0;
} else if (x_45_scale <= -1.5e-260) {
tmp = 0.25 * (y_45_scale * (Math.sqrt(2.0) * (Math.sqrt(8.0) * b)));
} else if (x_45_scale <= 1500000000.0) {
tmp = (0.25 * (y_45_scale * Math.sqrt(8.0))) * (Math.sqrt(2.0) * -b);
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = (0.25 * (x_45_scale * math.sqrt(8.0))) * (a * math.sqrt(2.0)) tmp = 0 if x_45_scale <= -5.3e+54: tmp = t_0 elif x_45_scale <= -1.5e-260: tmp = 0.25 * (y_45_scale * (math.sqrt(2.0) * (math.sqrt(8.0) * b))) elif x_45_scale <= 1500000000.0: tmp = (0.25 * (y_45_scale * math.sqrt(8.0))) * (math.sqrt(2.0) * -b) else: tmp = t_0 return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) * Float64(a * sqrt(2.0))) tmp = 0.0 if (x_45_scale <= -5.3e+54) tmp = t_0; elseif (x_45_scale <= -1.5e-260) tmp = Float64(0.25 * Float64(y_45_scale * Float64(sqrt(2.0) * Float64(sqrt(8.0) * b)))); elseif (x_45_scale <= 1500000000.0) tmp = Float64(Float64(0.25 * Float64(y_45_scale * sqrt(8.0))) * Float64(sqrt(2.0) * Float64(-b))); else tmp = t_0; end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = (0.25 * (x_45_scale * sqrt(8.0))) * (a * sqrt(2.0)); tmp = 0.0; if (x_45_scale <= -5.3e+54) tmp = t_0; elseif (x_45_scale <= -1.5e-260) tmp = 0.25 * (y_45_scale * (sqrt(2.0) * (sqrt(8.0) * b))); elseif (x_45_scale <= 1500000000.0) tmp = (0.25 * (y_45_scale * sqrt(8.0))) * (sqrt(2.0) * -b); else tmp = t_0; end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$45$scale, -5.3e+54], t$95$0, If[LessEqual[x$45$scale, -1.5e-260], N[(0.25 * N[(y$45$scale * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[8.0], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$45$scale, 1500000000.0], N[(N[(0.25 * N[(y$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * (-b)), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \left(a \cdot \sqrt{2}\right)\\
\mathbf{if}\;x-scale \leq -5.3 \cdot 10^{+54}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x-scale \leq -1.5 \cdot 10^{-260}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \left(\sqrt{8} \cdot b\right)\right)\right)\\
\mathbf{elif}\;x-scale \leq 1500000000:\\
\;\;\;\;\left(0.25 \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \left(\sqrt{2} \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x-scale < -5.30000000000000018e54 or 1.5e9 < x-scale Initial program 2.1%
Taylor expanded in y-scale around 0 22.4%
associate-*r*22.4%
distribute-lft-out22.4%
fma-def22.4%
Simplified22.5%
Taylor expanded in angle around 0 26.0%
if -5.30000000000000018e54 < x-scale < -1.5e-260Initial program 1.8%
Taylor expanded in angle around 0 26.6%
associate-*r*26.6%
associate-*r*26.5%
Simplified26.5%
Taylor expanded in y-scale around 0 26.6%
if -1.5e-260 < x-scale < 1.5e9Initial program 2.6%
Taylor expanded in x-scale around 0 20.1%
associate-*r*20.1%
distribute-lft-out20.1%
*-commutative20.1%
Simplified22.5%
Taylor expanded in angle around 0 22.5%
Taylor expanded in b around -inf 22.7%
mul-1-neg22.7%
distribute-rgt-neg-in22.7%
Simplified22.7%
Final simplification25.1%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(if (<= y-scale -1.92e-36)
(* 0.25 (* (sqrt 2.0) (* y-scale (* (sqrt 8.0) b))))
(if (<= y-scale 1.65e-224)
(* (* 0.25 (* x-scale (sqrt 8.0))) (* a (sqrt 2.0)))
(* 0.25 (* y-scale (sqrt (* 2.0 (* b (* 8.0 b)))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (y_45_scale <= -1.92e-36) {
tmp = 0.25 * (sqrt(2.0) * (y_45_scale * (sqrt(8.0) * b)));
} else if (y_45_scale <= 1.65e-224) {
tmp = (0.25 * (x_45_scale * sqrt(8.0))) * (a * sqrt(2.0));
} else {
tmp = 0.25 * (y_45_scale * sqrt((2.0 * (b * (8.0 * b)))));
}
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 (y_45scale <= (-1.92d-36)) then
tmp = 0.25d0 * (sqrt(2.0d0) * (y_45scale * (sqrt(8.0d0) * b)))
else if (y_45scale <= 1.65d-224) then
tmp = (0.25d0 * (x_45scale * sqrt(8.0d0))) * (a * sqrt(2.0d0))
else
tmp = 0.25d0 * (y_45scale * sqrt((2.0d0 * (b * (8.0d0 * b)))))
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 (y_45_scale <= -1.92e-36) {
tmp = 0.25 * (Math.sqrt(2.0) * (y_45_scale * (Math.sqrt(8.0) * b)));
} else if (y_45_scale <= 1.65e-224) {
tmp = (0.25 * (x_45_scale * Math.sqrt(8.0))) * (a * Math.sqrt(2.0));
} else {
tmp = 0.25 * (y_45_scale * Math.sqrt((2.0 * (b * (8.0 * b)))));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if y_45_scale <= -1.92e-36: tmp = 0.25 * (math.sqrt(2.0) * (y_45_scale * (math.sqrt(8.0) * b))) elif y_45_scale <= 1.65e-224: tmp = (0.25 * (x_45_scale * math.sqrt(8.0))) * (a * math.sqrt(2.0)) else: tmp = 0.25 * (y_45_scale * math.sqrt((2.0 * (b * (8.0 * b))))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (y_45_scale <= -1.92e-36) tmp = Float64(0.25 * Float64(sqrt(2.0) * Float64(y_45_scale * Float64(sqrt(8.0) * b)))); elseif (y_45_scale <= 1.65e-224) tmp = Float64(Float64(0.25 * Float64(x_45_scale * sqrt(8.0))) * Float64(a * sqrt(2.0))); else tmp = Float64(0.25 * Float64(y_45_scale * sqrt(Float64(2.0 * Float64(b * Float64(8.0 * b)))))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (y_45_scale <= -1.92e-36) tmp = 0.25 * (sqrt(2.0) * (y_45_scale * (sqrt(8.0) * b))); elseif (y_45_scale <= 1.65e-224) tmp = (0.25 * (x_45_scale * sqrt(8.0))) * (a * sqrt(2.0)); else tmp = 0.25 * (y_45_scale * sqrt((2.0 * (b * (8.0 * b))))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[y$45$scale, -1.92e-36], N[(0.25 * N[(N[Sqrt[2.0], $MachinePrecision] * N[(y$45$scale * N[(N[Sqrt[8.0], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$45$scale, 1.65e-224], N[(N[(0.25 * N[(x$45$scale * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(y$45$scale * N[Sqrt[N[(2.0 * N[(b * N[(8.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y-scale \leq -1.92 \cdot 10^{-36}:\\
\;\;\;\;0.25 \cdot \left(\sqrt{2} \cdot \left(y-scale \cdot \left(\sqrt{8} \cdot b\right)\right)\right)\\
\mathbf{elif}\;y-scale \leq 1.65 \cdot 10^{-224}:\\
\;\;\;\;\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \left(a \cdot \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot \sqrt{2 \cdot \left(b \cdot \left(8 \cdot b\right)\right)}\right)\\
\end{array}
\end{array}
if y-scale < -1.91999999999999993e-36Initial program 2.7%
Taylor expanded in angle around 0 20.0%
if -1.91999999999999993e-36 < y-scale < 1.6500000000000001e-224Initial program 2.0%
Taylor expanded in y-scale around 0 18.6%
associate-*r*18.6%
distribute-lft-out18.6%
fma-def18.6%
Simplified18.6%
Taylor expanded in angle around 0 23.7%
if 1.6500000000000001e-224 < y-scale Initial program 1.9%
Taylor expanded in angle around 0 16.4%
associate-*r*16.4%
associate-*r*16.4%
Simplified16.4%
Taylor expanded in y-scale around 0 16.4%
add-sqr-sqrt15.1%
sqrt-unprod34.4%
swap-sqr34.4%
add-sqr-sqrt34.5%
swap-sqr34.3%
add-sqr-sqrt34.5%
Applied egg-rr34.5%
associate-*l*34.5%
Simplified34.5%
Final simplification27.5%
(FPCore (a b angle x-scale y-scale) :precision binary64 (if (<= y-scale -8.2e-299) (* 0.25 (* y-scale (* b (* (sqrt 8.0) (sqrt 2.0))))) (* 0.25 (* y-scale (sqrt (* 2.0 (* b (* 8.0 b))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (y_45_scale <= -8.2e-299) {
tmp = 0.25 * (y_45_scale * (b * (sqrt(8.0) * sqrt(2.0))));
} else {
tmp = 0.25 * (y_45_scale * sqrt((2.0 * (b * (8.0 * b)))));
}
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 (y_45scale <= (-8.2d-299)) then
tmp = 0.25d0 * (y_45scale * (b * (sqrt(8.0d0) * sqrt(2.0d0))))
else
tmp = 0.25d0 * (y_45scale * sqrt((2.0d0 * (b * (8.0d0 * b)))))
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 (y_45_scale <= -8.2e-299) {
tmp = 0.25 * (y_45_scale * (b * (Math.sqrt(8.0) * Math.sqrt(2.0))));
} else {
tmp = 0.25 * (y_45_scale * Math.sqrt((2.0 * (b * (8.0 * b)))));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if y_45_scale <= -8.2e-299: tmp = 0.25 * (y_45_scale * (b * (math.sqrt(8.0) * math.sqrt(2.0)))) else: tmp = 0.25 * (y_45_scale * math.sqrt((2.0 * (b * (8.0 * b))))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (y_45_scale <= -8.2e-299) tmp = Float64(0.25 * Float64(y_45_scale * Float64(b * Float64(sqrt(8.0) * sqrt(2.0))))); else tmp = Float64(0.25 * Float64(y_45_scale * sqrt(Float64(2.0 * Float64(b * Float64(8.0 * b)))))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (y_45_scale <= -8.2e-299) tmp = 0.25 * (y_45_scale * (b * (sqrt(8.0) * sqrt(2.0)))); else tmp = 0.25 * (y_45_scale * sqrt((2.0 * (b * (8.0 * b))))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[y$45$scale, -8.2e-299], N[(0.25 * N[(y$45$scale * N[(b * N[(N[Sqrt[8.0], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(y$45$scale * N[Sqrt[N[(2.0 * N[(b * N[(8.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y-scale \leq -8.2 \cdot 10^{-299}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot \left(b \cdot \left(\sqrt{8} \cdot \sqrt{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot \sqrt{2 \cdot \left(b \cdot \left(8 \cdot b\right)\right)}\right)\\
\end{array}
\end{array}
if y-scale < -8.2000000000000002e-299Initial program 2.5%
Taylor expanded in angle around 0 13.9%
associate-*r*13.9%
associate-*r*13.9%
Simplified13.9%
Taylor expanded in y-scale around 0 13.9%
expm1-log1p-u3.2%
expm1-udef2.0%
*-commutative2.0%
associate-*l*2.0%
Applied egg-rr2.0%
expm1-def3.2%
expm1-log1p13.9%
*-commutative13.9%
Simplified13.9%
if -8.2000000000000002e-299 < y-scale Initial program 1.8%
Taylor expanded in angle around 0 14.4%
associate-*r*14.4%
associate-*r*14.4%
Simplified14.4%
Taylor expanded in y-scale around 0 14.3%
add-sqr-sqrt13.1%
sqrt-unprod31.2%
swap-sqr31.2%
add-sqr-sqrt31.3%
swap-sqr31.1%
add-sqr-sqrt31.2%
Applied egg-rr31.2%
associate-*l*31.3%
Simplified31.3%
Final simplification22.9%
(FPCore (a b angle x-scale y-scale) :precision binary64 (if (<= y-scale -8.2e-299) (* 0.25 (* y-scale (* (sqrt 2.0) (* (sqrt 8.0) b)))) (* 0.25 (* y-scale (sqrt (* 2.0 (* b (* 8.0 b))))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double tmp;
if (y_45_scale <= -8.2e-299) {
tmp = 0.25 * (y_45_scale * (sqrt(2.0) * (sqrt(8.0) * b)));
} else {
tmp = 0.25 * (y_45_scale * sqrt((2.0 * (b * (8.0 * b)))));
}
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 (y_45scale <= (-8.2d-299)) then
tmp = 0.25d0 * (y_45scale * (sqrt(2.0d0) * (sqrt(8.0d0) * b)))
else
tmp = 0.25d0 * (y_45scale * sqrt((2.0d0 * (b * (8.0d0 * b)))))
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 (y_45_scale <= -8.2e-299) {
tmp = 0.25 * (y_45_scale * (Math.sqrt(2.0) * (Math.sqrt(8.0) * b)));
} else {
tmp = 0.25 * (y_45_scale * Math.sqrt((2.0 * (b * (8.0 * b)))));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): tmp = 0 if y_45_scale <= -8.2e-299: tmp = 0.25 * (y_45_scale * (math.sqrt(2.0) * (math.sqrt(8.0) * b))) else: tmp = 0.25 * (y_45_scale * math.sqrt((2.0 * (b * (8.0 * b))))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0 if (y_45_scale <= -8.2e-299) tmp = Float64(0.25 * Float64(y_45_scale * Float64(sqrt(2.0) * Float64(sqrt(8.0) * b)))); else tmp = Float64(0.25 * Float64(y_45_scale * sqrt(Float64(2.0 * Float64(b * Float64(8.0 * b)))))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.0; if (y_45_scale <= -8.2e-299) tmp = 0.25 * (y_45_scale * (sqrt(2.0) * (sqrt(8.0) * b))); else tmp = 0.25 * (y_45_scale * sqrt((2.0 * (b * (8.0 * b))))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := If[LessEqual[y$45$scale, -8.2e-299], N[(0.25 * N[(y$45$scale * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[8.0], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(y$45$scale * N[Sqrt[N[(2.0 * N[(b * N[(8.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y-scale \leq -8.2 \cdot 10^{-299}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \left(\sqrt{8} \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(y-scale \cdot \sqrt{2 \cdot \left(b \cdot \left(8 \cdot b\right)\right)}\right)\\
\end{array}
\end{array}
if y-scale < -8.2000000000000002e-299Initial program 2.5%
Taylor expanded in angle around 0 13.9%
associate-*r*13.9%
associate-*r*13.9%
Simplified13.9%
Taylor expanded in y-scale around 0 13.9%
if -8.2000000000000002e-299 < y-scale Initial program 1.8%
Taylor expanded in angle around 0 14.4%
associate-*r*14.4%
associate-*r*14.4%
Simplified14.4%
Taylor expanded in y-scale around 0 14.3%
add-sqr-sqrt13.1%
sqrt-unprod31.2%
swap-sqr31.2%
add-sqr-sqrt31.3%
swap-sqr31.1%
add-sqr-sqrt31.2%
Applied egg-rr31.2%
associate-*l*31.3%
Simplified31.3%
Final simplification22.9%
(FPCore (a b angle x-scale y-scale) :precision binary64 (* 0.25 (* y-scale (sqrt (* 2.0 (* b (* 8.0 b)))))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 0.25 * (y_45_scale * sqrt((2.0 * (b * (8.0 * 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 = 0.25d0 * (y_45scale * sqrt((2.0d0 * (b * (8.0d0 * b)))))
end function
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 0.25 * (y_45_scale * Math.sqrt((2.0 * (b * (8.0 * b)))));
}
def code(a, b, angle, x_45_scale, y_45_scale): return 0.25 * (y_45_scale * math.sqrt((2.0 * (b * (8.0 * b)))))
function code(a, b, angle, x_45_scale, y_45_scale) return Float64(0.25 * Float64(y_45_scale * sqrt(Float64(2.0 * Float64(b * Float64(8.0 * b)))))) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.25 * (y_45_scale * sqrt((2.0 * (b * (8.0 * b))))); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(0.25 * N[(y$45$scale * N[Sqrt[N[(2.0 * N[(b * N[(8.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.25 \cdot \left(y-scale \cdot \sqrt{2 \cdot \left(b \cdot \left(8 \cdot b\right)\right)}\right)
\end{array}
Initial program 2.2%
Taylor expanded in angle around 0 14.1%
associate-*r*14.1%
associate-*r*14.1%
Simplified14.1%
Taylor expanded in y-scale around 0 14.1%
add-sqr-sqrt7.3%
sqrt-unprod17.1%
swap-sqr17.1%
add-sqr-sqrt17.1%
swap-sqr17.1%
add-sqr-sqrt17.1%
Applied egg-rr17.1%
associate-*l*17.1%
Simplified17.1%
Final simplification17.1%
(FPCore (a b angle x-scale y-scale) :precision binary64 (* 0.25 (* y-scale (sqrt (* (* b b) 16.0)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 0.25 * (y_45_scale * sqrt(((b * b) * 16.0)));
}
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 = 0.25d0 * (y_45scale * sqrt(((b * b) * 16.0d0)))
end function
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 0.25 * (y_45_scale * Math.sqrt(((b * b) * 16.0)));
}
def code(a, b, angle, x_45_scale, y_45_scale): return 0.25 * (y_45_scale * math.sqrt(((b * b) * 16.0)))
function code(a, b, angle, x_45_scale, y_45_scale) return Float64(0.25 * Float64(y_45_scale * sqrt(Float64(Float64(b * b) * 16.0)))) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.25 * (y_45_scale * sqrt(((b * b) * 16.0))); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(0.25 * N[(y$45$scale * N[Sqrt[N[(N[(b * b), $MachinePrecision] * 16.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.25 \cdot \left(y-scale \cdot \sqrt{\left(b \cdot b\right) \cdot 16}\right)
\end{array}
Initial program 2.2%
Taylor expanded in angle around 0 14.1%
associate-*r*14.1%
associate-*r*14.1%
Simplified14.1%
Taylor expanded in y-scale around 0 14.1%
add-sqr-sqrt7.3%
sqrt-unprod17.1%
swap-sqr17.1%
add-sqr-sqrt17.1%
swap-sqr17.1%
add-sqr-sqrt17.1%
Applied egg-rr17.1%
*-commutative17.1%
unpow217.1%
associate-*l*17.1%
unpow217.1%
metadata-eval17.1%
Simplified17.1%
Final simplification17.1%
herbie shell --seed 2023187
(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))))