
(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 (if (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (fma c i (+ (* z t) (+ (* a b) (* x y)))) (fma z t (fma 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) + ((x * y) + (z * t))) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(c, i, ((z * t) + ((a * b) + (x * y))));
} else {
tmp = fma(z, t, fma(a, b, (c * i)));
}
return tmp;
}
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, Float64(Float64(z * t) + Float64(Float64(a * b) + Float64(x * y)))); else tmp = fma(z, t, fma(a, b, Float64(c * i))); end return tmp end
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[(N[(z * t), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\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, z \cdot t + \left(a \cdot b + x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(a, b, c \cdot i\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-def100.0%
+-commutative100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-def100.0%
associate-+r+100.0%
Applied egg-rr100.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 x around 0 45.5%
associate-+r+45.5%
fma-udef63.6%
*-commutative63.6%
+-commutative63.6%
fma-def72.7%
Simplified72.7%
Final simplification98.8%
(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 95.7%
+-commutative95.7%
fma-def96.1%
associate-+l+96.1%
fma-def98.0%
fma-def98.4%
Simplified98.4%
Final simplification98.4%
(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 95.7%
+-commutative95.7%
fma-def96.1%
+-commutative96.1%
fma-def96.5%
fma-def97.6%
Simplified97.6%
Final simplification97.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (fma c i (+ (* z t) (+ (* a b) (* x y)))) (fma c i (* 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) + ((x * y) + (z * t))) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(c, i, ((z * t) + ((a * b) + (x * y))));
} else {
tmp = fma(c, i, (z * t));
}
return tmp;
}
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, Float64(Float64(z * t) + Float64(Float64(a * b) + Float64(x * y)))); else tmp = fma(c, i, Float64(z * t)); end return tmp end
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[(N[(z * t), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\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, z \cdot t + \left(a \cdot b + x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
+-commutative100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-def100.0%
associate-+r+100.0%
Applied egg-rr100.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-def9.1%
+-commutative9.1%
fma-def18.2%
fma-def45.5%
Simplified45.5%
fma-udef36.4%
fma-def9.1%
associate-+r+9.1%
Applied egg-rr9.1%
Taylor expanded in z around inf 64.1%
Final simplification98.4%
(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 (fma c i (* z t)))))
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 = fma(c, i, (z * t));
}
return tmp;
}
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 = fma(c, i, Float64(z * t)); end return tmp end
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[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\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}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
+-commutative0.0%
fma-def9.1%
+-commutative9.1%
fma-def18.2%
fma-def45.5%
Simplified45.5%
fma-udef36.4%
fma-def9.1%
associate-+r+9.1%
Applied egg-rr9.1%
Taylor expanded in z around inf 64.1%
Final simplification98.4%
(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 (+ (* c i) (* z t)))))
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 = (c * i) + (z * t);
}
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 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
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 = (c * i) + (z * t) return tmp
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(Float64(c * i) + Float64(z * t)); end return tmp end
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 = (c * i) + (z * t); end tmp_2 = tmp; end
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[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\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}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\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 27.3%
Taylor expanded in x around 0 55.1%
Final simplification98.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -3e-18)
(* c i)
(if (<= (* c i) 0.0)
(* z t)
(if (<= (* c i) 1e-174)
(* a b)
(if (<= (* c i) 4.1e+181) (* 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 ((c * i) <= -3e-18) {
tmp = c * i;
} else if ((c * i) <= 0.0) {
tmp = z * t;
} else if ((c * i) <= 1e-174) {
tmp = a * b;
} else if ((c * i) <= 4.1e+181) {
tmp = z * t;
} 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 ((c * i) <= (-3d-18)) then
tmp = c * i
else if ((c * i) <= 0.0d0) then
tmp = z * t
else if ((c * i) <= 1d-174) then
tmp = a * b
else if ((c * i) <= 4.1d+181) then
tmp = z * t
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 ((c * i) <= -3e-18) {
tmp = c * i;
} else if ((c * i) <= 0.0) {
tmp = z * t;
} else if ((c * i) <= 1e-174) {
tmp = a * b;
} else if ((c * i) <= 4.1e+181) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -3e-18: tmp = c * i elif (c * i) <= 0.0: tmp = z * t elif (c * i) <= 1e-174: tmp = a * b elif (c * i) <= 4.1e+181: tmp = z * t else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -3e-18) tmp = Float64(c * i); elseif (Float64(c * i) <= 0.0) tmp = Float64(z * t); elseif (Float64(c * i) <= 1e-174) tmp = Float64(a * b); elseif (Float64(c * i) <= 4.1e+181) tmp = Float64(z * t); 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 ((c * i) <= -3e-18) tmp = c * i; elseif ((c * i) <= 0.0) tmp = z * t; elseif ((c * i) <= 1e-174) tmp = a * b; elseif ((c * i) <= 4.1e+181) tmp = z * t; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -3e-18], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 0.0], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e-174], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.1e+181], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3 \cdot 10^{-18}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 0:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 10^{-174}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 4.1 \cdot 10^{+181}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.99999999999999983e-18 or 4.10000000000000018e181 < (*.f64 c i) Initial program 95.3%
Taylor expanded in c around inf 64.5%
if -2.99999999999999983e-18 < (*.f64 c i) < 0.0 or 1e-174 < (*.f64 c i) < 4.10000000000000018e181Initial program 95.4%
Taylor expanded in x around 0 71.5%
+-commutative71.5%
*-commutative71.5%
fma-def72.1%
Simplified72.1%
Taylor expanded in z around inf 43.6%
if 0.0 < (*.f64 c i) < 1e-174Initial program 100.0%
Taylor expanded in x around 0 73.1%
+-commutative73.1%
*-commutative73.1%
fma-def73.1%
Simplified73.1%
Taylor expanded in a around inf 73.1%
Final simplification52.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -3.7e+93) (not (<= (* a b) 1.08e+175))) (+ (* a b) (* z t)) (+ (* c i) (+ (* 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 (((a * b) <= -3.7e+93) || !((a * b) <= 1.08e+175)) {
tmp = (a * b) + (z * t);
} else {
tmp = (c * i) + ((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 (((a * b) <= (-3.7d+93)) .or. (.not. ((a * b) <= 1.08d+175))) then
tmp = (a * b) + (z * t)
else
tmp = (c * i) + ((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 (((a * b) <= -3.7e+93) || !((a * b) <= 1.08e+175)) {
tmp = (a * b) + (z * t);
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -3.7e+93) or not ((a * b) <= 1.08e+175): tmp = (a * b) + (z * t) else: tmp = (c * i) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -3.7e+93) || !(Float64(a * b) <= 1.08e+175)) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = Float64(Float64(c * i) + 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 (((a * b) <= -3.7e+93) || ~(((a * b) <= 1.08e+175))) tmp = (a * b) + (z * t); else tmp = (c * i) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -3.7e+93], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.08e+175]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -3.7 \cdot 10^{+93} \lor \neg \left(a \cdot b \leq 1.08 \cdot 10^{+175}\right):\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -3.69999999999999987e93 or 1.08e175 < (*.f64 a b) Initial program 86.4%
Taylor expanded in x around 0 86.4%
+-commutative86.4%
*-commutative86.4%
fma-def88.1%
Simplified88.1%
Taylor expanded in c around 0 86.3%
if -3.69999999999999987e93 < (*.f64 a b) < 1.08e175Initial program 98.5%
Taylor expanded in a around 0 90.6%
Final simplification89.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -2.5e-7) (not (<= (* a b) 2.5e+38))) (+ (* c i) (+ (* a b) (* z t))) (+ (* c i) (+ (* 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 (((a * b) <= -2.5e-7) || !((a * b) <= 2.5e+38)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((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 (((a * b) <= (-2.5d-7)) .or. (.not. ((a * b) <= 2.5d+38))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((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 (((a * b) <= -2.5e-7) || !((a * b) <= 2.5e+38)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -2.5e-7) or not ((a * b) <= 2.5e+38): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -2.5e-7) || !(Float64(a * b) <= 2.5e+38)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -2.5e-7) || ~(((a * b) <= 2.5e+38))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -2.5e-7], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.5e+38]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.5 \cdot 10^{-7} \lor \neg \left(a \cdot b \leq 2.5 \cdot 10^{+38}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.49999999999999989e-7 or 2.49999999999999985e38 < (*.f64 a b) Initial program 92.5%
Taylor expanded in x around 0 85.0%
if -2.49999999999999989e-7 < (*.f64 a b) < 2.49999999999999985e38Initial program 98.0%
Taylor expanded in a around 0 95.5%
Final simplification91.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -2e+50) (not (<= (* z t) 1e+71))) (+ (* c i) (+ (* a b) (* z t))) (+ (* 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 (((z * t) <= -2e+50) || !((z * t) <= 1e+71)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((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 (((z * t) <= (-2d+50)) .or. (.not. ((z * t) <= 1d+71))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((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 (((z * t) <= -2e+50) || !((z * t) <= 1e+71)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -2e+50) or not ((z * t) <= 1e+71): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((a * b) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -2e+50) || !(Float64(z * t) <= 1e+71)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + 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 (((z * t) <= -2e+50) || ~(((z * t) <= 1e+71))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((a * b) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -2e+50], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1e+71]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+50} \lor \neg \left(z \cdot t \leq 10^{+71}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -2.0000000000000002e50 or 1e71 < (*.f64 z t) Initial program 91.7%
Taylor expanded in x around 0 87.1%
if -2.0000000000000002e50 < (*.f64 z t) < 1e71Initial program 98.6%
Taylor expanded in x around inf 96.3%
Final simplification92.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2.05e+148) (not (<= (* x y) 3.2e+140))) (* 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) <= -2.05e+148) || !((x * y) <= 3.2e+140)) {
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) <= (-2.05d+148)) .or. (.not. ((x * y) <= 3.2d+140))) 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) <= -2.05e+148) || !((x * y) <= 3.2e+140)) {
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) <= -2.05e+148) or not ((x * y) <= 3.2e+140): 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) <= -2.05e+148) || !(Float64(x * y) <= 3.2e+140)) 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) <= -2.05e+148) || ~(((x * y) <= 3.2e+140))) 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], -2.05e+148], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.2e+140]], $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 -2.05 \cdot 10^{+148} \lor \neg \left(x \cdot y \leq 3.2 \cdot 10^{+140}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0499999999999999e148 or 3.20000000000000011e140 < (*.f64 x y) Initial program 91.6%
Taylor expanded in a around 0 87.4%
Taylor expanded in t around 0 75.2%
Taylor expanded in c around 0 69.1%
if -2.0499999999999999e148 < (*.f64 x y) < 3.20000000000000011e140Initial program 97.3%
Taylor expanded in a around inf 59.2%
Final simplification62.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -8.6e-19) (not (<= (* c i) 5.9e+181))) (+ (* a b) (* 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 (((c * i) <= -8.6e-19) || !((c * i) <= 5.9e+181)) {
tmp = (a * b) + (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 (((c * i) <= (-8.6d-19)) .or. (.not. ((c * i) <= 5.9d+181))) then
tmp = (a * b) + (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 (((c * i) <= -8.6e-19) || !((c * i) <= 5.9e+181)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -8.6e-19) or not ((c * i) <= 5.9e+181): tmp = (a * b) + (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(c * i) <= -8.6e-19) || !(Float64(c * i) <= 5.9e+181)) tmp = Float64(Float64(a * b) + 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 (((c * i) <= -8.6e-19) || ~(((c * i) <= 5.9e+181))) tmp = (a * b) + (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[(c * i), $MachinePrecision], -8.6e-19], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5.9e+181]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8.6 \cdot 10^{-19} \lor \neg \left(c \cdot i \leq 5.9 \cdot 10^{+181}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -8.6e-19 or 5.8999999999999997e181 < (*.f64 c i) Initial program 95.3%
Taylor expanded in a around inf 70.3%
if -8.6e-19 < (*.f64 c i) < 5.8999999999999997e181Initial program 95.9%
Taylor expanded in x around 0 71.7%
+-commutative71.7%
*-commutative71.7%
fma-def72.2%
Simplified72.2%
Taylor expanded in c around 0 66.2%
Final simplification67.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -2.6e-18) (+ (* c i) (* z t)) (if (<= (* c i) 4.1e+181) (+ (* a b) (* z t)) (+ (* 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) <= -2.6e-18) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 4.1e+181) {
tmp = (a * b) + (z * t);
} 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) <= (-2.6d-18)) then
tmp = (c * i) + (z * t)
else if ((c * i) <= 4.1d+181) then
tmp = (a * b) + (z * t)
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) <= -2.6e-18) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 4.1e+181) {
tmp = (a * b) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -2.6e-18: tmp = (c * i) + (z * t) elif (c * i) <= 4.1e+181: tmp = (a * b) + (z * t) 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) <= -2.6e-18) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(c * i) <= 4.1e+181) tmp = Float64(Float64(a * b) + Float64(z * t)); 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) <= -2.6e-18) tmp = (c * i) + (z * t); elseif ((c * i) <= 4.1e+181) tmp = (a * b) + (z * t); 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], -2.6e-18], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.1e+181], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.6 \cdot 10^{-18}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 4.1 \cdot 10^{+181}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.6e-18Initial program 94.9%
Taylor expanded in a around 0 91.5%
Taylor expanded in x around 0 73.5%
if -2.6e-18 < (*.f64 c i) < 4.10000000000000018e181Initial program 95.9%
Taylor expanded in x around 0 71.7%
+-commutative71.7%
*-commutative71.7%
fma-def72.2%
Simplified72.2%
Taylor expanded in c around 0 66.2%
if 4.10000000000000018e181 < (*.f64 c i) Initial program 96.2%
Taylor expanded in a around inf 88.5%
Final simplification70.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -3e-18) (+ (* x y) (* c i)) (if (<= (* c i) 3.9e+181) (+ (* a b) (* z t)) (+ (* 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) <= -3e-18) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 3.9e+181) {
tmp = (a * b) + (z * t);
} 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) <= (-3d-18)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= 3.9d+181) then
tmp = (a * b) + (z * t)
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) <= -3e-18) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 3.9e+181) {
tmp = (a * b) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -3e-18: tmp = (x * y) + (c * i) elif (c * i) <= 3.9e+181: tmp = (a * b) + (z * t) 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) <= -3e-18) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= 3.9e+181) tmp = Float64(Float64(a * b) + Float64(z * t)); 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) <= -3e-18) tmp = (x * y) + (c * i); elseif ((c * i) <= 3.9e+181) tmp = (a * b) + (z * t); 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], -3e-18], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.9e+181], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3 \cdot 10^{-18}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 3.9 \cdot 10^{+181}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.99999999999999983e-18Initial program 94.9%
Taylor expanded in a around 0 91.5%
Taylor expanded in t around 0 78.7%
if -2.99999999999999983e-18 < (*.f64 c i) < 3.9e181Initial program 95.9%
Taylor expanded in x around 0 71.7%
+-commutative71.7%
*-commutative71.7%
fma-def72.2%
Simplified72.2%
Taylor expanded in c around 0 66.2%
if 3.9e181 < (*.f64 c i) Initial program 96.2%
Taylor expanded in a around inf 88.5%
Final simplification71.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -2.8e-18) (not (<= (* c i) 1.2e+125))) (* 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) <= -2.8e-18) || !((c * i) <= 1.2e+125)) {
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) <= (-2.8d-18)) .or. (.not. ((c * i) <= 1.2d+125))) 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) <= -2.8e-18) || !((c * i) <= 1.2e+125)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -2.8e-18) or not ((c * i) <= 1.2e+125): 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) <= -2.8e-18) || !(Float64(c * i) <= 1.2e+125)) 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) <= -2.8e-18) || ~(((c * i) <= 1.2e+125))) 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], -2.8e-18], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.2e+125]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.8 \cdot 10^{-18} \lor \neg \left(c \cdot i \leq 1.2 \cdot 10^{+125}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -2.80000000000000012e-18 or 1.2e125 < (*.f64 c i) Initial program 94.7%
Taylor expanded in c around inf 60.6%
if -2.80000000000000012e-18 < (*.f64 c i) < 1.2e125Initial program 96.3%
Taylor expanded in x around 0 71.3%
+-commutative71.3%
*-commutative71.3%
fma-def71.9%
Simplified71.9%
Taylor expanded in a around inf 31.9%
Final simplification42.5%
(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 95.7%
Taylor expanded in x around 0 75.0%
+-commutative75.0%
*-commutative75.0%
fma-def75.4%
Simplified75.4%
Taylor expanded in a around inf 25.0%
Final simplification25.0%
herbie shell --seed 2024021
(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)))