
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* a (+ b (+ (* t (/ z a)) (* x (/ y a))))))))
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 + ((t * (z / a)) + (x * (y / a))));
}
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 + ((t * (z / a)) + (x * (y / a))));
}
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 + ((t * (z / a)) + (x * (y / a)))) 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 * Float64(b + Float64(Float64(t * Float64(z / a)) + Float64(x * Float64(y / a))))); 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 + ((t * (z / a)) + (x * (y / a))));
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 * N[(b + N[(N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / a), $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}:\\
\;\;\;\;a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\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%
Taylor expanded in c around 0 33.3%
Taylor expanded in a around inf 44.4%
associate-/l*66.7%
associate-/l*66.7%
Simplified66.7%
Final simplification98.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 (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.5%
+-commutative96.5%
fma-define97.7%
associate-+l+97.7%
fma-define98.0%
fma-define98.4%
Simplified98.4%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 96.5%
+-commutative96.5%
fma-define97.7%
+-commutative97.7%
fma-define98.0%
fma-define98.4%
Simplified98.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 (/ (* x y) a))))
(t_2 (+ (* c i) (* z t)))
(t_3 (+ (* x y) (* c i))))
(if (<= (* a b) -5e+246)
t_1
(if (<= (* a b) -5e+144)
t_2
(if (<= (* a b) -2e+104)
t_1
(if (<= (* a b) -1e-85)
t_2
(if (<= (* a b) 5e-233)
t_3
(if (<= (* a b) 5e-111)
(+ (* x y) (* z t))
(if (<= (* a b) 1e-47)
t_3
(if (<= (* a b) 4e+121) t_2 (+ (* a b) (* c i))))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a * (b + ((x * y) / a));
double t_2 = (c * i) + (z * t);
double t_3 = (x * y) + (c * i);
double tmp;
if ((a * b) <= -5e+246) {
tmp = t_1;
} else if ((a * b) <= -5e+144) {
tmp = t_2;
} else if ((a * b) <= -2e+104) {
tmp = t_1;
} else if ((a * b) <= -1e-85) {
tmp = t_2;
} else if ((a * b) <= 5e-233) {
tmp = t_3;
} else if ((a * b) <= 5e-111) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 1e-47) {
tmp = t_3;
} else if ((a * b) <= 4e+121) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = a * (b + ((x * y) / a))
t_2 = (c * i) + (z * t)
t_3 = (x * y) + (c * i)
if ((a * b) <= (-5d+246)) then
tmp = t_1
else if ((a * b) <= (-5d+144)) then
tmp = t_2
else if ((a * b) <= (-2d+104)) then
tmp = t_1
else if ((a * b) <= (-1d-85)) then
tmp = t_2
else if ((a * b) <= 5d-233) then
tmp = t_3
else if ((a * b) <= 5d-111) then
tmp = (x * y) + (z * t)
else if ((a * b) <= 1d-47) then
tmp = t_3
else if ((a * b) <= 4d+121) then
tmp = t_2
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 t_1 = a * (b + ((x * y) / a));
double t_2 = (c * i) + (z * t);
double t_3 = (x * y) + (c * i);
double tmp;
if ((a * b) <= -5e+246) {
tmp = t_1;
} else if ((a * b) <= -5e+144) {
tmp = t_2;
} else if ((a * b) <= -2e+104) {
tmp = t_1;
} else if ((a * b) <= -1e-85) {
tmp = t_2;
} else if ((a * b) <= 5e-233) {
tmp = t_3;
} else if ((a * b) <= 5e-111) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 1e-47) {
tmp = t_3;
} else if ((a * b) <= 4e+121) {
tmp = t_2;
} 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): t_1 = a * (b + ((x * y) / a)) t_2 = (c * i) + (z * t) t_3 = (x * y) + (c * i) tmp = 0 if (a * b) <= -5e+246: tmp = t_1 elif (a * b) <= -5e+144: tmp = t_2 elif (a * b) <= -2e+104: tmp = t_1 elif (a * b) <= -1e-85: tmp = t_2 elif (a * b) <= 5e-233: tmp = t_3 elif (a * b) <= 5e-111: tmp = (x * y) + (z * t) elif (a * b) <= 1e-47: tmp = t_3 elif (a * b) <= 4e+121: tmp = t_2 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) t_1 = Float64(a * Float64(b + Float64(Float64(x * y) / a))) t_2 = Float64(Float64(c * i) + Float64(z * t)) t_3 = Float64(Float64(x * y) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -5e+246) tmp = t_1; elseif (Float64(a * b) <= -5e+144) tmp = t_2; elseif (Float64(a * b) <= -2e+104) tmp = t_1; elseif (Float64(a * b) <= -1e-85) tmp = t_2; elseif (Float64(a * b) <= 5e-233) tmp = t_3; elseif (Float64(a * b) <= 5e-111) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(a * b) <= 1e-47) tmp = t_3; elseif (Float64(a * b) <= 4e+121) tmp = t_2; 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)
t_1 = a * (b + ((x * y) / a));
t_2 = (c * i) + (z * t);
t_3 = (x * y) + (c * i);
tmp = 0.0;
if ((a * b) <= -5e+246)
tmp = t_1;
elseif ((a * b) <= -5e+144)
tmp = t_2;
elseif ((a * b) <= -2e+104)
tmp = t_1;
elseif ((a * b) <= -1e-85)
tmp = t_2;
elseif ((a * b) <= 5e-233)
tmp = t_3;
elseif ((a * b) <= 5e-111)
tmp = (x * y) + (z * t);
elseif ((a * b) <= 1e-47)
tmp = t_3;
elseif ((a * b) <= 4e+121)
tmp = t_2;
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_] := Block[{t$95$1 = N[(a * N[(b + N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+246], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -5e+144], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -2e+104], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1e-85], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 5e-233], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 5e-111], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e-47], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 4e+121], t$95$2, 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}
t_1 := a \cdot \left(b + \frac{x \cdot y}{a}\right)\\
t_2 := c \cdot i + z \cdot t\\
t_3 := x \cdot y + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+246}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{+144}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-85}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-233}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-111}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 10^{-47}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+121}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -4.99999999999999976e246 or -4.9999999999999999e144 < (*.f64 a b) < -2e104Initial program 86.2%
Taylor expanded in c around 0 89.7%
Taylor expanded in a around inf 89.7%
associate-/l*96.6%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in t around 0 93.2%
if -4.99999999999999976e246 < (*.f64 a b) < -4.9999999999999999e144 or -2e104 < (*.f64 a b) < -9.9999999999999998e-86 or 9.9999999999999997e-48 < (*.f64 a b) < 4.00000000000000015e121Initial program 98.8%
Taylor expanded in a around 0 88.7%
Taylor expanded in x around 0 79.5%
if -9.9999999999999998e-86 < (*.f64 a b) < 5.00000000000000012e-233 or 5.0000000000000003e-111 < (*.f64 a b) < 9.9999999999999997e-48Initial program 96.5%
Taylor expanded in a around 0 95.4%
Taylor expanded in t around 0 77.9%
if 5.00000000000000012e-233 < (*.f64 a b) < 5.0000000000000003e-111Initial program 100.0%
Taylor expanded in c around 0 93.3%
Taylor expanded in a around inf 74.5%
associate-/l*74.5%
associate-/l*67.8%
Simplified67.8%
Taylor expanded in a around 0 93.3%
if 4.00000000000000015e121 < (*.f64 a b) Initial program 97.7%
Taylor expanded in x around 0 91.1%
Taylor expanded in t around 0 84.7%
Final simplification82.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))) (t_2 (+ (* c i) (* z t))))
(if (<= (* c i) -3.8e+103)
t_2
(if (<= (* c i) -105.0)
t_1
(if (<= (* c i) -3.9e-43)
(+ (* x y) (* c i))
(if (<= (* c i) -1.55e-279)
(+ (* x y) (* z t))
(if (<= (* c i) 4.5e+65) t_1 t_2)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -3.8e+103) {
tmp = t_2;
} else if ((c * i) <= -105.0) {
tmp = t_1;
} else if ((c * i) <= -3.9e-43) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= -1.55e-279) {
tmp = (x * y) + (z * t);
} else if ((c * i) <= 4.5e+65) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (c * i) + (z * t)
if ((c * i) <= (-3.8d+103)) then
tmp = t_2
else if ((c * i) <= (-105.0d0)) then
tmp = t_1
else if ((c * i) <= (-3.9d-43)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= (-1.55d-279)) then
tmp = (x * y) + (z * t)
else if ((c * i) <= 4.5d+65) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -3.8e+103) {
tmp = t_2;
} else if ((c * i) <= -105.0) {
tmp = t_1;
} else if ((c * i) <= -3.9e-43) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= -1.55e-279) {
tmp = (x * y) + (z * t);
} else if ((c * i) <= 4.5e+65) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (c * i) + (z * t) tmp = 0 if (c * i) <= -3.8e+103: tmp = t_2 elif (c * i) <= -105.0: tmp = t_1 elif (c * i) <= -3.9e-43: tmp = (x * y) + (c * i) elif (c * i) <= -1.55e-279: tmp = (x * y) + (z * t) elif (c * i) <= 4.5e+65: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -3.8e+103) tmp = t_2; elseif (Float64(c * i) <= -105.0) tmp = t_1; elseif (Float64(c * i) <= -3.9e-43) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= -1.55e-279) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(c * i) <= 4.5e+65) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (a * b) + (z * t);
t_2 = (c * i) + (z * t);
tmp = 0.0;
if ((c * i) <= -3.8e+103)
tmp = t_2;
elseif ((c * i) <= -105.0)
tmp = t_1;
elseif ((c * i) <= -3.9e-43)
tmp = (x * y) + (c * i);
elseif ((c * i) <= -1.55e-279)
tmp = (x * y) + (z * t);
elseif ((c * i) <= 4.5e+65)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -3.8e+103], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -105.0], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -3.9e-43], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.55e-279], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.5e+65], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+103}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq -105:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -3.9 \cdot 10^{-43}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-279}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 4.5 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 c i) < -3.7999999999999997e103 or 4.5e65 < (*.f64 c i) Initial program 95.4%
Taylor expanded in a around 0 90.6%
Taylor expanded in x around 0 84.5%
if -3.7999999999999997e103 < (*.f64 c i) < -105 or -1.55e-279 < (*.f64 c i) < 4.5e65Initial program 97.1%
Taylor expanded in x around 0 73.2%
Taylor expanded in c around 0 69.9%
if -105 < (*.f64 c i) < -3.9e-43Initial program 88.9%
Taylor expanded in a around 0 68.0%
Taylor expanded in t around 0 79.1%
if -3.9e-43 < (*.f64 c i) < -1.55e-279Initial program 100.0%
Taylor expanded in c around 0 100.0%
Taylor expanded in a around inf 74.9%
associate-/l*74.9%
associate-/l*69.2%
Simplified69.2%
Taylor expanded in a around 0 77.4%
Final simplification77.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) -9e+102)
(* c i)
(if (<= (* c i) -2.8e-279)
(* x y)
(if (<= (* c i) 2.5e-20)
(* a b)
(if (<= (* c i) 1.5e+32)
(* x y)
(if (<= (* c i) 9.5e+56) (* 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) <= -9e+102) {
tmp = c * i;
} else if ((c * i) <= -2.8e-279) {
tmp = x * y;
} else if ((c * i) <= 2.5e-20) {
tmp = a * b;
} else if ((c * i) <= 1.5e+32) {
tmp = x * y;
} else if ((c * i) <= 9.5e+56) {
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) <= (-9d+102)) then
tmp = c * i
else if ((c * i) <= (-2.8d-279)) then
tmp = x * y
else if ((c * i) <= 2.5d-20) then
tmp = a * b
else if ((c * i) <= 1.5d+32) then
tmp = x * y
else if ((c * i) <= 9.5d+56) 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) <= -9e+102) {
tmp = c * i;
} else if ((c * i) <= -2.8e-279) {
tmp = x * y;
} else if ((c * i) <= 2.5e-20) {
tmp = a * b;
} else if ((c * i) <= 1.5e+32) {
tmp = x * y;
} else if ((c * i) <= 9.5e+56) {
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) <= -9e+102: tmp = c * i elif (c * i) <= -2.8e-279: tmp = x * y elif (c * i) <= 2.5e-20: tmp = a * b elif (c * i) <= 1.5e+32: tmp = x * y elif (c * i) <= 9.5e+56: 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) <= -9e+102) tmp = Float64(c * i); elseif (Float64(c * i) <= -2.8e-279) tmp = Float64(x * y); elseif (Float64(c * i) <= 2.5e-20) tmp = Float64(a * b); elseif (Float64(c * i) <= 1.5e+32) tmp = Float64(x * y); elseif (Float64(c * i) <= 9.5e+56) 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) <= -9e+102)
tmp = c * i;
elseif ((c * i) <= -2.8e-279)
tmp = x * y;
elseif ((c * i) <= 2.5e-20)
tmp = a * b;
elseif ((c * i) <= 1.5e+32)
tmp = x * y;
elseif ((c * i) <= 9.5e+56)
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], -9e+102], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.8e-279], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.5e-20], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.5e+32], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 9.5e+56], 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 -9 \cdot 10^{+102}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -2.8 \cdot 10^{-279}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 2.5 \cdot 10^{-20}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{+32}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 9.5 \cdot 10^{+56}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -9.00000000000000042e102 or 9.4999999999999997e56 < (*.f64 c i) Initial program 95.5%
Taylor expanded in c around inf 66.9%
if -9.00000000000000042e102 < (*.f64 c i) < -2.8000000000000001e-279 or 2.4999999999999999e-20 < (*.f64 c i) < 1.5e32Initial program 97.1%
Taylor expanded in c around 0 94.3%
Taylor expanded in a around inf 72.5%
associate-/l*73.9%
associate-/l*71.1%
Simplified71.1%
Taylor expanded in x around inf 45.7%
if -2.8000000000000001e-279 < (*.f64 c i) < 2.4999999999999999e-20Initial program 97.2%
Taylor expanded in a around inf 44.0%
if 1.5e32 < (*.f64 c i) < 9.4999999999999997e56Initial program 100.0%
Taylor expanded in c around 0 100.0%
Taylor expanded in a around inf 66.7%
associate-/l*66.7%
associate-/l*66.7%
Simplified66.7%
Taylor expanded in t around inf 66.9%
Final simplification54.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
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* c i) (* z t))))
(if (<= (* c i) -6.5e+104)
t_2
(if (<= (* c i) -0.0024)
t_1
(if (<= (* c i) -1.55e-70)
(+ (* x y) (* c i))
(if (<= (* c i) 8.5e+64) t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -6.5e+104) {
tmp = t_2;
} else if ((c * i) <= -0.0024) {
tmp = t_1;
} else if ((c * i) <= -1.55e-70) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 8.5e+64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (c * i) + (z * t)
if ((c * i) <= (-6.5d+104)) then
tmp = t_2
else if ((c * i) <= (-0.0024d0)) then
tmp = t_1
else if ((c * i) <= (-1.55d-70)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= 8.5d+64) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -6.5e+104) {
tmp = t_2;
} else if ((c * i) <= -0.0024) {
tmp = t_1;
} else if ((c * i) <= -1.55e-70) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 8.5e+64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (c * i) + (z * t) tmp = 0 if (c * i) <= -6.5e+104: tmp = t_2 elif (c * i) <= -0.0024: tmp = t_1 elif (c * i) <= -1.55e-70: tmp = (x * y) + (c * i) elif (c * i) <= 8.5e+64: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -6.5e+104) tmp = t_2; elseif (Float64(c * i) <= -0.0024) tmp = t_1; elseif (Float64(c * i) <= -1.55e-70) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= 8.5e+64) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (a * b) + (z * t);
t_2 = (c * i) + (z * t);
tmp = 0.0;
if ((c * i) <= -6.5e+104)
tmp = t_2;
elseif ((c * i) <= -0.0024)
tmp = t_1;
elseif ((c * i) <= -1.55e-70)
tmp = (x * y) + (c * i);
elseif ((c * i) <= 8.5e+64)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -6.5e+104], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -0.0024], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -1.55e-70], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 8.5e+64], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -6.5 \cdot 10^{+104}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq -0.0024:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-70}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 8.5 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 c i) < -6.5000000000000005e104 or 8.4999999999999998e64 < (*.f64 c i) Initial program 95.4%
Taylor expanded in a around 0 90.6%
Taylor expanded in x around 0 84.5%
if -6.5000000000000005e104 < (*.f64 c i) < -0.00239999999999999979 or -1.55e-70 < (*.f64 c i) < 8.4999999999999998e64Initial program 97.8%
Taylor expanded in x around 0 70.2%
Taylor expanded in c around 0 67.7%
if -0.00239999999999999979 < (*.f64 c i) < -1.55e-70Initial program 90.9%
Taylor expanded in a around 0 73.8%
Taylor expanded in t around 0 82.9%
Final simplification75.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 (+ (* a b) (* z t))) (t_2 (+ (* c i) (* z t))))
(if (<= (* c i) -1.4e+104)
t_2
(if (<= (* c i) -6.5)
t_1
(if (<= (* c i) -1.55e-70)
(* x y)
(if (<= (* c i) 1.7e+64) t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -1.4e+104) {
tmp = t_2;
} else if ((c * i) <= -6.5) {
tmp = t_1;
} else if ((c * i) <= -1.55e-70) {
tmp = x * y;
} else if ((c * i) <= 1.7e+64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (c * i) + (z * t)
if ((c * i) <= (-1.4d+104)) then
tmp = t_2
else if ((c * i) <= (-6.5d0)) then
tmp = t_1
else if ((c * i) <= (-1.55d-70)) then
tmp = x * y
else if ((c * i) <= 1.7d+64) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -1.4e+104) {
tmp = t_2;
} else if ((c * i) <= -6.5) {
tmp = t_1;
} else if ((c * i) <= -1.55e-70) {
tmp = x * y;
} else if ((c * i) <= 1.7e+64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (c * i) + (z * t) tmp = 0 if (c * i) <= -1.4e+104: tmp = t_2 elif (c * i) <= -6.5: tmp = t_1 elif (c * i) <= -1.55e-70: tmp = x * y elif (c * i) <= 1.7e+64: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -1.4e+104) tmp = t_2; elseif (Float64(c * i) <= -6.5) tmp = t_1; elseif (Float64(c * i) <= -1.55e-70) tmp = Float64(x * y); elseif (Float64(c * i) <= 1.7e+64) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (a * b) + (z * t);
t_2 = (c * i) + (z * t);
tmp = 0.0;
if ((c * i) <= -1.4e+104)
tmp = t_2;
elseif ((c * i) <= -6.5)
tmp = t_1;
elseif ((c * i) <= -1.55e-70)
tmp = x * y;
elseif ((c * i) <= 1.7e+64)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.4e+104], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -6.5], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -1.55e-70], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.7e+64], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1.4 \cdot 10^{+104}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq -6.5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-70}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 1.7 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 c i) < -1.4e104 or 1.7000000000000001e64 < (*.f64 c i) Initial program 95.4%
Taylor expanded in a around 0 90.6%
Taylor expanded in x around 0 84.5%
if -1.4e104 < (*.f64 c i) < -6.5 or -1.55e-70 < (*.f64 c i) < 1.7000000000000001e64Initial program 97.8%
Taylor expanded in x around 0 70.2%
Taylor expanded in c around 0 67.7%
if -6.5 < (*.f64 c i) < -1.55e-70Initial program 90.9%
Taylor expanded in c around 0 82.1%
Taylor expanded in a around inf 56.3%
associate-/l*65.3%
associate-/l*65.1%
Simplified65.1%
Taylor expanded in x around inf 74.0%
Final simplification75.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -2.35e+244)
(* x y)
(if (<= (* x y) -1.7e-16)
t_1
(if (<= (* x y) -2.6e-36)
(* z t)
(if (<= (* x y) 4.8e+197) t_1 (* x y)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -2.35e+244) {
tmp = x * y;
} else if ((x * y) <= -1.7e-16) {
tmp = t_1;
} else if ((x * y) <= -2.6e-36) {
tmp = z * t;
} else if ((x * y) <= 4.8e+197) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((x * y) <= (-2.35d+244)) then
tmp = x * y
else if ((x * y) <= (-1.7d-16)) then
tmp = t_1
else if ((x * y) <= (-2.6d-36)) then
tmp = z * t
else if ((x * y) <= 4.8d+197) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -2.35e+244) {
tmp = x * y;
} else if ((x * y) <= -1.7e-16) {
tmp = t_1;
} else if ((x * y) <= -2.6e-36) {
tmp = z * t;
} else if ((x * y) <= 4.8e+197) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (x * y) <= -2.35e+244: tmp = x * y elif (x * y) <= -1.7e-16: tmp = t_1 elif (x * y) <= -2.6e-36: tmp = z * t elif (x * y) <= 4.8e+197: tmp = t_1 else: tmp = x * y return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -2.35e+244) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.7e-16) tmp = t_1; elseif (Float64(x * y) <= -2.6e-36) tmp = Float64(z * t); elseif (Float64(x * y) <= 4.8e+197) tmp = t_1; else tmp = Float64(x * y); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (a * b) + (c * i);
tmp = 0.0;
if ((x * y) <= -2.35e+244)
tmp = x * y;
elseif ((x * y) <= -1.7e-16)
tmp = t_1;
elseif ((x * y) <= -2.6e-36)
tmp = z * t;
elseif ((x * y) <= 4.8e+197)
tmp = t_1;
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.35e+244], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.7e-16], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.6e-36], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.8e+197], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -2.35 \cdot 10^{+244}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-36}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{+197}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.35000000000000006e244 or 4.7999999999999998e197 < (*.f64 x y) Initial program 90.6%
Taylor expanded in c around 0 81.8%
Taylor expanded in a around inf 63.4%
associate-/l*65.3%
associate-/l*65.3%
Simplified65.3%
Taylor expanded in x around inf 73.0%
if -2.35000000000000006e244 < (*.f64 x y) < -1.7e-16 or -2.6e-36 < (*.f64 x y) < 4.7999999999999998e197Initial program 97.9%
Taylor expanded in x around 0 87.7%
Taylor expanded in t around 0 65.7%
if -1.7e-16 < (*.f64 x y) < -2.6e-36Initial program 100.0%
Taylor expanded in c around 0 89.4%
Taylor expanded in a around inf 78.3%
associate-/l*78.3%
associate-/l*78.1%
Simplified78.1%
Taylor expanded in t around inf 78.5%
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 (<= (* a b) -1e+274)
(* a (+ b (+ (* t (/ z a)) (* x (/ y a)))))
(if (or (<= (* a b) -5e+84) (not (<= (* a b) 1e-47)))
(+ (* c i) (+ (* a b) (* z t)))
(+ (* c i) (+ (* 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 ((a * b) <= -1e+274) {
tmp = a * (b + ((t * (z / a)) + (x * (y / a))));
} else if (((a * b) <= -5e+84) || !((a * b) <= 1e-47)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((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 ((a * b) <= (-1d+274)) then
tmp = a * (b + ((t * (z / a)) + (x * (y / a))))
else if (((a * b) <= (-5d+84)) .or. (.not. ((a * b) <= 1d-47))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((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 ((a * b) <= -1e+274) {
tmp = a * (b + ((t * (z / a)) + (x * (y / a))));
} else if (((a * b) <= -5e+84) || !((a * b) <= 1e-47)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((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 (a * b) <= -1e+274: tmp = a * (b + ((t * (z / a)) + (x * (y / a)))) elif ((a * b) <= -5e+84) or not ((a * b) <= 1e-47): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((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(a * b) <= -1e+274) tmp = Float64(a * Float64(b + Float64(Float64(t * Float64(z / a)) + Float64(x * Float64(y / a))))); elseif ((Float64(a * b) <= -5e+84) || !(Float64(a * b) <= 1e-47)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + 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 ((a * b) <= -1e+274)
tmp = a * (b + ((t * (z / a)) + (x * (y / a))));
elseif (((a * b) <= -5e+84) || ~(((a * b) <= 1e-47)))
tmp = (c * i) + ((a * b) + (z * t));
else
tmp = (c * i) + ((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[LessEqual[N[(a * b), $MachinePrecision], -1e+274], N[(a * N[(b + N[(N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+84], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e-47]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $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}\;a \cdot b \leq -1 \cdot 10^{+274}:\\
\;\;\;\;a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{+84} \lor \neg \left(a \cdot b \leq 10^{-47}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -9.99999999999999921e273Initial program 77.8%
Taylor expanded in c around 0 83.3%
Taylor expanded in a around inf 88.9%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
if -9.99999999999999921e273 < (*.f64 a b) < -5.0000000000000001e84 or 9.9999999999999997e-48 < (*.f64 a b) Initial program 98.1%
Taylor expanded in x around 0 92.7%
if -5.0000000000000001e84 < (*.f64 a b) < 9.9999999999999997e-48Initial program 97.8%
Taylor expanded in a around 0 95.6%
Final simplification94.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) -5e+84) (not (<= (* a b) 1e-47))) (+ (* c i) (+ (* a b) (* z t))) (+ (* c i) (+ (* 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 (((a * b) <= -5e+84) || !((a * b) <= 1e-47)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((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 (((a * b) <= (-5d+84)) .or. (.not. ((a * b) <= 1d-47))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((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 (((a * b) <= -5e+84) || !((a * b) <= 1e-47)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((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 ((a * b) <= -5e+84) or not ((a * b) <= 1e-47): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((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(a * b) <= -5e+84) || !(Float64(a * b) <= 1e-47)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + 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 (((a * b) <= -5e+84) || ~(((a * b) <= 1e-47)))
tmp = (c * i) + ((a * b) + (z * t));
else
tmp = (c * i) + ((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[(a * b), $MachinePrecision], -5e+84], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e-47]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $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}\;a \cdot b \leq -5 \cdot 10^{+84} \lor \neg \left(a \cdot b \leq 10^{-47}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5.0000000000000001e84 or 9.9999999999999997e-48 < (*.f64 a b) Initial program 95.1%
Taylor expanded in x around 0 89.7%
if -5.0000000000000001e84 < (*.f64 a b) < 9.9999999999999997e-48Initial program 97.8%
Taylor expanded in a around 0 95.6%
Final simplification92.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
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= (* c i) -9e+102) (not (<= (* c i) 7.6e+66)))
(+ (* c i) t_1)
(+ (* a b) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((c * i) <= -9e+102) || !((c * i) <= 7.6e+66)) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if (((c * i) <= (-9d+102)) .or. (.not. ((c * i) <= 7.6d+66))) then
tmp = (c * i) + t_1
else
tmp = (a * b) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((c * i) <= -9e+102) || !((c * i) <= 7.6e+66)) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if ((c * i) <= -9e+102) or not ((c * i) <= 7.6e+66): tmp = (c * i) + t_1 else: tmp = (a * b) + t_1 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((Float64(c * i) <= -9e+102) || !(Float64(c * i) <= 7.6e+66)) tmp = Float64(Float64(c * i) + t_1); else tmp = Float64(Float64(a * b) + t_1); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (x * y) + (z * t);
tmp = 0.0;
if (((c * i) <= -9e+102) || ~(((c * i) <= 7.6e+66)))
tmp = (c * i) + t_1;
else
tmp = (a * b) + 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[(c * i), $MachinePrecision], -9e+102], N[Not[LessEqual[N[(c * i), $MachinePrecision], 7.6e+66]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -9 \cdot 10^{+102} \lor \neg \left(c \cdot i \leq 7.6 \cdot 10^{+66}\right):\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -9.00000000000000042e102 or 7.6000000000000004e66 < (*.f64 c i) Initial program 95.4%
Taylor expanded in a around 0 90.6%
if -9.00000000000000042e102 < (*.f64 c i) < 7.6000000000000004e66Initial program 97.3%
Taylor expanded in c around 0 94.0%
Final simplification92.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) -1.05e+106) (not (<= (* c i) 4.5e+145))) (+ (* c i) (* z t)) (+ (* 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) <= -1.05e+106) || !((c * i) <= 4.5e+145)) {
tmp = (c * i) + (z * t);
} 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) <= (-1.05d+106)) .or. (.not. ((c * i) <= 4.5d+145))) then
tmp = (c * i) + (z * t)
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) <= -1.05e+106) || !((c * i) <= 4.5e+145)) {
tmp = (c * i) + (z * t);
} 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) <= -1.05e+106) or not ((c * i) <= 4.5e+145): tmp = (c * i) + (z * t) 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) <= -1.05e+106) || !(Float64(c * i) <= 4.5e+145)) tmp = Float64(Float64(c * i) + Float64(z * t)); 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) <= -1.05e+106) || ~(((c * i) <= 4.5e+145)))
tmp = (c * i) + (z * t);
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], -1.05e+106], N[Not[LessEqual[N[(c * i), $MachinePrecision], 4.5e+145]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(z * t), $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.05 \cdot 10^{+106} \lor \neg \left(c \cdot i \leq 4.5 \cdot 10^{+145}\right):\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -1.05000000000000002e106 or 4.4999999999999998e145 < (*.f64 c i) Initial program 94.3%
Taylor expanded in a around 0 92.0%
Taylor expanded in x around 0 88.8%
if -1.05000000000000002e106 < (*.f64 c i) < 4.4999999999999998e145Initial program 97.6%
Taylor expanded in c around 0 90.8%
Final simplification90.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -7e+101) (not (<= (* c i) 2.8e+155))) (+ (* 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) <= -7e+101) || !((c * i) <= 2.8e+155)) {
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) <= (-7d+101)) .or. (.not. ((c * i) <= 2.8d+155))) 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) <= -7e+101) || !((c * i) <= 2.8e+155)) {
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) <= -7e+101) or not ((c * i) <= 2.8e+155): 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) <= -7e+101) || !(Float64(c * i) <= 2.8e+155)) 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) <= -7e+101) || ~(((c * i) <= 2.8e+155)))
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], -7e+101], N[Not[LessEqual[N[(c * i), $MachinePrecision], 2.8e+155]], $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 -7 \cdot 10^{+101} \lor \neg \left(c \cdot i \leq 2.8 \cdot 10^{+155}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -7.00000000000000046e101 or 2.80000000000000016e155 < (*.f64 c i) Initial program 94.3%
Taylor expanded in x around 0 89.9%
Taylor expanded in t around 0 80.0%
if -7.00000000000000046e101 < (*.f64 c i) < 2.80000000000000016e155Initial program 97.6%
Taylor expanded in x around 0 69.8%
Taylor expanded in c around 0 63.1%
Final simplification68.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -3.1e+105) (not (<= (* c i) 1.22e+64))) (* c i) (* a b)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -3.1e+105) || !((c * i) <= 1.22e+64)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-3.1d+105)) .or. (.not. ((c * i) <= 1.22d+64))) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -3.1e+105) || !((c * i) <= 1.22e+64)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -3.1e+105) or not ((c * i) <= 1.22e+64): tmp = c * i else: tmp = a * b return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -3.1e+105) || !(Float64(c * i) <= 1.22e+64)) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (((c * i) <= -3.1e+105) || ~(((c * i) <= 1.22e+64)))
tmp = c * i;
else
tmp = a * b;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -3.1e+105], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.22e+64]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.1 \cdot 10^{+105} \lor \neg \left(c \cdot i \leq 1.22 \cdot 10^{+64}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -3.10000000000000004e105 or 1.21999999999999994e64 < (*.f64 c i) Initial program 95.4%
Taylor expanded in c around inf 67.7%
if -3.10000000000000004e105 < (*.f64 c i) < 1.21999999999999994e64Initial program 97.3%
Taylor expanded in a around inf 37.2%
Final simplification50.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 (* 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.5%
Taylor expanded in a around inf 25.7%
herbie shell --seed 2024085
(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)))