
(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 c i (fma a b (fma x y (* z t)))) (* t (+ z (* c (/ i 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) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = fma(c, i, fma(a, b, fma(x, y, (z * t))));
} else {
tmp = t * (z + (c * (i / 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(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) <= Inf) tmp = fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))); else tmp = Float64(t * Float64(z + Float64(c * Float64(i / t)))); 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[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z + N[(c * N[(i / 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])\\
\\
\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(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z + c \cdot \frac{i}{t}\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%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.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-define28.6%
+-commutative28.6%
fma-define42.9%
fma-define42.9%
Simplified42.9%
Taylor expanded in a around 0 28.6%
Taylor expanded in x around 0 36.2%
Taylor expanded in t around inf 36.2%
associate-/l*64.8%
Simplified64.8%
Final simplification98.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (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 94.5%
+-commutative94.5%
fma-define96.1%
associate-+l+96.1%
fma-define96.9%
fma-define97.7%
Simplified97.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))) INFINITY) (+ (fma x y (* z t)) (+ (* a b) (* c i))) (* t (+ z (* c (/ i 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) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = fma(x, y, (z * t)) + ((a * b) + (c * i));
} else {
tmp = t * (z + (c * (i / 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(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(t * Float64(z + Float64(c * Float64(i / t)))); 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[(t * N[(z + N[(c * N[(i / 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])\\
\\
\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}:\\
\;\;\;\;t \cdot \left(z + c \cdot \frac{i}{t}\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-define28.6%
+-commutative28.6%
fma-define42.9%
fma-define42.9%
Simplified42.9%
Taylor expanded in a around 0 28.6%
Taylor expanded in x around 0 36.2%
Taylor expanded in t around inf 36.2%
associate-/l*64.8%
Simplified64.8%
Final simplification98.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 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* t (+ z (* c (/ i 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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = t * (z + (c * (i / t)));
}
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 = t * (z + (c * (i / 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 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = t * (z + (c * (i / 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(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(t * Float64(z + Float64(c * Float64(i / 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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = t * (z + (c * (i / 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[(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[(t * N[(z + N[(c * N[(i / 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])\\
\\
\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}:\\
\;\;\;\;t \cdot \left(z + c \cdot \frac{i}{t}\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-define28.6%
+-commutative28.6%
fma-define42.9%
fma-define42.9%
Simplified42.9%
Taylor expanded in a around 0 28.6%
Taylor expanded in x around 0 36.2%
Taylor expanded in t around inf 36.2%
associate-/l*64.8%
Simplified64.8%
Final simplification98.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))) (t_2 (+ (* a b) (* c i))))
(if (<= (* c i) -2e+129)
t_2
(if (<= (* c i) -2e+26)
(+ (* c i) t_1)
(if (<= (* c i) 1e+79) (+ (* a b) t_1) t_2)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -2e+129) {
tmp = t_2;
} else if ((c * i) <= -2e+26) {
tmp = (c * i) + t_1;
} else if ((c * i) <= 1e+79) {
tmp = (a * b) + t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) + (z * t)
t_2 = (a * b) + (c * i)
if ((c * i) <= (-2d+129)) then
tmp = t_2
else if ((c * i) <= (-2d+26)) then
tmp = (c * i) + t_1
else if ((c * i) <= 1d+79) then
tmp = (a * b) + t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -2e+129) {
tmp = t_2;
} else if ((c * i) <= -2e+26) {
tmp = (c * i) + t_1;
} else if ((c * i) <= 1e+79) {
tmp = (a * b) + t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = (a * b) + (c * i) tmp = 0 if (c * i) <= -2e+129: tmp = t_2 elif (c * i) <= -2e+26: tmp = (c * i) + t_1 elif (c * i) <= 1e+79: tmp = (a * b) + t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -2e+129) tmp = t_2; elseif (Float64(c * i) <= -2e+26) tmp = Float64(Float64(c * i) + t_1); elseif (Float64(c * i) <= 1e+79) tmp = Float64(Float64(a * b) + t_1); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (x * y) + (z * t);
t_2 = (a * b) + (c * i);
tmp = 0.0;
if ((c * i) <= -2e+129)
tmp = t_2;
elseif ((c * i) <= -2e+26)
tmp = (c * i) + t_1;
elseif ((c * i) <= 1e+79)
tmp = (a * b) + t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2e+129], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -2e+26], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e+79], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], 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 := x \cdot y + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+129}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{+26}:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{elif}\;c \cdot i \leq 10^{+79}:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 c i) < -2e129 or 9.99999999999999967e78 < (*.f64 c i) Initial program 87.3%
associate-+l+87.3%
fma-define87.3%
Simplified87.3%
Taylor expanded in x around inf 85.6%
Taylor expanded in x around 0 82.8%
if -2e129 < (*.f64 c i) < -2.0000000000000001e26Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
if -2.0000000000000001e26 < (*.f64 c i) < 9.99999999999999967e78Initial program 98.6%
+-commutative98.6%
fma-define98.6%
+-commutative98.6%
fma-define99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in c around 0 94.4%
Final simplification90.4%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* c i) -1e+60)
t_1
(if (<= (* c i) 1e-234)
(+ (* a b) (* x y))
(if (<= (* c i) 1e+79) (+ (* a b) (* z t)) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1e+60) {
tmp = t_1;
} else if ((c * i) <= 1e-234) {
tmp = (a * b) + (x * y);
} else if ((c * i) <= 1e+79) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((c * i) <= (-1d+60)) then
tmp = t_1
else if ((c * i) <= 1d-234) then
tmp = (a * b) + (x * y)
else if ((c * i) <= 1d+79) then
tmp = (a * b) + (z * t)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1e+60) {
tmp = t_1;
} else if ((c * i) <= 1e-234) {
tmp = (a * b) + (x * y);
} else if ((c * i) <= 1e+79) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (c * i) <= -1e+60: tmp = t_1 elif (c * i) <= 1e-234: tmp = (a * b) + (x * y) elif (c * i) <= 1e+79: tmp = (a * b) + (z * t) 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(c * i)) tmp = 0.0 if (Float64(c * i) <= -1e+60) tmp = t_1; elseif (Float64(c * i) <= 1e-234) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(c * i) <= 1e+79) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (a * b) + (c * i);
tmp = 0.0;
if ((c * i) <= -1e+60)
tmp = t_1;
elseif ((c * i) <= 1e-234)
tmp = (a * b) + (x * y);
elseif ((c * i) <= 1e+79)
tmp = (a * b) + (z * t);
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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1e+60], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1e-234], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e+79], N[(N[(a * b), $MachinePrecision] + N[(z * t), $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 + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 10^{-234}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 10^{+79}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -9.9999999999999995e59 or 9.99999999999999967e78 < (*.f64 c i) Initial program 88.5%
associate-+l+88.5%
fma-define88.5%
Simplified88.5%
Taylor expanded in x around inf 84.2%
Taylor expanded in x around 0 79.7%
if -9.9999999999999995e59 < (*.f64 c i) < 9.9999999999999996e-235Initial program 97.8%
+-commutative97.8%
fma-define97.8%
+-commutative97.8%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in c around 0 92.6%
Taylor expanded in t around 0 71.1%
*-commutative71.1%
Simplified71.1%
if 9.9999999999999996e-235 < (*.f64 c i) < 9.99999999999999967e78Initial program 99.9%
+-commutative99.9%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 96.0%
Taylor expanded in t around inf 71.0%
Final simplification74.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 (or (<= (* c i) -1e+154) (not (<= (* c i) 1e+79))) (+ (* a b) (* c i)) (+ (* a b) (+ (* x y) (* z t)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1e+154) || !((c * i) <= 1e+79)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-1d+154)) .or. (.not. ((c * i) <= 1d+79))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + ((x * y) + (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1e+154) || !((c * i) <= 1e+79)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -1e+154) or not ((c * i) <= 1e+79): tmp = (a * b) + (c * i) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -1e+154) || !(Float64(c * i) <= 1e+79)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (((c * i) <= -1e+154) || ~(((c * i) <= 1e+79)))
tmp = (a * b) + (c * i);
else
tmp = (a * b) + ((x * y) + (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1e+154], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1e+79]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+154} \lor \neg \left(c \cdot i \leq 10^{+79}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -1.00000000000000004e154 or 9.99999999999999967e78 < (*.f64 c i) Initial program 86.8%
associate-+l+86.8%
fma-define86.8%
Simplified86.8%
Taylor expanded in x around inf 84.9%
Taylor expanded in x around 0 82.0%
if -1.00000000000000004e154 < (*.f64 c i) < 9.99999999999999967e78Initial program 98.8%
+-commutative98.8%
fma-define98.8%
+-commutative98.8%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in c around 0 91.6%
Final simplification88.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 (<= (* c i) -2.2e-34)
(+ (* x y) t_1)
(if (<= (* c i) 1e+79) (+ (* a b) (+ (* x y) (* z t))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -2.2e-34) {
tmp = (x * y) + t_1;
} else if ((c * i) <= 1e+79) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((c * i) <= (-2.2d-34)) then
tmp = (x * y) + t_1
else if ((c * i) <= 1d+79) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -2.2e-34) {
tmp = (x * y) + t_1;
} else if ((c * i) <= 1e+79) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (c * i) <= -2.2e-34: tmp = (x * y) + t_1 elif (c * i) <= 1e+79: tmp = (a * b) + ((x * y) + (z * t)) 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(c * i)) tmp = 0.0 if (Float64(c * i) <= -2.2e-34) tmp = Float64(Float64(x * y) + t_1); elseif (Float64(c * i) <= 1e+79) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (a * b) + (c * i);
tmp = 0.0;
if ((c * i) <= -2.2e-34)
tmp = (x * y) + t_1;
elseif ((c * i) <= 1e+79)
tmp = (a * b) + ((x * y) + (z * t));
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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2.2e-34], N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e+79], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -2.2 \cdot 10^{-34}:\\
\;\;\;\;x \cdot y + t\_1\\
\mathbf{elif}\;c \cdot i \leq 10^{+79}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -2.1999999999999999e-34Initial program 90.5%
associate-+l+90.5%
fma-define90.5%
Simplified90.5%
Taylor expanded in x around inf 83.1%
if -2.1999999999999999e-34 < (*.f64 c i) < 9.99999999999999967e78Initial program 98.5%
+-commutative98.5%
fma-define98.5%
+-commutative98.5%
fma-define99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in c around 0 95.5%
if 9.99999999999999967e78 < (*.f64 c i) Initial program 88.6%
associate-+l+88.6%
fma-define88.6%
Simplified88.6%
Taylor expanded in x around inf 85.2%
Taylor expanded in x around 0 85.4%
Final simplification90.4%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.02e+60)
(* c i)
(if (<= (* c i) 9.6e-234)
(* x y)
(if (<= (* c i) 1.05e+80) (* 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.02e+60) {
tmp = c * i;
} else if ((c * i) <= 9.6e-234) {
tmp = x * y;
} else if ((c * i) <= 1.05e+80) {
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.02d+60)) then
tmp = c * i
else if ((c * i) <= 9.6d-234) then
tmp = x * y
else if ((c * i) <= 1.05d+80) 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.02e+60) {
tmp = c * i;
} else if ((c * i) <= 9.6e-234) {
tmp = x * y;
} else if ((c * i) <= 1.05e+80) {
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.02e+60: tmp = c * i elif (c * i) <= 9.6e-234: tmp = x * y elif (c * i) <= 1.05e+80: 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.02e+60) tmp = Float64(c * i); elseif (Float64(c * i) <= 9.6e-234) tmp = Float64(x * y); elseif (Float64(c * i) <= 1.05e+80) 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.02e+60)
tmp = c * i;
elseif ((c * i) <= 9.6e-234)
tmp = x * y;
elseif ((c * i) <= 1.05e+80)
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.02e+60], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 9.6e-234], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.05e+80], 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.02 \cdot 10^{+60}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 9.6 \cdot 10^{-234}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 1.05 \cdot 10^{+80}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.0200000000000001e60 or 1.05000000000000001e80 < (*.f64 c i) Initial program 88.5%
+-commutative88.5%
fma-define92.4%
+-commutative92.4%
fma-define93.3%
fma-define93.3%
Simplified93.3%
Taylor expanded in c around inf 61.9%
if -1.0200000000000001e60 < (*.f64 c i) < 9.5999999999999996e-234Initial program 97.8%
associate-+l+97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in x around inf 76.3%
Taylor expanded in a around 0 48.9%
Taylor expanded in c around 0 43.5%
if 9.5999999999999996e-234 < (*.f64 c i) < 1.05000000000000001e80Initial program 99.9%
+-commutative99.9%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 96.0%
Taylor expanded in t around inf 71.0%
Taylor expanded in a around 0 39.4%
Final simplification50.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.4e+173)
(* a b)
(if (<= (* a b) 1.5e-268)
(* c i)
(if (<= (* a b) 2.35e+101) (* 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) {
double tmp;
if ((a * b) <= -2.4e+173) {
tmp = a * b;
} else if ((a * b) <= 1.5e-268) {
tmp = c * i;
} else if ((a * b) <= 2.35e+101) {
tmp = z * t;
} 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) <= (-2.4d+173)) then
tmp = a * b
else if ((a * b) <= 1.5d-268) then
tmp = c * i
else if ((a * b) <= 2.35d+101) then
tmp = z * t
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) <= -2.4e+173) {
tmp = a * b;
} else if ((a * b) <= 1.5e-268) {
tmp = c * i;
} else if ((a * b) <= 2.35e+101) {
tmp = z * t;
} 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) <= -2.4e+173: tmp = a * b elif (a * b) <= 1.5e-268: tmp = c * i elif (a * b) <= 2.35e+101: tmp = z * t 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) <= -2.4e+173) tmp = Float64(a * b); elseif (Float64(a * b) <= 1.5e-268) tmp = Float64(c * i); elseif (Float64(a * b) <= 2.35e+101) tmp = Float64(z * t); 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) <= -2.4e+173)
tmp = a * b;
elseif ((a * b) <= 1.5e-268)
tmp = c * i;
elseif ((a * b) <= 2.35e+101)
tmp = z * t;
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], -2.4e+173], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.5e-268], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.35e+101], N[(z * t), $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 -2.4 \cdot 10^{+173}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 1.5 \cdot 10^{-268}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 2.35 \cdot 10^{+101}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.3999999999999999e173 or 2.34999999999999985e101 < (*.f64 a b) Initial program 88.1%
+-commutative88.1%
fma-define89.5%
+-commutative89.5%
fma-define92.1%
fma-define92.1%
Simplified92.1%
Taylor expanded in a around inf 74.0%
if -2.3999999999999999e173 < (*.f64 a b) < 1.4999999999999999e-268Initial program 96.7%
+-commutative96.7%
fma-define98.3%
+-commutative98.3%
fma-define98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in c around inf 41.0%
if 1.4999999999999999e-268 < (*.f64 a b) < 2.34999999999999985e101Initial program 98.3%
+-commutative98.3%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in c around 0 75.7%
Taylor expanded in t around inf 45.0%
Taylor expanded in a around 0 36.8%
Final simplification49.8%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -2e-34) (not (<= (* c i) 4.8e+79))) (+ (* a b) (* 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) <= -2e-34) || !((c * i) <= 4.8e+79)) {
tmp = (a * b) + (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) <= (-2d-34)) .or. (.not. ((c * i) <= 4.8d+79))) then
tmp = (a * b) + (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) <= -2e-34) || !((c * i) <= 4.8e+79)) {
tmp = (a * b) + (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) <= -2e-34) or not ((c * i) <= 4.8e+79): tmp = (a * b) + (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) <= -2e-34) || !(Float64(c * i) <= 4.8e+79)) tmp = Float64(Float64(a * b) + 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) <= -2e-34) || ~(((c * i) <= 4.8e+79)))
tmp = (a * b) + (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], -2e-34], N[Not[LessEqual[N[(c * i), $MachinePrecision], 4.8e+79]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $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 -2 \cdot 10^{-34} \lor \neg \left(c \cdot i \leq 4.8 \cdot 10^{+79}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -1.99999999999999986e-34 or 4.79999999999999971e79 < (*.f64 c i) Initial program 89.7%
associate-+l+89.7%
fma-define89.7%
Simplified89.7%
Taylor expanded in x around inf 84.2%
Taylor expanded in x around 0 76.2%
if -1.99999999999999986e-34 < (*.f64 c i) < 4.79999999999999971e79Initial program 98.5%
+-commutative98.5%
fma-define98.5%
+-commutative98.5%
fma-define99.2%
fma-define99.3%
Simplified99.3%
Taylor expanded in c around 0 95.5%
Taylor expanded in t around inf 64.0%
Final simplification69.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) -6e+276) (not (<= (* x y) 3.3e+183))) (* 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) <= -6e+276) || !((x * y) <= 3.3e+183)) {
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) <= (-6d+276)) .or. (.not. ((x * y) <= 3.3d+183))) 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) <= -6e+276) || !((x * y) <= 3.3e+183)) {
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) <= -6e+276) or not ((x * y) <= 3.3e+183): 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) <= -6e+276) || !(Float64(x * y) <= 3.3e+183)) 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) <= -6e+276) || ~(((x * y) <= 3.3e+183)))
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], -6e+276], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.3e+183]], $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 -6 \cdot 10^{+276} \lor \neg \left(x \cdot y \leq 3.3 \cdot 10^{+183}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -5.99999999999999982e276 or 3.3000000000000001e183 < (*.f64 x y) Initial program 88.6%
associate-+l+88.6%
fma-define88.6%
Simplified88.6%
Taylor expanded in x around inf 84.9%
Taylor expanded in a around 0 85.4%
Taylor expanded in c around 0 81.6%
if -5.99999999999999982e276 < (*.f64 x y) < 3.3000000000000001e183Initial program 96.0%
associate-+l+96.0%
fma-define96.0%
Simplified96.0%
Taylor expanded in x around inf 74.7%
Taylor expanded in x around 0 64.0%
Final simplification67.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.6e+173) (not (<= (* a b) 1.6e+66))) (* 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) <= -1.6e+173) || !((a * b) <= 1.6e+66)) {
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) <= (-1.6d+173)) .or. (.not. ((a * b) <= 1.6d+66))) 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) <= -1.6e+173) || !((a * b) <= 1.6e+66)) {
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) <= -1.6e+173) or not ((a * b) <= 1.6e+66): 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) <= -1.6e+173) || !(Float64(a * b) <= 1.6e+66)) 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) <= -1.6e+173) || ~(((a * b) <= 1.6e+66)))
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], -1.6e+173], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.6e+66]], $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 -1.6 \cdot 10^{+173} \lor \neg \left(a \cdot b \leq 1.6 \cdot 10^{+66}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.6000000000000001e173 or 1.6e66 < (*.f64 a b) Initial program 89.1%
+-commutative89.1%
fma-define90.3%
+-commutative90.3%
fma-define92.8%
fma-define92.8%
Simplified92.8%
Taylor expanded in a around inf 69.2%
if -1.6000000000000001e173 < (*.f64 a b) < 1.6e66Initial program 97.1%
+-commutative97.1%
fma-define98.8%
+-commutative98.8%
fma-define98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in c around inf 37.2%
Final simplification47.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 (* 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 94.5%
+-commutative94.5%
fma-define96.1%
+-commutative96.1%
fma-define96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in a around inf 28.8%
herbie shell --seed 2024165
(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)))