
(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 (fma z t (fma c i (fma x y (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(z, t, fma(c, i, fma(x, y, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(z, t, fma(c, i, fma(x, y, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z * t + N[(c * i + N[(x * y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)
\end{array}
Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+l+96.1%
fma-def96.1%
associate-+r+96.1%
+-commutative96.1%
fma-def97.6%
fma-def98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (fma a b (fma 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) {
return fma(a, b, fma(x, y, fma(c, i, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(a, b, fma(x, y, fma(c, i, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b + N[(x * y + N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, z \cdot t\right)\right)\right)
\end{array}
Initial program 96.1%
+-commutative96.1%
associate-+l+96.1%
fma-def96.5%
associate-+l+96.5%
fma-def98.4%
+-commutative98.4%
fma-def98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* x y) 4e+73) (fma z t (+ (fma x y (* a b)) (* c i))) (fma c i (fma 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) <= 4e+73) {
tmp = fma(z, t, (fma(x, y, (a * b)) + (c * i)));
} else {
tmp = fma(c, i, fma(x, y, (z * t)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= 4e+73) tmp = fma(z, t, Float64(fma(x, y, Float64(a * b)) + Float64(c * i))); else tmp = fma(c, i, fma(x, y, Float64(z * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], 4e+73], N[(z * t + N[(N[(x * y + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * i + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq 4 \cdot 10^{+73}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right) + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < 3.99999999999999993e73Initial program 98.5%
associate-+l+98.5%
+-commutative98.5%
associate-+l+98.5%
fma-def98.5%
associate-+r+98.5%
+-commutative98.5%
fma-def99.0%
fma-def99.5%
Simplified99.5%
fma-udef99.0%
+-commutative99.0%
Applied egg-rr99.0%
if 3.99999999999999993e73 < (*.f64 x y) Initial program 85.1%
Taylor expanded in a around 0 87.2%
fma-def91.5%
*-commutative91.5%
+-commutative91.5%
fma-def95.7%
*-commutative95.7%
Simplified95.7%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))) INFINITY) (fma z t (+ (* a b) (+ (* x y) (* c i)))) (+ (* 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 (((c * i) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = fma(z, t, ((a * b) + ((x * y) + (c * i))));
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) <= Inf) tmp = fma(z, t, Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(c * i)))); else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(z * t + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z, t, a \cdot b + \left(x \cdot y + c \cdot i\right)\right)\\
\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%
associate-+l+100.0%
+-commutative100.0%
associate-+l+100.0%
fma-def100.0%
associate-+r+100.0%
+-commutative100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.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 a around 0 10.0%
Taylor expanded in x around 0 60.0%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t)))
(t_2 (+ (* a b) (* z t)))
(t_3 (+ (* c i) (* z t))))
(if (<= (* c i) -1.1e+131)
t_3
(if (<= (* c i) -8.5e-71)
t_1
(if (<= (* c i) -3e-299)
t_2
(if (<= (* c i) 2e-143)
t_1
(if (<= (* c i) 1.22e+17)
t_2
(if (<= (* c i) 2.1e+133) t_1 t_3))))))))
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) + (z * t);
double t_3 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -1.1e+131) {
tmp = t_3;
} else if ((c * i) <= -8.5e-71) {
tmp = t_1;
} else if ((c * i) <= -3e-299) {
tmp = t_2;
} else if ((c * i) <= 2e-143) {
tmp = t_1;
} else if ((c * i) <= 1.22e+17) {
tmp = t_2;
} else if ((c * i) <= 2.1e+133) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (x * y) + (z * t)
t_2 = (a * b) + (z * t)
t_3 = (c * i) + (z * t)
if ((c * i) <= (-1.1d+131)) then
tmp = t_3
else if ((c * i) <= (-8.5d-71)) then
tmp = t_1
else if ((c * i) <= (-3d-299)) then
tmp = t_2
else if ((c * i) <= 2d-143) then
tmp = t_1
else if ((c * i) <= 1.22d+17) then
tmp = t_2
else if ((c * i) <= 2.1d+133) then
tmp = t_1
else
tmp = t_3
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 = (x * y) + (z * t);
double t_2 = (a * b) + (z * t);
double t_3 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -1.1e+131) {
tmp = t_3;
} else if ((c * i) <= -8.5e-71) {
tmp = t_1;
} else if ((c * i) <= -3e-299) {
tmp = t_2;
} else if ((c * i) <= 2e-143) {
tmp = t_1;
} else if ((c * i) <= 1.22e+17) {
tmp = t_2;
} else if ((c * i) <= 2.1e+133) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = (a * b) + (z * t) t_3 = (c * i) + (z * t) tmp = 0 if (c * i) <= -1.1e+131: tmp = t_3 elif (c * i) <= -8.5e-71: tmp = t_1 elif (c * i) <= -3e-299: tmp = t_2 elif (c * i) <= 2e-143: tmp = t_1 elif (c * i) <= 1.22e+17: tmp = t_2 elif (c * i) <= 2.1e+133: tmp = t_1 else: tmp = t_3 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(a * b) + Float64(z * t)) t_3 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -1.1e+131) tmp = t_3; elseif (Float64(c * i) <= -8.5e-71) tmp = t_1; elseif (Float64(c * i) <= -3e-299) tmp = t_2; elseif (Float64(c * i) <= 2e-143) tmp = t_1; elseif (Float64(c * i) <= 1.22e+17) tmp = t_2; elseif (Float64(c * i) <= 2.1e+133) tmp = t_1; else tmp = t_3; 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) + (z * t); t_3 = (c * i) + (z * t); tmp = 0.0; if ((c * i) <= -1.1e+131) tmp = t_3; elseif ((c * i) <= -8.5e-71) tmp = t_1; elseif ((c * i) <= -3e-299) tmp = t_2; elseif ((c * i) <= 2e-143) tmp = t_1; elseif ((c * i) <= 1.22e+17) tmp = t_2; elseif ((c * i) <= 2.1e+133) tmp = t_1; else tmp = t_3; 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[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.1e+131], t$95$3, If[LessEqual[N[(c * i), $MachinePrecision], -8.5e-71], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -3e-299], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 2e-143], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.22e+17], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 2.1e+133], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := a \cdot b + z \cdot t\\
t_3 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1.1 \cdot 10^{+131}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \cdot i \leq -8.5 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -3 \cdot 10^{-299}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{-143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 1.22 \cdot 10^{+17}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 2.1 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 c i) < -1.0999999999999999e131 or 2.1e133 < (*.f64 c i) Initial program 88.4%
Taylor expanded in a around 0 83.1%
Taylor expanded in x around 0 80.9%
if -1.0999999999999999e131 < (*.f64 c i) < -8.49999999999999988e-71 or -2.99999999999999984e-299 < (*.f64 c i) < 1.9999999999999999e-143 or 1.22e17 < (*.f64 c i) < 2.1e133Initial program 100.0%
Taylor expanded in a around 0 82.9%
Taylor expanded in c around 0 77.5%
if -8.49999999999999988e-71 < (*.f64 c i) < -2.99999999999999984e-299 or 1.9999999999999999e-143 < (*.f64 c i) < 1.22e17Initial program 98.4%
Taylor expanded in x around 0 83.8%
Taylor expanded in c around 0 78.5%
Final simplification78.8%
(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 (+ (* 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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
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 = (c * i) + ((a * b) + ((x * y) + (z * t))) 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(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(c * i) + Float64(z * t)); 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 = (c * i) + (z * t); 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[(c * i), $MachinePrecision] + N[(z * t), $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}:\\
\;\;\;\;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 10.0%
Taylor expanded in x around 0 60.0%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* a b) (* z t))))
(if (<= (* a b) -6.4e+119)
t_2
(if (<= (* a b) -2.25e-5)
t_1
(if (<= (* a b) -1.5e-28)
(* x y)
(if (<= (* a b) 2.9e-40)
t_1
(if (<= (* a b) 6.3) (+ (* a b) (* x y)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = (a * b) + (z * t);
double tmp;
if ((a * b) <= -6.4e+119) {
tmp = t_2;
} else if ((a * b) <= -2.25e-5) {
tmp = t_1;
} else if ((a * b) <= -1.5e-28) {
tmp = x * y;
} else if ((a * b) <= 2.9e-40) {
tmp = t_1;
} else if ((a * b) <= 6.3) {
tmp = (a * b) + (x * y);
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = (c * i) + (z * t)
t_2 = (a * b) + (z * t)
if ((a * b) <= (-6.4d+119)) then
tmp = t_2
else if ((a * b) <= (-2.25d-5)) then
tmp = t_1
else if ((a * b) <= (-1.5d-28)) then
tmp = x * y
else if ((a * b) <= 2.9d-40) then
tmp = t_1
else if ((a * b) <= 6.3d0) then
tmp = (a * b) + (x * y)
else
tmp = t_2
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 = (c * i) + (z * t);
double t_2 = (a * b) + (z * t);
double tmp;
if ((a * b) <= -6.4e+119) {
tmp = t_2;
} else if ((a * b) <= -2.25e-5) {
tmp = t_1;
} else if ((a * b) <= -1.5e-28) {
tmp = x * y;
} else if ((a * b) <= 2.9e-40) {
tmp = t_1;
} else if ((a * b) <= 6.3) {
tmp = (a * b) + (x * y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = (a * b) + (z * t) tmp = 0 if (a * b) <= -6.4e+119: tmp = t_2 elif (a * b) <= -2.25e-5: tmp = t_1 elif (a * b) <= -1.5e-28: tmp = x * y elif (a * b) <= 2.9e-40: tmp = t_1 elif (a * b) <= 6.3: tmp = (a * b) + (x * y) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) t_2 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -6.4e+119) tmp = t_2; elseif (Float64(a * b) <= -2.25e-5) tmp = t_1; elseif (Float64(a * b) <= -1.5e-28) tmp = Float64(x * y); elseif (Float64(a * b) <= 2.9e-40) tmp = t_1; elseif (Float64(a * b) <= 6.3) tmp = Float64(Float64(a * b) + Float64(x * y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); t_2 = (a * b) + (z * t); tmp = 0.0; if ((a * b) <= -6.4e+119) tmp = t_2; elseif ((a * b) <= -2.25e-5) tmp = t_1; elseif ((a * b) <= -1.5e-28) tmp = x * y; elseif ((a * b) <= 2.9e-40) tmp = t_1; elseif ((a * b) <= 6.3) tmp = (a * b) + (x * y); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -6.4e+119], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -2.25e-5], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1.5e-28], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.9e-40], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 6.3], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -6.4 \cdot 10^{+119}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -2.25 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -1.5 \cdot 10^{-28}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2.9 \cdot 10^{-40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 6.3:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -6.39999999999999979e119 or 6.29999999999999982 < (*.f64 a b) Initial program 92.0%
Taylor expanded in x around 0 84.6%
Taylor expanded in c around 0 81.0%
if -6.39999999999999979e119 < (*.f64 a b) < -2.25000000000000014e-5 or -1.50000000000000001e-28 < (*.f64 a b) < 2.8999999999999999e-40Initial program 99.3%
Taylor expanded in a around 0 95.3%
Taylor expanded in x around 0 69.7%
if -2.25000000000000014e-5 < (*.f64 a b) < -1.50000000000000001e-28Initial program 80.0%
Taylor expanded in x around inf 100.0%
if 2.8999999999999999e-40 < (*.f64 a b) < 6.29999999999999982Initial program 91.7%
Taylor expanded in z around 0 86.0%
+-commutative86.0%
*-commutative86.0%
fma-def86.0%
Applied egg-rr86.0%
Taylor expanded in c around 0 70.6%
Final simplification74.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.65e+128)
(* c i)
(if (<= (* c i) -8.2e-268)
(* z t)
(if (<= (* c i) 1.18e-256)
(* a b)
(if (<= (* c i) 2.5e+140) (* 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) <= -1.65e+128) {
tmp = c * i;
} else if ((c * i) <= -8.2e-268) {
tmp = z * t;
} else if ((c * i) <= 1.18e-256) {
tmp = a * b;
} else if ((c * i) <= 2.5e+140) {
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) <= (-1.65d+128)) then
tmp = c * i
else if ((c * i) <= (-8.2d-268)) then
tmp = z * t
else if ((c * i) <= 1.18d-256) then
tmp = a * b
else if ((c * i) <= 2.5d+140) 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) <= -1.65e+128) {
tmp = c * i;
} else if ((c * i) <= -8.2e-268) {
tmp = z * t;
} else if ((c * i) <= 1.18e-256) {
tmp = a * b;
} else if ((c * i) <= 2.5e+140) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.65e+128: tmp = c * i elif (c * i) <= -8.2e-268: tmp = z * t elif (c * i) <= 1.18e-256: tmp = a * b elif (c * i) <= 2.5e+140: 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) <= -1.65e+128) tmp = Float64(c * i); elseif (Float64(c * i) <= -8.2e-268) tmp = Float64(z * t); elseif (Float64(c * i) <= 1.18e-256) tmp = Float64(a * b); elseif (Float64(c * i) <= 2.5e+140) 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) <= -1.65e+128) tmp = c * i; elseif ((c * i) <= -8.2e-268) tmp = z * t; elseif ((c * i) <= 1.18e-256) tmp = a * b; elseif ((c * i) <= 2.5e+140) 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], -1.65e+128], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -8.2e-268], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.18e-256], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.5e+140], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.65 \cdot 10^{+128}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -8.2 \cdot 10^{-268}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 1.18 \cdot 10^{-256}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 2.5 \cdot 10^{+140}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.65e128 or 2.50000000000000004e140 < (*.f64 c i) Initial program 88.4%
Taylor expanded in c around inf 67.4%
if -1.65e128 < (*.f64 c i) < -8.1999999999999998e-268 or 1.18e-256 < (*.f64 c i) < 2.50000000000000004e140Initial program 99.2%
Taylor expanded in z around inf 42.1%
if -8.1999999999999998e-268 < (*.f64 c i) < 1.18e-256Initial program 100.0%
Taylor expanded in a around inf 42.9%
Final simplification50.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -8e+118) (not (<= (* a b) 1.85e+118))) (+ (* 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) <= -8e+118) || !((a * b) <= 1.85e+118)) {
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) <= (-8d+118)) .or. (.not. ((a * b) <= 1.85d+118))) 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) <= -8e+118) || !((a * b) <= 1.85e+118)) {
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) <= -8e+118) or not ((a * b) <= 1.85e+118): 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) <= -8e+118) || !(Float64(a * b) <= 1.85e+118)) 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) <= -8e+118) || ~(((a * b) <= 1.85e+118))) 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], -8e+118], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.85e+118]], $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 -8 \cdot 10^{+118} \lor \neg \left(a \cdot b \leq 1.85 \cdot 10^{+118}\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) < -7.99999999999999973e118 or 1.84999999999999993e118 < (*.f64 a b) Initial program 90.8%
Taylor expanded in x around 0 84.6%
Taylor expanded in c around 0 83.1%
if -7.99999999999999973e118 < (*.f64 a b) < 1.84999999999999993e118Initial program 98.3%
Taylor expanded in a around 0 92.3%
Final simplification89.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -3.8e+78) (not (<= (* x y) 2.7e+31))) (+ (* c i) (+ (* x y) (* z t))) (+ (* 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) <= -3.8e+78) || !((x * y) <= 2.7e+31)) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((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) <= (-3.8d+78)) .or. (.not. ((x * y) <= 2.7d+31))) then
tmp = (c * i) + ((x * y) + (z * t))
else
tmp = (c * i) + ((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) <= -3.8e+78) || !((x * y) <= 2.7e+31)) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -3.8e+78) or not ((x * y) <= 2.7e+31): tmp = (c * i) + ((x * y) + (z * t)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -3.8e+78) || !(Float64(x * y) <= 2.7e+31)) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * i) + 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) <= -3.8e+78) || ~(((x * y) <= 2.7e+31))) tmp = (c * i) + ((x * y) + (z * t)); else tmp = (c * i) + ((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], -3.8e+78], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.7e+31]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.8 \cdot 10^{+78} \lor \neg \left(x \cdot y \leq 2.7 \cdot 10^{+31}\right):\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -3.7999999999999999e78 or 2.69999999999999986e31 < (*.f64 x y) Initial program 91.0%
Taylor expanded in a around 0 87.5%
if -3.7999999999999999e78 < (*.f64 x y) < 2.69999999999999986e31Initial program 99.3%
Taylor expanded in x around 0 96.0%
Final simplification92.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.05e+59) (not (<= (* x y) 5e+45))) (* 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) <= -1.05e+59) || !((x * y) <= 5e+45)) {
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) <= (-1.05d+59)) .or. (.not. ((x * y) <= 5d+45))) 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) <= -1.05e+59) || !((x * y) <= 5e+45)) {
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) <= -1.05e+59) or not ((x * y) <= 5e+45): 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) <= -1.05e+59) || !(Float64(x * y) <= 5e+45)) 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) <= -1.05e+59) || ~(((x * y) <= 5e+45))) 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], -1.05e+59], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+45]], $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 -1.05 \cdot 10^{+59} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+45}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -1.04999999999999992e59 or 5e45 < (*.f64 x y) Initial program 91.0%
Taylor expanded in x around inf 62.6%
if -1.04999999999999992e59 < (*.f64 x y) < 5e45Initial program 99.3%
Taylor expanded in x around 0 95.3%
Taylor expanded in c around 0 70.8%
Final simplification67.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -4.5e+56) (not (<= (* x y) 2.2e+22))) (+ (* 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) <= -4.5e+56) || !((x * y) <= 2.2e+22)) {
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) <= (-4.5d+56)) .or. (.not. ((x * y) <= 2.2d+22))) 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) <= -4.5e+56) || !((x * y) <= 2.2e+22)) {
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) <= -4.5e+56) or not ((x * y) <= 2.2e+22): 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) <= -4.5e+56) || !(Float64(x * y) <= 2.2e+22)) 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) <= -4.5e+56) || ~(((x * y) <= 2.2e+22))) 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], -4.5e+56], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.2e+22]], $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 -4.5 \cdot 10^{+56} \lor \neg \left(x \cdot y \leq 2.2 \cdot 10^{+22}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -4.5000000000000003e56 or 2.2e22 < (*.f64 x y) Initial program 91.4%
Taylor expanded in z around 0 81.3%
+-commutative81.3%
*-commutative81.3%
fma-def83.2%
Applied egg-rr83.2%
Taylor expanded in c around 0 69.3%
if -4.5000000000000003e56 < (*.f64 x y) < 2.2e22Initial program 99.3%
Taylor expanded in x around 0 96.5%
Taylor expanded in c around 0 71.7%
Final simplification70.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -4.4e+53) (not (<= (* x y) 2.2e+31))) (+ (* 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) <= -4.4e+53) || !((x * y) <= 2.2e+31)) {
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) <= (-4.4d+53)) .or. (.not. ((x * y) <= 2.2d+31))) 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) <= -4.4e+53) || !((x * y) <= 2.2e+31)) {
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) <= -4.4e+53) or not ((x * y) <= 2.2e+31): 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) <= -4.4e+53) || !(Float64(x * y) <= 2.2e+31)) 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) <= -4.4e+53) || ~(((x * y) <= 2.2e+31))) 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], -4.4e+53], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.2e+31]], $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 -4.4 \cdot 10^{+53} \lor \neg \left(x \cdot y \leq 2.2 \cdot 10^{+31}\right):\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -4.39999999999999997e53 or 2.2000000000000001e31 < (*.f64 x y) Initial program 91.2%
associate-+l+91.2%
+-commutative91.2%
associate-+l+91.2%
fma-def91.2%
associate-+r+91.2%
+-commutative91.2%
fma-def94.2%
fma-def96.1%
Simplified96.1%
fma-udef93.2%
+-commutative93.2%
Applied egg-rr93.2%
Taylor expanded in a around 0 87.9%
fma-def89.8%
Simplified89.8%
fma-udef89.8%
*-commutative89.8%
+-commutative89.8%
*-commutative89.8%
Applied egg-rr89.8%
Taylor expanded in z around 0 76.6%
if -4.39999999999999997e53 < (*.f64 x y) < 2.2000000000000001e31Initial program 99.3%
Taylor expanded in x around 0 95.9%
Taylor expanded in c around 0 71.5%
Final simplification73.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -8.5e+117) (not (<= (* a b) 6e-13))) (* 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) <= -8.5e+117) || !((a * b) <= 6e-13)) {
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) <= (-8.5d+117)) .or. (.not. ((a * b) <= 6d-13))) 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) <= -8.5e+117) || !((a * b) <= 6e-13)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -8.5e+117) or not ((a * b) <= 6e-13): 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) <= -8.5e+117) || !(Float64(a * b) <= 6e-13)) 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) <= -8.5e+117) || ~(((a * b) <= 6e-13))) 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], -8.5e+117], N[Not[LessEqual[N[(a * b), $MachinePrecision], 6e-13]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8.5 \cdot 10^{+117} \lor \neg \left(a \cdot b \leq 6 \cdot 10^{-13}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -8.49999999999999966e117 or 5.99999999999999968e-13 < (*.f64 a b) Initial program 91.4%
Taylor expanded in a around inf 56.5%
if -8.49999999999999966e117 < (*.f64 a b) < 5.99999999999999968e-13Initial program 98.7%
Taylor expanded in c around inf 32.1%
Final simplification41.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -9.8e+58) (not (<= (* x y) 3.5e+22))) (* 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) <= -9.8e+58) || !((x * y) <= 3.5e+22)) {
tmp = x * y;
} 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 (((x * y) <= (-9.8d+58)) .or. (.not. ((x * y) <= 3.5d+22))) then
tmp = x * y
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 (((x * y) <= -9.8e+58) || !((x * y) <= 3.5e+22)) {
tmp = x * y;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -9.8e+58) or not ((x * y) <= 3.5e+22): tmp = x * y else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -9.8e+58) || !(Float64(x * y) <= 3.5e+22)) tmp = Float64(x * y); 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 (((x * y) <= -9.8e+58) || ~(((x * y) <= 3.5e+22))) tmp = x * y; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -9.8e+58], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.5e+22]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.8 \cdot 10^{+58} \lor \neg \left(x \cdot y \leq 3.5 \cdot 10^{+22}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -9.80000000000000037e58 or 3.5e22 < (*.f64 x y) Initial program 91.4%
Taylor expanded in x around inf 61.6%
if -9.80000000000000037e58 < (*.f64 x y) < 3.5e22Initial program 99.3%
Taylor expanded in z around inf 43.8%
Final simplification51.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -5.8e+100) (not (<= z 1.65e-33))) (* 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 ((z <= -5.8e+100) || !(z <= 1.65e-33)) {
tmp = 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 ((z <= (-5.8d+100)) .or. (.not. (z <= 1.65d-33))) then
tmp = 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 ((z <= -5.8e+100) || !(z <= 1.65e-33)) {
tmp = z * t;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -5.8e+100) or not (z <= 1.65e-33): tmp = z * t else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -5.8e+100) || !(z <= 1.65e-33)) tmp = 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 ((z <= -5.8e+100) || ~((z <= 1.65e-33))) tmp = z * t; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -5.8e+100], N[Not[LessEqual[z, 1.65e-33]], $MachinePrecision]], N[(z * t), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+100} \lor \neg \left(z \leq 1.65 \cdot 10^{-33}\right):\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if z < -5.8000000000000001e100 or 1.6500000000000001e-33 < z Initial program 95.4%
Taylor expanded in z around inf 46.6%
if -5.8000000000000001e100 < z < 1.6500000000000001e-33Initial program 96.7%
Taylor expanded in x around 0 70.5%
Taylor expanded in t around 0 54.3%
Final simplification50.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 a around inf 24.1%
Final simplification24.1%
herbie shell --seed 2023306
(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)))