
(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 17 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 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (fma c i (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(c, i, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(c, i, Float64(x * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(c * i + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, x \cdot y\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in z around 0 33.3%
Taylor expanded in a around 0 50.1%
fma-define66.8%
Simplified66.8%
Final simplification99.2%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-define98.4%
associate-+l+98.4%
fma-define98.4%
fma-define98.8%
Simplified98.8%
Final simplification98.8%
(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 97.6%
+-commutative97.6%
fma-define98.4%
+-commutative98.4%
fma-define98.8%
fma-define98.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 97.6%
+-commutative97.6%
fma-define98.4%
associate-+l+98.4%
fma-define98.4%
fma-define98.8%
Simplified98.8%
fma-undefine98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (+ (+ (* a b) (* 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, (((a * b) + (x * y)) + (z * t)));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(z * t))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \left(a \cdot b + x \cdot y\right) + z \cdot t\right)
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-define98.4%
+-commutative98.4%
fma-define98.8%
fma-define98.8%
Simplified98.8%
fma-undefine98.4%
fma-define98.4%
associate-+r+98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.5e+42)
(* a b)
(if (<= (* a b) -2.1e-145)
(* c i)
(if (<= (* a b) -4e-177)
(* x y)
(if (<= (* a b) 0.0)
(* z t)
(if (<= (* a b) 1.5e-60)
(* x y)
(if (<= (* a b) 8.2e+117) (* z t) (* 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) <= -2.5e+42) {
tmp = a * b;
} else if ((a * b) <= -2.1e-145) {
tmp = c * i;
} else if ((a * b) <= -4e-177) {
tmp = x * y;
} else if ((a * b) <= 0.0) {
tmp = z * t;
} else if ((a * b) <= 1.5e-60) {
tmp = x * y;
} else if ((a * b) <= 8.2e+117) {
tmp = z * t;
} 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) <= (-2.5d+42)) then
tmp = a * b
else if ((a * b) <= (-2.1d-145)) then
tmp = c * i
else if ((a * b) <= (-4d-177)) then
tmp = x * y
else if ((a * b) <= 0.0d0) then
tmp = z * t
else if ((a * b) <= 1.5d-60) then
tmp = x * y
else if ((a * b) <= 8.2d+117) then
tmp = z * t
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) <= -2.5e+42) {
tmp = a * b;
} else if ((a * b) <= -2.1e-145) {
tmp = c * i;
} else if ((a * b) <= -4e-177) {
tmp = x * y;
} else if ((a * b) <= 0.0) {
tmp = z * t;
} else if ((a * b) <= 1.5e-60) {
tmp = x * y;
} else if ((a * b) <= 8.2e+117) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.5e+42: tmp = a * b elif (a * b) <= -2.1e-145: tmp = c * i elif (a * b) <= -4e-177: tmp = x * y elif (a * b) <= 0.0: tmp = z * t elif (a * b) <= 1.5e-60: tmp = x * y elif (a * b) <= 8.2e+117: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.5e+42) tmp = Float64(a * b); elseif (Float64(a * b) <= -2.1e-145) tmp = Float64(c * i); elseif (Float64(a * b) <= -4e-177) tmp = Float64(x * y); elseif (Float64(a * b) <= 0.0) tmp = Float64(z * t); elseif (Float64(a * b) <= 1.5e-60) tmp = Float64(x * y); elseif (Float64(a * b) <= 8.2e+117) tmp = Float64(z * t); 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) <= -2.5e+42) tmp = a * b; elseif ((a * b) <= -2.1e-145) tmp = c * i; elseif ((a * b) <= -4e-177) tmp = x * y; elseif ((a * b) <= 0.0) tmp = z * t; elseif ((a * b) <= 1.5e-60) tmp = x * y; elseif ((a * b) <= 8.2e+117) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.5e+42], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2.1e-145], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -4e-177], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 0.0], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.5e-60], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 8.2e+117], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.5 \cdot 10^{+42}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -2.1 \cdot 10^{-145}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -4 \cdot 10^{-177}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 0:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.5 \cdot 10^{-60}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 8.2 \cdot 10^{+117}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.50000000000000003e42 or 8.1999999999999999e117 < (*.f64 a b) Initial program 95.9%
Taylor expanded in a around inf 64.2%
if -2.50000000000000003e42 < (*.f64 a b) < -2.09999999999999991e-145Initial program 100.0%
Taylor expanded in c around inf 39.5%
if -2.09999999999999991e-145 < (*.f64 a b) < -3.99999999999999981e-177 or 0.0 < (*.f64 a b) < 1.50000000000000009e-60Initial program 100.0%
Taylor expanded in x around inf 65.0%
if -3.99999999999999981e-177 < (*.f64 a b) < 0.0 or 1.50000000000000009e-60 < (*.f64 a b) < 8.1999999999999999e117Initial program 97.3%
Taylor expanded in z around inf 45.7%
Final simplification55.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -1.56e+112)
(* x y)
(if (<= (* x y) 2.2e-81)
t_1
(if (<= (* x y) 1.6e-45)
(* z t)
(if (<= (* x y) 3.4e+130) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.56e+112) {
tmp = x * y;
} else if ((x * y) <= 2.2e-81) {
tmp = t_1;
} else if ((x * y) <= 1.6e-45) {
tmp = z * t;
} else if ((x * y) <= 3.4e+130) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((x * y) <= (-1.56d+112)) then
tmp = x * y
else if ((x * y) <= 2.2d-81) then
tmp = t_1
else if ((x * y) <= 1.6d-45) then
tmp = z * t
else if ((x * y) <= 3.4d+130) then
tmp = t_1
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 t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.56e+112) {
tmp = x * y;
} else if ((x * y) <= 2.2e-81) {
tmp = t_1;
} else if ((x * y) <= 1.6e-45) {
tmp = z * t;
} else if ((x * y) <= 3.4e+130) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (x * y) <= -1.56e+112: tmp = x * y elif (x * y) <= 2.2e-81: tmp = t_1 elif (x * y) <= 1.6e-45: tmp = z * t elif (x * y) <= 3.4e+130: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -1.56e+112) tmp = Float64(x * y); elseif (Float64(x * y) <= 2.2e-81) tmp = t_1; elseif (Float64(x * y) <= 1.6e-45) tmp = Float64(z * t); elseif (Float64(x * y) <= 3.4e+130) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); tmp = 0.0; if ((x * y) <= -1.56e+112) tmp = x * y; elseif ((x * y) <= 2.2e-81) tmp = t_1; elseif ((x * y) <= 1.6e-45) tmp = z * t; elseif ((x * y) <= 3.4e+130) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.56e+112], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-81], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.6e-45], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.4e+130], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.56 \cdot 10^{+112}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{-45}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 3.4 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.55999999999999992e112 or 3.4000000000000001e130 < (*.f64 x y) Initial program 96.4%
Taylor expanded in x around inf 72.2%
if -1.55999999999999992e112 < (*.f64 x y) < 2.1999999999999999e-81 or 1.60000000000000004e-45 < (*.f64 x y) < 3.4000000000000001e130Initial program 98.1%
Taylor expanded in z around 0 69.4%
Taylor expanded in x around 0 62.3%
if 2.1999999999999999e-81 < (*.f64 x y) < 1.60000000000000004e-45Initial program 100.0%
Taylor expanded in z around inf 70.1%
Final simplification65.9%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (+ (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a * b) + (x * y);
}
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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\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 z around 0 33.3%
+-commutative33.3%
*-commutative33.3%
fma-define33.3%
Applied egg-rr33.3%
Taylor expanded in c around 0 66.7%
Final simplification99.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -3.9e+248) (not (<= (* c i) 9e+200))) (+ (* x y) (* c i)) (+ (* a b) (+ (* 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 (((c * i) <= -3.9e+248) || !((c * i) <= 9e+200)) {
tmp = (x * y) + (c * i);
} else {
tmp = (a * b) + ((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 (((c * i) <= (-3.9d+248)) .or. (.not. ((c * i) <= 9d+200))) then
tmp = (x * y) + (c * i)
else
tmp = (a * b) + ((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 (((c * i) <= -3.9e+248) || !((c * i) <= 9e+200)) {
tmp = (x * y) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -3.9e+248) or not ((c * i) <= 9e+200): tmp = (x * y) + (c * i) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -3.9e+248) || !(Float64(c * i) <= 9e+200)) tmp = Float64(Float64(x * y) + Float64(c * i)); else tmp = Float64(Float64(a * b) + 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 (((c * i) <= -3.9e+248) || ~(((c * i) <= 9e+200))) tmp = (x * y) + (c * i); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -3.9e+248], N[Not[LessEqual[N[(c * i), $MachinePrecision], 9e+200]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.9 \cdot 10^{+248} \lor \neg \left(c \cdot i \leq 9 \cdot 10^{+200}\right):\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -3.8999999999999999e248 or 8.99999999999999939e200 < (*.f64 c i) Initial program 91.1%
Taylor expanded in z around 0 91.6%
Taylor expanded in a around 0 91.9%
if -3.8999999999999999e248 < (*.f64 c i) < 8.99999999999999939e200Initial program 99.5%
Taylor expanded in c around 0 94.0%
Final simplification93.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -3.8e+121)
(+ (* c i) (+ (* a b) (* z t)))
(if (<= (* c i) 2.7e+195)
(+ (* a b) (+ (* x y) (* z t)))
(+ (* x y) (* 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.8e+121) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((c * i) <= 2.7e+195) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (x * y) + (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) <= (-3.8d+121)) then
tmp = (c * i) + ((a * b) + (z * t))
else if ((c * i) <= 2.7d+195) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (x * y) + (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) <= -3.8e+121) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((c * i) <= 2.7e+195) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -3.8e+121: tmp = (c * i) + ((a * b) + (z * t)) elif (c * i) <= 2.7e+195: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -3.8e+121) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); elseif (Float64(c * i) <= 2.7e+195) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(x * y) + 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) <= -3.8e+121) tmp = (c * i) + ((a * b) + (z * t)); elseif ((c * i) <= 2.7e+195) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -3.8e+121], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.7e+195], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+121}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{elif}\;c \cdot i \leq 2.7 \cdot 10^{+195}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -3.8e121Initial program 94.3%
Taylor expanded in x around 0 88.8%
if -3.8e121 < (*.f64 c i) < 2.7000000000000002e195Initial program 99.4%
Taylor expanded in c around 0 95.6%
if 2.7000000000000002e195 < (*.f64 c i) Initial program 91.4%
Taylor expanded in z around 0 92.3%
Taylor expanded in a around 0 89.9%
Final simplification93.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -5.4e+121)
(+ (* c i) (+ (* a b) (* z t)))
(if (<= (* c i) 1.5e+153)
(+ (* a b) (+ (* x y) (* z t)))
(+ (+ (* a b) (* x y)) (* 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) <= -5.4e+121) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((c * i) <= 1.5e+153) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = ((a * b) + (x * y)) + (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) <= (-5.4d+121)) then
tmp = (c * i) + ((a * b) + (z * t))
else if ((c * i) <= 1.5d+153) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = ((a * b) + (x * y)) + (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) <= -5.4e+121) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((c * i) <= 1.5e+153) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = ((a * b) + (x * y)) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -5.4e+121: tmp = (c * i) + ((a * b) + (z * t)) elif (c * i) <= 1.5e+153: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = ((a * b) + (x * y)) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -5.4e+121) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); elseif (Float64(c * i) <= 1.5e+153) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(Float64(a * b) + Float64(x * y)) + 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) <= -5.4e+121) tmp = (c * i) + ((a * b) + (z * t)); elseif ((c * i) <= 1.5e+153) tmp = (a * b) + ((x * y) + (z * t)); else tmp = ((a * b) + (x * y)) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -5.4e+121], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.5e+153], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5.4 \cdot 10^{+121}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{+153}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot b + x \cdot y\right) + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -5.4000000000000004e121Initial program 94.3%
Taylor expanded in x around 0 88.8%
if -5.4000000000000004e121 < (*.f64 c i) < 1.50000000000000009e153Initial program 99.4%
Taylor expanded in c around 0 96.1%
if 1.50000000000000009e153 < (*.f64 c i) Initial program 92.3%
Taylor expanded in z around 0 90.6%
Final simplification94.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -9e+102) (not (<= (* x y) 2.15e+39))) (* x y) (+ (* a b) (* 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) <= -9e+102) || !((x * y) <= 2.15e+39)) {
tmp = x * y;
} else {
tmp = (a * b) + (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) <= (-9d+102)) .or. (.not. ((x * y) <= 2.15d+39))) then
tmp = x * y
else
tmp = (a * b) + (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) <= -9e+102) || !((x * y) <= 2.15e+39)) {
tmp = x * y;
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -9e+102) or not ((x * y) <= 2.15e+39): tmp = x * y else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -9e+102) || !(Float64(x * y) <= 2.15e+39)) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) + 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) <= -9e+102) || ~(((x * y) <= 2.15e+39))) tmp = x * y; else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -9e+102], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.15e+39]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9 \cdot 10^{+102} \lor \neg \left(x \cdot y \leq 2.15 \cdot 10^{+39}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -9.00000000000000042e102 or 2.15e39 < (*.f64 x y) Initial program 96.8%
Taylor expanded in x around inf 68.2%
if -9.00000000000000042e102 < (*.f64 x y) < 2.15e39Initial program 98.1%
Taylor expanded in x around 0 92.7%
Taylor expanded in c around 0 72.9%
Final simplification71.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -7.5e+89) (not (<= (* x y) 6.4e+28))) (+ (* a b) (* x y)) (+ (* a b) (* 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) <= -7.5e+89) || !((x * y) <= 6.4e+28)) {
tmp = (a * b) + (x * y);
} else {
tmp = (a * b) + (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) <= (-7.5d+89)) .or. (.not. ((x * y) <= 6.4d+28))) then
tmp = (a * b) + (x * y)
else
tmp = (a * b) + (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) <= -7.5e+89) || !((x * y) <= 6.4e+28)) {
tmp = (a * b) + (x * y);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -7.5e+89) or not ((x * y) <= 6.4e+28): tmp = (a * b) + (x * y) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -7.5e+89) || !(Float64(x * y) <= 6.4e+28)) tmp = Float64(Float64(a * b) + Float64(x * y)); else tmp = Float64(Float64(a * b) + 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) <= -7.5e+89) || ~(((x * y) <= 6.4e+28))) tmp = (a * b) + (x * y); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -7.5e+89], N[Not[LessEqual[N[(x * y), $MachinePrecision], 6.4e+28]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{+89} \lor \neg \left(x \cdot y \leq 6.4 \cdot 10^{+28}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -7.49999999999999947e89 or 6.4000000000000001e28 < (*.f64 x y) Initial program 96.9%
Taylor expanded in z around 0 91.0%
+-commutative91.0%
*-commutative91.0%
fma-define91.0%
Applied egg-rr91.0%
Taylor expanded in c around 0 76.3%
if -7.49999999999999947e89 < (*.f64 x y) < 6.4000000000000001e28Initial program 98.1%
Taylor expanded in x around 0 93.1%
Taylor expanded in c around 0 72.8%
Final simplification74.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5.5e+102) (not (<= (* x y) 1.65e+28))) (+ (* x y) (* c i)) (+ (* a b) (* 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) <= -5.5e+102) || !((x * y) <= 1.65e+28)) {
tmp = (x * y) + (c * i);
} else {
tmp = (a * b) + (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) <= (-5.5d+102)) .or. (.not. ((x * y) <= 1.65d+28))) then
tmp = (x * y) + (c * i)
else
tmp = (a * b) + (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) <= -5.5e+102) || !((x * y) <= 1.65e+28)) {
tmp = (x * y) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5.5e+102) or not ((x * y) <= 1.65e+28): tmp = (x * y) + (c * i) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -5.5e+102) || !(Float64(x * y) <= 1.65e+28)) tmp = Float64(Float64(x * y) + Float64(c * i)); else tmp = Float64(Float64(a * b) + 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) <= -5.5e+102) || ~(((x * y) <= 1.65e+28))) tmp = (x * y) + (c * i); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5.5e+102], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.65e+28]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.5 \cdot 10^{+102} \lor \neg \left(x \cdot y \leq 1.65 \cdot 10^{+28}\right):\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -5.49999999999999981e102 or 1.65e28 < (*.f64 x y) Initial program 96.8%
Taylor expanded in z around 0 91.6%
Taylor expanded in a around 0 83.9%
if -5.49999999999999981e102 < (*.f64 x y) < 1.65e28Initial program 98.1%
Taylor expanded in x around 0 92.7%
Taylor expanded in c around 0 72.9%
Final simplification76.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -3.9e+248) (not (<= (* c i) 2.1e+191))) (* 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 (((c * i) <= -3.9e+248) || !((c * i) <= 2.1e+191)) {
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 (((c * i) <= (-3.9d+248)) .or. (.not. ((c * i) <= 2.1d+191))) 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 (((c * i) <= -3.9e+248) || !((c * i) <= 2.1e+191)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -3.9e+248) or not ((c * i) <= 2.1e+191): tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -3.9e+248) || !(Float64(c * i) <= 2.1e+191)) 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 (((c * i) <= -3.9e+248) || ~(((c * i) <= 2.1e+191))) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -3.9e+248], N[Not[LessEqual[N[(c * i), $MachinePrecision], 2.1e+191]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.9 \cdot 10^{+248} \lor \neg \left(c \cdot i \leq 2.1 \cdot 10^{+191}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -3.8999999999999999e248 or 2.1000000000000001e191 < (*.f64 c i) Initial program 91.1%
Taylor expanded in c around inf 84.9%
if -3.8999999999999999e248 < (*.f64 c i) < 2.1000000000000001e191Initial program 99.5%
Taylor expanded in a around inf 33.3%
Final simplification44.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -7.5e+33) (not (<= (* a b) 4.6e+119))) (* a b) (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -7.5e+33) || !((a * b) <= 4.6e+119)) {
tmp = a * b;
} else {
tmp = 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 (((a * b) <= (-7.5d+33)) .or. (.not. ((a * b) <= 4.6d+119))) then
tmp = a * b
else
tmp = 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 (((a * b) <= -7.5e+33) || !((a * b) <= 4.6e+119)) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -7.5e+33) or not ((a * b) <= 4.6e+119): tmp = a * b else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -7.5e+33) || !(Float64(a * b) <= 4.6e+119)) tmp = Float64(a * b); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -7.5e+33) || ~(((a * b) <= 4.6e+119))) tmp = a * b; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -7.5e+33], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.6e+119]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -7.5 \cdot 10^{+33} \lor \neg \left(a \cdot b \leq 4.6 \cdot 10^{+119}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -7.50000000000000046e33 or 4.6000000000000001e119 < (*.f64 a b) Initial program 96.0%
Taylor expanded in a around inf 63.0%
if -7.50000000000000046e33 < (*.f64 a b) < 4.6000000000000001e119Initial program 98.7%
Taylor expanded in z around inf 38.3%
Final simplification48.0%
(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 97.6%
Taylor expanded in a around inf 28.4%
Final simplification28.4%
herbie shell --seed 2024043
(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)))