
(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 14 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 (if (<= (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))) INFINITY) (+ (fma x y (* z t)) (+ (* a b) (* c i))) (* z (+ t (+ (* a (/ b z)) (+ (* x (/ y z)) (* c (/ 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 tmp;
if (((c * i) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = fma(x, y, (z * t)) + ((a * b) + (c * i));
} else {
tmp = z * (t + ((a * (b / z)) + ((x * (y / z)) + (c * (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) tmp = 0.0 if (Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) <= Inf) tmp = Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))); else tmp = Float64(z * Float64(t + Float64(Float64(a * Float64(b / z)) + Float64(Float64(x * Float64(y / z)) + Float64(c * Float64(i / z)))))); end return 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[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t + N[(N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / z), $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}
\mathbf{if}\;c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \left(a \cdot \frac{b}{z} + \left(x \cdot \frac{y}{z} + c \cdot \frac{i}{z}\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%
associate-+l+100.0%
fma-define100.0%
Simplified100.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-define20.0%
associate-+l+20.0%
fma-define50.0%
fma-define80.0%
Simplified80.0%
Taylor expanded in z around inf 50.0%
associate-/l*50.0%
+-commutative50.0%
associate-/l*60.0%
associate-/l*80.0%
Simplified80.0%
Final simplification99.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 (fma c i (fma x y (fma z t (* 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 fma(c, i, fma(x, y, fma(z, t, (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 fma(c, i, fma(x, y, fma(z, t, Float64(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[(c * i + N[(x * y + N[(z * t + N[(a * b), $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(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 96.1%
+-commutative96.1%
fma-define96.9%
associate-+l+96.9%
fma-define98.0%
fma-define99.2%
Simplified99.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 (* z (+ t (/ (* c i) z)))) (t_2 (+ (* a b) (* z t))))
(if (<= (* a b) -140000000000.0)
t_2
(if (<= (* a b) -1.95e-303)
t_1
(if (<= (* a b) 5.8e-277)
(+ (* x y) (* z t))
(if (<= (* a b) 1e-153)
(+ (* x y) (* c i))
(if (<= (* a b) 3.8e+57) 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 = z * (t + ((c * i) / z));
double t_2 = (a * b) + (z * t);
double tmp;
if ((a * b) <= -140000000000.0) {
tmp = t_2;
} else if ((a * b) <= -1.95e-303) {
tmp = t_1;
} else if ((a * b) <= 5.8e-277) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 1e-153) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 3.8e+57) {
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 = z * (t + ((c * i) / z))
t_2 = (a * b) + (z * t)
if ((a * b) <= (-140000000000.0d0)) then
tmp = t_2
else if ((a * b) <= (-1.95d-303)) then
tmp = t_1
else if ((a * b) <= 5.8d-277) then
tmp = (x * y) + (z * t)
else if ((a * b) <= 1d-153) then
tmp = (x * y) + (c * i)
else if ((a * b) <= 3.8d+57) 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 = z * (t + ((c * i) / z));
double t_2 = (a * b) + (z * t);
double tmp;
if ((a * b) <= -140000000000.0) {
tmp = t_2;
} else if ((a * b) <= -1.95e-303) {
tmp = t_1;
} else if ((a * b) <= 5.8e-277) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 1e-153) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 3.8e+57) {
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 = z * (t + ((c * i) / z)) t_2 = (a * b) + (z * t) tmp = 0 if (a * b) <= -140000000000.0: tmp = t_2 elif (a * b) <= -1.95e-303: tmp = t_1 elif (a * b) <= 5.8e-277: tmp = (x * y) + (z * t) elif (a * b) <= 1e-153: tmp = (x * y) + (c * i) elif (a * b) <= 3.8e+57: 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(z * Float64(t + Float64(Float64(c * i) / z))) t_2 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -140000000000.0) tmp = t_2; elseif (Float64(a * b) <= -1.95e-303) tmp = t_1; elseif (Float64(a * b) <= 5.8e-277) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(a * b) <= 1e-153) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(a * b) <= 3.8e+57) 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 = z * (t + ((c * i) / z));
t_2 = (a * b) + (z * t);
tmp = 0.0;
if ((a * b) <= -140000000000.0)
tmp = t_2;
elseif ((a * b) <= -1.95e-303)
tmp = t_1;
elseif ((a * b) <= 5.8e-277)
tmp = (x * y) + (z * t);
elseif ((a * b) <= 1e-153)
tmp = (x * y) + (c * i);
elseif ((a * b) <= 3.8e+57)
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[(z * N[(t + N[(N[(c * i), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -140000000000.0], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1.95e-303], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 5.8e-277], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e-153], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.8e+57], 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 := z \cdot \left(t + \frac{c \cdot i}{z}\right)\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -140000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -1.95 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 5.8 \cdot 10^{-277}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 10^{-153}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.4e11 or 3.7999999999999999e57 < (*.f64 a b) Initial program 92.3%
+-commutative92.3%
fma-define94.2%
associate-+l+94.2%
fma-define96.2%
fma-define99.0%
Simplified99.0%
Taylor expanded in c around 0 87.7%
Taylor expanded in t around inf 75.7%
if -1.4e11 < (*.f64 a b) < -1.95e-303 or 1.00000000000000004e-153 < (*.f64 a b) < 3.7999999999999999e57Initial program 98.9%
+-commutative98.9%
fma-define98.9%
associate-+l+98.9%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 94.7%
Taylor expanded in t around inf 76.3%
Taylor expanded in z around inf 74.2%
if -1.95e-303 < (*.f64 a b) < 5.79999999999999955e-277Initial program 100.0%
+-commutative100.0%
fma-define100.0%
associate-+l+100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in t around inf 87.7%
Taylor expanded in c around 0 72.2%
*-commutative72.2%
associate-*r/72.1%
Simplified72.1%
Taylor expanded in t around 0 76.3%
if 5.79999999999999955e-277 < (*.f64 a b) < 1.00000000000000004e-153Initial program 93.7%
+-commutative93.7%
fma-define93.8%
associate-+l+93.8%
fma-define93.8%
fma-define93.8%
Simplified93.8%
Taylor expanded in a around 0 87.8%
Taylor expanded in t around 0 91.0%
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 (+ (* c i) (+ (* a b) (+ (* x y) (* z t))))))
(if (<= t_1 INFINITY)
t_1
(* z (+ t (+ (* a (/ b z)) (+ (* x (/ y z)) (* c (/ 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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (t + ((a * (b / z)) + ((x * (y / z)) + (c * (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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (t + ((a * (b / z)) + ((x * (y / z)) + (c * (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 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (t + ((a * (b / z)) + ((x * (y / z)) + (c * (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(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(z * Float64(t + Float64(Float64(a * Float64(b / z)) + Float64(Float64(x * Float64(y / z)) + Float64(c * Float64(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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = z * (t + ((a * (b / z)) + ((x * (y / z)) + (c * (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[(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[(z * N[(t + N[(N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / z), $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}:\\
\;\;\;\;z \cdot \left(t + \left(a \cdot \frac{b}{z} + \left(x \cdot \frac{y}{z} + c \cdot \frac{i}{z}\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-define20.0%
associate-+l+20.0%
fma-define50.0%
fma-define80.0%
Simplified80.0%
Taylor expanded in z around inf 50.0%
associate-/l*50.0%
+-commutative50.0%
associate-/l*60.0%
associate-/l*80.0%
Simplified80.0%
Final simplification99.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) (* z t))))
(if (<= (* a b) -200000000000.0)
t_1
(if (<= (* a b) -1.6e-308)
(+ (* c i) (* z t))
(if (<= (* a b) 7e-287)
(+ (* x y) (* z t))
(if (<= (* a b) 2.5e+114) (+ (* x y) (* 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) + (z * t);
double tmp;
if ((a * b) <= -200000000000.0) {
tmp = t_1;
} else if ((a * b) <= -1.6e-308) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 7e-287) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 2.5e+114) {
tmp = (x * y) + (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) + (z * t)
if ((a * b) <= (-200000000000.0d0)) then
tmp = t_1
else if ((a * b) <= (-1.6d-308)) then
tmp = (c * i) + (z * t)
else if ((a * b) <= 7d-287) then
tmp = (x * y) + (z * t)
else if ((a * b) <= 2.5d+114) then
tmp = (x * y) + (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) + (z * t);
double tmp;
if ((a * b) <= -200000000000.0) {
tmp = t_1;
} else if ((a * b) <= -1.6e-308) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 7e-287) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 2.5e+114) {
tmp = (x * y) + (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) + (z * t) tmp = 0 if (a * b) <= -200000000000.0: tmp = t_1 elif (a * b) <= -1.6e-308: tmp = (c * i) + (z * t) elif (a * b) <= 7e-287: tmp = (x * y) + (z * t) elif (a * b) <= 2.5e+114: tmp = (x * y) + (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(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -200000000000.0) tmp = t_1; elseif (Float64(a * b) <= -1.6e-308) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(a * b) <= 7e-287) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(a * b) <= 2.5e+114) tmp = Float64(Float64(x * y) + 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) + (z * t);
tmp = 0.0;
if ((a * b) <= -200000000000.0)
tmp = t_1;
elseif ((a * b) <= -1.6e-308)
tmp = (c * i) + (z * t);
elseif ((a * b) <= 7e-287)
tmp = (x * y) + (z * t);
elseif ((a * b) <= 2.5e+114)
tmp = (x * y) + (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[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -200000000000.0], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1.6e-308], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 7e-287], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.5e+114], N[(N[(x * y), $MachinePrecision] + N[(c * i), $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 := a \cdot b + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -200000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -1.6 \cdot 10^{-308}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 7 \cdot 10^{-287}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.5 \cdot 10^{+114}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2e11 or 2.5e114 < (*.f64 a b) Initial program 91.7%
+-commutative91.7%
fma-define93.7%
associate-+l+93.7%
fma-define95.8%
fma-define99.0%
Simplified99.0%
Taylor expanded in c around 0 87.7%
Taylor expanded in t around inf 77.8%
if -2e11 < (*.f64 a b) < -1.6000000000000001e-308Initial program 98.0%
+-commutative98.0%
fma-define98.0%
associate-+l+98.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 94.3%
Taylor expanded in t around inf 78.0%
if -1.6000000000000001e-308 < (*.f64 a b) < 7e-287Initial program 100.0%
+-commutative100.0%
fma-define100.0%
associate-+l+100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in t around inf 87.7%
Taylor expanded in c around 0 72.2%
*-commutative72.2%
associate-*r/72.1%
Simplified72.1%
Taylor expanded in t around 0 76.3%
if 7e-287 < (*.f64 a b) < 2.5e114Initial program 98.4%
+-commutative98.4%
fma-define98.4%
associate-+l+98.4%
fma-define98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in a around 0 89.3%
Taylor expanded in t around 0 69.9%
Final simplification75.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 i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* 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 t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * 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 = 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): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 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) 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(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)
t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
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_] := 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[(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}
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}:\\
\;\;\;\;a \cdot b\\
\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-define20.0%
associate-+l+20.0%
fma-define50.0%
fma-define80.0%
Simplified80.0%
Taylor expanded in a around inf 61.1%
Final simplification98.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) (* c i))))
(if (<= (* c i) -4.2e+18)
t_1
(if (<= (* c i) 48000000.0)
(+ (* a b) (* z t))
(if (<= (* c i) 3.3e+74) t_1 (+ (* c i) (* 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 t_1 = (x * y) + (c * i);
double tmp;
if ((c * i) <= -4.2e+18) {
tmp = t_1;
} else if ((c * i) <= 48000000.0) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 3.3e+74) {
tmp = t_1;
} else {
tmp = (c * i) + (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) :: t_1
real(8) :: tmp
t_1 = (x * y) + (c * i)
if ((c * i) <= (-4.2d+18)) then
tmp = t_1
else if ((c * i) <= 48000000.0d0) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 3.3d+74) then
tmp = t_1
else
tmp = (c * i) + (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 t_1 = (x * y) + (c * i);
double tmp;
if ((c * i) <= -4.2e+18) {
tmp = t_1;
} else if ((c * i) <= 48000000.0) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 3.3e+74) {
tmp = t_1;
} else {
tmp = (c * i) + (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): t_1 = (x * y) + (c * i) tmp = 0 if (c * i) <= -4.2e+18: tmp = t_1 elif (c * i) <= 48000000.0: tmp = (a * b) + (z * t) elif (c * i) <= 3.3e+74: tmp = t_1 else: tmp = (c * i) + (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) t_1 = Float64(Float64(x * y) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -4.2e+18) tmp = t_1; elseif (Float64(c * i) <= 48000000.0) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 3.3e+74) tmp = t_1; else tmp = Float64(Float64(c * i) + 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)
t_1 = (x * y) + (c * i);
tmp = 0.0;
if ((c * i) <= -4.2e+18)
tmp = t_1;
elseif ((c * i) <= 48000000.0)
tmp = (a * b) + (z * t);
elseif ((c * i) <= 3.3e+74)
tmp = t_1;
else
tmp = (c * i) + (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_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -4.2e+18], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 48000000.0], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.3e+74], t$95$1, N[(N[(c * i), $MachinePrecision] + 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])\\
\\
\begin{array}{l}
t_1 := x \cdot y + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -4.2 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 48000000:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 3.3 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -4.2e18 or 4.8e7 < (*.f64 c i) < 3.3000000000000002e74Initial program 94.3%
+-commutative94.3%
fma-define95.8%
associate-+l+95.8%
fma-define95.8%
fma-define97.2%
Simplified97.2%
Taylor expanded in a around 0 80.8%
Taylor expanded in t around 0 73.4%
if -4.2e18 < (*.f64 c i) < 4.8e7Initial program 97.8%
+-commutative97.8%
fma-define97.8%
associate-+l+97.8%
fma-define98.5%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 96.3%
Taylor expanded in t around inf 71.8%
if 3.3000000000000002e74 < (*.f64 c i) Initial program 93.8%
+-commutative93.8%
fma-define95.8%
associate-+l+95.8%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 85.6%
Taylor expanded in t around inf 78.9%
Final simplification73.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 (or (<= (* a b) -340000000000.0) (not (<= (* a b) 2.65e+81)))
(+ (* 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 (((a * b) <= -340000000000.0) || !((a * b) <= 2.65e+81)) {
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 (((a * b) <= (-340000000000.0d0)) .or. (.not. ((a * b) <= 2.65d+81))) 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 (((a * b) <= -340000000000.0) || !((a * b) <= 2.65e+81)) {
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 ((a * b) <= -340000000000.0) or not ((a * b) <= 2.65e+81): 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(a * b) <= -340000000000.0) || !(Float64(a * b) <= 2.65e+81)) 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 (((a * b) <= -340000000000.0) || ~(((a * b) <= 2.65e+81)))
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[Or[LessEqual[N[(a * b), $MachinePrecision], -340000000000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.65e+81]], $MachinePrecision]], 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}\;a \cdot b \leq -340000000000 \lor \neg \left(a \cdot b \leq 2.65 \cdot 10^{+81}\right):\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -3.4e11 or 2.65000000000000014e81 < (*.f64 a b) Initial program 92.1%
+-commutative92.1%
fma-define94.1%
associate-+l+94.1%
fma-define96.1%
fma-define99.0%
Simplified99.0%
Taylor expanded in c around 0 88.4%
if -3.4e11 < (*.f64 a b) < 2.65000000000000014e81Initial program 98.7%
+-commutative98.7%
fma-define98.7%
associate-+l+98.7%
fma-define99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in a around 0 95.0%
Final simplification92.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 (<= (* c i) -6.8e+133)
(+ (* x y) (* c i))
(if (<= (* c i) 1.38e+79)
(+ (* a b) (+ (* x y) (* z t)))
(+ (* c i) (* 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 * i) <= -6.8e+133) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 1.38e+79) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (c * i) + (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 * i) <= (-6.8d+133)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= 1.38d+79) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (c * i) + (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 * i) <= -6.8e+133) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 1.38e+79) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (c * i) + (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 * i) <= -6.8e+133: tmp = (x * y) + (c * i) elif (c * i) <= 1.38e+79: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (c * i) + (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 (Float64(c * i) <= -6.8e+133) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= 1.38e+79) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * i) + 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 * i) <= -6.8e+133)
tmp = (x * y) + (c * i);
elseif ((c * i) <= 1.38e+79)
tmp = (a * b) + ((x * y) + (z * t));
else
tmp = (c * i) + (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[LessEqual[N[(c * i), $MachinePrecision], -6.8e+133], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.38e+79], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + 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])\\
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6.8 \cdot 10^{+133}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 1.38 \cdot 10^{+79}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -6.79999999999999975e133Initial program 91.8%
+-commutative91.8%
fma-define94.6%
associate-+l+94.6%
fma-define94.6%
fma-define94.6%
Simplified94.6%
Taylor expanded in a around 0 81.7%
Taylor expanded in t around 0 78.8%
if -6.79999999999999975e133 < (*.f64 c i) < 1.38e79Initial program 97.7%
+-commutative97.7%
fma-define97.7%
associate-+l+97.7%
fma-define98.3%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 91.1%
if 1.38e79 < (*.f64 c i) Initial program 93.5%
+-commutative93.5%
fma-define95.7%
associate-+l+95.7%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 87.1%
Taylor expanded in t around inf 80.1%
Final simplification87.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 (<= (* a b) -4.7e+39)
(* a b)
(if (<= (* a b) 5.2e-273)
(* z t)
(if (<= (* a b) 3.2e+99) (* 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 ((a * b) <= -4.7e+39) {
tmp = a * b;
} else if ((a * b) <= 5.2e-273) {
tmp = z * t;
} else if ((a * b) <= 3.2e+99) {
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 ((a * b) <= (-4.7d+39)) then
tmp = a * b
else if ((a * b) <= 5.2d-273) then
tmp = z * t
else if ((a * b) <= 3.2d+99) 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 ((a * b) <= -4.7e+39) {
tmp = a * b;
} else if ((a * b) <= 5.2e-273) {
tmp = z * t;
} else if ((a * b) <= 3.2e+99) {
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 (a * b) <= -4.7e+39: tmp = a * b elif (a * b) <= 5.2e-273: tmp = z * t elif (a * b) <= 3.2e+99: 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(a * b) <= -4.7e+39) tmp = Float64(a * b); elseif (Float64(a * b) <= 5.2e-273) tmp = Float64(z * t); elseif (Float64(a * b) <= 3.2e+99) 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 ((a * b) <= -4.7e+39)
tmp = a * b;
elseif ((a * b) <= 5.2e-273)
tmp = z * t;
elseif ((a * b) <= 3.2e+99)
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[LessEqual[N[(a * b), $MachinePrecision], -4.7e+39], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.2e-273], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.2e+99], 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}\;a \cdot b \leq -4.7 \cdot 10^{+39}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 5.2 \cdot 10^{-273}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 3.2 \cdot 10^{+99}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -4.6999999999999999e39 or 3.19999999999999999e99 < (*.f64 a b) Initial program 91.5%
+-commutative91.5%
fma-define93.6%
associate-+l+93.6%
fma-define95.7%
fma-define98.9%
Simplified98.9%
Taylor expanded in a around inf 66.8%
if -4.6999999999999999e39 < (*.f64 a b) < 5.19999999999999967e-273Initial program 99.0%
+-commutative99.0%
fma-define99.0%
associate-+l+99.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 71.5%
Taylor expanded in t around inf 47.5%
Taylor expanded in a around 0 43.6%
if 5.19999999999999967e-273 < (*.f64 a b) < 3.19999999999999999e99Initial program 98.3%
+-commutative98.3%
fma-define98.3%
associate-+l+98.3%
fma-define98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in c around inf 44.0%
Final simplification52.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 (<= (* a b) -22000000.0) (not (<= (* a b) 1.6e+59))) (+ (* a b) (* z t)) (+ (* c i) (* 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 (((a * b) <= -22000000.0) || !((a * b) <= 1.6e+59)) {
tmp = (a * b) + (z * t);
} else {
tmp = (c * i) + (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 (((a * b) <= (-22000000.0d0)) .or. (.not. ((a * b) <= 1.6d+59))) then
tmp = (a * b) + (z * t)
else
tmp = (c * i) + (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 (((a * b) <= -22000000.0) || !((a * b) <= 1.6e+59)) {
tmp = (a * b) + (z * t);
} else {
tmp = (c * i) + (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 ((a * b) <= -22000000.0) or not ((a * b) <= 1.6e+59): tmp = (a * b) + (z * t) else: tmp = (c * i) + (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 ((Float64(a * b) <= -22000000.0) || !(Float64(a * b) <= 1.6e+59)) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = Float64(Float64(c * i) + 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 (((a * b) <= -22000000.0) || ~(((a * b) <= 1.6e+59)))
tmp = (a * b) + (z * t);
else
tmp = (c * i) + (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[N[(a * b), $MachinePrecision], -22000000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.6e+59]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + 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])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -22000000 \lor \neg \left(a \cdot b \leq 1.6 \cdot 10^{+59}\right):\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -2.2e7 or 1.59999999999999991e59 < (*.f64 a b) Initial program 92.3%
+-commutative92.3%
fma-define94.2%
associate-+l+94.2%
fma-define96.2%
fma-define99.0%
Simplified99.0%
Taylor expanded in c around 0 87.7%
Taylor expanded in t around inf 75.7%
if -2.2e7 < (*.f64 a b) < 1.59999999999999991e59Initial program 98.7%
+-commutative98.7%
fma-define98.7%
associate-+l+98.7%
fma-define99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in a around 0 95.6%
Taylor expanded in t around inf 68.3%
Final simplification71.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 i) -8.2e+133) (not (<= (* c i) 2.3e+217))) (* c i) (+ (* a b) (* 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 * i) <= -8.2e+133) || !((c * i) <= 2.3e+217)) {
tmp = c * i;
} else {
tmp = (a * b) + (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 * i) <= (-8.2d+133)) .or. (.not. ((c * i) <= 2.3d+217))) then
tmp = c * i
else
tmp = (a * b) + (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 * i) <= -8.2e+133) || !((c * i) <= 2.3e+217)) {
tmp = c * i;
} else {
tmp = (a * b) + (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 * i) <= -8.2e+133) or not ((c * i) <= 2.3e+217): tmp = c * i else: tmp = (a * b) + (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 ((Float64(c * i) <= -8.2e+133) || !(Float64(c * i) <= 2.3e+217)) tmp = Float64(c * i); else tmp = Float64(Float64(a * b) + 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 * i) <= -8.2e+133) || ~(((c * i) <= 2.3e+217)))
tmp = c * i;
else
tmp = (a * b) + (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[N[(c * i), $MachinePrecision], -8.2e+133], N[Not[LessEqual[N[(c * i), $MachinePrecision], 2.3e+217]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + 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])\\
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8.2 \cdot 10^{+133} \lor \neg \left(c \cdot i \leq 2.3 \cdot 10^{+217}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -8.20000000000000008e133 or 2.2999999999999999e217 < (*.f64 c i) Initial program 91.9%
+-commutative91.9%
fma-define95.1%
associate-+l+95.1%
fma-define96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in c around inf 76.2%
if -8.20000000000000008e133 < (*.f64 c i) < 2.2999999999999999e217Initial program 97.4%
+-commutative97.4%
fma-define97.4%
associate-+l+97.4%
fma-define98.5%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 88.1%
Taylor expanded in t around inf 63.1%
Final simplification66.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 (<= (* a b) -1150000000.0) (not (<= (* a b) 3e+99))) (* 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 (((a * b) <= -1150000000.0) || !((a * b) <= 3e+99)) {
tmp = a * b;
} 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 (((a * b) <= (-1150000000.0d0)) .or. (.not. ((a * b) <= 3d+99))) then
tmp = a * b
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 (((a * b) <= -1150000000.0) || !((a * b) <= 3e+99)) {
tmp = a * b;
} 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 ((a * b) <= -1150000000.0) or not ((a * b) <= 3e+99): tmp = a * b 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(a * b) <= -1150000000.0) || !(Float64(a * b) <= 3e+99)) tmp = Float64(a * b); 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 (((a * b) <= -1150000000.0) || ~(((a * b) <= 3e+99)))
tmp = a * b;
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[Or[LessEqual[N[(a * b), $MachinePrecision], -1150000000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 3e+99]], $MachinePrecision]], N[(a * b), $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}\;a \cdot b \leq -1150000000 \lor \neg \left(a \cdot b \leq 3 \cdot 10^{+99}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.15e9 or 3.00000000000000014e99 < (*.f64 a b) Initial program 92.0%
+-commutative92.0%
fma-define94.0%
associate-+l+94.0%
fma-define96.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in a around inf 64.9%
if -1.15e9 < (*.f64 a b) < 3.00000000000000014e99Initial program 98.7%
+-commutative98.7%
fma-define98.7%
associate-+l+98.7%
fma-define99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in c around inf 36.2%
Final simplification47.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 (* 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 96.1%
+-commutative96.1%
fma-define96.9%
associate-+l+96.9%
fma-define98.0%
fma-define99.2%
Simplified99.2%
Taylor expanded in a around inf 28.7%
herbie shell --seed 2024158
(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)))