
(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}
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
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))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
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}
\\
\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.1%
+-commutative96.1%
fma-def96.8%
+-commutative96.8%
fma-def98.8%
fma-def98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (+ (* a b) (* z t)))))
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, ((a * b) + (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, Float64(Float64(a * b) + Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, a \cdot b + z \cdot t\right)\right)
\end{array}
Initial program 96.1%
+-commutative96.1%
fma-def96.8%
associate-+l+96.8%
fma-def97.3%
fma-def97.6%
Simplified97.6%
fma-udef97.3%
Applied egg-rr97.3%
Final simplification97.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (+ (+ (* a b) t_1) (* c i)) INFINITY)
(+ (fma x y (* z t)) (+ (* a b) (* c i)))
t_1)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((((a * b) + t_1) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(x, y, (z * t)) + ((a * b) + (c * i));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(Float64(Float64(a * b) + t_1) + Float64(c * i)) <= Inf) tmp = Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;\left(a \cdot b + t_1\right) + c \cdot i \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
associate-+l+100.0%
fma-def100.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%
Taylor expanded in a around 0 60.0%
+-commutative60.0%
*-commutative60.0%
fma-def60.0%
*-commutative60.0%
Applied egg-rr60.0%
Taylor expanded in c around 0 60.1%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (+ (* a b) t_1) INFINITY)
(fma c i (+ (+ (* a b) (* x y)) (* z t)))
t_1)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((a * b) + t_1) <= ((double) INFINITY)) {
tmp = fma(c, i, (((a * b) + (x * y)) + (z * t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(Float64(a * b) + t_1) <= Inf) tmp = fma(c, i, Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(z * t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], Infinity], N[(c * i + N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b + t_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, \left(a \cdot b + x \cdot y\right) + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 98.8%
+-commutative98.8%
fma-def99.6%
+-commutative99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
fma-udef99.6%
fma-def99.6%
associate-+r+99.6%
Applied egg-rr99.6%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
Taylor expanded in a around 0 71.4%
+-commutative71.4%
*-commutative71.4%
fma-def71.4%
*-commutative71.4%
Applied egg-rr71.4%
Taylor expanded in c around 0 71.4%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1.35e+126)
(* x y)
(if (<= (* x y) -1.05e+73)
(* z t)
(if (<= (* x y) -4.4e-134)
(* a b)
(if (<= (* x y) -1.12e-299)
(* z t)
(if (<= (* x y) 8.6e-164)
(* c i)
(if (<= (* x y) 3.4e+95) (* a b) (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1.35e+126) {
tmp = x * y;
} else if ((x * y) <= -1.05e+73) {
tmp = z * t;
} else if ((x * y) <= -4.4e-134) {
tmp = a * b;
} else if ((x * y) <= -1.12e-299) {
tmp = z * t;
} else if ((x * y) <= 8.6e-164) {
tmp = c * i;
} else if ((x * y) <= 3.4e+95) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
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.35d+126)) then
tmp = x * y
else if ((x * y) <= (-1.05d+73)) then
tmp = z * t
else if ((x * y) <= (-4.4d-134)) then
tmp = a * b
else if ((x * y) <= (-1.12d-299)) then
tmp = z * t
else if ((x * y) <= 8.6d-164) then
tmp = c * i
else if ((x * y) <= 3.4d+95) then
tmp = a * b
else
tmp = x * y
end if
code = tmp
end function
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.35e+126) {
tmp = x * y;
} else if ((x * y) <= -1.05e+73) {
tmp = z * t;
} else if ((x * y) <= -4.4e-134) {
tmp = a * b;
} else if ((x * y) <= -1.12e-299) {
tmp = z * t;
} else if ((x * y) <= 8.6e-164) {
tmp = c * i;
} else if ((x * y) <= 3.4e+95) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1.35e+126: tmp = x * y elif (x * y) <= -1.05e+73: tmp = z * t elif (x * y) <= -4.4e-134: tmp = a * b elif (x * y) <= -1.12e-299: tmp = z * t elif (x * y) <= 8.6e-164: tmp = c * i elif (x * y) <= 3.4e+95: tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1.35e+126) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.05e+73) tmp = Float64(z * t); elseif (Float64(x * y) <= -4.4e-134) tmp = Float64(a * b); elseif (Float64(x * y) <= -1.12e-299) tmp = Float64(z * t); elseif (Float64(x * y) <= 8.6e-164) tmp = Float64(c * i); elseif (Float64(x * y) <= 3.4e+95) tmp = Float64(a * b); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1.35e+126) tmp = x * y; elseif ((x * y) <= -1.05e+73) tmp = z * t; elseif ((x * y) <= -4.4e-134) tmp = a * b; elseif ((x * y) <= -1.12e-299) tmp = z * t; elseif ((x * y) <= 8.6e-164) tmp = c * i; elseif ((x * y) <= 3.4e+95) tmp = a * b; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1.35e+126], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.05e+73], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.4e-134], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.12e-299], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.6e-164], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.4e+95], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.35 \cdot 10^{+126}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{+73}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -4.4 \cdot 10^{-134}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq -1.12 \cdot 10^{-299}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 8.6 \cdot 10^{-164}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 3.4 \cdot 10^{+95}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.35000000000000001e126 or 3.40000000000000022e95 < (*.f64 x y) Initial program 94.2%
Taylor expanded in z around 0 87.3%
+-commutative87.3%
*-commutative87.3%
fma-def88.5%
Applied egg-rr88.5%
Taylor expanded in y around inf 69.0%
if -1.35000000000000001e126 < (*.f64 x y) < -1.0500000000000001e73 or -4.3999999999999999e-134 < (*.f64 x y) < -1.11999999999999998e-299Initial program 91.2%
Taylor expanded in z around inf 72.3%
+-commutative72.3%
*-commutative72.3%
fma-def72.3%
*-commutative72.3%
Applied egg-rr72.3%
Taylor expanded in i around 0 49.4%
if -1.0500000000000001e73 < (*.f64 x y) < -4.3999999999999999e-134 or 8.5999999999999996e-164 < (*.f64 x y) < 3.40000000000000022e95Initial program 100.0%
Taylor expanded in z around 0 77.6%
+-commutative77.6%
*-commutative77.6%
fma-def77.6%
Applied egg-rr77.6%
Taylor expanded in a around inf 42.7%
if -1.11999999999999998e-299 < (*.f64 x y) < 8.5999999999999996e-164Initial program 96.4%
Taylor expanded in c around inf 50.2%
Final simplification54.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -8e+112)
(* a b)
(if (<= (* a b) -1250.0)
(* z t)
(if (<= (* a b) -6e-66)
(* c i)
(if (<= (* a b) -3.4e-181)
(* z t)
(if (<= (* a b) 9.2e+46) (* c i) (* a b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -8e+112) {
tmp = a * b;
} else if ((a * b) <= -1250.0) {
tmp = z * t;
} else if ((a * b) <= -6e-66) {
tmp = c * i;
} else if ((a * b) <= -3.4e-181) {
tmp = z * t;
} else if ((a * b) <= 9.2e+46) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
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) <= (-8d+112)) then
tmp = a * b
else if ((a * b) <= (-1250.0d0)) then
tmp = z * t
else if ((a * b) <= (-6d-66)) then
tmp = c * i
else if ((a * b) <= (-3.4d-181)) then
tmp = z * t
else if ((a * b) <= 9.2d+46) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
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) <= -8e+112) {
tmp = a * b;
} else if ((a * b) <= -1250.0) {
tmp = z * t;
} else if ((a * b) <= -6e-66) {
tmp = c * i;
} else if ((a * b) <= -3.4e-181) {
tmp = z * t;
} else if ((a * b) <= 9.2e+46) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -8e+112: tmp = a * b elif (a * b) <= -1250.0: tmp = z * t elif (a * b) <= -6e-66: tmp = c * i elif (a * b) <= -3.4e-181: tmp = z * t elif (a * b) <= 9.2e+46: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -8e+112) tmp = Float64(a * b); elseif (Float64(a * b) <= -1250.0) tmp = Float64(z * t); elseif (Float64(a * b) <= -6e-66) tmp = Float64(c * i); elseif (Float64(a * b) <= -3.4e-181) tmp = Float64(z * t); elseif (Float64(a * b) <= 9.2e+46) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -8e+112) tmp = a * b; elseif ((a * b) <= -1250.0) tmp = z * t; elseif ((a * b) <= -6e-66) tmp = c * i; elseif ((a * b) <= -3.4e-181) tmp = z * t; elseif ((a * b) <= 9.2e+46) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -8e+112], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1250.0], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -6e-66], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3.4e-181], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 9.2e+46], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8 \cdot 10^{+112}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1250:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -6 \cdot 10^{-66}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -3.4 \cdot 10^{-181}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 9.2 \cdot 10^{+46}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -7.9999999999999994e112 or 9.2000000000000002e46 < (*.f64 a b) Initial program 90.3%
Taylor expanded in z around 0 80.2%
+-commutative80.2%
*-commutative80.2%
fma-def81.2%
Applied egg-rr81.2%
Taylor expanded in a around inf 64.7%
if -7.9999999999999994e112 < (*.f64 a b) < -1250 or -6.0000000000000004e-66 < (*.f64 a b) < -3.4e-181Initial program 100.0%
Taylor expanded in z around inf 47.2%
+-commutative47.2%
*-commutative47.2%
fma-def47.2%
*-commutative47.2%
Applied egg-rr47.2%
Taylor expanded in i around 0 37.1%
if -1250 < (*.f64 a b) < -6.0000000000000004e-66 or -3.4e-181 < (*.f64 a b) < 9.2000000000000002e46Initial program 99.9%
Taylor expanded in c around inf 44.5%
Final simplification51.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= (* c i) -1.6e+27)
(+ (* z t) (* c i))
(if (<= (* c i) -2.6e-195)
t_1
(if (<= (* c i) 1.05e-148)
(+ (* x y) (* z t))
(if (<= (* c i) 1.6e+160) t_1 (+ (* a b) (* 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);
double tmp;
if ((c * i) <= -1.6e+27) {
tmp = (z * t) + (c * i);
} else if ((c * i) <= -2.6e-195) {
tmp = t_1;
} else if ((c * i) <= 1.05e-148) {
tmp = (x * y) + (z * t);
} else if ((c * i) <= 1.6e+160) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
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) + (x * y)
if ((c * i) <= (-1.6d+27)) then
tmp = (z * t) + (c * i)
else if ((c * i) <= (-2.6d-195)) then
tmp = t_1
else if ((c * i) <= 1.05d-148) then
tmp = (x * y) + (z * t)
else if ((c * i) <= 1.6d+160) then
tmp = t_1
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
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);
double tmp;
if ((c * i) <= -1.6e+27) {
tmp = (z * t) + (c * i);
} else if ((c * i) <= -2.6e-195) {
tmp = t_1;
} else if ((c * i) <= 1.05e-148) {
tmp = (x * y) + (z * t);
} else if ((c * i) <= 1.6e+160) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) tmp = 0 if (c * i) <= -1.6e+27: tmp = (z * t) + (c * i) elif (c * i) <= -2.6e-195: tmp = t_1 elif (c * i) <= 1.05e-148: tmp = (x * y) + (z * t) elif (c * i) <= 1.6e+160: tmp = t_1 else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(c * i) <= -1.6e+27) tmp = Float64(Float64(z * t) + Float64(c * i)); elseif (Float64(c * i) <= -2.6e-195) tmp = t_1; elseif (Float64(c * i) <= 1.05e-148) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(c * i) <= 1.6e+160) tmp = t_1; else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); tmp = 0.0; if ((c * i) <= -1.6e+27) tmp = (z * t) + (c * i); elseif ((c * i) <= -2.6e-195) tmp = t_1; elseif ((c * i) <= 1.05e-148) tmp = (x * y) + (z * t); elseif ((c * i) <= 1.6e+160) tmp = t_1; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.6e+27], N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.6e-195], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.05e-148], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.6e+160], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;c \cdot i \leq -1.6 \cdot 10^{+27}:\\
\;\;\;\;z \cdot t + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -2.6 \cdot 10^{-195}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 1.05 \cdot 10^{-148}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 1.6 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.60000000000000008e27Initial program 98.2%
Taylor expanded in z around inf 76.2%
if -1.60000000000000008e27 < (*.f64 c i) < -2.6000000000000002e-195 or 1.05e-148 < (*.f64 c i) < 1.5999999999999999e160Initial program 97.8%
Taylor expanded in z around 0 82.9%
+-commutative82.9%
*-commutative82.9%
fma-def83.0%
Applied egg-rr83.0%
Taylor expanded in c around 0 72.4%
if -2.6000000000000002e-195 < (*.f64 c i) < 1.05e-148Initial program 95.6%
Taylor expanded in a around 0 79.1%
+-commutative79.1%
*-commutative79.1%
fma-def79.1%
*-commutative79.1%
Applied egg-rr79.1%
Taylor expanded in c around 0 79.1%
if 1.5999999999999999e160 < (*.f64 c i) Initial program 89.2%
Taylor expanded in a around inf 81.4%
Final simplification76.3%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ (+ (* a b) t_1) (* c i)))) (if (<= t_2 INFINITY) t_2 t_1)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = ((a * b) + t_1) + (c * i);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = ((a * b) + t_1) + (c * i);
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = ((a * b) + t_1) + (c * i) tmp = 0 if t_2 <= math.inf: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(Float64(Float64(a * b) + t_1) + Float64(c * i)) tmp = 0.0 if (t_2 <= Inf) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); t_2 = ((a * b) + t_1) + (c * i); tmp = 0.0; if (t_2 <= Inf) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], t$95$2, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := \left(a \cdot b + t_1\right) + c \cdot i\\
\mathbf{if}\;t_2 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around 0 60.0%
+-commutative60.0%
*-commutative60.0%
fma-def60.0%
*-commutative60.0%
Applied egg-rr60.0%
Taylor expanded in c around 0 60.1%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2e+129)
(+ (* a b) (* x y))
(if (<= (* x y) 4.4e+101)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2e+129) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 4.4e+101) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
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+129)) then
tmp = (a * b) + (x * y)
else if ((x * y) <= 4.4d+101) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (x * y) + (z * t)
end if
code = tmp
end function
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+129) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 4.4e+101) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2e+129: tmp = (a * b) + (x * y) elif (x * y) <= 4.4e+101: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (x * y) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2e+129) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(x * y) <= 4.4e+101) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -2e+129) tmp = (a * b) + (x * y); elseif ((x * y) <= 4.4e+101) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (x * y) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+129], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.4e+101], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+129}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 4.4 \cdot 10^{+101}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -2e129Initial program 97.5%
Taylor expanded in z around 0 92.5%
+-commutative92.5%
*-commutative92.5%
fma-def92.5%
Applied egg-rr92.5%
Taylor expanded in c around 0 81.0%
if -2e129 < (*.f64 x y) < 4.4000000000000001e101Initial program 97.1%
Taylor expanded in x around 0 90.1%
if 4.4000000000000001e101 < (*.f64 x y) Initial program 90.6%
Taylor expanded in a around 0 89.3%
+-commutative89.3%
*-commutative89.3%
fma-def89.3%
*-commutative89.3%
Applied egg-rr89.3%
Taylor expanded in c around 0 85.9%
Final simplification87.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1.6e+122)
(+ (+ (* a b) (* x y)) (* c i))
(if (<= (* x y) 2.15e+101)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1.6e+122) {
tmp = ((a * b) + (x * y)) + (c * i);
} else if ((x * y) <= 2.15e+101) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
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.6d+122)) then
tmp = ((a * b) + (x * y)) + (c * i)
else if ((x * y) <= 2.15d+101) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (x * y) + (z * t)
end if
code = tmp
end function
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.6e+122) {
tmp = ((a * b) + (x * y)) + (c * i);
} else if ((x * y) <= 2.15e+101) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1.6e+122: tmp = ((a * b) + (x * y)) + (c * i) elif (x * y) <= 2.15e+101: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (x * y) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1.6e+122) tmp = Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(c * i)); elseif (Float64(x * y) <= 2.15e+101) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1.6e+122) tmp = ((a * b) + (x * y)) + (c * i); elseif ((x * y) <= 2.15e+101) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (x * y) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1.6e+122], N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.15e+101], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.6 \cdot 10^{+122}:\\
\;\;\;\;\left(a \cdot b + x \cdot y\right) + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 2.15 \cdot 10^{+101}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -1.60000000000000006e122Initial program 97.5%
Taylor expanded in z around 0 92.5%
if -1.60000000000000006e122 < (*.f64 x y) < 2.15e101Initial program 97.1%
Taylor expanded in x around 0 90.1%
if 2.15e101 < (*.f64 x y) Initial program 90.6%
Taylor expanded in a around 0 89.3%
+-commutative89.3%
*-commutative89.3%
fma-def89.3%
*-commutative89.3%
Applied egg-rr89.3%
Taylor expanded in c around 0 85.9%
Final simplification89.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5.5e+123)
(+ (+ (* a b) (* x y)) (* c i))
(if (<= (* x y) 6.4e+91)
(+ (* c i) (+ (* a b) (* z t)))
(+ (+ (* x y) (* z t)) (* 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) <= -5.5e+123) {
tmp = ((a * b) + (x * y)) + (c * i);
} else if ((x * y) <= 6.4e+91) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = ((x * y) + (z * t)) + (c * i);
}
return tmp;
}
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) <= (-5.5d+123)) then
tmp = ((a * b) + (x * y)) + (c * i)
else if ((x * y) <= 6.4d+91) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = ((x * y) + (z * t)) + (c * i)
end if
code = tmp
end function
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) <= -5.5e+123) {
tmp = ((a * b) + (x * y)) + (c * i);
} else if ((x * y) <= 6.4e+91) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = ((x * y) + (z * t)) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -5.5e+123: tmp = ((a * b) + (x * y)) + (c * i) elif (x * y) <= 6.4e+91: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = ((x * y) + (z * t)) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5.5e+123) tmp = Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(c * i)); elseif (Float64(x * y) <= 6.4e+91) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -5.5e+123) tmp = ((a * b) + (x * y)) + (c * i); elseif ((x * y) <= 6.4e+91) tmp = (c * i) + ((a * b) + (z * t)); else tmp = ((x * y) + (z * t)) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5.5e+123], N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.4e+91], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.5 \cdot 10^{+123}:\\
\;\;\;\;\left(a \cdot b + x \cdot y\right) + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{+91}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -5.5000000000000002e123Initial program 97.5%
Taylor expanded in z around 0 92.5%
if -5.5000000000000002e123 < (*.f64 x y) < 6.39999999999999979e91Initial program 97.0%
Taylor expanded in x around 0 90.5%
if 6.39999999999999979e91 < (*.f64 x y) Initial program 91.2%
Taylor expanded in a around 0 90.0%
Final simplification90.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -4e+182) (not (<= (* x y) 3.8e+139))) (* x y) (+ (* a b) (* 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) <= -4e+182) || !((x * y) <= 3.8e+139)) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
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) <= (-4d+182)) .or. (.not. ((x * y) <= 3.8d+139))) then
tmp = x * y
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
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) <= -4e+182) || !((x * y) <= 3.8e+139)) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -4e+182) or not ((x * y) <= 3.8e+139): tmp = x * y else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -4e+182) || !(Float64(x * y) <= 3.8e+139)) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -4e+182) || ~(((x * y) <= 3.8e+139))) tmp = x * y; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -4e+182], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.8e+139]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+182} \lor \neg \left(x \cdot y \leq 3.8 \cdot 10^{+139}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -4.0000000000000003e182 or 3.79999999999999999e139 < (*.f64 x y) Initial program 93.2%
Taylor expanded in z around 0 86.4%
+-commutative86.4%
*-commutative86.4%
fma-def87.8%
Applied egg-rr87.8%
Taylor expanded in y around inf 74.0%
if -4.0000000000000003e182 < (*.f64 x y) < 3.79999999999999999e139Initial program 97.2%
Taylor expanded in a around inf 66.4%
Final simplification68.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -7.2e+31) (not (<= (* c i) 1.5e+159))) (+ (* a b) (* c i)) (+ (* a b) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -7.2e+31) || !((c * i) <= 1.5e+159)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
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) <= (-7.2d+31)) .or. (.not. ((c * i) <= 1.5d+159))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + (x * y)
end if
code = tmp
end function
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) <= -7.2e+31) || !((c * i) <= 1.5e+159)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -7.2e+31) or not ((c * i) <= 1.5e+159): tmp = (a * b) + (c * i) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -7.2e+31) || !(Float64(c * i) <= 1.5e+159)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -7.2e+31) || ~(((c * i) <= 1.5e+159))) tmp = (a * b) + (c * i); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -7.2e+31], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.5e+159]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -7.2 \cdot 10^{+31} \lor \neg \left(c \cdot i \leq 1.5 \cdot 10^{+159}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 c i) < -7.19999999999999992e31 or 1.5000000000000001e159 < (*.f64 c i) Initial program 94.5%
Taylor expanded in a around inf 77.2%
if -7.19999999999999992e31 < (*.f64 c i) < 1.5000000000000001e159Initial program 96.9%
Taylor expanded in z around 0 75.5%
+-commutative75.5%
*-commutative75.5%
fma-def75.5%
Applied egg-rr75.5%
Taylor expanded in c around 0 69.4%
Final simplification72.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -1.35e+27) (+ (* z t) (* c i)) (if (<= (* c i) 7.6e+158) (+ (* a b) (* x y)) (+ (* a b) (* 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.35e+27) {
tmp = (z * t) + (c * i);
} else if ((c * i) <= 7.6e+158) {
tmp = (a * b) + (x * y);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
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.35d+27)) then
tmp = (z * t) + (c * i)
else if ((c * i) <= 7.6d+158) then
tmp = (a * b) + (x * y)
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
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.35e+27) {
tmp = (z * t) + (c * i);
} else if ((c * i) <= 7.6e+158) {
tmp = (a * b) + (x * y);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.35e+27: tmp = (z * t) + (c * i) elif (c * i) <= 7.6e+158: tmp = (a * b) + (x * y) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1.35e+27) tmp = Float64(Float64(z * t) + Float64(c * i)); elseif (Float64(c * i) <= 7.6e+158) tmp = Float64(Float64(a * b) + Float64(x * y)); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -1.35e+27) tmp = (z * t) + (c * i); elseif ((c * i) <= 7.6e+158) tmp = (a * b) + (x * y); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1.35e+27], N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 7.6e+158], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.35 \cdot 10^{+27}:\\
\;\;\;\;z \cdot t + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 7.6 \cdot 10^{+158}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.3499999999999999e27Initial program 98.2%
Taylor expanded in z around inf 76.2%
if -1.3499999999999999e27 < (*.f64 c i) < 7.5999999999999997e158Initial program 96.9%
Taylor expanded in z around 0 75.9%
+-commutative75.9%
*-commutative75.9%
fma-def76.0%
Applied egg-rr76.0%
Taylor expanded in c around 0 69.8%
if 7.5999999999999997e158 < (*.f64 c i) Initial program 89.2%
Taylor expanded in a around inf 81.4%
Final simplification72.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.1e+110) (not (<= (* a b) 9e+46))) (* a b) (* 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.1e+110) || !((a * b) <= 9e+46)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
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.1d+110)) .or. (.not. ((a * b) <= 9d+46))) then
tmp = a * b
else
tmp = c * i
end if
code = tmp
end function
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.1e+110) || !((a * b) <= 9e+46)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.1e+110) or not ((a * b) <= 9e+46): tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1.1e+110) || !(Float64(a * b) <= 9e+46)) tmp = Float64(a * b); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -1.1e+110) || ~(((a * b) <= 9e+46))) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.1e+110], N[Not[LessEqual[N[(a * b), $MachinePrecision], 9e+46]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.1 \cdot 10^{+110} \lor \neg \left(a \cdot b \leq 9 \cdot 10^{+46}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.09999999999999996e110 or 9.00000000000000019e46 < (*.f64 a b) Initial program 90.4%
Taylor expanded in z around 0 79.4%
+-commutative79.4%
*-commutative79.4%
fma-def80.4%
Applied egg-rr80.4%
Taylor expanded in a around inf 64.1%
if -1.09999999999999996e110 < (*.f64 a b) < 9.00000000000000019e46Initial program 100.0%
Taylor expanded in c around inf 37.5%
Final simplification48.3%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
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
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.1%
Taylor expanded in z around 0 77.9%
+-commutative77.9%
*-commutative77.9%
fma-def78.3%
Applied egg-rr78.3%
Taylor expanded in a around inf 29.9%
Final simplification29.9%
herbie shell --seed 2024020
(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)))