
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (<= t_2 (- INFINITY))
(* 2.0 (* z (- t (/ (* c (* t_1 i)) z))))
(if (<= t_2 1e+229)
(* (- (+ (* x y) (* z t)) t_2) 2.0)
(* (* t_1 (* c i)) (- 2.0))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = 2.0 * (z * (t - ((c * (t_1 * i)) / z)));
} else if (t_2 <= 1e+229) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = (t_1 * (c * i)) * -2.0;
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = 2.0 * (z * (t - ((c * (t_1 * i)) / z)));
} else if (t_2 <= 1e+229) {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
} else {
tmp = (t_1 * (c * i)) * -2.0;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if t_2 <= -math.inf: tmp = 2.0 * (z * (t - ((c * (t_1 * i)) / z))) elif t_2 <= 1e+229: tmp = (((x * y) + (z * t)) - t_2) * 2.0 else: tmp = (t_1 * (c * i)) * -2.0 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(2.0 * Float64(z * Float64(t - Float64(Float64(c * Float64(t_1 * i)) / z)))); elseif (t_2 <= 1e+229) tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); else tmp = Float64(Float64(t_1 * Float64(c * i)) * Float64(-2.0)); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = a + (b * c);
t_2 = (c * t_1) * i;
tmp = 0.0;
if (t_2 <= -Inf)
tmp = 2.0 * (z * (t - ((c * (t_1 * i)) / z)));
elseif (t_2 <= 1e+229)
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
else
tmp = (t_1 * (c * i)) * -2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(z * N[(t - N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+229], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision] * (-2.0)), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(z \cdot \left(t - \frac{c \cdot \left(t\_1 \cdot i\right)}{z}\right)\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+229}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 \cdot \left(c \cdot i\right)\right) \cdot \left(-2\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0Initial program 74.4%
fma-define74.4%
associate-*l*85.9%
Simplified85.9%
fma-define85.9%
+-commutative85.9%
Applied egg-rr85.9%
Taylor expanded in c around 0 83.6%
Taylor expanded in z around inf 75.9%
associate--l+75.9%
div-sub80.0%
Simplified86.1%
Taylor expanded in x around 0 92.2%
if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.9999999999999999e228Initial program 99.8%
if 9.9999999999999999e228 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 66.0%
fma-define66.0%
associate-*l*76.8%
Simplified76.8%
fma-define76.8%
+-commutative76.8%
Applied egg-rr76.8%
Taylor expanded in c around 0 74.3%
Taylor expanded in i around inf 89.0%
mul-1-neg89.0%
associate-*r*90.9%
distribute-lft-neg-in90.9%
*-commutative90.9%
distribute-rgt-neg-in90.9%
*-commutative90.9%
Simplified90.9%
Final simplification96.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* z (- t (/ (* c (* t_1 i)) z)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (z * (t - ((c * (t_1 * i)) / z)));
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (z * (t - ((c * (t_1 * i)) / z)));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * (z * (t - ((c * (t_1 * i)) / z))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(z * Float64(t - Float64(Float64(c * Float64(t_1 * i)) / z)))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = a + (b * c);
t_2 = (x * y) + (z * t);
tmp = 0.0;
if ((t_2 - ((c * t_1) * i)) <= Inf)
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
else
tmp = 2.0 * (z * (t - ((c * (t_1 * i)) / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * N[(t - N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot \left(t - \frac{c \cdot \left(t\_1 \cdot i\right)}{z}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 94.8%
fma-define94.8%
associate-*l*98.2%
Simplified98.2%
fma-define98.2%
+-commutative98.2%
Applied egg-rr98.2%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
fma-define0.0%
associate-*l*6.7%
Simplified6.7%
fma-define6.7%
+-commutative6.7%
Applied egg-rr6.7%
Taylor expanded in c around 0 13.3%
Taylor expanded in z around inf 26.7%
associate--l+26.7%
div-sub33.3%
Simplified33.3%
Taylor expanded in x around 0 86.7%
Final simplification97.6%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= c -2.05e+43)
(* 2.0 (- t_1 (* c (* b (* c i)))))
(if (<= c 3.05e-158)
(* 2.0 (- t_1 (* i (* a c))))
(if (<= c 2.3e+58)
(* 2.0 (- t_1 (* (* b c) (* c i))))
(* 2.0 (- (* x y) (* c (* c (+ (* b i) (/ (* a i) c)))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (c <= -2.05e+43) {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
} else if (c <= 3.05e-158) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else if (c <= 2.3e+58) {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
} else {
tmp = 2.0 * ((x * y) - (c * (c * ((b * i) + ((a * i) / c)))));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if (c <= (-2.05d+43)) then
tmp = 2.0d0 * (t_1 - (c * (b * (c * i))))
else if (c <= 3.05d-158) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else if (c <= 2.3d+58) then
tmp = 2.0d0 * (t_1 - ((b * c) * (c * i)))
else
tmp = 2.0d0 * ((x * y) - (c * (c * ((b * i) + ((a * i) / c)))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (c <= -2.05e+43) {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
} else if (c <= 3.05e-158) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else if (c <= 2.3e+58) {
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
} else {
tmp = 2.0 * ((x * y) - (c * (c * ((b * i) + ((a * i) / c)))));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if c <= -2.05e+43: tmp = 2.0 * (t_1 - (c * (b * (c * i)))) elif c <= 3.05e-158: tmp = 2.0 * (t_1 - (i * (a * c))) elif c <= 2.3e+58: tmp = 2.0 * (t_1 - ((b * c) * (c * i))) else: tmp = 2.0 * ((x * y) - (c * (c * ((b * i) + ((a * i) / c))))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (c <= -2.05e+43) tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(b * Float64(c * i))))); elseif (c <= 3.05e-158) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); elseif (c <= 2.3e+58) tmp = Float64(2.0 * Float64(t_1 - Float64(Float64(b * c) * Float64(c * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(c * Float64(Float64(b * i) + Float64(Float64(a * i) / c)))))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (x * y) + (z * t);
tmp = 0.0;
if (c <= -2.05e+43)
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
elseif (c <= 3.05e-158)
tmp = 2.0 * (t_1 - (i * (a * c)));
elseif (c <= 2.3e+58)
tmp = 2.0 * (t_1 - ((b * c) * (c * i)));
else
tmp = 2.0 * ((x * y) - (c * (c * ((b * i) + ((a * i) / c)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.05e+43], N[(2.0 * N[(t$95$1 - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.05e-158], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.3e+58], N[(2.0 * N[(t$95$1 - N[(N[(b * c), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(c * N[(N[(b * i), $MachinePrecision] + N[(N[(a * i), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \leq -2.05 \cdot 10^{+43}:\\
\;\;\;\;2 \cdot \left(t\_1 - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 3.05 \cdot 10^{-158}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{elif}\;c \leq 2.3 \cdot 10^{+58}:\\
\;\;\;\;2 \cdot \left(t\_1 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right)\right)\right)\\
\end{array}
\end{array}
if c < -2.05e43Initial program 77.1%
fma-define77.1%
associate-*l*85.5%
Simplified85.5%
fma-define85.5%
+-commutative85.5%
Applied egg-rr85.5%
Taylor expanded in c around 0 88.9%
Taylor expanded in a around 0 89.1%
if -2.05e43 < c < 3.0499999999999999e-158Initial program 97.9%
Taylor expanded in a around inf 92.5%
*-commutative92.5%
Simplified92.5%
if 3.0499999999999999e-158 < c < 2.30000000000000002e58Initial program 96.0%
fma-define96.0%
associate-*l*96.0%
Simplified96.0%
fma-define96.0%
+-commutative96.0%
Applied egg-rr96.0%
Taylor expanded in a around 0 86.5%
if 2.30000000000000002e58 < c Initial program 77.9%
fma-define77.9%
associate-*l*89.7%
Simplified89.7%
fma-define89.7%
+-commutative89.7%
Applied egg-rr89.7%
Taylor expanded in c around 0 87.3%
Taylor expanded in z around 0 87.5%
cancel-sign-sub-inv87.5%
+-commutative87.5%
fma-undefine87.5%
cancel-sign-sub-inv87.5%
*-commutative87.5%
fma-undefine87.5%
associate-*r*89.8%
distribute-rgt-in89.8%
+-commutative89.8%
*-commutative89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in c around inf 91.6%
Final simplification90.4%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -5.3e+144)
(and (not (<= c -1.55e+54)) (or (<= c -7.5e-5) (not (<= c 6.8e-18)))))
(* (* c (* (+ a (* b c)) i)) -2.0)
(* 2.0 (+ (* x y) (* z t)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.3e+144) || (!(c <= -1.55e+54) && ((c <= -7.5e-5) || !(c <= 6.8e-18)))) {
tmp = (c * ((a + (b * c)) * i)) * -2.0;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-5.3d+144)) .or. (.not. (c <= (-1.55d+54))) .and. (c <= (-7.5d-5)) .or. (.not. (c <= 6.8d-18))) then
tmp = (c * ((a + (b * c)) * i)) * (-2.0d0)
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -5.3e+144) || (!(c <= -1.55e+54) && ((c <= -7.5e-5) || !(c <= 6.8e-18)))) {
tmp = (c * ((a + (b * c)) * i)) * -2.0;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -5.3e+144) or (not (c <= -1.55e+54) and ((c <= -7.5e-5) or not (c <= 6.8e-18))): tmp = (c * ((a + (b * c)) * i)) * -2.0 else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -5.3e+144) || (!(c <= -1.55e+54) && ((c <= -7.5e-5) || !(c <= 6.8e-18)))) tmp = Float64(Float64(c * Float64(Float64(a + Float64(b * c)) * i)) * -2.0); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((c <= -5.3e+144) || (~((c <= -1.55e+54)) && ((c <= -7.5e-5) || ~((c <= 6.8e-18)))))
tmp = (c * ((a + (b * c)) * i)) * -2.0;
else
tmp = 2.0 * ((x * y) + (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -5.3e+144], And[N[Not[LessEqual[c, -1.55e+54]], $MachinePrecision], Or[LessEqual[c, -7.5e-5], N[Not[LessEqual[c, 6.8e-18]], $MachinePrecision]]]], N[(N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.3 \cdot 10^{+144} \lor \neg \left(c \leq -1.55 \cdot 10^{+54}\right) \land \left(c \leq -7.5 \cdot 10^{-5} \lor \neg \left(c \leq 6.8 \cdot 10^{-18}\right)\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -5.2999999999999997e144 or -1.55e54 < c < -7.49999999999999934e-5 or 6.80000000000000002e-18 < c Initial program 81.8%
fma-define81.8%
associate-*l*90.1%
Simplified90.1%
fma-define90.1%
+-commutative90.1%
Applied egg-rr90.1%
Taylor expanded in c around 0 86.5%
Taylor expanded in i around inf 79.1%
mul-1-neg79.1%
associate-*r*79.1%
distribute-lft-neg-in79.1%
*-commutative79.1%
distribute-rgt-neg-in79.1%
*-commutative79.1%
Simplified79.1%
Taylor expanded in i around 0 79.1%
if -5.2999999999999997e144 < c < -1.55e54 or -7.49999999999999934e-5 < c < 6.80000000000000002e-18Initial program 95.1%
Taylor expanded in c around 0 70.4%
Final simplification74.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (or (<= c -1.5e+149)
(and (not (<= c -1.35e+109))
(or (<= c -2.4e+28) (not (<= c 1.38e-17)))))
(* 2.0 (* (* b c) (* c (- i))))
(* 2.0 (+ (* x y) (* z t)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.5e+149) || (!(c <= -1.35e+109) && ((c <= -2.4e+28) || !(c <= 1.38e-17)))) {
tmp = 2.0 * ((b * c) * (c * -i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.5d+149)) .or. (.not. (c <= (-1.35d+109))) .and. (c <= (-2.4d+28)) .or. (.not. (c <= 1.38d-17))) then
tmp = 2.0d0 * ((b * c) * (c * -i))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.5e+149) || (!(c <= -1.35e+109) && ((c <= -2.4e+28) || !(c <= 1.38e-17)))) {
tmp = 2.0 * ((b * c) * (c * -i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.5e+149) or (not (c <= -1.35e+109) and ((c <= -2.4e+28) or not (c <= 1.38e-17))): tmp = 2.0 * ((b * c) * (c * -i)) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.5e+149) || (!(c <= -1.35e+109) && ((c <= -2.4e+28) || !(c <= 1.38e-17)))) tmp = Float64(2.0 * Float64(Float64(b * c) * Float64(c * Float64(-i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((c <= -1.5e+149) || (~((c <= -1.35e+109)) && ((c <= -2.4e+28) || ~((c <= 1.38e-17)))))
tmp = 2.0 * ((b * c) * (c * -i));
else
tmp = 2.0 * ((x * y) + (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.5e+149], And[N[Not[LessEqual[c, -1.35e+109]], $MachinePrecision], Or[LessEqual[c, -2.4e+28], N[Not[LessEqual[c, 1.38e-17]], $MachinePrecision]]]], N[(2.0 * N[(N[(b * c), $MachinePrecision] * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.5 \cdot 10^{+149} \lor \neg \left(c \leq -1.35 \cdot 10^{+109}\right) \land \left(c \leq -2.4 \cdot 10^{+28} \lor \neg \left(c \leq 1.38 \cdot 10^{-17}\right)\right):\\
\;\;\;\;2 \cdot \left(\left(b \cdot c\right) \cdot \left(c \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.50000000000000002e149 or -1.35000000000000001e109 < c < -2.39999999999999981e28 or 1.3800000000000001e-17 < c Initial program 79.7%
fma-define79.7%
associate-*l*88.3%
Simplified88.3%
fma-define88.3%
+-commutative88.3%
Applied egg-rr88.3%
Taylor expanded in c around 0 86.5%
Taylor expanded in i around inf 75.8%
mul-1-neg75.8%
associate-*r*75.8%
distribute-lft-neg-in75.8%
*-commutative75.8%
distribute-rgt-neg-in75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in a around 0 61.4%
*-commutative61.4%
Simplified61.4%
if -1.50000000000000002e149 < c < -1.35000000000000001e109 or -2.39999999999999981e28 < c < 1.3800000000000001e-17Initial program 97.7%
Taylor expanded in c around 0 71.4%
Final simplification66.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* (+ a (* b c)) (* c i)) (- 2.0))))
(if (<= i -6.8e+131)
t_1
(if (<= i 7.5e-197)
(* 2.0 (+ (* x y) (* z t)))
(if (<= i 7.2e+62) (* 2.0 (- (* x y) (* c (* b (* c i))))) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * (c * i)) * -2.0;
double tmp;
if (i <= -6.8e+131) {
tmp = t_1;
} else if (i <= 7.5e-197) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (i <= 7.2e+62) {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = ((a + (b * c)) * (c * i)) * -2.0d0
if (i <= (-6.8d+131)) then
tmp = t_1
else if (i <= 7.5d-197) then
tmp = 2.0d0 * ((x * y) + (z * t))
else if (i <= 7.2d+62) then
tmp = 2.0d0 * ((x * y) - (c * (b * (c * i))))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a + (b * c)) * (c * i)) * -2.0;
double tmp;
if (i <= -6.8e+131) {
tmp = t_1;
} else if (i <= 7.5e-197) {
tmp = 2.0 * ((x * y) + (z * t));
} else if (i <= 7.2e+62) {
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = ((a + (b * c)) * (c * i)) * -2.0 tmp = 0 if i <= -6.8e+131: tmp = t_1 elif i <= 7.5e-197: tmp = 2.0 * ((x * y) + (z * t)) elif i <= 7.2e+62: tmp = 2.0 * ((x * y) - (c * (b * (c * i)))) else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a + Float64(b * c)) * Float64(c * i)) * Float64(-2.0)) tmp = 0.0 if (i <= -6.8e+131) tmp = t_1; elseif (i <= 7.5e-197) tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); elseif (i <= 7.2e+62) tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(b * Float64(c * i))))); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = ((a + (b * c)) * (c * i)) * -2.0;
tmp = 0.0;
if (i <= -6.8e+131)
tmp = t_1;
elseif (i <= 7.5e-197)
tmp = 2.0 * ((x * y) + (z * t));
elseif (i <= 7.2e+62)
tmp = 2.0 * ((x * y) - (c * (b * (c * i))));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision] * (-2.0)), $MachinePrecision]}, If[LessEqual[i, -6.8e+131], t$95$1, If[LessEqual[i, 7.5e-197], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.2e+62], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \cdot \left(-2\right)\\
\mathbf{if}\;i \leq -6.8 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 7.5 \cdot 10^{-197}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\mathbf{elif}\;i \leq 7.2 \cdot 10^{+62}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -6.79999999999999972e131 or 7.2e62 < i Initial program 89.2%
fma-define89.2%
associate-*l*89.2%
Simplified89.2%
fma-define89.2%
+-commutative89.2%
Applied egg-rr89.2%
Taylor expanded in c around 0 73.7%
Taylor expanded in i around inf 68.3%
mul-1-neg68.3%
associate-*r*76.3%
distribute-lft-neg-in76.3%
*-commutative76.3%
distribute-rgt-neg-in76.3%
*-commutative76.3%
Simplified76.3%
if -6.79999999999999972e131 < i < 7.5e-197Initial program 90.5%
Taylor expanded in c around 0 72.5%
if 7.5e-197 < i < 7.2e62Initial program 86.2%
fma-define86.2%
associate-*l*92.9%
Simplified92.9%
fma-define92.9%
+-commutative92.9%
Applied egg-rr92.9%
Taylor expanded in c around 0 95.2%
Taylor expanded in z around 0 88.6%
cancel-sign-sub-inv88.6%
+-commutative88.6%
fma-undefine88.6%
cancel-sign-sub-inv88.6%
*-commutative88.6%
fma-undefine88.6%
associate-*r*86.2%
distribute-rgt-in86.2%
+-commutative86.2%
*-commutative86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in a around 0 75.3%
Final simplification74.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)))
(if (<= a -1.55e+26)
(* (* i (* a c)) (- 2.0))
(if (<= a -4e-271)
t_1
(if (<= a -3.3e-296)
(* 2.0 (* z t))
(if (<= a 4.2e+119) t_1 (* -2.0 (* c (* a i)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double tmp;
if (a <= -1.55e+26) {
tmp = (i * (a * c)) * -2.0;
} else if (a <= -4e-271) {
tmp = t_1;
} else if (a <= -3.3e-296) {
tmp = 2.0 * (z * t);
} else if (a <= 4.2e+119) {
tmp = t_1;
} else {
tmp = -2.0 * (c * (a * i));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) * 2.0d0
if (a <= (-1.55d+26)) then
tmp = (i * (a * c)) * -2.0d0
else if (a <= (-4d-271)) then
tmp = t_1
else if (a <= (-3.3d-296)) then
tmp = 2.0d0 * (z * t)
else if (a <= 4.2d+119) then
tmp = t_1
else
tmp = (-2.0d0) * (c * (a * i))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double tmp;
if (a <= -1.55e+26) {
tmp = (i * (a * c)) * -2.0;
} else if (a <= -4e-271) {
tmp = t_1;
} else if (a <= -3.3e-296) {
tmp = 2.0 * (z * t);
} else if (a <= 4.2e+119) {
tmp = t_1;
} else {
tmp = -2.0 * (c * (a * i));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 tmp = 0 if a <= -1.55e+26: tmp = (i * (a * c)) * -2.0 elif a <= -4e-271: tmp = t_1 elif a <= -3.3e-296: tmp = 2.0 * (z * t) elif a <= 4.2e+119: tmp = t_1 else: tmp = -2.0 * (c * (a * i)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (a <= -1.55e+26) tmp = Float64(Float64(i * Float64(a * c)) * Float64(-2.0)); elseif (a <= -4e-271) tmp = t_1; elseif (a <= -3.3e-296) tmp = Float64(2.0 * Float64(z * t)); elseif (a <= 4.2e+119) tmp = t_1; else tmp = Float64(-2.0 * Float64(c * Float64(a * i))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (x * y) * 2.0;
tmp = 0.0;
if (a <= -1.55e+26)
tmp = (i * (a * c)) * -2.0;
elseif (a <= -4e-271)
tmp = t_1;
elseif (a <= -3.3e-296)
tmp = 2.0 * (z * t);
elseif (a <= 4.2e+119)
tmp = t_1;
else
tmp = -2.0 * (c * (a * i));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[a, -1.55e+26], N[(N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision] * (-2.0)), $MachinePrecision], If[LessEqual[a, -4e-271], t$95$1, If[LessEqual[a, -3.3e-296], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.2e+119], t$95$1, N[(-2.0 * N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;a \leq -1.55 \cdot 10^{+26}:\\
\;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot \left(-2\right)\\
\mathbf{elif}\;a \leq -4 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.3 \cdot 10^{-296}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if a < -1.55e26Initial program 88.1%
fma-define88.1%
associate-*l*90.9%
Simplified90.9%
fma-define90.9%
+-commutative90.9%
Applied egg-rr90.9%
Taylor expanded in c around 0 80.7%
Taylor expanded in a around inf 52.5%
*-commutative52.5%
*-commutative52.5%
associate-*r*53.9%
neg-mul-153.9%
distribute-rgt-neg-in53.9%
*-commutative53.9%
distribute-lft-neg-in53.9%
Simplified53.9%
if -1.55e26 < a < -3.99999999999999985e-271 or -3.3e-296 < a < 4.19999999999999966e119Initial program 91.9%
Taylor expanded in x around inf 40.1%
if -3.99999999999999985e-271 < a < -3.3e-296Initial program 82.4%
Taylor expanded in z around inf 64.7%
if 4.19999999999999966e119 < a Initial program 82.6%
fma-define82.6%
associate-*l*91.1%
Simplified91.1%
fma-define91.1%
+-commutative91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 79.8%
Taylor expanded in i around inf 58.2%
mul-1-neg58.2%
associate-*r*57.8%
distribute-lft-neg-in57.8%
*-commutative57.8%
distribute-rgt-neg-in57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in c around 0 47.2%
*-commutative47.2%
associate-*r*49.7%
Simplified49.7%
Final simplification46.0%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)))
(if (<= a -8e+25)
(* -2.0 (* a (* c i)))
(if (<= a -1.04e-271)
t_1
(if (<= a -3.1e-297)
(* 2.0 (* z t))
(if (<= a 9e+119) t_1 (* -2.0 (* c (* a i)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double tmp;
if (a <= -8e+25) {
tmp = -2.0 * (a * (c * i));
} else if (a <= -1.04e-271) {
tmp = t_1;
} else if (a <= -3.1e-297) {
tmp = 2.0 * (z * t);
} else if (a <= 9e+119) {
tmp = t_1;
} else {
tmp = -2.0 * (c * (a * i));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) * 2.0d0
if (a <= (-8d+25)) then
tmp = (-2.0d0) * (a * (c * i))
else if (a <= (-1.04d-271)) then
tmp = t_1
else if (a <= (-3.1d-297)) then
tmp = 2.0d0 * (z * t)
else if (a <= 9d+119) then
tmp = t_1
else
tmp = (-2.0d0) * (c * (a * i))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double tmp;
if (a <= -8e+25) {
tmp = -2.0 * (a * (c * i));
} else if (a <= -1.04e-271) {
tmp = t_1;
} else if (a <= -3.1e-297) {
tmp = 2.0 * (z * t);
} else if (a <= 9e+119) {
tmp = t_1;
} else {
tmp = -2.0 * (c * (a * i));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 tmp = 0 if a <= -8e+25: tmp = -2.0 * (a * (c * i)) elif a <= -1.04e-271: tmp = t_1 elif a <= -3.1e-297: tmp = 2.0 * (z * t) elif a <= 9e+119: tmp = t_1 else: tmp = -2.0 * (c * (a * i)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (a <= -8e+25) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); elseif (a <= -1.04e-271) tmp = t_1; elseif (a <= -3.1e-297) tmp = Float64(2.0 * Float64(z * t)); elseif (a <= 9e+119) tmp = t_1; else tmp = Float64(-2.0 * Float64(c * Float64(a * i))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (x * y) * 2.0;
tmp = 0.0;
if (a <= -8e+25)
tmp = -2.0 * (a * (c * i));
elseif (a <= -1.04e-271)
tmp = t_1;
elseif (a <= -3.1e-297)
tmp = 2.0 * (z * t);
elseif (a <= 9e+119)
tmp = t_1;
else
tmp = -2.0 * (c * (a * i));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[a, -8e+25], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.04e-271], t$95$1, If[LessEqual[a, -3.1e-297], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9e+119], t$95$1, N[(-2.0 * N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;a \leq -8 \cdot 10^{+25}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;a \leq -1.04 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -3.1 \cdot 10^{-297}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;a \leq 9 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\
\end{array}
\end{array}
if a < -8.00000000000000072e25Initial program 88.1%
fma-define88.1%
associate-*l*90.9%
Simplified90.9%
fma-define90.9%
+-commutative90.9%
Applied egg-rr90.9%
Taylor expanded in c around 0 80.7%
Taylor expanded in i around inf 60.1%
mul-1-neg60.1%
associate-*r*67.3%
distribute-lft-neg-in67.3%
*-commutative67.3%
distribute-rgt-neg-in67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in c around 0 52.5%
if -8.00000000000000072e25 < a < -1.03999999999999997e-271 or -3.0999999999999997e-297 < a < 9.00000000000000039e119Initial program 91.9%
Taylor expanded in x around inf 40.1%
if -1.03999999999999997e-271 < a < -3.0999999999999997e-297Initial program 82.4%
Taylor expanded in z around inf 64.7%
if 9.00000000000000039e119 < a Initial program 82.6%
fma-define82.6%
associate-*l*91.1%
Simplified91.1%
fma-define91.1%
+-commutative91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 79.8%
Taylor expanded in i around inf 58.2%
mul-1-neg58.2%
associate-*r*57.8%
distribute-lft-neg-in57.8%
*-commutative57.8%
distribute-rgt-neg-in57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in c around 0 47.2%
*-commutative47.2%
associate-*r*49.7%
Simplified49.7%
Final simplification45.6%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (* x y) 2.0)) (t_2 (* -2.0 (* a (* c i)))))
(if (<= a -7.5e+25)
t_2
(if (<= a -8.8e-272)
t_1
(if (<= a -8e-304) (* 2.0 (* z t)) (if (<= a 1.95e+119) t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double t_2 = -2.0 * (a * (c * i));
double tmp;
if (a <= -7.5e+25) {
tmp = t_2;
} else if (a <= -8.8e-272) {
tmp = t_1;
} else if (a <= -8e-304) {
tmp = 2.0 * (z * t);
} else if (a <= 1.95e+119) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) * 2.0d0
t_2 = (-2.0d0) * (a * (c * i))
if (a <= (-7.5d+25)) then
tmp = t_2
else if (a <= (-8.8d-272)) then
tmp = t_1
else if (a <= (-8d-304)) then
tmp = 2.0d0 * (z * t)
else if (a <= 1.95d+119) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) * 2.0;
double t_2 = -2.0 * (a * (c * i));
double tmp;
if (a <= -7.5e+25) {
tmp = t_2;
} else if (a <= -8.8e-272) {
tmp = t_1;
} else if (a <= -8e-304) {
tmp = 2.0 * (z * t);
} else if (a <= 1.95e+119) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (x * y) * 2.0 t_2 = -2.0 * (a * (c * i)) tmp = 0 if a <= -7.5e+25: tmp = t_2 elif a <= -8.8e-272: tmp = t_1 elif a <= -8e-304: tmp = 2.0 * (z * t) elif a <= 1.95e+119: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) * 2.0) t_2 = Float64(-2.0 * Float64(a * Float64(c * i))) tmp = 0.0 if (a <= -7.5e+25) tmp = t_2; elseif (a <= -8.8e-272) tmp = t_1; elseif (a <= -8e-304) tmp = Float64(2.0 * Float64(z * t)); elseif (a <= 1.95e+119) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (x * y) * 2.0;
t_2 = -2.0 * (a * (c * i));
tmp = 0.0;
if (a <= -7.5e+25)
tmp = t_2;
elseif (a <= -8.8e-272)
tmp = t_1;
elseif (a <= -8e-304)
tmp = 2.0 * (z * t);
elseif (a <= 1.95e+119)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.5e+25], t$95$2, If[LessEqual[a, -8.8e-272], t$95$1, If[LessEqual[a, -8e-304], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.95e+119], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
t_2 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{if}\;a \leq -7.5 \cdot 10^{+25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -8.8 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -8 \cdot 10^{-304}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -7.49999999999999993e25 or 1.9499999999999999e119 < a Initial program 86.2%
fma-define86.2%
associate-*l*91.0%
Simplified91.0%
fma-define91.0%
+-commutative91.0%
Applied egg-rr91.0%
Taylor expanded in c around 0 80.4%
Taylor expanded in i around inf 59.4%
mul-1-neg59.4%
associate-*r*64.0%
distribute-lft-neg-in64.0%
*-commutative64.0%
distribute-rgt-neg-in64.0%
*-commutative64.0%
Simplified64.0%
Taylor expanded in c around 0 50.7%
if -7.49999999999999993e25 < a < -8.79999999999999952e-272 or -7.99999999999999977e-304 < a < 1.9499999999999999e119Initial program 91.9%
Taylor expanded in x around inf 40.1%
if -8.79999999999999952e-272 < a < -7.99999999999999977e-304Initial program 82.4%
Taylor expanded in z around inf 64.7%
Final simplification45.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -1.32e-5) (not (<= c 1.9e-18))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (+ (* x y) (* z t)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.32e-5) || !(c <= 1.9e-18)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c <= (-1.32d-5)) .or. (.not. (c <= 1.9d-18))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -1.32e-5) || !(c <= 1.9e-18)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -1.32e-5) or not (c <= 1.9e-18): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -1.32e-5) || !(c <= 1.9e-18)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((c <= -1.32e-5) || ~((c <= 1.9e-18)))
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
else
tmp = 2.0 * ((x * y) + (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -1.32e-5], N[Not[LessEqual[c, 1.9e-18]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.32 \cdot 10^{-5} \lor \neg \left(c \leq 1.9 \cdot 10^{-18}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if c < -1.32000000000000007e-5 or 1.8999999999999999e-18 < c Initial program 80.5%
Taylor expanded in x around 0 81.1%
if -1.32000000000000007e-5 < c < 1.8999999999999999e-18Initial program 99.1%
Taylor expanded in c around 0 72.7%
Final simplification77.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= c -1.55e+43)
(* 2.0 (- t_1 (* c (* b (* c i)))))
(if (<= c 2.3e-166)
(* 2.0 (- t_1 (* i (* a c))))
(* 2.0 (- (* x y) (* c (* (+ a (* b c)) i))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (c <= -1.55e+43) {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
} else if (c <= 2.3e-166) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if (c <= (-1.55d+43)) then
tmp = 2.0d0 * (t_1 - (c * (b * (c * i))))
else if (c <= 2.3d-166) then
tmp = 2.0d0 * (t_1 - (i * (a * c)))
else
tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (c <= -1.55e+43) {
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
} else if (c <= 2.3e-166) {
tmp = 2.0 * (t_1 - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if c <= -1.55e+43: tmp = 2.0 * (t_1 - (c * (b * (c * i)))) elif c <= 2.3e-166: tmp = 2.0 * (t_1 - (i * (a * c))) else: tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (c <= -1.55e+43) tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(b * Float64(c * i))))); elseif (c <= 2.3e-166) tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (x * y) + (z * t);
tmp = 0.0;
if (c <= -1.55e+43)
tmp = 2.0 * (t_1 - (c * (b * (c * i))));
elseif (c <= 2.3e-166)
tmp = 2.0 * (t_1 - (i * (a * c)));
else
tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.55e+43], N[(2.0 * N[(t$95$1 - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.3e-166], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \leq -1.55 \cdot 10^{+43}:\\
\;\;\;\;2 \cdot \left(t\_1 - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{elif}\;c \leq 2.3 \cdot 10^{-166}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\end{array}
\end{array}
if c < -1.5500000000000001e43Initial program 77.1%
fma-define77.1%
associate-*l*85.5%
Simplified85.5%
fma-define85.5%
+-commutative85.5%
Applied egg-rr85.5%
Taylor expanded in c around 0 88.9%
Taylor expanded in a around 0 89.1%
if -1.5500000000000001e43 < c < 2.29999999999999999e-166Initial program 97.9%
Taylor expanded in a around inf 92.3%
*-commutative92.3%
Simplified92.3%
if 2.29999999999999999e-166 < c Initial program 87.5%
Taylor expanded in z around 0 84.8%
Final simplification88.6%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))))
(if (<= c -1.45e+28)
(* 2.0 (- (* z t) t_1))
(if (<= c 2.3e-166)
(* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
(* 2.0 (- (* x y) t_1))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.45e+28) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 2.3e-166) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (c <= (-1.45d+28)) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 2.3d-166) then
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
else
tmp = 2.0d0 * ((x * y) - t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (c <= -1.45e+28) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 2.3e-166) {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if c <= -1.45e+28: tmp = 2.0 * ((z * t) - t_1) elif c <= 2.3e-166: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) else: tmp = 2.0 * ((x * y) - t_1) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (c <= -1.45e+28) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 2.3e-166) tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = c * ((a + (b * c)) * i);
tmp = 0.0;
if (c <= -1.45e+28)
tmp = 2.0 * ((z * t) - t_1);
elseif (c <= 2.3e-166)
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
else
tmp = 2.0 * ((x * y) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.45e+28], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.3e-166], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -1.45 \cdot 10^{+28}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 2.3 \cdot 10^{-166}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\end{array}
\end{array}
if c < -1.4500000000000001e28Initial program 75.6%
Taylor expanded in x around 0 78.6%
if -1.4500000000000001e28 < c < 2.29999999999999999e-166Initial program 99.9%
Taylor expanded in a around inf 95.1%
*-commutative95.1%
Simplified95.1%
if 2.29999999999999999e-166 < c Initial program 87.5%
Taylor expanded in z around 0 84.8%
Final simplification87.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -6.8e+131) (not (<= i 3.5e-113))) (* (* (+ a (* b c)) (* c i)) (- 2.0)) (* 2.0 (+ (* x y) (* z t)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -6.8e+131) || !(i <= 3.5e-113)) {
tmp = ((a + (b * c)) * (c * i)) * -2.0;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((i <= (-6.8d+131)) .or. (.not. (i <= 3.5d-113))) then
tmp = ((a + (b * c)) * (c * i)) * -2.0d0
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -6.8e+131) || !(i <= 3.5e-113)) {
tmp = ((a + (b * c)) * (c * i)) * -2.0;
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -6.8e+131) or not (i <= 3.5e-113): tmp = ((a + (b * c)) * (c * i)) * -2.0 else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -6.8e+131) || !(i <= 3.5e-113)) tmp = Float64(Float64(Float64(a + Float64(b * c)) * Float64(c * i)) * Float64(-2.0)); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((i <= -6.8e+131) || ~((i <= 3.5e-113)))
tmp = ((a + (b * c)) * (c * i)) * -2.0;
else
tmp = 2.0 * ((x * y) + (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -6.8e+131], N[Not[LessEqual[i, 3.5e-113]], $MachinePrecision]], N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision] * (-2.0)), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -6.8 \cdot 10^{+131} \lor \neg \left(i \leq 3.5 \cdot 10^{-113}\right):\\
\;\;\;\;\left(\left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \cdot \left(-2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if i < -6.79999999999999972e131 or 3.50000000000000029e-113 < i Initial program 89.2%
fma-define89.2%
associate-*l*90.0%
Simplified90.0%
fma-define90.0%
+-commutative90.0%
Applied egg-rr90.0%
Taylor expanded in c around 0 78.1%
Taylor expanded in i around inf 67.5%
mul-1-neg67.5%
associate-*r*73.6%
distribute-lft-neg-in73.6%
*-commutative73.6%
distribute-rgt-neg-in73.6%
*-commutative73.6%
Simplified73.6%
if -6.79999999999999972e131 < i < 3.50000000000000029e-113Initial program 89.4%
Taylor expanded in c around 0 72.0%
Final simplification72.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* c (* (+ a (* b c)) i)))) (if (<= z -5.2e+175) (* 2.0 (- (* z t) t_1)) (* 2.0 (- (* x y) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (z <= -5.2e+175) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
if (z <= (-5.2d+175)) then
tmp = 2.0d0 * ((z * t) - t_1)
else
tmp = 2.0d0 * ((x * y) - t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double tmp;
if (z <= -5.2e+175) {
tmp = 2.0 * ((z * t) - t_1);
} else {
tmp = 2.0 * ((x * y) - t_1);
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) tmp = 0 if z <= -5.2e+175: tmp = 2.0 * ((z * t) - t_1) else: tmp = 2.0 * ((x * y) - t_1) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) tmp = 0.0 if (z <= -5.2e+175) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); else tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = c * ((a + (b * c)) * i);
tmp = 0.0;
if (z <= -5.2e+175)
tmp = 2.0 * ((z * t) - t_1);
else
tmp = 2.0 * ((x * y) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.2e+175], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+175}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\end{array}
\end{array}
if z < -5.2000000000000001e175Initial program 88.3%
Taylor expanded in x around 0 77.4%
if -5.2000000000000001e175 < z Initial program 89.4%
Taylor expanded in z around 0 77.8%
Final simplification77.8%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -1.1e+170) (not (<= i 5.6e+73))) (* -2.0 (* a (* c i))) (* 2.0 (+ (* x y) (* z t)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -1.1e+170) || !(i <= 5.6e+73)) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((i <= (-1.1d+170)) .or. (.not. (i <= 5.6d+73))) then
tmp = (-2.0d0) * (a * (c * i))
else
tmp = 2.0d0 * ((x * y) + (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -1.1e+170) || !(i <= 5.6e+73)) {
tmp = -2.0 * (a * (c * i));
} else {
tmp = 2.0 * ((x * y) + (z * t));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -1.1e+170) or not (i <= 5.6e+73): tmp = -2.0 * (a * (c * i)) else: tmp = 2.0 * ((x * y) + (z * t)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -1.1e+170) || !(i <= 5.6e+73)) tmp = Float64(-2.0 * Float64(a * Float64(c * i))); else tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((i <= -1.1e+170) || ~((i <= 5.6e+73)))
tmp = -2.0 * (a * (c * i));
else
tmp = 2.0 * ((x * y) + (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -1.1e+170], N[Not[LessEqual[i, 5.6e+73]], $MachinePrecision]], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.1 \cdot 10^{+170} \lor \neg \left(i \leq 5.6 \cdot 10^{+73}\right):\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if i < -1.09999999999999994e170 or 5.60000000000000016e73 < i Initial program 89.8%
fma-define89.8%
associate-*l*89.8%
Simplified89.8%
fma-define89.8%
+-commutative89.8%
Applied egg-rr89.8%
Taylor expanded in c around 0 72.8%
Taylor expanded in i around inf 69.8%
mul-1-neg69.8%
associate-*r*80.4%
distribute-lft-neg-in80.4%
*-commutative80.4%
distribute-rgt-neg-in80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in c around 0 47.3%
if -1.09999999999999994e170 < i < 5.60000000000000016e73Initial program 89.1%
Taylor expanded in c around 0 65.4%
Final simplification59.8%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -5.2e-25) (not (<= t 1.2e+123))) (* 2.0 (* z t)) (* (* x y) 2.0)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -5.2e-25) || !(t <= 1.2e+123)) {
tmp = 2.0 * (z * t);
} else {
tmp = (x * y) * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((t <= (-5.2d-25)) .or. (.not. (t <= 1.2d+123))) then
tmp = 2.0d0 * (z * t)
else
tmp = (x * y) * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -5.2e-25) || !(t <= 1.2e+123)) {
tmp = 2.0 * (z * t);
} else {
tmp = (x * y) * 2.0;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -5.2e-25) or not (t <= 1.2e+123): tmp = 2.0 * (z * t) else: tmp = (x * y) * 2.0 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -5.2e-25) || !(t <= 1.2e+123)) tmp = Float64(2.0 * Float64(z * t)); else tmp = Float64(Float64(x * y) * 2.0); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((t <= -5.2e-25) || ~((t <= 1.2e+123)))
tmp = 2.0 * (z * t);
else
tmp = (x * y) * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -5.2e-25], N[Not[LessEqual[t, 1.2e+123]], $MachinePrecision]], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-25} \lor \neg \left(t \leq 1.2 \cdot 10^{+123}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\end{array}
\end{array}
if t < -5.2e-25 or 1.19999999999999994e123 < t Initial program 79.1%
Taylor expanded in z around inf 40.1%
if -5.2e-25 < t < 1.19999999999999994e123Initial program 96.1%
Taylor expanded in x around inf 39.4%
Final simplification39.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (z * t)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = 2.0 * (z * t);
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 89.3%
Taylor expanded in z around inf 23.7%
Final simplification23.7%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024091
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))