
(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}
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}
Herbie found 7 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}
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}
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle PI)))))
(if (<= (fabs y-scale) 2.5e-168)
(*
0.25
(/
(*
(fabs a)
(*
(pow (fabs y-scale) 2.0)
(sqrt
(*
8.0
(-
0.5
(* 0.5 (cos (* 0.011111111111111112 (* angle PI)))))))))
(fabs (fabs y-scale))))
(*
0.25
(*
(fabs a)
(*
(fabs y-scale)
(sqrt (* 8.0 (- (pow t_0 2.0) (sqrt (pow t_0 4.0)))))))))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = sin((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (fabs(y_45_scale) <= 2.5e-168) {
tmp = 0.25 * ((fabs(a) * (pow(fabs(y_45_scale), 2.0) * sqrt((8.0 * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * ((double) M_PI)))))))))) / fabs(fabs(y_45_scale)));
} else {
tmp = 0.25 * (fabs(a) * (fabs(y_45_scale) * sqrt((8.0 * (pow(t_0, 2.0) - sqrt(pow(t_0, 4.0)))))));
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.sin((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (Math.abs(y_45_scale) <= 2.5e-168) {
tmp = 0.25 * ((Math.abs(a) * (Math.pow(Math.abs(y_45_scale), 2.0) * Math.sqrt((8.0 * (0.5 - (0.5 * Math.cos((0.011111111111111112 * (angle * Math.PI))))))))) / Math.abs(Math.abs(y_45_scale)));
} else {
tmp = 0.25 * (Math.abs(a) * (Math.abs(y_45_scale) * Math.sqrt((8.0 * (Math.pow(t_0, 2.0) - Math.sqrt(Math.pow(t_0, 4.0)))))));
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = math.sin((0.005555555555555556 * (angle * math.pi))) tmp = 0 if math.fabs(y_45_scale) <= 2.5e-168: tmp = 0.25 * ((math.fabs(a) * (math.pow(math.fabs(y_45_scale), 2.0) * math.sqrt((8.0 * (0.5 - (0.5 * math.cos((0.011111111111111112 * (angle * math.pi))))))))) / math.fabs(math.fabs(y_45_scale))) else: tmp = 0.25 * (math.fabs(a) * (math.fabs(y_45_scale) * math.sqrt((8.0 * (math.pow(t_0, 2.0) - math.sqrt(math.pow(t_0, 4.0))))))) return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = sin(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (abs(y_45_scale) <= 2.5e-168) tmp = Float64(0.25 * Float64(Float64(abs(a) * Float64((abs(y_45_scale) ^ 2.0) * sqrt(Float64(8.0 * Float64(0.5 - Float64(0.5 * cos(Float64(0.011111111111111112 * Float64(angle * pi))))))))) / abs(abs(y_45_scale)))); else tmp = Float64(0.25 * Float64(abs(a) * Float64(abs(y_45_scale) * sqrt(Float64(8.0 * Float64((t_0 ^ 2.0) - sqrt((t_0 ^ 4.0)))))))); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = sin((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (abs(y_45_scale) <= 2.5e-168) tmp = 0.25 * ((abs(a) * ((abs(y_45_scale) ^ 2.0) * sqrt((8.0 * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * pi))))))))) / abs(abs(y_45_scale))); else tmp = 0.25 * (abs(a) * (abs(y_45_scale) * sqrt((8.0 * ((t_0 ^ 2.0) - sqrt((t_0 ^ 4.0))))))); end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[y$45$scale], $MachinePrecision], 2.5e-168], N[(0.25 * N[(N[(N[Abs[a], $MachinePrecision] * N[(N[Power[N[Abs[y$45$scale], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[N[(8.0 * N[(0.5 - N[(0.5 * N[Cos[N[(0.011111111111111112 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[N[Abs[y$45$scale], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[Abs[a], $MachinePrecision] * N[(N[Abs[y$45$scale], $MachinePrecision] * N[Sqrt[N[(8.0 * N[(N[Power[t$95$0, 2.0], $MachinePrecision] - N[Sqrt[N[Power[t$95$0, 4.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;\left|y-scale\right| \leq 2.5 \cdot 10^{-168}:\\
\;\;\;\;0.25 \cdot \frac{\left|a\right| \cdot \left({\left(\left|y-scale\right|\right)}^{2} \cdot \sqrt{8 \cdot \left(0.5 - 0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\left|\left|y-scale\right|\right|}\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\left|a\right| \cdot \left(\left|y-scale\right| \cdot \sqrt{8 \cdot \left({t\_0}^{2} - \sqrt{{t\_0}^{4}}\right)}\right)\right)\\
\end{array}
if y-scale < 2.5e-168Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Applied rewrites3.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in b around 0
lower-/.f64N/A
Applied rewrites23.7%
if 2.5e-168 < y-scale Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites4.1%
Taylor expanded in b around 0
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
Applied rewrites12.8%
Taylor expanded in y-scale around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites29.5%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (pow (fabs y-scale) 2.0))
(t_1 (* (* b a) (* b (- a))))
(t_2 (/ (* 4.0 t_1) (pow (* x-scale (fabs y-scale)) 2.0))))
(if (<= (fabs y-scale) 1.55e-162)
(*
0.25
(/
(*
a
(*
t_0
(sqrt
(*
8.0
(-
0.5
(* 0.5 (cos (* 0.011111111111111112 (* angle PI)))))))))
(fabs (fabs y-scale))))
(if (<= (fabs y-scale) 1.32e+154)
(*
0.25
(*
a
(*
t_0
(*
angle
(sqrt
(*
8.0
(/
(-
(* 3.08641975308642e-5 (pow PI 2.0))
(sqrt (* 9.525986892242036e-10 (pow PI 4.0))))
t_0)))))))
(/ (- (sqrt (* (* (* 2.0 t_2) t_1) (/ 0.0 t_0)))) t_2)))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = pow(fabs(y_45_scale), 2.0);
double t_1 = (b * a) * (b * -a);
double t_2 = (4.0 * t_1) / pow((x_45_scale * fabs(y_45_scale)), 2.0);
double tmp;
if (fabs(y_45_scale) <= 1.55e-162) {
tmp = 0.25 * ((a * (t_0 * sqrt((8.0 * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * ((double) M_PI)))))))))) / fabs(fabs(y_45_scale)));
} else if (fabs(y_45_scale) <= 1.32e+154) {
tmp = 0.25 * (a * (t_0 * (angle * sqrt((8.0 * (((3.08641975308642e-5 * pow(((double) M_PI), 2.0)) - sqrt((9.525986892242036e-10 * pow(((double) M_PI), 4.0)))) / t_0))))));
} else {
tmp = -sqrt((((2.0 * t_2) * t_1) * (0.0 / t_0))) / t_2;
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.pow(Math.abs(y_45_scale), 2.0);
double t_1 = (b * a) * (b * -a);
double t_2 = (4.0 * t_1) / Math.pow((x_45_scale * Math.abs(y_45_scale)), 2.0);
double tmp;
if (Math.abs(y_45_scale) <= 1.55e-162) {
tmp = 0.25 * ((a * (t_0 * Math.sqrt((8.0 * (0.5 - (0.5 * Math.cos((0.011111111111111112 * (angle * Math.PI))))))))) / Math.abs(Math.abs(y_45_scale)));
} else if (Math.abs(y_45_scale) <= 1.32e+154) {
tmp = 0.25 * (a * (t_0 * (angle * Math.sqrt((8.0 * (((3.08641975308642e-5 * Math.pow(Math.PI, 2.0)) - Math.sqrt((9.525986892242036e-10 * Math.pow(Math.PI, 4.0)))) / t_0))))));
} else {
tmp = -Math.sqrt((((2.0 * t_2) * t_1) * (0.0 / t_0))) / t_2;
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = math.pow(math.fabs(y_45_scale), 2.0) t_1 = (b * a) * (b * -a) t_2 = (4.0 * t_1) / math.pow((x_45_scale * math.fabs(y_45_scale)), 2.0) tmp = 0 if math.fabs(y_45_scale) <= 1.55e-162: tmp = 0.25 * ((a * (t_0 * math.sqrt((8.0 * (0.5 - (0.5 * math.cos((0.011111111111111112 * (angle * math.pi))))))))) / math.fabs(math.fabs(y_45_scale))) elif math.fabs(y_45_scale) <= 1.32e+154: tmp = 0.25 * (a * (t_0 * (angle * math.sqrt((8.0 * (((3.08641975308642e-5 * math.pow(math.pi, 2.0)) - math.sqrt((9.525986892242036e-10 * math.pow(math.pi, 4.0)))) / t_0)))))) else: tmp = -math.sqrt((((2.0 * t_2) * t_1) * (0.0 / t_0))) / t_2 return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = abs(y_45_scale) ^ 2.0 t_1 = Float64(Float64(b * a) * Float64(b * Float64(-a))) t_2 = Float64(Float64(4.0 * t_1) / (Float64(x_45_scale * abs(y_45_scale)) ^ 2.0)) tmp = 0.0 if (abs(y_45_scale) <= 1.55e-162) tmp = Float64(0.25 * Float64(Float64(a * Float64(t_0 * sqrt(Float64(8.0 * Float64(0.5 - Float64(0.5 * cos(Float64(0.011111111111111112 * Float64(angle * pi))))))))) / abs(abs(y_45_scale)))); elseif (abs(y_45_scale) <= 1.32e+154) tmp = Float64(0.25 * Float64(a * Float64(t_0 * Float64(angle * sqrt(Float64(8.0 * Float64(Float64(Float64(3.08641975308642e-5 * (pi ^ 2.0)) - sqrt(Float64(9.525986892242036e-10 * (pi ^ 4.0)))) / t_0))))))); else tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * t_2) * t_1) * Float64(0.0 / t_0)))) / t_2); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = abs(y_45_scale) ^ 2.0; t_1 = (b * a) * (b * -a); t_2 = (4.0 * t_1) / ((x_45_scale * abs(y_45_scale)) ^ 2.0); tmp = 0.0; if (abs(y_45_scale) <= 1.55e-162) tmp = 0.25 * ((a * (t_0 * sqrt((8.0 * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * pi))))))))) / abs(abs(y_45_scale))); elseif (abs(y_45_scale) <= 1.32e+154) tmp = 0.25 * (a * (t_0 * (angle * sqrt((8.0 * (((3.08641975308642e-5 * (pi ^ 2.0)) - sqrt((9.525986892242036e-10 * (pi ^ 4.0)))) / t_0)))))); else tmp = -sqrt((((2.0 * t_2) * t_1) * (0.0 / t_0))) / t_2; end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[Power[N[Abs[y$45$scale], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * N[(b * (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(4.0 * t$95$1), $MachinePrecision] / N[Power[N[(x$45$scale * N[Abs[y$45$scale], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[y$45$scale], $MachinePrecision], 1.55e-162], N[(0.25 * N[(N[(a * N[(t$95$0 * N[Sqrt[N[(8.0 * N[(0.5 - N[(0.5 * N[Cos[N[(0.011111111111111112 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[N[Abs[y$45$scale], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[y$45$scale], $MachinePrecision], 1.32e+154], N[(0.25 * N[(a * N[(t$95$0 * N[(angle * N[Sqrt[N[(8.0 * N[(N[(N[(3.08641975308642e-5 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(9.525986892242036e-10 * N[Power[Pi, 4.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(N[(N[(2.0 * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(0.0 / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := {\left(\left|y-scale\right|\right)}^{2}\\
t_1 := \left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\\
t_2 := \frac{4 \cdot t\_1}{{\left(x-scale \cdot \left|y-scale\right|\right)}^{2}}\\
\mathbf{if}\;\left|y-scale\right| \leq 1.55 \cdot 10^{-162}:\\
\;\;\;\;0.25 \cdot \frac{a \cdot \left(t\_0 \cdot \sqrt{8 \cdot \left(0.5 - 0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{\left|\left|y-scale\right|\right|}\\
\mathbf{elif}\;\left|y-scale\right| \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;0.25 \cdot \left(a \cdot \left(t\_0 \cdot \left(angle \cdot \sqrt{8 \cdot \frac{3.08641975308642 \cdot 10^{-5} \cdot {\pi}^{2} - \sqrt{9.525986892242036 \cdot 10^{-10} \cdot {\pi}^{4}}}{t\_0}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot t\_2\right) \cdot t\_1\right) \cdot \frac{0}{t\_0}}}{t\_2}\\
\end{array}
if y-scale < 1.5499999999999999e-162Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Applied rewrites3.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in b around 0
lower-/.f64N/A
Applied rewrites23.7%
if 1.5499999999999999e-162 < y-scale < 1.32e154Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites4.1%
Taylor expanded in b around 0
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
Applied rewrites12.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites14.2%
if 1.32e154 < y-scale Initial program 0.0%
Taylor expanded in angle around 0
Applied rewrites0.1%
Taylor expanded in y-scale around 0
lower-/.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-pow.f64N/A
lower-pow.f642.3%
Applied rewrites2.3%
Taylor expanded in a around 0
Applied rewrites3.8%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (pow (fabs y-scale) 2.0)) (t_1 (fabs (fabs y-scale))))
(if (<= (fabs y-scale) 1.55e-162)
(*
0.25
(/
(*
a
(*
t_0
(sqrt
(*
8.0
(-
0.5
(* 0.5 (cos (* 0.011111111111111112 (* angle PI)))))))))
t_1))
(if (<= (fabs y-scale) 1.4e+154)
(*
0.25
(*
a
(*
t_0
(*
angle
(sqrt
(*
8.0
(/
(-
(* 3.08641975308642e-5 (pow PI 2.0))
(sqrt (* 9.525986892242036e-10 (pow PI 4.0))))
t_0)))))))
(*
(*
(fabs y-scale)
(*
(fabs y-scale)
(/
(sqrt
(*
(* 8.0 (pow (* a b) 4.0))
(- (* b b) (sqrt (pow b 4.0)))))
(* t_1 (* (* (* a b) a) b)))))
0.25)))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = pow(fabs(y_45_scale), 2.0);
double t_1 = fabs(fabs(y_45_scale));
double tmp;
if (fabs(y_45_scale) <= 1.55e-162) {
tmp = 0.25 * ((a * (t_0 * sqrt((8.0 * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * ((double) M_PI)))))))))) / t_1);
} else if (fabs(y_45_scale) <= 1.4e+154) {
tmp = 0.25 * (a * (t_0 * (angle * sqrt((8.0 * (((3.08641975308642e-5 * pow(((double) M_PI), 2.0)) - sqrt((9.525986892242036e-10 * pow(((double) M_PI), 4.0)))) / t_0))))));
} else {
tmp = (fabs(y_45_scale) * (fabs(y_45_scale) * (sqrt(((8.0 * pow((a * b), 4.0)) * ((b * b) - sqrt(pow(b, 4.0))))) / (t_1 * (((a * b) * a) * b))))) * 0.25;
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.pow(Math.abs(y_45_scale), 2.0);
double t_1 = Math.abs(Math.abs(y_45_scale));
double tmp;
if (Math.abs(y_45_scale) <= 1.55e-162) {
tmp = 0.25 * ((a * (t_0 * Math.sqrt((8.0 * (0.5 - (0.5 * Math.cos((0.011111111111111112 * (angle * Math.PI))))))))) / t_1);
} else if (Math.abs(y_45_scale) <= 1.4e+154) {
tmp = 0.25 * (a * (t_0 * (angle * Math.sqrt((8.0 * (((3.08641975308642e-5 * Math.pow(Math.PI, 2.0)) - Math.sqrt((9.525986892242036e-10 * Math.pow(Math.PI, 4.0)))) / t_0))))));
} else {
tmp = (Math.abs(y_45_scale) * (Math.abs(y_45_scale) * (Math.sqrt(((8.0 * Math.pow((a * b), 4.0)) * ((b * b) - Math.sqrt(Math.pow(b, 4.0))))) / (t_1 * (((a * b) * a) * b))))) * 0.25;
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = math.pow(math.fabs(y_45_scale), 2.0) t_1 = math.fabs(math.fabs(y_45_scale)) tmp = 0 if math.fabs(y_45_scale) <= 1.55e-162: tmp = 0.25 * ((a * (t_0 * math.sqrt((8.0 * (0.5 - (0.5 * math.cos((0.011111111111111112 * (angle * math.pi))))))))) / t_1) elif math.fabs(y_45_scale) <= 1.4e+154: tmp = 0.25 * (a * (t_0 * (angle * math.sqrt((8.0 * (((3.08641975308642e-5 * math.pow(math.pi, 2.0)) - math.sqrt((9.525986892242036e-10 * math.pow(math.pi, 4.0)))) / t_0)))))) else: tmp = (math.fabs(y_45_scale) * (math.fabs(y_45_scale) * (math.sqrt(((8.0 * math.pow((a * b), 4.0)) * ((b * b) - math.sqrt(math.pow(b, 4.0))))) / (t_1 * (((a * b) * a) * b))))) * 0.25 return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = abs(y_45_scale) ^ 2.0 t_1 = abs(abs(y_45_scale)) tmp = 0.0 if (abs(y_45_scale) <= 1.55e-162) tmp = Float64(0.25 * Float64(Float64(a * Float64(t_0 * sqrt(Float64(8.0 * Float64(0.5 - Float64(0.5 * cos(Float64(0.011111111111111112 * Float64(angle * pi))))))))) / t_1)); elseif (abs(y_45_scale) <= 1.4e+154) tmp = Float64(0.25 * Float64(a * Float64(t_0 * Float64(angle * sqrt(Float64(8.0 * Float64(Float64(Float64(3.08641975308642e-5 * (pi ^ 2.0)) - sqrt(Float64(9.525986892242036e-10 * (pi ^ 4.0)))) / t_0))))))); else tmp = Float64(Float64(abs(y_45_scale) * Float64(abs(y_45_scale) * Float64(sqrt(Float64(Float64(8.0 * (Float64(a * b) ^ 4.0)) * Float64(Float64(b * b) - sqrt((b ^ 4.0))))) / Float64(t_1 * Float64(Float64(Float64(a * b) * a) * b))))) * 0.25); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = abs(y_45_scale) ^ 2.0; t_1 = abs(abs(y_45_scale)); tmp = 0.0; if (abs(y_45_scale) <= 1.55e-162) tmp = 0.25 * ((a * (t_0 * sqrt((8.0 * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * pi))))))))) / t_1); elseif (abs(y_45_scale) <= 1.4e+154) tmp = 0.25 * (a * (t_0 * (angle * sqrt((8.0 * (((3.08641975308642e-5 * (pi ^ 2.0)) - sqrt((9.525986892242036e-10 * (pi ^ 4.0)))) / t_0)))))); else tmp = (abs(y_45_scale) * (abs(y_45_scale) * (sqrt(((8.0 * ((a * b) ^ 4.0)) * ((b * b) - sqrt((b ^ 4.0))))) / (t_1 * (((a * b) * a) * b))))) * 0.25; end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[Power[N[Abs[y$45$scale], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[Abs[y$45$scale], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[y$45$scale], $MachinePrecision], 1.55e-162], N[(0.25 * N[(N[(a * N[(t$95$0 * N[Sqrt[N[(8.0 * N[(0.5 - N[(0.5 * N[Cos[N[(0.011111111111111112 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[y$45$scale], $MachinePrecision], 1.4e+154], N[(0.25 * N[(a * N[(t$95$0 * N[(angle * N[Sqrt[N[(8.0 * N[(N[(N[(3.08641975308642e-5 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(9.525986892242036e-10 * N[Power[Pi, 4.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[y$45$scale], $MachinePrecision] * N[(N[Abs[y$45$scale], $MachinePrecision] * N[(N[Sqrt[N[(N[(8.0 * N[Power[N[(a * b), $MachinePrecision], 4.0], $MachinePrecision]), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] - N[Sqrt[N[Power[b, 4.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$1 * N[(N[(N[(a * b), $MachinePrecision] * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := {\left(\left|y-scale\right|\right)}^{2}\\
t_1 := \left|\left|y-scale\right|\right|\\
\mathbf{if}\;\left|y-scale\right| \leq 1.55 \cdot 10^{-162}:\\
\;\;\;\;0.25 \cdot \frac{a \cdot \left(t\_0 \cdot \sqrt{8 \cdot \left(0.5 - 0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{t\_1}\\
\mathbf{elif}\;\left|y-scale\right| \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;0.25 \cdot \left(a \cdot \left(t\_0 \cdot \left(angle \cdot \sqrt{8 \cdot \frac{3.08641975308642 \cdot 10^{-5} \cdot {\pi}^{2} - \sqrt{9.525986892242036 \cdot 10^{-10} \cdot {\pi}^{4}}}{t\_0}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left|y-scale\right| \cdot \left(\left|y-scale\right| \cdot \frac{\sqrt{\left(8 \cdot {\left(a \cdot b\right)}^{4}\right) \cdot \left(b \cdot b - \sqrt{{b}^{4}}\right)}}{t\_1 \cdot \left(\left(\left(a \cdot b\right) \cdot a\right) \cdot b\right)}\right)\right) \cdot 0.25\\
\end{array}
if y-scale < 1.5499999999999999e-162Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Applied rewrites3.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in b around 0
lower-/.f64N/A
Applied rewrites23.7%
if 1.5499999999999999e-162 < y-scale < 1.4e154Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites4.1%
Taylor expanded in b around 0
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
Applied rewrites12.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites14.2%
if 1.4e154 < y-scale Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Taylor expanded in angle around 0
lower--.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-pow.f640.7%
Applied rewrites0.7%
Applied rewrites7.2%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites5.4%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (fabs a) b)) (t_1 (fabs (fabs y-scale))))
(if (<= (fabs y-scale) 2.2e+170)
(*
0.25
(/
(*
(fabs a)
(*
(pow (fabs y-scale) 2.0)
(sqrt
(*
8.0
(-
0.5
(* 0.5 (cos (* 0.011111111111111112 (* angle PI)))))))))
t_1))
(*
(*
(fabs y-scale)
(*
(fabs y-scale)
(/
(sqrt
(* (* 8.0 (pow t_0 4.0)) (- (* b b) (sqrt (pow b 4.0)))))
(* t_1 (* (* t_0 (fabs a)) b)))))
0.25))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = fabs(a) * b;
double t_1 = fabs(fabs(y_45_scale));
double tmp;
if (fabs(y_45_scale) <= 2.2e+170) {
tmp = 0.25 * ((fabs(a) * (pow(fabs(y_45_scale), 2.0) * sqrt((8.0 * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * ((double) M_PI)))))))))) / t_1);
} else {
tmp = (fabs(y_45_scale) * (fabs(y_45_scale) * (sqrt(((8.0 * pow(t_0, 4.0)) * ((b * b) - sqrt(pow(b, 4.0))))) / (t_1 * ((t_0 * fabs(a)) * b))))) * 0.25;
}
return tmp;
}
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = Math.abs(a) * b;
double t_1 = Math.abs(Math.abs(y_45_scale));
double tmp;
if (Math.abs(y_45_scale) <= 2.2e+170) {
tmp = 0.25 * ((Math.abs(a) * (Math.pow(Math.abs(y_45_scale), 2.0) * Math.sqrt((8.0 * (0.5 - (0.5 * Math.cos((0.011111111111111112 * (angle * Math.PI))))))))) / t_1);
} else {
tmp = (Math.abs(y_45_scale) * (Math.abs(y_45_scale) * (Math.sqrt(((8.0 * Math.pow(t_0, 4.0)) * ((b * b) - Math.sqrt(Math.pow(b, 4.0))))) / (t_1 * ((t_0 * Math.abs(a)) * b))))) * 0.25;
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = math.fabs(a) * b t_1 = math.fabs(math.fabs(y_45_scale)) tmp = 0 if math.fabs(y_45_scale) <= 2.2e+170: tmp = 0.25 * ((math.fabs(a) * (math.pow(math.fabs(y_45_scale), 2.0) * math.sqrt((8.0 * (0.5 - (0.5 * math.cos((0.011111111111111112 * (angle * math.pi))))))))) / t_1) else: tmp = (math.fabs(y_45_scale) * (math.fabs(y_45_scale) * (math.sqrt(((8.0 * math.pow(t_0, 4.0)) * ((b * b) - math.sqrt(math.pow(b, 4.0))))) / (t_1 * ((t_0 * math.fabs(a)) * b))))) * 0.25 return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(abs(a) * b) t_1 = abs(abs(y_45_scale)) tmp = 0.0 if (abs(y_45_scale) <= 2.2e+170) tmp = Float64(0.25 * Float64(Float64(abs(a) * Float64((abs(y_45_scale) ^ 2.0) * sqrt(Float64(8.0 * Float64(0.5 - Float64(0.5 * cos(Float64(0.011111111111111112 * Float64(angle * pi))))))))) / t_1)); else tmp = Float64(Float64(abs(y_45_scale) * Float64(abs(y_45_scale) * Float64(sqrt(Float64(Float64(8.0 * (t_0 ^ 4.0)) * Float64(Float64(b * b) - sqrt((b ^ 4.0))))) / Float64(t_1 * Float64(Float64(t_0 * abs(a)) * b))))) * 0.25); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = abs(a) * b; t_1 = abs(abs(y_45_scale)); tmp = 0.0; if (abs(y_45_scale) <= 2.2e+170) tmp = 0.25 * ((abs(a) * ((abs(y_45_scale) ^ 2.0) * sqrt((8.0 * (0.5 - (0.5 * cos((0.011111111111111112 * (angle * pi))))))))) / t_1); else tmp = (abs(y_45_scale) * (abs(y_45_scale) * (sqrt(((8.0 * (t_0 ^ 4.0)) * ((b * b) - sqrt((b ^ 4.0))))) / (t_1 * ((t_0 * abs(a)) * b))))) * 0.25; end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[Abs[a], $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[Abs[y$45$scale], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[y$45$scale], $MachinePrecision], 2.2e+170], N[(0.25 * N[(N[(N[Abs[a], $MachinePrecision] * N[(N[Power[N[Abs[y$45$scale], $MachinePrecision], 2.0], $MachinePrecision] * N[Sqrt[N[(8.0 * N[(0.5 - N[(0.5 * N[Cos[N[(0.011111111111111112 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[y$45$scale], $MachinePrecision] * N[(N[Abs[y$45$scale], $MachinePrecision] * N[(N[Sqrt[N[(N[(8.0 * N[Power[t$95$0, 4.0], $MachinePrecision]), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] - N[Sqrt[N[Power[b, 4.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$1 * N[(N[(t$95$0 * N[Abs[a], $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left|a\right| \cdot b\\
t_1 := \left|\left|y-scale\right|\right|\\
\mathbf{if}\;\left|y-scale\right| \leq 2.2 \cdot 10^{+170}:\\
\;\;\;\;0.25 \cdot \frac{\left|a\right| \cdot \left({\left(\left|y-scale\right|\right)}^{2} \cdot \sqrt{8 \cdot \left(0.5 - 0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)}\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\left|y-scale\right| \cdot \left(\left|y-scale\right| \cdot \frac{\sqrt{\left(8 \cdot {t\_0}^{4}\right) \cdot \left(b \cdot b - \sqrt{{b}^{4}}\right)}}{t\_1 \cdot \left(\left(t\_0 \cdot \left|a\right|\right) \cdot b\right)}\right)\right) \cdot 0.25\\
\end{array}
if y-scale < 2.1999999999999999e170Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Applied rewrites3.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in b around 0
lower-/.f64N/A
Applied rewrites23.7%
if 2.1999999999999999e170 < y-scale Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Taylor expanded in angle around 0
lower--.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-pow.f640.7%
Applied rewrites0.7%
Applied rewrites7.2%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites5.4%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0
(sqrt
(*
(* 8.0 (pow (* a b) 4.0))
(- (* b b) (sqrt (pow b 4.0))))))
(t_1 (fabs (fabs y-scale))))
(if (<= (fabs y-scale) 3.8e+152)
(*
(*
(* (fabs y-scale) (fabs y-scale))
(/ (/ (/ t_0 t_1) (* a b)) (* a b)))
0.25)
(*
(*
(fabs y-scale)
(* (fabs y-scale) (/ t_0 (* t_1 (* (* (* a b) a) b)))))
0.25))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = sqrt(((8.0 * pow((a * b), 4.0)) * ((b * b) - sqrt(pow(b, 4.0)))));
double t_1 = fabs(fabs(y_45_scale));
double tmp;
if (fabs(y_45_scale) <= 3.8e+152) {
tmp = ((fabs(y_45_scale) * fabs(y_45_scale)) * (((t_0 / t_1) / (a * b)) / (a * b))) * 0.25;
} else {
tmp = (fabs(y_45_scale) * (fabs(y_45_scale) * (t_0 / (t_1 * (((a * b) * a) * b))))) * 0.25;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(a, b, angle, x_45scale, y_45scale)
use fmin_fmax_functions
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) :: t_1
real(8) :: tmp
t_0 = sqrt(((8.0d0 * ((a * b) ** 4.0d0)) * ((b * b) - sqrt((b ** 4.0d0)))))
t_1 = abs(abs(y_45scale))
if (abs(y_45scale) <= 3.8d+152) then
tmp = ((abs(y_45scale) * abs(y_45scale)) * (((t_0 / t_1) / (a * b)) / (a * b))) * 0.25d0
else
tmp = (abs(y_45scale) * (abs(y_45scale) * (t_0 / (t_1 * (((a * b) * a) * b))))) * 0.25d0
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 * Math.pow((a * b), 4.0)) * ((b * b) - Math.sqrt(Math.pow(b, 4.0)))));
double t_1 = Math.abs(Math.abs(y_45_scale));
double tmp;
if (Math.abs(y_45_scale) <= 3.8e+152) {
tmp = ((Math.abs(y_45_scale) * Math.abs(y_45_scale)) * (((t_0 / t_1) / (a * b)) / (a * b))) * 0.25;
} else {
tmp = (Math.abs(y_45_scale) * (Math.abs(y_45_scale) * (t_0 / (t_1 * (((a * b) * a) * b))))) * 0.25;
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = math.sqrt(((8.0 * math.pow((a * b), 4.0)) * ((b * b) - math.sqrt(math.pow(b, 4.0))))) t_1 = math.fabs(math.fabs(y_45_scale)) tmp = 0 if math.fabs(y_45_scale) <= 3.8e+152: tmp = ((math.fabs(y_45_scale) * math.fabs(y_45_scale)) * (((t_0 / t_1) / (a * b)) / (a * b))) * 0.25 else: tmp = (math.fabs(y_45_scale) * (math.fabs(y_45_scale) * (t_0 / (t_1 * (((a * b) * a) * b))))) * 0.25 return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = sqrt(Float64(Float64(8.0 * (Float64(a * b) ^ 4.0)) * Float64(Float64(b * b) - sqrt((b ^ 4.0))))) t_1 = abs(abs(y_45_scale)) tmp = 0.0 if (abs(y_45_scale) <= 3.8e+152) tmp = Float64(Float64(Float64(abs(y_45_scale) * abs(y_45_scale)) * Float64(Float64(Float64(t_0 / t_1) / Float64(a * b)) / Float64(a * b))) * 0.25); else tmp = Float64(Float64(abs(y_45_scale) * Float64(abs(y_45_scale) * Float64(t_0 / Float64(t_1 * Float64(Float64(Float64(a * b) * a) * b))))) * 0.25); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = sqrt(((8.0 * ((a * b) ^ 4.0)) * ((b * b) - sqrt((b ^ 4.0))))); t_1 = abs(abs(y_45_scale)); tmp = 0.0; if (abs(y_45_scale) <= 3.8e+152) tmp = ((abs(y_45_scale) * abs(y_45_scale)) * (((t_0 / t_1) / (a * b)) / (a * b))) * 0.25; else tmp = (abs(y_45_scale) * (abs(y_45_scale) * (t_0 / (t_1 * (((a * b) * a) * b))))) * 0.25; end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[Sqrt[N[(N[(8.0 * N[Power[N[(a * b), $MachinePrecision], 4.0], $MachinePrecision]), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] - N[Sqrt[N[Power[b, 4.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[Abs[y$45$scale], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[y$45$scale], $MachinePrecision], 3.8e+152], N[(N[(N[(N[Abs[y$45$scale], $MachinePrecision] * N[Abs[y$45$scale], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$0 / t$95$1), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision] / N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision], N[(N[(N[Abs[y$45$scale], $MachinePrecision] * N[(N[Abs[y$45$scale], $MachinePrecision] * N[(t$95$0 / N[(t$95$1 * N[(N[(N[(a * b), $MachinePrecision] * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \sqrt{\left(8 \cdot {\left(a \cdot b\right)}^{4}\right) \cdot \left(b \cdot b - \sqrt{{b}^{4}}\right)}\\
t_1 := \left|\left|y-scale\right|\right|\\
\mathbf{if}\;\left|y-scale\right| \leq 3.8 \cdot 10^{+152}:\\
\;\;\;\;\left(\left(\left|y-scale\right| \cdot \left|y-scale\right|\right) \cdot \frac{\frac{\frac{t\_0}{t\_1}}{a \cdot b}}{a \cdot b}\right) \cdot 0.25\\
\mathbf{else}:\\
\;\;\;\;\left(\left|y-scale\right| \cdot \left(\left|y-scale\right| \cdot \frac{t\_0}{t\_1 \cdot \left(\left(\left(a \cdot b\right) \cdot a\right) \cdot b\right)}\right)\right) \cdot 0.25\\
\end{array}
if y-scale < 3.8e152Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Taylor expanded in angle around 0
lower--.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-pow.f640.7%
Applied rewrites0.7%
Applied rewrites7.2%
lift-/.f64N/A
lift-*.f64N/A
Applied rewrites13.8%
if 3.8e152 < y-scale Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Taylor expanded in angle around 0
lower--.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-pow.f640.7%
Applied rewrites0.7%
Applied rewrites7.2%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites5.4%
(FPCore (a b angle x-scale y-scale)
:precision binary64
(let* ((t_0 (* (fabs a) b)))
(if (<= (fabs a) 9.5e-93)
(*
0.25
(/
(*
(fabs a)
(*
(pow y-scale 2.0)
(sqrt (* 8.0 (* (pow b 4.0) (- 0.5 0.5))))))
(* (pow b 2.0) (fabs y-scale))))
(*
(*
y-scale
(*
y-scale
(/
(sqrt
(* (* 8.0 (pow t_0 4.0)) (- (* b b) (sqrt (pow b 4.0)))))
(* (fabs y-scale) (* (* t_0 (fabs a)) b)))))
0.25))))double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
double t_0 = fabs(a) * b;
double tmp;
if (fabs(a) <= 9.5e-93) {
tmp = 0.25 * ((fabs(a) * (pow(y_45_scale, 2.0) * sqrt((8.0 * (pow(b, 4.0) * (0.5 - 0.5)))))) / (pow(b, 2.0) * fabs(y_45_scale)));
} else {
tmp = (y_45_scale * (y_45_scale * (sqrt(((8.0 * pow(t_0, 4.0)) * ((b * b) - sqrt(pow(b, 4.0))))) / (fabs(y_45_scale) * ((t_0 * fabs(a)) * b))))) * 0.25;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(a, b, angle, x_45scale, y_45scale)
use fmin_fmax_functions
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 = abs(a) * b
if (abs(a) <= 9.5d-93) then
tmp = 0.25d0 * ((abs(a) * ((y_45scale ** 2.0d0) * sqrt((8.0d0 * ((b ** 4.0d0) * (0.5d0 - 0.5d0)))))) / ((b ** 2.0d0) * abs(y_45scale)))
else
tmp = (y_45scale * (y_45scale * (sqrt(((8.0d0 * (t_0 ** 4.0d0)) * ((b * b) - sqrt((b ** 4.0d0))))) / (abs(y_45scale) * ((t_0 * abs(a)) * b))))) * 0.25d0
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.abs(a) * b;
double tmp;
if (Math.abs(a) <= 9.5e-93) {
tmp = 0.25 * ((Math.abs(a) * (Math.pow(y_45_scale, 2.0) * Math.sqrt((8.0 * (Math.pow(b, 4.0) * (0.5 - 0.5)))))) / (Math.pow(b, 2.0) * Math.abs(y_45_scale)));
} else {
tmp = (y_45_scale * (y_45_scale * (Math.sqrt(((8.0 * Math.pow(t_0, 4.0)) * ((b * b) - Math.sqrt(Math.pow(b, 4.0))))) / (Math.abs(y_45_scale) * ((t_0 * Math.abs(a)) * b))))) * 0.25;
}
return tmp;
}
def code(a, b, angle, x_45_scale, y_45_scale): t_0 = math.fabs(a) * b tmp = 0 if math.fabs(a) <= 9.5e-93: tmp = 0.25 * ((math.fabs(a) * (math.pow(y_45_scale, 2.0) * math.sqrt((8.0 * (math.pow(b, 4.0) * (0.5 - 0.5)))))) / (math.pow(b, 2.0) * math.fabs(y_45_scale))) else: tmp = (y_45_scale * (y_45_scale * (math.sqrt(((8.0 * math.pow(t_0, 4.0)) * ((b * b) - math.sqrt(math.pow(b, 4.0))))) / (math.fabs(y_45_scale) * ((t_0 * math.fabs(a)) * b))))) * 0.25 return tmp
function code(a, b, angle, x_45_scale, y_45_scale) t_0 = Float64(abs(a) * b) tmp = 0.0 if (abs(a) <= 9.5e-93) tmp = Float64(0.25 * Float64(Float64(abs(a) * Float64((y_45_scale ^ 2.0) * sqrt(Float64(8.0 * Float64((b ^ 4.0) * Float64(0.5 - 0.5)))))) / Float64((b ^ 2.0) * abs(y_45_scale)))); else tmp = Float64(Float64(y_45_scale * Float64(y_45_scale * Float64(sqrt(Float64(Float64(8.0 * (t_0 ^ 4.0)) * Float64(Float64(b * b) - sqrt((b ^ 4.0))))) / Float64(abs(y_45_scale) * Float64(Float64(t_0 * abs(a)) * b))))) * 0.25); end return tmp end
function tmp_2 = code(a, b, angle, x_45_scale, y_45_scale) t_0 = abs(a) * b; tmp = 0.0; if (abs(a) <= 9.5e-93) tmp = 0.25 * ((abs(a) * ((y_45_scale ^ 2.0) * sqrt((8.0 * ((b ^ 4.0) * (0.5 - 0.5)))))) / ((b ^ 2.0) * abs(y_45_scale))); else tmp = (y_45_scale * (y_45_scale * (sqrt(((8.0 * (t_0 ^ 4.0)) * ((b * b) - sqrt((b ^ 4.0))))) / (abs(y_45_scale) * ((t_0 * abs(a)) * b))))) * 0.25; end tmp_2 = tmp; end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := Block[{t$95$0 = N[(N[Abs[a], $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[Abs[a], $MachinePrecision], 9.5e-93], N[(0.25 * N[(N[(N[Abs[a], $MachinePrecision] * N[(N[Power[y$45$scale, 2.0], $MachinePrecision] * N[Sqrt[N[(8.0 * N[(N[Power[b, 4.0], $MachinePrecision] * N[(0.5 - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[b, 2.0], $MachinePrecision] * N[Abs[y$45$scale], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$45$scale * N[(y$45$scale * N[(N[Sqrt[N[(N[(8.0 * N[Power[t$95$0, 4.0], $MachinePrecision]), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] - N[Sqrt[N[Power[b, 4.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[Abs[y$45$scale], $MachinePrecision] * N[(N[(t$95$0 * N[Abs[a], $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.25), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|a\right| \cdot b\\
\mathbf{if}\;\left|a\right| \leq 9.5 \cdot 10^{-93}:\\
\;\;\;\;0.25 \cdot \frac{\left|a\right| \cdot \left({y-scale}^{2} \cdot \sqrt{8 \cdot \left({b}^{4} \cdot \left(0.5 - 0.5\right)\right)}\right)}{{b}^{2} \cdot \left|y-scale\right|}\\
\mathbf{else}:\\
\;\;\;\;\left(y-scale \cdot \left(y-scale \cdot \frac{\sqrt{\left(8 \cdot {t\_0}^{4}\right) \cdot \left(b \cdot b - \sqrt{{b}^{4}}\right)}}{\left|y-scale\right| \cdot \left(\left(t\_0 \cdot \left|a\right|\right) \cdot b\right)}\right)\right) \cdot 0.25\\
\end{array}
if a < 9.5000000000000001e-93Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Applied rewrites3.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in angle around 0
Applied rewrites5.4%
if 9.5000000000000001e-93 < a Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Taylor expanded in angle around 0
lower--.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
lower-pow.f640.7%
Applied rewrites0.7%
Applied rewrites7.2%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites5.4%
(FPCore (a b angle x-scale y-scale) :precision binary64 (* 0.25 (/ (* a (* (pow y-scale 2.0) (sqrt (* 8.0 (* (pow b 4.0) (- 0.5 0.5)))))) (* (pow b 2.0) (fabs y-scale)))))
double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 0.25 * ((a * (pow(y_45_scale, 2.0) * sqrt((8.0 * (pow(b, 4.0) * (0.5 - 0.5)))))) / (pow(b, 2.0) * fabs(y_45_scale)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(a, b, angle, x_45scale, y_45scale)
use fmin_fmax_functions
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 * ((a * ((y_45scale ** 2.0d0) * sqrt((8.0d0 * ((b ** 4.0d0) * (0.5d0 - 0.5d0)))))) / ((b ** 2.0d0) * abs(y_45scale)))
end function
public static double code(double a, double b, double angle, double x_45_scale, double y_45_scale) {
return 0.25 * ((a * (Math.pow(y_45_scale, 2.0) * Math.sqrt((8.0 * (Math.pow(b, 4.0) * (0.5 - 0.5)))))) / (Math.pow(b, 2.0) * Math.abs(y_45_scale)));
}
def code(a, b, angle, x_45_scale, y_45_scale): return 0.25 * ((a * (math.pow(y_45_scale, 2.0) * math.sqrt((8.0 * (math.pow(b, 4.0) * (0.5 - 0.5)))))) / (math.pow(b, 2.0) * math.fabs(y_45_scale)))
function code(a, b, angle, x_45_scale, y_45_scale) return Float64(0.25 * Float64(Float64(a * Float64((y_45_scale ^ 2.0) * sqrt(Float64(8.0 * Float64((b ^ 4.0) * Float64(0.5 - 0.5)))))) / Float64((b ^ 2.0) * abs(y_45_scale)))) end
function tmp = code(a, b, angle, x_45_scale, y_45_scale) tmp = 0.25 * ((a * ((y_45_scale ^ 2.0) * sqrt((8.0 * ((b ^ 4.0) * (0.5 - 0.5)))))) / ((b ^ 2.0) * abs(y_45_scale))); end
code[a_, b_, angle_, x$45$scale_, y$45$scale_] := N[(0.25 * N[(N[(a * N[(N[Power[y$45$scale, 2.0], $MachinePrecision] * N[Sqrt[N[(8.0 * N[(N[Power[b, 4.0], $MachinePrecision] * N[(0.5 - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[b, 2.0], $MachinePrecision] * N[Abs[y$45$scale], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
0.25 \cdot \frac{a \cdot \left({y-scale}^{2} \cdot \sqrt{8 \cdot \left({b}^{4} \cdot \left(0.5 - 0.5\right)\right)}\right)}{{b}^{2} \cdot \left|y-scale\right|}
Initial program 0.0%
Taylor expanded in x-scale around 0
Applied rewrites0.8%
Applied rewrites3.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in angle around 0
Applied rewrites5.4%
herbie shell --seed 2025212
(FPCore (a b angle x-scale y-scale)
:name "b 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))))