
(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 18 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.5%
associate-+l+96.5%
+-commutative96.5%
associate-+l+96.5%
fma-def97.6%
associate-+r+97.6%
+-commutative97.6%
fma-def98.8%
fma-def98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (fma z t (+ (fma x y (* a b)) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(z, t, (fma(x, y, (a * b)) + (c * i)));
}
function code(x, y, z, t, a, b, c, i) return fma(z, t, Float64(fma(x, y, Float64(a * b)) + Float64(c * i))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z * t + N[(N[(x * y + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right) + c \cdot i\right)
\end{array}
Initial program 96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+l+96.5%
fma-def97.6%
associate-+r+97.6%
+-commutative97.6%
fma-def98.8%
fma-def98.8%
Simplified98.8%
fma-udef97.6%
+-commutative97.6%
Applied egg-rr97.6%
Final simplification97.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))) INFINITY) (+ (fma x y (* a b)) (+ (* c i) (* z t))) (fma z t (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = fma(x, y, (a * b)) + ((c * i) + (z * t));
} else {
tmp = fma(z, t, (x * y));
}
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 = Float64(fma(x, y, Float64(a * b)) + Float64(Float64(c * i) + Float64(z * t))); else tmp = fma(z, t, Float64(x * y)); 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[(N[(x * y + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(x * y), $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(x, y, a \cdot b\right) + \left(c \cdot i + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, 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%
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%
+-commutative100.0%
Applied egg-rr100.0%
fma-udef100.0%
*-commutative100.0%
+-commutative100.0%
associate-+r+100.0%
*-commutative100.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%
associate-+l+0.0%
+-commutative0.0%
associate-+l+0.0%
fma-def33.3%
associate-+r+33.3%
+-commutative33.3%
fma-def66.7%
fma-def66.7%
Simplified66.7%
fma-udef33.3%
+-commutative33.3%
Applied egg-rr33.3%
Taylor expanded in x around inf 55.9%
Final simplification98.4%
(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 z t (* 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(z, t, (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(z, t, 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[(z * t + 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(z, t, 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%
associate-+l+0.0%
+-commutative0.0%
associate-+l+0.0%
fma-def33.3%
associate-+r+33.3%
+-commutative33.3%
fma-def66.7%
fma-def66.7%
Simplified66.7%
fma-udef33.3%
+-commutative33.3%
Applied egg-rr33.3%
Taylor expanded in x around inf 55.9%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t)))
(t_2 (+ (* a b) (* c i)))
(t_3 (+ (* a b) (* x y))))
(if (<= (* x y) -2.1e+98)
t_3
(if (<= (* x y) -2.6e+52)
t_1
(if (<= (* x y) -1.06e-242)
t_2
(if (<= (* x y) 4e+26)
t_1
(if (<= (* x y) 1.1e+74)
t_2
(if (<= (* x y) 3.8e+151)
t_1
(if (<= (* x y) 3.1e+223) t_2 t_3)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (a * b) + (c * i);
double t_3 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -2.1e+98) {
tmp = t_3;
} else if ((x * y) <= -2.6e+52) {
tmp = t_1;
} else if ((x * y) <= -1.06e-242) {
tmp = t_2;
} else if ((x * y) <= 4e+26) {
tmp = t_1;
} else if ((x * y) <= 1.1e+74) {
tmp = t_2;
} else if ((x * y) <= 3.8e+151) {
tmp = t_1;
} else if ((x * y) <= 3.1e+223) {
tmp = t_2;
} 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 = (a * b) + (z * t)
t_2 = (a * b) + (c * i)
t_3 = (a * b) + (x * y)
if ((x * y) <= (-2.1d+98)) then
tmp = t_3
else if ((x * y) <= (-2.6d+52)) then
tmp = t_1
else if ((x * y) <= (-1.06d-242)) then
tmp = t_2
else if ((x * y) <= 4d+26) then
tmp = t_1
else if ((x * y) <= 1.1d+74) then
tmp = t_2
else if ((x * y) <= 3.8d+151) then
tmp = t_1
else if ((x * y) <= 3.1d+223) then
tmp = t_2
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 = (a * b) + (z * t);
double t_2 = (a * b) + (c * i);
double t_3 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -2.1e+98) {
tmp = t_3;
} else if ((x * y) <= -2.6e+52) {
tmp = t_1;
} else if ((x * y) <= -1.06e-242) {
tmp = t_2;
} else if ((x * y) <= 4e+26) {
tmp = t_1;
} else if ((x * y) <= 1.1e+74) {
tmp = t_2;
} else if ((x * y) <= 3.8e+151) {
tmp = t_1;
} else if ((x * y) <= 3.1e+223) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (a * b) + (c * i) t_3 = (a * b) + (x * y) tmp = 0 if (x * y) <= -2.1e+98: tmp = t_3 elif (x * y) <= -2.6e+52: tmp = t_1 elif (x * y) <= -1.06e-242: tmp = t_2 elif (x * y) <= 4e+26: tmp = t_1 elif (x * y) <= 1.1e+74: tmp = t_2 elif (x * y) <= 3.8e+151: tmp = t_1 elif (x * y) <= 3.1e+223: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(a * b) + Float64(c * i)) t_3 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2.1e+98) tmp = t_3; elseif (Float64(x * y) <= -2.6e+52) tmp = t_1; elseif (Float64(x * y) <= -1.06e-242) tmp = t_2; elseif (Float64(x * y) <= 4e+26) tmp = t_1; elseif (Float64(x * y) <= 1.1e+74) tmp = t_2; elseif (Float64(x * y) <= 3.8e+151) tmp = t_1; elseif (Float64(x * y) <= 3.1e+223) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); t_2 = (a * b) + (c * i); t_3 = (a * b) + (x * y); tmp = 0.0; if ((x * y) <= -2.1e+98) tmp = t_3; elseif ((x * y) <= -2.6e+52) tmp = t_1; elseif ((x * y) <= -1.06e-242) tmp = t_2; elseif ((x * y) <= 4e+26) tmp = t_1; elseif ((x * y) <= 1.1e+74) tmp = t_2; elseif ((x * y) <= 3.8e+151) tmp = t_1; elseif ((x * y) <= 3.1e+223) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.1e+98], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2.6e+52], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.06e-242], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 4e+26], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.1e+74], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 3.8e+151], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.1e+223], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
t_3 := a \cdot b + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+98}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{+52}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.06 \cdot 10^{-242}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.1 \cdot 10^{+74}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 3.8 \cdot 10^{+151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.1 \cdot 10^{+223}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -2.10000000000000004e98 or 3.09999999999999982e223 < (*.f64 x y) Initial program 92.8%
associate-+l+92.8%
+-commutative92.8%
associate-+l+92.8%
fma-def95.7%
associate-+r+95.7%
+-commutative95.7%
fma-def98.5%
fma-def98.5%
Simplified98.5%
fma-udef95.7%
+-commutative95.7%
Applied egg-rr95.7%
fma-udef92.8%
*-commutative92.8%
+-commutative92.8%
associate-+r+92.8%
*-commutative92.8%
Applied egg-rr92.8%
Taylor expanded in z around 0 85.6%
Taylor expanded in c around 0 80.1%
if -2.10000000000000004e98 < (*.f64 x y) < -2.6e52 or -1.06000000000000008e-242 < (*.f64 x y) < 4.00000000000000019e26 or 1.1000000000000001e74 < (*.f64 x y) < 3.8e151Initial program 99.1%
Taylor expanded in c around 0 80.6%
Taylor expanded in x around 0 74.7%
if -2.6e52 < (*.f64 x y) < -1.06000000000000008e-242 or 4.00000000000000019e26 < (*.f64 x y) < 1.1000000000000001e74 or 3.8e151 < (*.f64 x y) < 3.09999999999999982e223Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+l+96.1%
fma-def97.4%
associate-+r+97.4%
+-commutative97.4%
fma-def97.4%
fma-def97.4%
Simplified97.4%
fma-udef97.4%
+-commutative97.4%
Applied egg-rr97.4%
fma-udef96.1%
*-commutative96.1%
+-commutative96.1%
associate-+r+96.1%
*-commutative96.1%
Applied egg-rr96.1%
Taylor expanded in z around 0 79.2%
Taylor expanded in c around inf 74.2%
Final simplification76.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))))
(if (<= (* x y) -1.85e+100)
(+ (* c i) (* x y))
(if (<= (* x y) -4.5e-190)
t_1
(if (<= (* x y) 0.38)
(+ (* a b) (* z t))
(if (or (<= (* x y) 2.75e+84)
(and (not (<= (* x y) 1.1e+174)) (<= (* x y) 5.5e+211)))
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) + (z * t);
double tmp;
if ((x * y) <= -1.85e+100) {
tmp = (c * i) + (x * y);
} else if ((x * y) <= -4.5e-190) {
tmp = t_1;
} else if ((x * y) <= 0.38) {
tmp = (a * b) + (z * t);
} else if (((x * y) <= 2.75e+84) || (!((x * y) <= 1.1e+174) && ((x * y) <= 5.5e+211))) {
tmp = t_1;
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * i) + (z * t)
if ((x * y) <= (-1.85d+100)) then
tmp = (c * i) + (x * y)
else if ((x * y) <= (-4.5d-190)) then
tmp = t_1
else if ((x * y) <= 0.38d0) then
tmp = (a * b) + (z * t)
else if (((x * y) <= 2.75d+84) .or. (.not. ((x * y) <= 1.1d+174)) .and. ((x * y) <= 5.5d+211)) then
tmp = t_1
else
tmp = (a * b) + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double tmp;
if ((x * y) <= -1.85e+100) {
tmp = (c * i) + (x * y);
} else if ((x * y) <= -4.5e-190) {
tmp = t_1;
} else if ((x * y) <= 0.38) {
tmp = (a * b) + (z * t);
} else if (((x * y) <= 2.75e+84) || (!((x * y) <= 1.1e+174) && ((x * y) <= 5.5e+211))) {
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) + (z * t) tmp = 0 if (x * y) <= -1.85e+100: tmp = (c * i) + (x * y) elif (x * y) <= -4.5e-190: tmp = t_1 elif (x * y) <= 0.38: tmp = (a * b) + (z * t) elif ((x * y) <= 2.75e+84) or (not ((x * y) <= 1.1e+174) and ((x * y) <= 5.5e+211)): 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(z * t)) tmp = 0.0 if (Float64(x * y) <= -1.85e+100) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (Float64(x * y) <= -4.5e-190) tmp = t_1; elseif (Float64(x * y) <= 0.38) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif ((Float64(x * y) <= 2.75e+84) || (!(Float64(x * y) <= 1.1e+174) && (Float64(x * y) <= 5.5e+211))) 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) + (z * t); tmp = 0.0; if ((x * y) <= -1.85e+100) tmp = (c * i) + (x * y); elseif ((x * y) <= -4.5e-190) tmp = t_1; elseif ((x * y) <= 0.38) tmp = (a * b) + (z * t); elseif (((x * y) <= 2.75e+84) || (~(((x * y) <= 1.1e+174)) && ((x * y) <= 5.5e+211))) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.85e+100], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.5e-190], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 0.38], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], 2.75e+84], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.1e+174]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 5.5e+211]]], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -1.85 \cdot 10^{+100}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-190}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 0.38:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.75 \cdot 10^{+84} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+174}\right) \land x \cdot y \leq 5.5 \cdot 10^{+211}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.8500000000000001e100Initial program 95.6%
associate-+l+95.6%
+-commutative95.6%
associate-+l+95.6%
fma-def97.8%
associate-+r+97.8%
+-commutative97.8%
fma-def99.9%
fma-def100.0%
Simplified100.0%
fma-udef97.8%
+-commutative97.8%
Applied egg-rr97.8%
fma-udef95.6%
*-commutative95.6%
+-commutative95.6%
associate-+r+95.6%
*-commutative95.6%
Applied egg-rr95.6%
Taylor expanded in z around 0 88.9%
Taylor expanded in a around 0 79.0%
if -1.8500000000000001e100 < (*.f64 x y) < -4.50000000000000021e-190 or 0.38 < (*.f64 x y) < 2.7500000000000002e84 or 1.1000000000000001e174 < (*.f64 x y) < 5.49999999999999988e211Initial program 97.5%
Taylor expanded in a around 0 82.1%
Taylor expanded in x around 0 77.2%
if -4.50000000000000021e-190 < (*.f64 x y) < 0.38Initial program 98.8%
Taylor expanded in c around 0 78.0%
Taylor expanded in x around 0 75.8%
if 2.7500000000000002e84 < (*.f64 x y) < 1.1000000000000001e174 or 5.49999999999999988e211 < (*.f64 x y) Initial program 90.2%
associate-+l+90.2%
+-commutative90.2%
associate-+l+90.2%
fma-def95.1%
associate-+r+95.1%
+-commutative95.1%
fma-def97.6%
fma-def97.6%
Simplified97.6%
fma-udef95.1%
+-commutative95.1%
Applied egg-rr95.1%
fma-udef90.2%
*-commutative90.2%
+-commutative90.2%
associate-+r+90.2%
*-commutative90.2%
Applied egg-rr90.2%
Taylor expanded in z around 0 81.1%
Taylor expanded in c around 0 75.5%
Final simplification76.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 (+ (* 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%
associate-+l+0.0%
+-commutative0.0%
associate-+l+0.0%
fma-def33.3%
associate-+r+33.3%
+-commutative33.3%
fma-def66.7%
fma-def66.7%
Simplified66.7%
fma-udef33.3%
+-commutative33.3%
Applied egg-rr33.3%
fma-udef0.0%
*-commutative0.0%
+-commutative0.0%
associate-+r+0.0%
*-commutative0.0%
Applied egg-rr0.0%
Taylor expanded in z around 0 33.3%
Taylor expanded in c around 0 45.0%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* z t) -5e+160)
(+ (* x y) (* z t))
(if (or (<= (* z t) 5e+105)
(and (not (<= (* z t) 5e+133)) (<= (* z t) 2e+164)))
(+ (* a b) (+ (* c i) (* 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 ((z * t) <= -5e+160) {
tmp = (x * y) + (z * t);
} else if (((z * t) <= 5e+105) || (!((z * t) <= 5e+133) && ((z * t) <= 2e+164))) {
tmp = (a * b) + ((c * i) + (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 ((z * t) <= (-5d+160)) then
tmp = (x * y) + (z * t)
else if (((z * t) <= 5d+105) .or. (.not. ((z * t) <= 5d+133)) .and. ((z * t) <= 2d+164)) then
tmp = (a * b) + ((c * i) + (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 ((z * t) <= -5e+160) {
tmp = (x * y) + (z * t);
} else if (((z * t) <= 5e+105) || (!((z * t) <= 5e+133) && ((z * t) <= 2e+164))) {
tmp = (a * b) + ((c * i) + (x * y));
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z * t) <= -5e+160: tmp = (x * y) + (z * t) elif ((z * t) <= 5e+105) or (not ((z * t) <= 5e+133) and ((z * t) <= 2e+164)): tmp = (a * b) + ((c * i) + (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(z * t) <= -5e+160) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif ((Float64(z * t) <= 5e+105) || (!(Float64(z * t) <= 5e+133) && (Float64(z * t) <= 2e+164))) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + 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 ((z * t) <= -5e+160) tmp = (x * y) + (z * t); elseif (((z * t) <= 5e+105) || (~(((z * t) <= 5e+133)) && ((z * t) <= 2e+164))) tmp = (a * b) + ((c * i) + (x * y)); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -5e+160], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(z * t), $MachinePrecision], 5e+105], And[N[Not[LessEqual[N[(z * t), $MachinePrecision], 5e+133]], $MachinePrecision], LessEqual[N[(z * t), $MachinePrecision], 2e+164]]], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+160}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+105} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+133}\right) \land z \cdot t \leq 2 \cdot 10^{+164}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 z t) < -5.0000000000000002e160Initial program 91.1%
Taylor expanded in c around 0 86.8%
Taylor expanded in a around 0 80.5%
if -5.0000000000000002e160 < (*.f64 z t) < 5.00000000000000046e105 or 4.99999999999999961e133 < (*.f64 z t) < 2e164Initial program 98.3%
associate-+l+98.3%
+-commutative98.3%
associate-+l+98.3%
fma-def98.3%
associate-+r+98.3%
+-commutative98.3%
fma-def99.4%
fma-def99.4%
Simplified99.4%
fma-udef98.3%
+-commutative98.3%
Applied egg-rr98.3%
fma-udef98.3%
*-commutative98.3%
+-commutative98.3%
associate-+r+98.3%
*-commutative98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 87.3%
if 5.00000000000000046e105 < (*.f64 z t) < 4.99999999999999961e133 or 2e164 < (*.f64 z t) Initial program 93.1%
Taylor expanded in c around 0 96.6%
Taylor expanded in x around 0 93.3%
Final simplification86.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* c i) -8.2e+150)
(+ (* c i) (* z t))
(if (<= (* c i) 0.0)
t_1
(if (<= (* c i) 1.55e-38)
(+ (* a b) (* x y))
(if (<= (* c i) 1.32e+70) t_1 (+ (* a b) (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -8.2e+150) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 0.0) {
tmp = t_1;
} else if ((c * i) <= 1.55e-38) {
tmp = (a * b) + (x * y);
} else if ((c * i) <= 1.32e+70) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (z * t)
if ((c * i) <= (-8.2d+150)) then
tmp = (c * i) + (z * t)
else if ((c * i) <= 0.0d0) then
tmp = t_1
else if ((c * i) <= 1.55d-38) then
tmp = (a * b) + (x * y)
else if ((c * i) <= 1.32d+70) then
tmp = t_1
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -8.2e+150) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 0.0) {
tmp = t_1;
} else if ((c * i) <= 1.55e-38) {
tmp = (a * b) + (x * y);
} else if ((c * i) <= 1.32e+70) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (c * i) <= -8.2e+150: tmp = (c * i) + (z * t) elif (c * i) <= 0.0: tmp = t_1 elif (c * i) <= 1.55e-38: tmp = (a * b) + (x * y) elif (c * i) <= 1.32e+70: tmp = t_1 else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -8.2e+150) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(c * i) <= 0.0) tmp = t_1; elseif (Float64(c * i) <= 1.55e-38) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(c * i) <= 1.32e+70) tmp = t_1; else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); tmp = 0.0; if ((c * i) <= -8.2e+150) tmp = (c * i) + (z * t); elseif ((c * i) <= 0.0) tmp = t_1; elseif ((c * i) <= 1.55e-38) tmp = (a * b) + (x * y); elseif ((c * i) <= 1.32e+70) tmp = t_1; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -8.2e+150], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 0.0], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.55e-38], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.32e+70], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -8.2 \cdot 10^{+150}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 0:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 1.55 \cdot 10^{-38}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 1.32 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -8.19999999999999988e150Initial program 86.1%
Taylor expanded in a around 0 82.4%
Taylor expanded in x around 0 79.8%
if -8.19999999999999988e150 < (*.f64 c i) < 0.0 or 1.54999999999999991e-38 < (*.f64 c i) < 1.3199999999999999e70Initial program 100.0%
Taylor expanded in c around 0 94.8%
Taylor expanded in x around 0 75.0%
if 0.0 < (*.f64 c i) < 1.54999999999999991e-38Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
associate-+r+99.9%
+-commutative99.9%
fma-def99.9%
fma-def99.9%
Simplified99.9%
fma-udef99.9%
+-commutative99.9%
Applied egg-rr99.9%
fma-udef99.9%
*-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 70.4%
Taylor expanded in c around 0 67.1%
if 1.3199999999999999e70 < (*.f64 c i) Initial program 92.4%
associate-+l+92.4%
+-commutative92.4%
associate-+l+92.4%
fma-def96.2%
associate-+r+96.2%
+-commutative96.2%
fma-def98.1%
fma-def98.1%
Simplified98.1%
fma-udef96.2%
+-commutative96.2%
Applied egg-rr96.2%
fma-udef92.5%
*-commutative92.5%
+-commutative92.5%
associate-+r+92.5%
*-commutative92.5%
Applied egg-rr92.5%
Taylor expanded in z around 0 88.5%
Taylor expanded in c around inf 72.2%
Final simplification73.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -5.7e+149) (not (<= (* c i) 3.4e+66))) (+ (* a b) (+ (* c i) (* x y))) (+ (* 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) <= -5.7e+149) || !((c * i) <= 3.4e+66)) {
tmp = (a * b) + ((c * i) + (x * y));
} 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) <= (-5.7d+149)) .or. (.not. ((c * i) <= 3.4d+66))) then
tmp = (a * b) + ((c * i) + (x * y))
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) <= -5.7e+149) || !((c * i) <= 3.4e+66)) {
tmp = (a * b) + ((c * i) + (x * y));
} 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) <= -5.7e+149) or not ((c * i) <= 3.4e+66): tmp = (a * b) + ((c * i) + (x * y)) 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) <= -5.7e+149) || !(Float64(c * i) <= 3.4e+66)) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(x * y))); 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) <= -5.7e+149) || ~(((c * i) <= 3.4e+66))) tmp = (a * b) + ((c * i) + (x * y)); 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], -5.7e+149], N[Not[LessEqual[N[(c * i), $MachinePrecision], 3.4e+66]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $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 -5.7 \cdot 10^{+149} \lor \neg \left(c \cdot i \leq 3.4 \cdot 10^{+66}\right):\\
\;\;\;\;a \cdot b + \left(c \cdot i + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -5.69999999999999965e149 or 3.4000000000000003e66 < (*.f64 c i) Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+l+89.9%
fma-def93.2%
associate-+r+93.2%
+-commutative93.2%
fma-def96.6%
fma-def96.6%
Simplified96.6%
fma-udef93.3%
+-commutative93.3%
Applied egg-rr93.3%
fma-udef89.9%
*-commutative89.9%
+-commutative89.9%
associate-+r+89.9%
*-commutative89.9%
Applied egg-rr89.9%
Taylor expanded in z around 0 85.4%
if -5.69999999999999965e149 < (*.f64 c i) < 3.4000000000000003e66Initial program 100.0%
Taylor expanded in c around 0 95.1%
Final simplification91.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -3.8e+29)
(+ (* c i) (+ (* a b) (* z t)))
(if (<= (* c i) 7e+65)
(+ (* a b) (+ (* x y) (* z t)))
(+ (* a b) (+ (* c i) (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -3.8e+29) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((c * i) <= 7e+65) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (a * b) + ((c * i) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-3.8d+29)) then
tmp = (c * i) + ((a * b) + (z * t))
else if ((c * i) <= 7d+65) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (a * b) + ((c * i) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -3.8e+29) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((c * i) <= 7e+65) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (a * b) + ((c * i) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -3.8e+29: tmp = (c * i) + ((a * b) + (z * t)) elif (c * i) <= 7e+65: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (a * b) + ((c * i) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -3.8e+29) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); elseif (Float64(c * i) <= 7e+65) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -3.8e+29) tmp = (c * i) + ((a * b) + (z * t)); elseif ((c * i) <= 7e+65) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (a * b) + ((c * i) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -3.8e+29], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 7e+65], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+29}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{elif}\;c \cdot i \leq 7 \cdot 10^{+65}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -3.79999999999999971e29Initial program 90.6%
Taylor expanded in x around 0 86.9%
if -3.79999999999999971e29 < (*.f64 c i) < 7.0000000000000002e65Initial program 100.0%
Taylor expanded in c around 0 97.0%
if 7.0000000000000002e65 < (*.f64 c i) Initial program 92.4%
associate-+l+92.4%
+-commutative92.4%
associate-+l+92.4%
fma-def96.2%
associate-+r+96.2%
+-commutative96.2%
fma-def98.1%
fma-def98.1%
Simplified98.1%
fma-udef96.2%
+-commutative96.2%
Applied egg-rr96.2%
fma-udef92.5%
*-commutative92.5%
+-commutative92.5%
associate-+r+92.5%
*-commutative92.5%
Applied egg-rr92.5%
Taylor expanded in z around 0 88.5%
Final simplification93.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= i -1.1e-110)
t_1
(if (<= i 3.6e-224)
(+ (* x y) (* z t))
(if (<= i 1.6e-15)
(+ (* a b) (* z t))
(if (<= i 2.1e+112)
(+ (* a b) (* x y))
(if (<= i 3.6e+178) 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) + (c * i);
double tmp;
if (i <= -1.1e-110) {
tmp = t_1;
} else if (i <= 3.6e-224) {
tmp = (x * y) + (z * t);
} else if (i <= 1.6e-15) {
tmp = (a * b) + (z * t);
} else if (i <= 2.1e+112) {
tmp = (a * b) + (x * y);
} else if (i <= 3.6e+178) {
tmp = t_1;
} else {
tmp = (c * i) + (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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if (i <= (-1.1d-110)) then
tmp = t_1
else if (i <= 3.6d-224) then
tmp = (x * y) + (z * t)
else if (i <= 1.6d-15) then
tmp = (a * b) + (z * t)
else if (i <= 2.1d+112) then
tmp = (a * b) + (x * y)
else if (i <= 3.6d+178) then
tmp = t_1
else
tmp = (c * i) + (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 t_1 = (a * b) + (c * i);
double tmp;
if (i <= -1.1e-110) {
tmp = t_1;
} else if (i <= 3.6e-224) {
tmp = (x * y) + (z * t);
} else if (i <= 1.6e-15) {
tmp = (a * b) + (z * t);
} else if (i <= 2.1e+112) {
tmp = (a * b) + (x * y);
} else if (i <= 3.6e+178) {
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) + (c * i) tmp = 0 if i <= -1.1e-110: tmp = t_1 elif i <= 3.6e-224: tmp = (x * y) + (z * t) elif i <= 1.6e-15: tmp = (a * b) + (z * t) elif i <= 2.1e+112: tmp = (a * b) + (x * y) elif i <= 3.6e+178: 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(a * b) + Float64(c * i)) tmp = 0.0 if (i <= -1.1e-110) tmp = t_1; elseif (i <= 3.6e-224) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (i <= 1.6e-15) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (i <= 2.1e+112) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (i <= 3.6e+178) 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) + (c * i); tmp = 0.0; if (i <= -1.1e-110) tmp = t_1; elseif (i <= 3.6e-224) tmp = (x * y) + (z * t); elseif (i <= 1.6e-15) tmp = (a * b) + (z * t); elseif (i <= 2.1e+112) tmp = (a * b) + (x * y); elseif (i <= 3.6e+178) 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[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.1e-110], t$95$1, If[LessEqual[i, 3.6e-224], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.6e-15], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.1e+112], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.6e+178], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;i \leq -1.1 \cdot 10^{-110}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 3.6 \cdot 10^{-224}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;i \leq 1.6 \cdot 10^{-15}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;i \leq 2.1 \cdot 10^{+112}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;i \leq 3.6 \cdot 10^{+178}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if i < -1.1e-110 or 2.0999999999999999e112 < i < 3.5999999999999998e178Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+l+96.1%
fma-def97.1%
associate-+r+97.1%
+-commutative97.1%
fma-def98.1%
fma-def98.1%
Simplified98.1%
fma-udef97.1%
+-commutative97.1%
Applied egg-rr97.1%
fma-udef96.1%
*-commutative96.1%
+-commutative96.1%
associate-+r+96.1%
*-commutative96.1%
Applied egg-rr96.1%
Taylor expanded in z around 0 75.6%
Taylor expanded in c around inf 62.3%
if -1.1e-110 < i < 3.6e-224Initial program 100.0%
Taylor expanded in c around 0 97.1%
Taylor expanded in a around 0 67.2%
if 3.6e-224 < i < 1.6e-15Initial program 97.2%
Taylor expanded in c around 0 89.5%
Taylor expanded in x around 0 76.0%
if 1.6e-15 < i < 2.0999999999999999e112Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+l+96.1%
fma-def99.9%
associate-+r+99.9%
+-commutative99.9%
fma-def99.9%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
+-commutative100.0%
Applied egg-rr100.0%
fma-udef96.2%
*-commutative96.2%
+-commutative96.2%
associate-+r+96.2%
*-commutative96.2%
Applied egg-rr96.2%
Taylor expanded in z around 0 76.9%
Taylor expanded in c around 0 57.9%
if 3.5999999999999998e178 < i Initial program 88.0%
Taylor expanded in a around 0 84.0%
Taylor expanded in x around 0 80.0%
Final simplification66.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= b -2.55e+107)
(* a b)
(if (<= b -8e-179)
(* z t)
(if (<= b 2.7e-198)
(* c i)
(if (<= b 1.15e-25)
(* z t)
(if (<= b 3.6e-5) (* x y) (if (<= b 2.8e+116) (* 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 (b <= -2.55e+107) {
tmp = a * b;
} else if (b <= -8e-179) {
tmp = z * t;
} else if (b <= 2.7e-198) {
tmp = c * i;
} else if (b <= 1.15e-25) {
tmp = z * t;
} else if (b <= 3.6e-5) {
tmp = x * y;
} else if (b <= 2.8e+116) {
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 (b <= (-2.55d+107)) then
tmp = a * b
else if (b <= (-8d-179)) then
tmp = z * t
else if (b <= 2.7d-198) then
tmp = c * i
else if (b <= 1.15d-25) then
tmp = z * t
else if (b <= 3.6d-5) then
tmp = x * y
else if (b <= 2.8d+116) 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 (b <= -2.55e+107) {
tmp = a * b;
} else if (b <= -8e-179) {
tmp = z * t;
} else if (b <= 2.7e-198) {
tmp = c * i;
} else if (b <= 1.15e-25) {
tmp = z * t;
} else if (b <= 3.6e-5) {
tmp = x * y;
} else if (b <= 2.8e+116) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if b <= -2.55e+107: tmp = a * b elif b <= -8e-179: tmp = z * t elif b <= 2.7e-198: tmp = c * i elif b <= 1.15e-25: tmp = z * t elif b <= 3.6e-5: tmp = x * y elif b <= 2.8e+116: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (b <= -2.55e+107) tmp = Float64(a * b); elseif (b <= -8e-179) tmp = Float64(z * t); elseif (b <= 2.7e-198) tmp = Float64(c * i); elseif (b <= 1.15e-25) tmp = Float64(z * t); elseif (b <= 3.6e-5) tmp = Float64(x * y); elseif (b <= 2.8e+116) 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 (b <= -2.55e+107) tmp = a * b; elseif (b <= -8e-179) tmp = z * t; elseif (b <= 2.7e-198) tmp = c * i; elseif (b <= 1.15e-25) tmp = z * t; elseif (b <= 3.6e-5) tmp = x * y; elseif (b <= 2.8e+116) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[b, -2.55e+107], N[(a * b), $MachinePrecision], If[LessEqual[b, -8e-179], N[(z * t), $MachinePrecision], If[LessEqual[b, 2.7e-198], N[(c * i), $MachinePrecision], If[LessEqual[b, 1.15e-25], N[(z * t), $MachinePrecision], If[LessEqual[b, 3.6e-5], N[(x * y), $MachinePrecision], If[LessEqual[b, 2.8e+116], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.55 \cdot 10^{+107}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq -8 \cdot 10^{-179}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;b \leq 2.7 \cdot 10^{-198}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-25}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{-5}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{+116}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if b < -2.5500000000000001e107 or 2.80000000000000004e116 < b Initial program 98.6%
Taylor expanded in a around inf 57.1%
if -2.5500000000000001e107 < b < -8.0000000000000002e-179 or 2.7000000000000002e-198 < b < 1.15e-25 or 3.60000000000000009e-5 < b < 2.80000000000000004e116Initial program 97.5%
Taylor expanded in z around inf 39.4%
if -8.0000000000000002e-179 < b < 2.7000000000000002e-198Initial program 92.2%
Taylor expanded in c around inf 34.8%
if 1.15e-25 < b < 3.60000000000000009e-5Initial program 87.5%
Taylor expanded in x around inf 63.7%
Final simplification44.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.35e+150) (not (<= (* x y) 1.15e+227))) (* 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) <= -1.35e+150) || !((x * y) <= 1.15e+227)) {
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) <= (-1.35d+150)) .or. (.not. ((x * y) <= 1.15d+227))) 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) <= -1.35e+150) || !((x * y) <= 1.15e+227)) {
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) <= -1.35e+150) or not ((x * y) <= 1.15e+227): 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) <= -1.35e+150) || !(Float64(x * y) <= 1.15e+227)) 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) <= -1.35e+150) || ~(((x * y) <= 1.15e+227))) 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], -1.35e+150], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.15e+227]], $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 -1.35 \cdot 10^{+150} \lor \neg \left(x \cdot y \leq 1.15 \cdot 10^{+227}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.35000000000000004e150 or 1.1499999999999999e227 < (*.f64 x y) Initial program 91.8%
Taylor expanded in x around inf 74.9%
if -1.35000000000000004e150 < (*.f64 x y) < 1.1499999999999999e227Initial program 97.9%
associate-+l+97.9%
+-commutative97.9%
associate-+l+97.9%
fma-def98.5%
associate-+r+98.5%
+-commutative98.5%
fma-def99.0%
fma-def99.0%
Simplified99.0%
fma-udef98.5%
+-commutative98.5%
Applied egg-rr98.5%
fma-udef97.9%
*-commutative97.9%
+-commutative97.9%
associate-+r+97.9%
*-commutative97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 68.3%
Taylor expanded in c around inf 61.3%
Final simplification64.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= b -1.8e+111)
(* a b)
(if (<= b -1.56e-177)
(* z t)
(if (<= b 2.55e-198) (* c i) (if (<= b 2.85e+116) (* 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 (b <= -1.8e+111) {
tmp = a * b;
} else if (b <= -1.56e-177) {
tmp = z * t;
} else if (b <= 2.55e-198) {
tmp = c * i;
} else if (b <= 2.85e+116) {
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 (b <= (-1.8d+111)) then
tmp = a * b
else if (b <= (-1.56d-177)) then
tmp = z * t
else if (b <= 2.55d-198) then
tmp = c * i
else if (b <= 2.85d+116) 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 (b <= -1.8e+111) {
tmp = a * b;
} else if (b <= -1.56e-177) {
tmp = z * t;
} else if (b <= 2.55e-198) {
tmp = c * i;
} else if (b <= 2.85e+116) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if b <= -1.8e+111: tmp = a * b elif b <= -1.56e-177: tmp = z * t elif b <= 2.55e-198: tmp = c * i elif b <= 2.85e+116: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (b <= -1.8e+111) tmp = Float64(a * b); elseif (b <= -1.56e-177) tmp = Float64(z * t); elseif (b <= 2.55e-198) tmp = Float64(c * i); elseif (b <= 2.85e+116) 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 (b <= -1.8e+111) tmp = a * b; elseif (b <= -1.56e-177) tmp = z * t; elseif (b <= 2.55e-198) tmp = c * i; elseif (b <= 2.85e+116) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[b, -1.8e+111], N[(a * b), $MachinePrecision], If[LessEqual[b, -1.56e-177], N[(z * t), $MachinePrecision], If[LessEqual[b, 2.55e-198], N[(c * i), $MachinePrecision], If[LessEqual[b, 2.85e+116], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{+111}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq -1.56 \cdot 10^{-177}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;b \leq 2.55 \cdot 10^{-198}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;b \leq 2.85 \cdot 10^{+116}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if b < -1.8000000000000001e111 or 2.84999999999999991e116 < b Initial program 98.6%
Taylor expanded in a around inf 57.9%
if -1.8000000000000001e111 < b < -1.5600000000000001e-177 or 2.5499999999999998e-198 < b < 2.84999999999999991e116Initial program 96.9%
Taylor expanded in z around inf 37.0%
if -1.5600000000000001e-177 < b < 2.5499999999999998e-198Initial program 92.2%
Taylor expanded in c around inf 34.8%
Final simplification42.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -5.2e+39) (not (<= (* a b) 7.5e+122))) (* 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) <= -5.2e+39) || !((a * b) <= 7.5e+122)) {
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) <= (-5.2d+39)) .or. (.not. ((a * b) <= 7.5d+122))) 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) <= -5.2e+39) || !((a * b) <= 7.5e+122)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -5.2e+39) or not ((a * b) <= 7.5e+122): 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) <= -5.2e+39) || !(Float64(a * b) <= 7.5e+122)) 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) <= -5.2e+39) || ~(((a * b) <= 7.5e+122))) 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], -5.2e+39], N[Not[LessEqual[N[(a * b), $MachinePrecision], 7.5e+122]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5.2 \cdot 10^{+39} \lor \neg \left(a \cdot b \leq 7.5 \cdot 10^{+122}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -5.2e39 or 7.5000000000000002e122 < (*.f64 a b) Initial program 95.9%
Taylor expanded in a around inf 57.4%
if -5.2e39 < (*.f64 a b) < 7.5000000000000002e122Initial program 96.8%
Taylor expanded in c around inf 36.7%
Final simplification44.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -1.1e-110) (not (<= i 6e+113))) (+ (* 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 ((i <= -1.1e-110) || !(i <= 6e+113)) {
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 ((i <= (-1.1d-110)) .or. (.not. (i <= 6d+113))) 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 ((i <= -1.1e-110) || !(i <= 6e+113)) {
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 (i <= -1.1e-110) or not (i <= 6e+113): 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 ((i <= -1.1e-110) || !(i <= 6e+113)) 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 ((i <= -1.1e-110) || ~((i <= 6e+113))) 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[i, -1.1e-110], N[Not[LessEqual[i, 6e+113]], $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}\;i \leq -1.1 \cdot 10^{-110} \lor \neg \left(i \leq 6 \cdot 10^{+113}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if i < -1.1e-110 or 6e113 < i Initial program 94.5%
associate-+l+94.5%
+-commutative94.5%
associate-+l+94.5%
fma-def96.1%
associate-+r+96.1%
+-commutative96.1%
fma-def98.4%
fma-def98.4%
Simplified98.4%
fma-udef96.1%
+-commutative96.1%
Applied egg-rr96.1%
fma-udef94.5%
*-commutative94.5%
+-commutative94.5%
associate-+r+94.5%
*-commutative94.5%
Applied egg-rr94.5%
Taylor expanded in z around 0 75.5%
Taylor expanded in c around inf 63.3%
if -1.1e-110 < i < 6e113Initial program 98.4%
Taylor expanded in c around 0 91.8%
Taylor expanded in x around 0 62.7%
Final simplification63.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 96.5%
Taylor expanded in a around inf 26.3%
Final simplification26.3%
herbie shell --seed 2023299
(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)))