
(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 13 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 (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (fma c i (fma a b (fma x y (* z t)))) (* x (+ y (+ (* a (/ b x)) (+ (* t (/ z x)) (* c (/ i x))))))))
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) + ((x * y) + (z * t))) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(c, i, fma(a, b, fma(x, y, (z * t))));
} else {
tmp = x * (y + ((a * (b / x)) + ((t * (z / x)) + (c * (i / x)))));
}
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(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) <= Inf) tmp = fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))); else tmp = Float64(x * Float64(y + Float64(Float64(a * Float64(b / x)) + Float64(Float64(t * Float64(z / x)) + Float64(c * Float64(i / x)))))); 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[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + N[(N[(a * N[(b / x), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i \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}:\\
\;\;\;\;x \cdot \left(y + \left(a \cdot \frac{b}{x} + \left(t \cdot \frac{z}{x} + c \cdot \frac{i}{x}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
+-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-define7.7%
+-commutative7.7%
fma-define30.8%
fma-define30.8%
Simplified30.8%
Taylor expanded in x around inf 23.1%
associate-/l*30.8%
+-commutative30.8%
associate-/l*69.2%
associate-/l*76.9%
Simplified76.9%
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
(let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i))))
(if (<= t_1 INFINITY)
t_1
(* x (+ y (+ (* a (/ b x)) (+ (* t (/ z x)) (* c (/ i x)))))))))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) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * (y + ((a * (b / x)) + ((t * (z / x)) + (c * (i / x)))));
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x * (y + ((a * (b / x)) + ((t * (z / x)) + (c * (i / x)))));
}
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) + (z * t))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x * (y + ((a * (b / x)) + ((t * (z / x)) + (c * (i / x))))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(x * Float64(y + Float64(Float64(a * Float64(b / x)) + Float64(Float64(t * Float64(z / x)) + Float64(c * Float64(i / x)))))); 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) + (z * t))) + (c * i);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = x * (y + ((a * (b / x)) + ((t * (z / x)) + (c * (i / x)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x * N[(y + N[(N[(a * N[(b / x), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + \left(a \cdot \frac{b}{x} + \left(t \cdot \frac{z}{x} + c \cdot \frac{i}{x}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
+-commutative0.0%
fma-define7.7%
+-commutative7.7%
fma-define30.8%
fma-define30.8%
Simplified30.8%
Taylor expanded in x around inf 23.1%
associate-/l*30.8%
+-commutative30.8%
associate-/l*69.2%
associate-/l*76.9%
Simplified76.9%
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 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (* x (+ y (* a (/ b x)))))))
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) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * (y + (a * (b / x)));
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x * (y + (a * (b / x)));
}
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) + (z * t))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x * (y + (a * (b / x))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(x * Float64(y + Float64(a * Float64(b / x)))); 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) + (z * t))) + (c * i);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = x * (y + (a * (b / x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x * N[(y + N[(a * N[(b / x), $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 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + a \cdot \frac{b}{x}\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-define7.7%
+-commutative7.7%
fma-define30.8%
fma-define30.8%
Simplified30.8%
Taylor expanded in x around inf 23.1%
associate-/l*30.8%
+-commutative30.8%
associate-/l*69.2%
associate-/l*76.9%
Simplified76.9%
Taylor expanded in c around 0 15.4%
associate-*r/30.8%
associate-*r/61.5%
Simplified61.5%
Taylor expanded in t around 0 53.9%
associate-*r/69.3%
Simplified69.3%
Final simplification98.4%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -3.3e+78)
(* x y)
(if (<= (* x y) 5.2e-54)
(+ (* a b) (* z t))
(if (<= (* x y) 9.8e+304) (+ (* a b) (* c i)) (* x y)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -3.3e+78) {
tmp = x * y;
} else if ((x * y) <= 5.2e-54) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 9.8e+304) {
tmp = (a * b) + (c * i);
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-3.3d+78)) then
tmp = x * y
else if ((x * y) <= 5.2d-54) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 9.8d+304) then
tmp = (a * b) + (c * i)
else
tmp = x * y
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -3.3e+78) {
tmp = x * y;
} else if ((x * y) <= 5.2e-54) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 9.8e+304) {
tmp = (a * b) + (c * i);
} else {
tmp = x * y;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -3.3e+78: tmp = x * y elif (x * y) <= 5.2e-54: tmp = (a * b) + (z * t) elif (x * y) <= 9.8e+304: tmp = (a * b) + (c * i) else: tmp = x * y return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -3.3e+78) tmp = Float64(x * y); elseif (Float64(x * y) <= 5.2e-54) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 9.8e+304) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(x * y); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((x * y) <= -3.3e+78)
tmp = x * y;
elseif ((x * y) <= 5.2e-54)
tmp = (a * b) + (z * t);
elseif ((x * y) <= 9.8e+304)
tmp = (a * b) + (c * i);
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -3.3e+78], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.2e-54], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9.8e+304], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.3 \cdot 10^{+78}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 5.2 \cdot 10^{-54}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 9.8 \cdot 10^{+304}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.3e78 or 9.80000000000000018e304 < (*.f64 x y) Initial program 87.3%
+-commutative87.3%
fma-define87.3%
+-commutative87.3%
fma-define90.5%
fma-define90.5%
Simplified90.5%
Taylor expanded in x around inf 92.1%
associate-/l*93.6%
+-commutative93.6%
associate-/l*96.8%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in x around inf 79.4%
if -3.3e78 < (*.f64 x y) < 5.20000000000000004e-54Initial program 97.7%
+-commutative97.7%
fma-define98.4%
+-commutative98.4%
fma-define99.2%
fma-define99.2%
Simplified99.2%
Taylor expanded in x around 0 93.3%
Taylor expanded in c around 0 75.6%
if 5.20000000000000004e-54 < (*.f64 x y) < 9.80000000000000018e304Initial program 96.8%
+-commutative96.8%
fma-define96.8%
+-commutative96.8%
fma-define96.8%
fma-define96.8%
Simplified96.8%
Taylor expanded in x around 0 69.0%
Taylor expanded in c around inf 53.7%
Final simplification71.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5e+53) (not (<= (* x y) 1e+34))) (+ (* x y) (+ (* a b) (* c i))) (+ (* a b) (+ (* c i) (* z t)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5e+53) || !((x * y) <= 1e+34)) {
tmp = (x * y) + ((a * b) + (c * i));
} else {
tmp = (a * b) + ((c * i) + (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-5d+53)) .or. (.not. ((x * y) <= 1d+34))) then
tmp = (x * y) + ((a * b) + (c * i))
else
tmp = (a * b) + ((c * i) + (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5e+53) || !((x * y) <= 1e+34)) {
tmp = (x * y) + ((a * b) + (c * i));
} else {
tmp = (a * b) + ((c * i) + (z * t));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5e+53) or not ((x * y) <= 1e+34): tmp = (x * y) + ((a * b) + (c * i)) else: tmp = (a * b) + ((c * i) + (z * t)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -5e+53) || !(Float64(x * y) <= 1e+34)) tmp = Float64(Float64(x * y) + Float64(Float64(a * b) + Float64(c * i))); else tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (((x * y) <= -5e+53) || ~(((x * y) <= 1e+34)))
tmp = (x * y) + ((a * b) + (c * i));
else
tmp = (a * b) + ((c * i) + (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e+53], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+34]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $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}\;x \cdot y \leq -5 \cdot 10^{+53} \lor \neg \left(x \cdot y \leq 10^{+34}\right):\\
\;\;\;\;x \cdot y + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000004e53 or 9.99999999999999946e33 < (*.f64 x y) Initial program 90.9%
associate-+l+90.9%
fma-define90.9%
Simplified90.9%
Taylor expanded in x around inf 88.5%
if -5.0000000000000004e53 < (*.f64 x y) < 9.99999999999999946e33Initial program 97.9%
+-commutative97.9%
fma-define98.6%
+-commutative98.6%
fma-define99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in x around 0 93.4%
Final simplification91.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -2e+57) (not (<= (* a b) 1e+22))) (+ (* a b) (+ (* c i) (* 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) <= -2e+57) || !((a * b) <= 1e+22)) {
tmp = (a * b) + ((c * i) + (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) <= (-2d+57)) .or. (.not. ((a * b) <= 1d+22))) then
tmp = (a * b) + ((c * i) + (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) <= -2e+57) || !((a * b) <= 1e+22)) {
tmp = (a * b) + ((c * i) + (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) <= -2e+57) or not ((a * b) <= 1e+22): tmp = (a * b) + ((c * i) + (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) <= -2e+57) || !(Float64(a * b) <= 1e+22)) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + 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) <= -2e+57) || ~(((a * b) <= 1e+22)))
tmp = (a * b) + ((c * i) + (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], -2e+57], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+22]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $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 -2 \cdot 10^{+57} \lor \neg \left(a \cdot b \leq 10^{+22}\right):\\
\;\;\;\;a \cdot b + \left(c \cdot i + 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) < -2.0000000000000001e57 or 1e22 < (*.f64 a b) Initial program 93.5%
+-commutative93.5%
fma-define94.3%
+-commutative94.3%
fma-define96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in x around 0 85.4%
if -2.0000000000000001e57 < (*.f64 a b) < 1e22Initial program 96.2%
+-commutative96.2%
fma-define96.2%
+-commutative96.2%
fma-define96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in a around 0 90.9%
Final simplification88.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2e+78)
(+ (* x y) (* c i))
(if (<= (* x y) 2e+277)
(+ (* a b) (+ (* c i) (* z t)))
(* x (+ y (* a (/ b x)))))))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) <= -2e+78) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= 2e+277) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = x * (y + (a * (b / x)));
}
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) <= (-2d+78)) then
tmp = (x * y) + (c * i)
else if ((x * y) <= 2d+277) then
tmp = (a * b) + ((c * i) + (z * t))
else
tmp = x * (y + (a * (b / x)))
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) <= -2e+78) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= 2e+277) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = x * (y + (a * (b / x)));
}
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) <= -2e+78: tmp = (x * y) + (c * i) elif (x * y) <= 2e+277: tmp = (a * b) + ((c * i) + (z * t)) else: tmp = x * (y + (a * (b / x))) 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) <= -2e+78) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(x * y) <= 2e+277) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); else tmp = Float64(x * Float64(y + Float64(a * Float64(b / x)))); 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) <= -2e+78)
tmp = (x * y) + (c * i);
elseif ((x * y) <= 2e+277)
tmp = (a * b) + ((c * i) + (z * t));
else
tmp = x * (y + (a * (b / x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+78], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+277], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + N[(a * N[(b / x), $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}\;x \cdot y \leq -2 \cdot 10^{+78}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+277}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + a \cdot \frac{b}{x}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.00000000000000002e78Initial program 93.0%
+-commutative93.0%
fma-define93.0%
+-commutative93.0%
fma-define95.3%
fma-define95.3%
Simplified95.3%
Taylor expanded in a around 0 85.7%
Taylor expanded in t around 0 85.9%
if -2.00000000000000002e78 < (*.f64 x y) < 2.00000000000000001e277Initial program 97.9%
+-commutative97.9%
fma-define98.4%
+-commutative98.4%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in x around 0 86.6%
if 2.00000000000000001e277 < (*.f64 x y) Initial program 75.0%
+-commutative75.0%
fma-define75.0%
+-commutative75.0%
fma-define79.2%
fma-define79.2%
Simplified79.2%
Taylor expanded in x around inf 87.5%
associate-/l*91.7%
+-commutative91.7%
associate-/l*100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in c around 0 75.6%
associate-*r/79.7%
associate-*r/83.9%
Simplified83.9%
Taylor expanded in t around 0 83.9%
associate-*r/88.1%
Simplified88.1%
Final simplification86.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 (<= (* a b) -1.7e+21)
(* a b)
(if (<= (* a b) -2.9e-228)
(* c i)
(if (<= (* a b) 5.1e+48) (* x y) (* a b)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.7e+21) {
tmp = a * b;
} else if ((a * b) <= -2.9e-228) {
tmp = c * i;
} else if ((a * b) <= 5.1e+48) {
tmp = x * y;
} 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) <= (-1.7d+21)) then
tmp = a * b
else if ((a * b) <= (-2.9d-228)) then
tmp = c * i
else if ((a * b) <= 5.1d+48) then
tmp = x * y
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) <= -1.7e+21) {
tmp = a * b;
} else if ((a * b) <= -2.9e-228) {
tmp = c * i;
} else if ((a * b) <= 5.1e+48) {
tmp = x * y;
} 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) <= -1.7e+21: tmp = a * b elif (a * b) <= -2.9e-228: tmp = c * i elif (a * b) <= 5.1e+48: tmp = x * y 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) <= -1.7e+21) tmp = Float64(a * b); elseif (Float64(a * b) <= -2.9e-228) tmp = Float64(c * i); elseif (Float64(a * b) <= 5.1e+48) tmp = Float64(x * y); 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) <= -1.7e+21)
tmp = a * b;
elseif ((a * b) <= -2.9e-228)
tmp = c * i;
elseif ((a * b) <= 5.1e+48)
tmp = x * y;
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], -1.7e+21], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2.9e-228], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.1e+48], N[(x * y), $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 -1.7 \cdot 10^{+21}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -2.9 \cdot 10^{-228}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 5.1 \cdot 10^{+48}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.7e21 or 5.0999999999999998e48 < (*.f64 a b) Initial program 93.7%
+-commutative93.7%
fma-define94.5%
+-commutative94.5%
fma-define96.8%
fma-define96.8%
Simplified96.8%
Taylor expanded in a around inf 64.5%
if -1.7e21 < (*.f64 a b) < -2.9000000000000001e-228Initial program 93.3%
+-commutative93.3%
fma-define93.3%
+-commutative93.3%
fma-define93.3%
fma-define93.3%
Simplified93.3%
Taylor expanded in c around inf 45.2%
if -2.9000000000000001e-228 < (*.f64 a b) < 5.0999999999999998e48Initial program 97.0%
+-commutative97.0%
fma-define97.0%
+-commutative97.0%
fma-define97.0%
fma-define97.0%
Simplified97.0%
Taylor expanded in x around inf 92.2%
associate-/l*90.2%
+-commutative90.2%
associate-/l*89.8%
associate-/l*89.8%
Simplified89.8%
Taylor expanded in x around inf 47.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -7e+114) (not (<= (* c i) 8.5e+249))) (+ (* a b) (* c i)) (+ (* x y) (* a b))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -7e+114) || !((c * i) <= 8.5e+249)) {
tmp = (a * b) + (c * i);
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-7d+114)) .or. (.not. ((c * i) <= 8.5d+249))) then
tmp = (a * b) + (c * i)
else
tmp = (x * y) + (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -7e+114) || !((c * i) <= 8.5e+249)) {
tmp = (a * b) + (c * i);
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -7e+114) or not ((c * i) <= 8.5e+249): tmp = (a * b) + (c * i) else: tmp = (x * y) + (a * b) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -7e+114) || !(Float64(c * i) <= 8.5e+249)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(x * y) + Float64(a * b)); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (((c * i) <= -7e+114) || ~(((c * i) <= 8.5e+249)))
tmp = (a * b) + (c * i);
else
tmp = (x * y) + (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -7e+114], N[Not[LessEqual[N[(c * i), $MachinePrecision], 8.5e+249]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -7 \cdot 10^{+114} \lor \neg \left(c \cdot i \leq 8.5 \cdot 10^{+249}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -7.0000000000000001e114 or 8.49999999999999933e249 < (*.f64 c i) Initial program 90.9%
+-commutative90.9%
fma-define92.4%
+-commutative92.4%
fma-define93.9%
fma-define93.9%
Simplified93.9%
Taylor expanded in x around 0 88.7%
Taylor expanded in c around inf 81.7%
if -7.0000000000000001e114 < (*.f64 c i) < 8.49999999999999933e249Initial program 96.3%
associate-+l+96.3%
fma-define96.3%
Simplified96.3%
Taylor expanded in x around inf 77.5%
Taylor expanded in c around 0 74.1%
Final simplification76.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 (<= (* x y) -1.9e+78) (not (<= (* x y) 9.8e+304))) (* x y) (+ (* a b) (* c i))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.9e+78) || !((x * y) <= 9.8e+304)) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1.9d+78)) .or. (.not. ((x * y) <= 9.8d+304))) then
tmp = x * y
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.9e+78) || !((x * y) <= 9.8e+304)) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1.9e+78) or not ((x * y) <= 9.8e+304): tmp = x * y else: tmp = (a * b) + (c * i) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1.9e+78) || !(Float64(x * y) <= 9.8e+304)) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (((x * y) <= -1.9e+78) || ~(((x * y) <= 9.8e+304)))
tmp = x * y;
else
tmp = (a * b) + (c * i);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.9e+78], N[Not[LessEqual[N[(x * y), $MachinePrecision], 9.8e+304]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.9 \cdot 10^{+78} \lor \neg \left(x \cdot y \leq 9.8 \cdot 10^{+304}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9e78 or 9.80000000000000018e304 < (*.f64 x y) Initial program 87.3%
+-commutative87.3%
fma-define87.3%
+-commutative87.3%
fma-define90.5%
fma-define90.5%
Simplified90.5%
Taylor expanded in x around inf 92.1%
associate-/l*93.6%
+-commutative93.6%
associate-/l*96.8%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in x around inf 79.4%
if -1.9e78 < (*.f64 x y) < 9.80000000000000018e304Initial program 97.4%
+-commutative97.4%
fma-define97.9%
+-commutative97.9%
fma-define98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in x around 0 85.5%
Taylor expanded in c around inf 64.4%
Final simplification68.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 (<= (* c i) -3.1e+150) (+ (* c i) (* z t)) (if (<= (* c i) 8.5e+249) (+ (* x y) (* a b)) (+ (* 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 ((c * i) <= -3.1e+150) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 8.5e+249) {
tmp = (x * y) + (a * b);
} 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 ((c * i) <= (-3.1d+150)) then
tmp = (c * i) + (z * t)
else if ((c * i) <= 8.5d+249) then
tmp = (x * y) + (a * b)
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 ((c * i) <= -3.1e+150) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 8.5e+249) {
tmp = (x * y) + (a * b);
} 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 (c * i) <= -3.1e+150: tmp = (c * i) + (z * t) elif (c * i) <= 8.5e+249: tmp = (x * y) + (a * b) 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(c * i) <= -3.1e+150) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(c * i) <= 8.5e+249) tmp = Float64(Float64(x * y) + Float64(a * b)); 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 ((c * i) <= -3.1e+150)
tmp = (c * i) + (z * t);
elseif ((c * i) <= 8.5e+249)
tmp = (x * y) + (a * b);
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[LessEqual[N[(c * i), $MachinePrecision], -3.1e+150], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 8.5e+249], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $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}\;c \cdot i \leq -3.1 \cdot 10^{+150}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 8.5 \cdot 10^{+249}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -3.10000000000000014e150Initial program 90.9%
+-commutative90.9%
fma-define93.9%
+-commutative93.9%
fma-define93.9%
fma-define93.9%
Simplified93.9%
Taylor expanded in x around 0 86.6%
Taylor expanded in a around 0 83.6%
if -3.10000000000000014e150 < (*.f64 c i) < 8.49999999999999933e249Initial program 96.4%
associate-+l+96.4%
fma-define96.4%
Simplified96.4%
Taylor expanded in x around inf 77.5%
Taylor expanded in c around 0 73.7%
if 8.49999999999999933e249 < (*.f64 c i) Initial program 89.6%
+-commutative89.6%
fma-define89.6%
+-commutative89.6%
fma-define93.0%
fma-define93.0%
Simplified93.0%
Taylor expanded in x around 0 89.6%
Taylor expanded in c around inf 93.5%
Final simplification77.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -2.1e+149) (not (<= (* c i) 6e+238))) (* 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) <= -2.1e+149) || !((c * i) <= 6e+238)) {
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) <= (-2.1d+149)) .or. (.not. ((c * i) <= 6d+238))) 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) <= -2.1e+149) || !((c * i) <= 6e+238)) {
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) <= -2.1e+149) or not ((c * i) <= 6e+238): 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) <= -2.1e+149) || !(Float64(c * i) <= 6e+238)) 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) <= -2.1e+149) || ~(((c * i) <= 6e+238)))
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], -2.1e+149], N[Not[LessEqual[N[(c * i), $MachinePrecision], 6e+238]], $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 -2.1 \cdot 10^{+149} \lor \neg \left(c \cdot i \leq 6 \cdot 10^{+238}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -2.1000000000000002e149 or 6e238 < (*.f64 c i) Initial program 90.7%
+-commutative90.7%
fma-define92.3%
+-commutative92.3%
fma-define93.8%
fma-define93.8%
Simplified93.8%
Taylor expanded in c around inf 76.2%
if -2.1000000000000002e149 < (*.f64 c i) < 6e238Initial program 96.3%
+-commutative96.3%
fma-define96.3%
+-commutative96.3%
fma-define97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in a around inf 43.5%
Final simplification51.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 (* 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.9%
+-commutative94.9%
fma-define95.3%
+-commutative95.3%
fma-define96.5%
fma-define96.5%
Simplified96.5%
Taylor expanded in a around inf 35.2%
herbie shell --seed 2024157
(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)))