
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (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 = (((x * y) + (z * t)) + (a * b)) + (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 (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (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 = (((x * y) + (z * t)) + (a * b)) + (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 (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\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 (+ (* c i) (+ (* a b) (+ (* x y) (* z t))))))
(if (<= t_1 INFINITY)
t_1
(* b (+ a (+ (* c (/ i b)) (+ (* t (/ z b)) (* x (/ y b)))))))))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 * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = b * (a + ((c * (i / b)) + ((t * (z / b)) + (x * (y / b)))));
}
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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = b * (a + ((c * (i / b)) + ((t * (z / b)) + (x * (y / b)))));
}
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 * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = b * (a + ((c * (i / b)) + ((t * (z / b)) + (x * (y / b))))) 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(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(b * Float64(a + Float64(Float64(c * Float64(i / b)) + Float64(Float64(t * Float64(z / b)) + Float64(x * Float64(y / b)))))); 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 * i) + ((a * b) + ((x * y) + (z * t)));
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = b * (a + ((c * (i / b)) + ((t * (z / b)) + (x * (y / b)))));
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[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(b * N[(a + N[(N[(c * N[(i / b), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(z / b), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / b), $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 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a + \left(c \cdot \frac{i}{b} + \left(t \cdot \frac{z}{b} + x \cdot \frac{y}{b}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
+-commutative0.0%
fma-define18.8%
+-commutative18.8%
fma-define56.3%
fma-define62.5%
Simplified62.5%
Taylor expanded in b around inf 43.8%
associate-/l*56.3%
associate-/l*75.0%
associate-/l*75.0%
Simplified75.0%
Final simplification98.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 (fma c i (fma a b (fma 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) {
return fma(c, i, fma(a, b, fma(x, y, (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 fma(c, i, fma(a, b, fma(x, y, Float64(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[(c * i + N[(a * b + N[(x * y + N[(z * t), $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])\\
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 93.7%
+-commutative93.7%
fma-define94.9%
+-commutative94.9%
fma-define97.2%
fma-define97.6%
Simplified97.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 (+ (* a b) (* c i))) (t_2 (+ (* x y) (* a b))))
(if (<= (* x y) -1e+40)
t_2
(if (<= (* x y) -4.8e-16)
t_1
(if (<= (* x y) 2.5e-169)
(+ (* a b) (* z t))
(if (<= (* x y) 6.5e+80) 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 = (a * b) + (c * i);
double t_2 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -1e+40) {
tmp = t_2;
} else if ((x * y) <= -4.8e-16) {
tmp = t_1;
} else if ((x * y) <= 2.5e-169) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 6.5e+80) {
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 = (a * b) + (c * i)
t_2 = (x * y) + (a * b)
if ((x * y) <= (-1d+40)) then
tmp = t_2
else if ((x * y) <= (-4.8d-16)) then
tmp = t_1
else if ((x * y) <= 2.5d-169) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 6.5d+80) 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 = (a * b) + (c * i);
double t_2 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -1e+40) {
tmp = t_2;
} else if ((x * y) <= -4.8e-16) {
tmp = t_1;
} else if ((x * y) <= 2.5e-169) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 6.5e+80) {
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 = (a * b) + (c * i) t_2 = (x * y) + (a * b) tmp = 0 if (x * y) <= -1e+40: tmp = t_2 elif (x * y) <= -4.8e-16: tmp = t_1 elif (x * y) <= 2.5e-169: tmp = (a * b) + (z * t) elif (x * y) <= 6.5e+80: 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(a * b) + Float64(c * i)) t_2 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(x * y) <= -1e+40) tmp = t_2; elseif (Float64(x * y) <= -4.8e-16) tmp = t_1; elseif (Float64(x * y) <= 2.5e-169) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 6.5e+80) 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 = (a * b) + (c * i);
t_2 = (x * y) + (a * b);
tmp = 0.0;
if ((x * y) <= -1e+40)
tmp = t_2;
elseif ((x * y) <= -4.8e-16)
tmp = t_1;
elseif ((x * y) <= 2.5e-169)
tmp = (a * b) + (z * t);
elseif ((x * y) <= 6.5e+80)
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[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+40], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -4.8e-16], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.5e-169], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.5e+80], 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 := a \cdot b + c \cdot i\\
t_2 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+40}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -4.8 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{-169}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000003e40 or 6.4999999999999998e80 < (*.f64 x y) Initial program 90.8%
associate-+l+90.8%
fma-define91.7%
Simplified91.7%
Taylor expanded in x around inf 83.7%
Taylor expanded in c around 0 78.0%
if -1.00000000000000003e40 < (*.f64 x y) < -4.8000000000000001e-16 or 2.5000000000000001e-169 < (*.f64 x y) < 6.4999999999999998e80Initial program 95.1%
+-commutative95.1%
fma-define95.1%
+-commutative95.1%
fma-define95.1%
fma-define95.1%
Simplified95.1%
Taylor expanded in x around 0 84.2%
Taylor expanded in c around inf 70.9%
if -4.8000000000000001e-16 < (*.f64 x y) < 2.5000000000000001e-169Initial program 97.3%
+-commutative97.3%
fma-define98.6%
+-commutative98.6%
fma-define98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in x around 0 94.9%
Taylor expanded in c around 0 77.8%
Final simplification76.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
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -1.2e+181)
(* x y)
(if (<= (* x y) -3.5e-16)
t_1
(if (<= (* x y) 2.5e-167)
(+ (* a b) (* z t))
(if (<= (* x y) 9.6e+151) t_1 (* x y)))))))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 * i);
double tmp;
if ((x * y) <= -1.2e+181) {
tmp = x * y;
} else if ((x * y) <= -3.5e-16) {
tmp = t_1;
} else if ((x * y) <= 2.5e-167) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 9.6e+151) {
tmp = t_1;
} else {
tmp = x * y;
}
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 * i)
if ((x * y) <= (-1.2d+181)) then
tmp = x * y
else if ((x * y) <= (-3.5d-16)) then
tmp = t_1
else if ((x * y) <= 2.5d-167) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 9.6d+151) then
tmp = t_1
else
tmp = x * y
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 * i);
double tmp;
if ((x * y) <= -1.2e+181) {
tmp = x * y;
} else if ((x * y) <= -3.5e-16) {
tmp = t_1;
} else if ((x * y) <= 2.5e-167) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 9.6e+151) {
tmp = t_1;
} else {
tmp = x * y;
}
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 * i) tmp = 0 if (x * y) <= -1.2e+181: tmp = x * y elif (x * y) <= -3.5e-16: tmp = t_1 elif (x * y) <= 2.5e-167: tmp = (a * b) + (z * t) elif (x * y) <= 9.6e+151: tmp = t_1 else: tmp = x * y 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(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -1.2e+181) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.5e-16) tmp = t_1; elseif (Float64(x * y) <= 2.5e-167) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 9.6e+151) tmp = t_1; else tmp = Float64(x * y); 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 * i);
tmp = 0.0;
if ((x * y) <= -1.2e+181)
tmp = x * y;
elseif ((x * y) <= -3.5e-16)
tmp = t_1;
elseif ((x * y) <= 2.5e-167)
tmp = (a * b) + (z * t);
elseif ((x * y) <= 9.6e+151)
tmp = t_1;
else
tmp = x * y;
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[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.2e+181], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.5e-16], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.5e-167], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9.6e+151], t$95$1, N[(x * y), $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 \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.2 \cdot 10^{+181}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{-167}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 9.6 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.20000000000000001e181 or 9.6000000000000004e151 < (*.f64 x y) Initial program 87.8%
+-commutative87.8%
fma-define89.0%
+-commutative89.0%
fma-define96.3%
fma-define97.6%
Simplified97.6%
Taylor expanded in a around 0 87.9%
Taylor expanded in t around 0 83.2%
Taylor expanded in c around 0 82.0%
if -1.20000000000000001e181 < (*.f64 x y) < -3.50000000000000017e-16 or 2.5000000000000001e-167 < (*.f64 x y) < 9.6000000000000004e151Initial program 95.9%
+-commutative95.9%
fma-define97.0%
+-commutative97.0%
fma-define97.0%
fma-define97.0%
Simplified97.0%
Taylor expanded in x around 0 79.2%
Taylor expanded in c around inf 63.2%
if -3.50000000000000017e-16 < (*.f64 x y) < 2.5000000000000001e-167Initial program 97.3%
+-commutative97.3%
fma-define98.6%
+-commutative98.6%
fma-define98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in x around 0 94.9%
Taylor expanded in c around 0 77.8%
Final simplification73.5%
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))) (t_2 (+ (* c i) (+ (* a b) t_1)))) (if (<= t_2 INFINITY) t_2 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 = (x * y) + (z * t);
double t_2 = (c * i) + ((a * b) + t_1);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = t_1;
}
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 = (x * y) + (z * t);
double t_2 = (c * i) + ((a * b) + t_1);
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} 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 = (x * y) + (z * t) t_2 = (c * i) + ((a * b) + t_1) tmp = 0 if t_2 <= math.inf: tmp = t_2 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(x * y) + Float64(z * t)) t_2 = Float64(Float64(c * i) + Float64(Float64(a * b) + t_1)) tmp = 0.0 if (t_2 <= Inf) tmp = t_2; 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 = (x * y) + (z * t);
t_2 = (c * i) + ((a * b) + t_1);
tmp = 0.0;
if (t_2 <= Inf)
tmp = t_2;
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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], t$95$2, 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 := x \cdot y + z \cdot t\\
t_2 := c \cdot i + \left(a \cdot b + t\_1\right)\\
\mathbf{if}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
+-commutative0.0%
fma-define18.8%
+-commutative18.8%
fma-define56.3%
fma-define62.5%
Simplified62.5%
Taylor expanded in a around 0 43.8%
Taylor expanded in c around 0 50.4%
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
(if (<= (* c i) -5e+142)
(* c (+ i (/ (* z t) c)))
(if (<= (* c i) -2e-293)
(+ (* x y) (* a b))
(if (<= (* c i) 5e+56) (+ (* x y) (* z t)) (+ (* x y) (* 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 tmp;
if ((c * i) <= -5e+142) {
tmp = c * (i + ((z * t) / c));
} else if ((c * i) <= -2e-293) {
tmp = (x * y) + (a * b);
} else if ((c * i) <= 5e+56) {
tmp = (x * y) + (z * t);
} else {
tmp = (x * y) + (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) :: tmp
if ((c * i) <= (-5d+142)) then
tmp = c * (i + ((z * t) / c))
else if ((c * i) <= (-2d-293)) then
tmp = (x * y) + (a * b)
else if ((c * i) <= 5d+56) then
tmp = (x * y) + (z * t)
else
tmp = (x * y) + (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 tmp;
if ((c * i) <= -5e+142) {
tmp = c * (i + ((z * t) / c));
} else if ((c * i) <= -2e-293) {
tmp = (x * y) + (a * b);
} else if ((c * i) <= 5e+56) {
tmp = (x * y) + (z * t);
} else {
tmp = (x * y) + (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): tmp = 0 if (c * i) <= -5e+142: tmp = c * (i + ((z * t) / c)) elif (c * i) <= -2e-293: tmp = (x * y) + (a * b) elif (c * i) <= 5e+56: tmp = (x * y) + (z * t) else: tmp = (x * y) + (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) tmp = 0.0 if (Float64(c * i) <= -5e+142) tmp = Float64(c * Float64(i + Float64(Float64(z * t) / c))); elseif (Float64(c * i) <= -2e-293) tmp = Float64(Float64(x * y) + Float64(a * b)); elseif (Float64(c * i) <= 5e+56) tmp = Float64(Float64(x * y) + Float64(z * t)); else tmp = Float64(Float64(x * y) + Float64(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)
tmp = 0.0;
if ((c * i) <= -5e+142)
tmp = c * (i + ((z * t) / c));
elseif ((c * i) <= -2e-293)
tmp = (x * y) + (a * b);
elseif ((c * i) <= 5e+56)
tmp = (x * y) + (z * t);
else
tmp = (x * y) + (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_] := If[LessEqual[N[(c * i), $MachinePrecision], -5e+142], N[(c * N[(i + N[(N[(z * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2e-293], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+56], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $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 \cdot i \leq -5 \cdot 10^{+142}:\\
\;\;\;\;c \cdot \left(i + \frac{z \cdot t}{c}\right)\\
\mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-293}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+56}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -5.0000000000000001e142Initial program 88.2%
+-commutative88.2%
fma-define94.1%
+-commutative94.1%
fma-define97.0%
fma-define97.0%
Simplified97.0%
Taylor expanded in x around 0 85.6%
Taylor expanded in a around 0 75.9%
Taylor expanded in c around inf 75.9%
if -5.0000000000000001e142 < (*.f64 c i) < -2.0000000000000001e-293Initial program 96.3%
associate-+l+96.3%
fma-define97.5%
Simplified97.5%
Taylor expanded in x around inf 82.6%
Taylor expanded in c around 0 77.8%
if -2.0000000000000001e-293 < (*.f64 c i) < 5.00000000000000024e56Initial program 94.8%
+-commutative94.8%
fma-define94.8%
+-commutative94.8%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in a around 0 75.4%
Taylor expanded in c around 0 73.5%
if 5.00000000000000024e56 < (*.f64 c i) Initial program 90.9%
+-commutative90.9%
fma-define93.2%
+-commutative93.2%
fma-define95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in a around 0 93.3%
Taylor expanded in t around 0 85.6%
Final simplification77.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 (<= (* c i) -4.5e+139)
(+ (* c i) (* z t))
(if (<= (* c i) -2.6e-304)
(+ (* x y) (* a b))
(if (<= (* c i) 6.5e+57) (+ (* x y) (* z t)) (+ (* x y) (* 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 tmp;
if ((c * i) <= -4.5e+139) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= -2.6e-304) {
tmp = (x * y) + (a * b);
} else if ((c * i) <= 6.5e+57) {
tmp = (x * y) + (z * t);
} else {
tmp = (x * y) + (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) :: tmp
if ((c * i) <= (-4.5d+139)) then
tmp = (c * i) + (z * t)
else if ((c * i) <= (-2.6d-304)) then
tmp = (x * y) + (a * b)
else if ((c * i) <= 6.5d+57) then
tmp = (x * y) + (z * t)
else
tmp = (x * y) + (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 tmp;
if ((c * i) <= -4.5e+139) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= -2.6e-304) {
tmp = (x * y) + (a * b);
} else if ((c * i) <= 6.5e+57) {
tmp = (x * y) + (z * t);
} else {
tmp = (x * y) + (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): tmp = 0 if (c * i) <= -4.5e+139: tmp = (c * i) + (z * t) elif (c * i) <= -2.6e-304: tmp = (x * y) + (a * b) elif (c * i) <= 6.5e+57: tmp = (x * y) + (z * t) else: tmp = (x * y) + (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) tmp = 0.0 if (Float64(c * i) <= -4.5e+139) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(c * i) <= -2.6e-304) tmp = Float64(Float64(x * y) + Float64(a * b)); elseif (Float64(c * i) <= 6.5e+57) tmp = Float64(Float64(x * y) + Float64(z * t)); else tmp = Float64(Float64(x * y) + Float64(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)
tmp = 0.0;
if ((c * i) <= -4.5e+139)
tmp = (c * i) + (z * t);
elseif ((c * i) <= -2.6e-304)
tmp = (x * y) + (a * b);
elseif ((c * i) <= 6.5e+57)
tmp = (x * y) + (z * t);
else
tmp = (x * y) + (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_] := If[LessEqual[N[(c * i), $MachinePrecision], -4.5e+139], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.6e-304], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 6.5e+57], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $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 \cdot i \leq -4.5 \cdot 10^{+139}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq -2.6 \cdot 10^{-304}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 6.5 \cdot 10^{+57}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -4.4999999999999999e139Initial program 88.2%
+-commutative88.2%
fma-define94.1%
+-commutative94.1%
fma-define97.0%
fma-define97.0%
Simplified97.0%
Taylor expanded in x around 0 85.6%
Taylor expanded in a around 0 75.9%
if -4.4999999999999999e139 < (*.f64 c i) < -2.59999999999999997e-304Initial program 96.3%
associate-+l+96.3%
fma-define97.5%
Simplified97.5%
Taylor expanded in x around inf 82.6%
Taylor expanded in c around 0 77.8%
if -2.59999999999999997e-304 < (*.f64 c i) < 6.4999999999999997e57Initial program 94.8%
+-commutative94.8%
fma-define94.8%
+-commutative94.8%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in a around 0 75.4%
Taylor expanded in c around 0 73.5%
if 6.4999999999999997e57 < (*.f64 c i) Initial program 90.9%
+-commutative90.9%
fma-define93.2%
+-commutative93.2%
fma-define95.5%
fma-define95.5%
Simplified95.5%
Taylor expanded in a around 0 93.3%
Taylor expanded in t around 0 85.6%
Final simplification77.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) (* z t))))
(if (<= (* c i) -1e+144)
(* i (+ c (+ (/ (* a b) i) (/ (* z t) i))))
(if (<= (* c i) 2e+22) (+ (* a b) t_1) (+ (* 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 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -1e+144) {
tmp = i * (c + (((a * b) / i) + ((z * t) / i)));
} else if ((c * i) <= 2e+22) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + 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 = (x * y) + (z * t)
if ((c * i) <= (-1d+144)) then
tmp = i * (c + (((a * b) / i) + ((z * t) / i)))
else if ((c * i) <= 2d+22) then
tmp = (a * b) + t_1
else
tmp = (c * i) + 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 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -1e+144) {
tmp = i * (c + (((a * b) / i) + ((z * t) / i)));
} else if ((c * i) <= 2e+22) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + 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 = (x * y) + (z * t) tmp = 0 if (c * i) <= -1e+144: tmp = i * (c + (((a * b) / i) + ((z * t) / i))) elif (c * i) <= 2e+22: tmp = (a * b) + t_1 else: tmp = (c * i) + 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(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -1e+144) tmp = Float64(i * Float64(c + Float64(Float64(Float64(a * b) / i) + Float64(Float64(z * t) / i)))); elseif (Float64(c * i) <= 2e+22) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + 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 = (x * y) + (z * t);
tmp = 0.0;
if ((c * i) <= -1e+144)
tmp = i * (c + (((a * b) / i) + ((z * t) / i)));
elseif ((c * i) <= 2e+22)
tmp = (a * b) + t_1;
else
tmp = (c * i) + 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1e+144], N[(i * N[(c + N[(N[(N[(a * b), $MachinePrecision] / i), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2e+22], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $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 \cdot i \leq -1 \cdot 10^{+144}:\\
\;\;\;\;i \cdot \left(c + \left(\frac{a \cdot b}{i} + \frac{z \cdot t}{i}\right)\right)\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+22}:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -1.00000000000000002e144Initial program 87.8%
+-commutative87.8%
fma-define93.9%
+-commutative93.9%
fma-define96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in x around 0 85.2%
Taylor expanded in i around inf 88.1%
if -1.00000000000000002e144 < (*.f64 c i) < 2e22Initial program 95.4%
+-commutative95.4%
fma-define95.4%
+-commutative95.4%
fma-define97.7%
fma-define98.3%
Simplified98.3%
Taylor expanded in c around 0 91.7%
if 2e22 < (*.f64 c i) Initial program 91.8%
+-commutative91.8%
fma-define93.9%
+-commutative93.9%
fma-define95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in a around 0 92.3%
Final simplification91.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
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* c i) -5e+38)
(+ (* x y) (* i (+ c (/ (* a b) i))))
(if (<= (* c i) 2e+22) (+ (* a b) t_1) (+ (* 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 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -5e+38) {
tmp = (x * y) + (i * (c + ((a * b) / i)));
} else if ((c * i) <= 2e+22) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + 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 = (x * y) + (z * t)
if ((c * i) <= (-5d+38)) then
tmp = (x * y) + (i * (c + ((a * b) / i)))
else if ((c * i) <= 2d+22) then
tmp = (a * b) + t_1
else
tmp = (c * i) + 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 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -5e+38) {
tmp = (x * y) + (i * (c + ((a * b) / i)));
} else if ((c * i) <= 2e+22) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + 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 = (x * y) + (z * t) tmp = 0 if (c * i) <= -5e+38: tmp = (x * y) + (i * (c + ((a * b) / i))) elif (c * i) <= 2e+22: tmp = (a * b) + t_1 else: tmp = (c * i) + 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(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -5e+38) tmp = Float64(Float64(x * y) + Float64(i * Float64(c + Float64(Float64(a * b) / i)))); elseif (Float64(c * i) <= 2e+22) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + 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 = (x * y) + (z * t);
tmp = 0.0;
if ((c * i) <= -5e+38)
tmp = (x * y) + (i * (c + ((a * b) / i)));
elseif ((c * i) <= 2e+22)
tmp = (a * b) + t_1;
else
tmp = (c * i) + 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -5e+38], N[(N[(x * y), $MachinePrecision] + N[(i * N[(c + N[(N[(a * b), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2e+22], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $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 \cdot i \leq -5 \cdot 10^{+38}:\\
\;\;\;\;x \cdot y + i \cdot \left(c + \frac{a \cdot b}{i}\right)\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+22}:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -4.9999999999999997e38Initial program 89.9%
associate-+l+89.9%
fma-define89.9%
Simplified89.9%
Taylor expanded in x around inf 82.1%
Taylor expanded in i around inf 82.3%
if -4.9999999999999997e38 < (*.f64 c i) < 2e22Initial program 95.5%
+-commutative95.5%
fma-define95.5%
+-commutative95.5%
fma-define98.1%
fma-define98.7%
Simplified98.7%
Taylor expanded in c around 0 93.3%
if 2e22 < (*.f64 c i) Initial program 91.8%
+-commutative91.8%
fma-define93.9%
+-commutative93.9%
fma-define95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in a around 0 92.3%
Final simplification91.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) (* z t))))
(if (<= (* c i) -1e+144)
(+ (* a b) (+ (* c i) (* z t)))
(if (<= (* c i) 2e+22) (+ (* a b) t_1) (+ (* 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 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -1e+144) {
tmp = (a * b) + ((c * i) + (z * t));
} else if ((c * i) <= 2e+22) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + 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 = (x * y) + (z * t)
if ((c * i) <= (-1d+144)) then
tmp = (a * b) + ((c * i) + (z * t))
else if ((c * i) <= 2d+22) then
tmp = (a * b) + t_1
else
tmp = (c * i) + 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 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -1e+144) {
tmp = (a * b) + ((c * i) + (z * t));
} else if ((c * i) <= 2e+22) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + 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 = (x * y) + (z * t) tmp = 0 if (c * i) <= -1e+144: tmp = (a * b) + ((c * i) + (z * t)) elif (c * i) <= 2e+22: tmp = (a * b) + t_1 else: tmp = (c * i) + 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(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -1e+144) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); elseif (Float64(c * i) <= 2e+22) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + 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 = (x * y) + (z * t);
tmp = 0.0;
if ((c * i) <= -1e+144)
tmp = (a * b) + ((c * i) + (z * t));
elseif ((c * i) <= 2e+22)
tmp = (a * b) + t_1;
else
tmp = (c * i) + 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1e+144], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2e+22], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $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 \cdot i \leq -1 \cdot 10^{+144}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+22}:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -1.00000000000000002e144Initial program 87.8%
+-commutative87.8%
fma-define93.9%
+-commutative93.9%
fma-define96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in x around 0 85.2%
if -1.00000000000000002e144 < (*.f64 c i) < 2e22Initial program 95.4%
+-commutative95.4%
fma-define95.4%
+-commutative95.4%
fma-define97.7%
fma-define98.3%
Simplified98.3%
Taylor expanded in c around 0 91.7%
if 2e22 < (*.f64 c i) Initial program 91.8%
+-commutative91.8%
fma-define93.9%
+-commutative93.9%
fma-define95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in a around 0 92.3%
Final simplification91.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
(if (<= (* c i) -1e+144)
(+ (* a b) (+ (* c i) (* z t)))
(if (<= (* c i) 8e+77)
(+ (* a b) (+ (* x y) (* z t)))
(+ (* x y) (* 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 tmp;
if ((c * i) <= -1e+144) {
tmp = (a * b) + ((c * i) + (z * t));
} else if ((c * i) <= 8e+77) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (x * y) + (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) :: tmp
if ((c * i) <= (-1d+144)) then
tmp = (a * b) + ((c * i) + (z * t))
else if ((c * i) <= 8d+77) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (x * y) + (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 tmp;
if ((c * i) <= -1e+144) {
tmp = (a * b) + ((c * i) + (z * t));
} else if ((c * i) <= 8e+77) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (x * y) + (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): tmp = 0 if (c * i) <= -1e+144: tmp = (a * b) + ((c * i) + (z * t)) elif (c * i) <= 8e+77: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (x * y) + (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) tmp = 0.0 if (Float64(c * i) <= -1e+144) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); elseif (Float64(c * i) <= 8e+77) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(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)
tmp = 0.0;
if ((c * i) <= -1e+144)
tmp = (a * b) + ((c * i) + (z * t));
elseif ((c * i) <= 8e+77)
tmp = (a * b) + ((x * y) + (z * t));
else
tmp = (x * y) + (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_] := If[LessEqual[N[(c * i), $MachinePrecision], -1e+144], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 8e+77], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $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 \cdot i \leq -1 \cdot 10^{+144}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{elif}\;c \cdot i \leq 8 \cdot 10^{+77}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.00000000000000002e144Initial program 87.8%
+-commutative87.8%
fma-define93.9%
+-commutative93.9%
fma-define96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in x around 0 85.2%
if -1.00000000000000002e144 < (*.f64 c i) < 7.99999999999999986e77Initial program 95.7%
+-commutative95.7%
fma-define95.7%
+-commutative95.7%
fma-define97.8%
fma-define98.4%
Simplified98.4%
Taylor expanded in c around 0 90.7%
if 7.99999999999999986e77 < (*.f64 c i) Initial program 89.4%
+-commutative89.4%
fma-define92.1%
+-commutative92.1%
fma-define94.7%
fma-define94.7%
Simplified94.7%
Taylor expanded in a around 0 94.7%
Taylor expanded in t around 0 89.2%
Final simplification89.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 (<= (* x y) -9.5e+180)
(* x y)
(if (<= (* x y) 7.2e+137)
(+ (* a b) (+ (* c i) (* z t)))
(+ (* x y) (* a b)))))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 ((x * y) <= -9.5e+180) {
tmp = x * y;
} else if ((x * y) <= 7.2e+137) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (x * y) + (a * b);
}
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 ((x * y) <= (-9.5d+180)) then
tmp = x * y
else if ((x * y) <= 7.2d+137) then
tmp = (a * b) + ((c * i) + (z * t))
else
tmp = (x * y) + (a * b)
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 ((x * y) <= -9.5e+180) {
tmp = x * y;
} else if ((x * y) <= 7.2e+137) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (x * y) + (a * b);
}
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 (x * y) <= -9.5e+180: tmp = x * y elif (x * y) <= 7.2e+137: tmp = (a * b) + ((c * i) + (z * t)) else: tmp = (x * y) + (a * b) 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 (Float64(x * y) <= -9.5e+180) tmp = Float64(x * y); elseif (Float64(x * y) <= 7.2e+137) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(a * b)); 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 ((x * y) <= -9.5e+180)
tmp = x * y;
elseif ((x * y) <= 7.2e+137)
tmp = (a * b) + ((c * i) + (z * t));
else
tmp = (x * y) + (a * b);
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[LessEqual[N[(x * y), $MachinePrecision], -9.5e+180], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7.2e+137], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(a * b), $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}\;x \cdot y \leq -9.5 \cdot 10^{+180}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 7.2 \cdot 10^{+137}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\end{array}
\end{array}
if (*.f64 x y) < -9.5000000000000003e180Initial program 86.7%
+-commutative86.7%
fma-define86.7%
+-commutative86.7%
fma-define93.3%
fma-define96.7%
Simplified96.7%
Taylor expanded in a around 0 90.2%
Taylor expanded in t around 0 90.5%
Taylor expanded in c around 0 90.5%
if -9.5000000000000003e180 < (*.f64 x y) < 7.1999999999999999e137Initial program 97.0%
+-commutative97.0%
fma-define97.6%
+-commutative97.6%
fma-define97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in x around 0 86.8%
if 7.1999999999999999e137 < (*.f64 x y) Initial program 87.5%
associate-+l+87.5%
fma-define87.5%
Simplified87.5%
Taylor expanded in x around inf 84.1%
Taylor expanded in c around 0 82.5%
Final simplification86.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 (<= (* x y) -3.3e+66) (* x y) (if (<= (* x y) 650.0) (* a b) (if (<= (* x y) 1e+151) (* c i) (* x y)))))
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 ((x * y) <= -3.3e+66) {
tmp = x * y;
} else if ((x * y) <= 650.0) {
tmp = a * b;
} else if ((x * y) <= 1e+151) {
tmp = c * i;
} else {
tmp = x * y;
}
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 ((x * y) <= (-3.3d+66)) then
tmp = x * y
else if ((x * y) <= 650.0d0) then
tmp = a * b
else if ((x * y) <= 1d+151) then
tmp = c * i
else
tmp = x * y
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 ((x * y) <= -3.3e+66) {
tmp = x * y;
} else if ((x * y) <= 650.0) {
tmp = a * b;
} else if ((x * y) <= 1e+151) {
tmp = c * i;
} else {
tmp = x * y;
}
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 (x * y) <= -3.3e+66: tmp = x * y elif (x * y) <= 650.0: tmp = a * b elif (x * y) <= 1e+151: tmp = c * i else: tmp = x * y 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 (Float64(x * y) <= -3.3e+66) tmp = Float64(x * y); elseif (Float64(x * y) <= 650.0) tmp = Float64(a * b); elseif (Float64(x * y) <= 1e+151) tmp = Float64(c * i); else tmp = Float64(x * y); 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 ((x * y) <= -3.3e+66)
tmp = x * y;
elseif ((x * y) <= 650.0)
tmp = a * b;
elseif ((x * y) <= 1e+151)
tmp = c * i;
else
tmp = x * y;
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[LessEqual[N[(x * y), $MachinePrecision], -3.3e+66], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 650.0], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+151], N[(c * i), $MachinePrecision], N[(x * y), $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}\;x \cdot y \leq -3.3 \cdot 10^{+66}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 650:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 10^{+151}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.3000000000000001e66 or 1.00000000000000002e151 < (*.f64 x y) Initial program 90.2%
+-commutative90.2%
fma-define91.2%
+-commutative91.2%
fma-define97.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in a around 0 85.8%
Taylor expanded in t around 0 77.0%
Taylor expanded in c around 0 72.1%
if -3.3000000000000001e66 < (*.f64 x y) < 650Initial program 95.8%
+-commutative95.8%
fma-define96.6%
+-commutative96.6%
fma-define96.6%
fma-define96.6%
Simplified96.6%
Taylor expanded in a around inf 40.9%
if 650 < (*.f64 x y) < 1.00000000000000002e151Initial program 97.1%
+-commutative97.1%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around inf 44.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
(if (<= (* c i) -1.75e+93)
(* c i)
(if (<= (* c i) -6.8e-304)
(* a b)
(if (<= (* c i) 1.4e+58) (* z t) (* 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 tmp;
if ((c * i) <= -1.75e+93) {
tmp = c * i;
} else if ((c * i) <= -6.8e-304) {
tmp = a * b;
} else if ((c * i) <= 1.4e+58) {
tmp = z * t;
} else {
tmp = 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) :: tmp
if ((c * i) <= (-1.75d+93)) then
tmp = c * i
else if ((c * i) <= (-6.8d-304)) then
tmp = a * b
else if ((c * i) <= 1.4d+58) then
tmp = z * t
else
tmp = 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 tmp;
if ((c * i) <= -1.75e+93) {
tmp = c * i;
} else if ((c * i) <= -6.8e-304) {
tmp = a * b;
} else if ((c * i) <= 1.4e+58) {
tmp = z * t;
} else {
tmp = 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): tmp = 0 if (c * i) <= -1.75e+93: tmp = c * i elif (c * i) <= -6.8e-304: tmp = a * b elif (c * i) <= 1.4e+58: tmp = z * t else: tmp = 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) tmp = 0.0 if (Float64(c * i) <= -1.75e+93) tmp = Float64(c * i); elseif (Float64(c * i) <= -6.8e-304) tmp = Float64(a * b); elseif (Float64(c * i) <= 1.4e+58) tmp = Float64(z * t); else tmp = Float64(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)
tmp = 0.0;
if ((c * i) <= -1.75e+93)
tmp = c * i;
elseif ((c * i) <= -6.8e-304)
tmp = a * b;
elseif ((c * i) <= 1.4e+58)
tmp = z * t;
else
tmp = 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_] := If[LessEqual[N[(c * i), $MachinePrecision], -1.75e+93], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -6.8e-304], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.4e+58], N[(z * t), $MachinePrecision], N[(c * i), $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 \cdot i \leq -1.75 \cdot 10^{+93}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -6.8 \cdot 10^{-304}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 1.4 \cdot 10^{+58}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.74999999999999999e93 or 1.3999999999999999e58 < (*.f64 c i) Initial program 90.3%
+-commutative90.3%
fma-define94.0%
+-commutative94.0%
fma-define96.4%
fma-define96.4%
Simplified96.4%
Taylor expanded in c around inf 59.7%
if -1.74999999999999999e93 < (*.f64 c i) < -6.7999999999999997e-304Initial program 96.1%
+-commutative96.1%
fma-define96.1%
+-commutative96.1%
fma-define96.1%
fma-define97.4%
Simplified97.4%
Taylor expanded in a around inf 46.8%
if -6.7999999999999997e-304 < (*.f64 c i) < 1.3999999999999999e58Initial program 94.8%
+-commutative94.8%
fma-define94.8%
+-commutative94.8%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in x around 0 59.6%
Taylor expanded in c around 0 56.8%
Taylor expanded in a around 0 34.8%
Final simplification46.5%
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 (<= (* x y) -1.65e+180) (not (<= (* x y) 3.3e+152))) (* x y) (+ (* 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 tmp;
if (((x * y) <= -1.65e+180) || !((x * y) <= 3.3e+152)) {
tmp = x * y;
} else {
tmp = (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) :: tmp
if (((x * y) <= (-1.65d+180)) .or. (.not. ((x * y) <= 3.3d+152))) then
tmp = x * y
else
tmp = (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 tmp;
if (((x * y) <= -1.65e+180) || !((x * y) <= 3.3e+152)) {
tmp = x * y;
} else {
tmp = (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): tmp = 0 if ((x * y) <= -1.65e+180) or not ((x * y) <= 3.3e+152): tmp = x * y else: tmp = (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) tmp = 0.0 if ((Float64(x * y) <= -1.65e+180) || !(Float64(x * y) <= 3.3e+152)) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) + Float64(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)
tmp = 0.0;
if (((x * y) <= -1.65e+180) || ~(((x * y) <= 3.3e+152)))
tmp = x * y;
else
tmp = (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_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.65e+180], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.3e+152]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $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}\;x \cdot y \leq -1.65 \cdot 10^{+180} \lor \neg \left(x \cdot y \leq 3.3 \cdot 10^{+152}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.64999999999999995e180 or 3.3000000000000001e152 < (*.f64 x y) Initial program 87.8%
+-commutative87.8%
fma-define89.0%
+-commutative89.0%
fma-define96.3%
fma-define97.6%
Simplified97.6%
Taylor expanded in a around 0 87.9%
Taylor expanded in t around 0 83.2%
Taylor expanded in c around 0 82.0%
if -1.64999999999999995e180 < (*.f64 x y) < 3.3000000000000001e152Initial program 96.5%
+-commutative96.5%
fma-define97.7%
+-commutative97.7%
fma-define97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in x around 0 86.0%
Taylor expanded in c around inf 61.1%
Final simplification67.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 (<= (* c i) -2.4e+134) (+ (* c i) (* z t)) (if (<= (* c i) 3.1e+37) (+ (* x y) (* a b)) (+ (* x y) (* 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 tmp;
if ((c * i) <= -2.4e+134) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 3.1e+37) {
tmp = (x * y) + (a * b);
} else {
tmp = (x * y) + (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) :: tmp
if ((c * i) <= (-2.4d+134)) then
tmp = (c * i) + (z * t)
else if ((c * i) <= 3.1d+37) then
tmp = (x * y) + (a * b)
else
tmp = (x * y) + (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 tmp;
if ((c * i) <= -2.4e+134) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 3.1e+37) {
tmp = (x * y) + (a * b);
} else {
tmp = (x * y) + (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): tmp = 0 if (c * i) <= -2.4e+134: tmp = (c * i) + (z * t) elif (c * i) <= 3.1e+37: tmp = (x * y) + (a * b) else: tmp = (x * y) + (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) tmp = 0.0 if (Float64(c * i) <= -2.4e+134) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(c * i) <= 3.1e+37) tmp = Float64(Float64(x * y) + Float64(a * b)); else tmp = Float64(Float64(x * y) + Float64(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)
tmp = 0.0;
if ((c * i) <= -2.4e+134)
tmp = (c * i) + (z * t);
elseif ((c * i) <= 3.1e+37)
tmp = (x * y) + (a * b);
else
tmp = (x * y) + (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_] := If[LessEqual[N[(c * i), $MachinePrecision], -2.4e+134], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.1e+37], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $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 \cdot i \leq -2.4 \cdot 10^{+134}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 3.1 \cdot 10^{+37}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.40000000000000005e134Initial program 88.2%
+-commutative88.2%
fma-define94.1%
+-commutative94.1%
fma-define97.0%
fma-define97.0%
Simplified97.0%
Taylor expanded in x around 0 85.6%
Taylor expanded in a around 0 75.9%
if -2.40000000000000005e134 < (*.f64 c i) < 3.1000000000000002e37Initial program 95.3%
associate-+l+95.3%
fma-define95.9%
Simplified95.9%
Taylor expanded in x around inf 75.2%
Taylor expanded in c around 0 71.9%
if 3.1000000000000002e37 < (*.f64 c i) Initial program 91.8%
+-commutative91.8%
fma-define93.9%
+-commutative93.9%
fma-define95.9%
fma-define95.9%
Simplified95.9%
Taylor expanded in a around 0 92.3%
Taylor expanded in t around 0 81.2%
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 i) -3.5e+102) (not (<= (* c i) 1.7e+40))) (* c i) (* a b)))
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 * i) <= -3.5e+102) || !((c * i) <= 1.7e+40)) {
tmp = c * i;
} else {
tmp = a * b;
}
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 * i) <= (-3.5d+102)) .or. (.not. ((c * i) <= 1.7d+40))) then
tmp = c * i
else
tmp = a * b
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 * i) <= -3.5e+102) || !((c * i) <= 1.7e+40)) {
tmp = c * i;
} else {
tmp = a * b;
}
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 * i) <= -3.5e+102) or not ((c * i) <= 1.7e+40): tmp = c * i else: tmp = a * b 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 ((Float64(c * i) <= -3.5e+102) || !(Float64(c * i) <= 1.7e+40)) tmp = Float64(c * i); else tmp = Float64(a * b); 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 * i) <= -3.5e+102) || ~(((c * i) <= 1.7e+40)))
tmp = c * i;
else
tmp = a * b;
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[N[(c * i), $MachinePrecision], -3.5e+102], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.7e+40]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $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 \cdot i \leq -3.5 \cdot 10^{+102} \lor \neg \left(c \cdot i \leq 1.7 \cdot 10^{+40}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -3.50000000000000011e102 or 1.69999999999999994e40 < (*.f64 c i) Initial program 90.8%
+-commutative90.8%
fma-define94.2%
+-commutative94.2%
fma-define96.5%
fma-define96.5%
Simplified96.5%
Taylor expanded in c around inf 58.2%
if -3.50000000000000011e102 < (*.f64 c i) < 1.69999999999999994e40Initial program 95.2%
+-commutative95.2%
fma-define95.2%
+-commutative95.2%
fma-define97.6%
fma-define98.2%
Simplified98.2%
Taylor expanded in a around inf 36.5%
Final simplification43.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 (* a b))
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 a * b;
}
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 = a * b
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 a * b;
}
[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 a * b
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(a * b) 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 = a * b;
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[(a * b), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
a \cdot b
\end{array}
Initial program 93.7%
+-commutative93.7%
fma-define94.9%
+-commutative94.9%
fma-define97.2%
fma-define97.6%
Simplified97.6%
Taylor expanded in a around inf 28.4%
herbie shell --seed 2024170
(FPCore (x y z t a b c i)
:name "Linear.V4:$cdot from linear-1.19.1.3, C"
:precision binary64
(+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))