
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-def98.4%
associate-+l+98.4%
fma-def98.4%
fma-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-def98.4%
+-commutative98.4%
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 (* a b)) (+ (* x y) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(z, t, (a * b)) + ((x * y) + (c * i));
}
function code(x, y, z, t, a, b, c, i) return Float64(fma(z, t, Float64(a * b)) + Float64(Float64(x * y) + Float64(c * i))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, t, a \cdot b\right) + \left(x \cdot y + c \cdot i\right)
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-def98.4%
+-commutative98.4%
fma-def98.8%
fma-def98.8%
Simplified98.8%
fma-udef98.0%
fma-def98.0%
fma-udef97.6%
+-commutative97.6%
associate-+l+97.6%
fma-udef98.0%
associate-+r+98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (+ (+ (* a b) (* x y)) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, (((a * b) + (x * y)) + (z * t)));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(z * t))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \left(a \cdot b + x \cdot y\right) + z \cdot t\right)
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-def98.4%
+-commutative98.4%
fma-def98.8%
fma-def98.8%
Simplified98.8%
fma-def98.8%
fma-udef98.4%
associate-+r+98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.5e+147)
(* a b)
(if (<= (* a b) -2.55e+91)
(* c i)
(if (<= (* a b) -1.3e+73)
(* a b)
(if (<= (* a b) -5.8e-69)
(* z t)
(if (<= (* a b) -2.8e-238)
(* x y)
(if (<= (* a b) -1.1e-282)
(* z t)
(if (<= (* a b) 1.05e-248)
(* c i)
(if (<= (* a b) 5.2e+74) (* x y) (* a b))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.5e+147) {
tmp = a * b;
} else if ((a * b) <= -2.55e+91) {
tmp = c * i;
} else if ((a * b) <= -1.3e+73) {
tmp = a * b;
} else if ((a * b) <= -5.8e-69) {
tmp = z * t;
} else if ((a * b) <= -2.8e-238) {
tmp = x * y;
} else if ((a * b) <= -1.1e-282) {
tmp = z * t;
} else if ((a * b) <= 1.05e-248) {
tmp = c * i;
} else if ((a * b) <= 5.2e+74) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.5d+147)) then
tmp = a * b
else if ((a * b) <= (-2.55d+91)) then
tmp = c * i
else if ((a * b) <= (-1.3d+73)) then
tmp = a * b
else if ((a * b) <= (-5.8d-69)) then
tmp = z * t
else if ((a * b) <= (-2.8d-238)) then
tmp = x * y
else if ((a * b) <= (-1.1d-282)) then
tmp = z * t
else if ((a * b) <= 1.05d-248) then
tmp = c * i
else if ((a * b) <= 5.2d+74) then
tmp = x * y
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.5e+147) {
tmp = a * b;
} else if ((a * b) <= -2.55e+91) {
tmp = c * i;
} else if ((a * b) <= -1.3e+73) {
tmp = a * b;
} else if ((a * b) <= -5.8e-69) {
tmp = z * t;
} else if ((a * b) <= -2.8e-238) {
tmp = x * y;
} else if ((a * b) <= -1.1e-282) {
tmp = z * t;
} else if ((a * b) <= 1.05e-248) {
tmp = c * i;
} else if ((a * b) <= 5.2e+74) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.5e+147: tmp = a * b elif (a * b) <= -2.55e+91: tmp = c * i elif (a * b) <= -1.3e+73: tmp = a * b elif (a * b) <= -5.8e-69: tmp = z * t elif (a * b) <= -2.8e-238: tmp = x * y elif (a * b) <= -1.1e-282: tmp = z * t elif (a * b) <= 1.05e-248: tmp = c * i elif (a * b) <= 5.2e+74: tmp = x * y else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.5e+147) tmp = Float64(a * b); elseif (Float64(a * b) <= -2.55e+91) tmp = Float64(c * i); elseif (Float64(a * b) <= -1.3e+73) tmp = Float64(a * b); elseif (Float64(a * b) <= -5.8e-69) tmp = Float64(z * t); elseif (Float64(a * b) <= -2.8e-238) tmp = Float64(x * y); elseif (Float64(a * b) <= -1.1e-282) tmp = Float64(z * t); elseif (Float64(a * b) <= 1.05e-248) tmp = Float64(c * i); elseif (Float64(a * b) <= 5.2e+74) tmp = Float64(x * y); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.5e+147) tmp = a * b; elseif ((a * b) <= -2.55e+91) tmp = c * i; elseif ((a * b) <= -1.3e+73) tmp = a * b; elseif ((a * b) <= -5.8e-69) tmp = z * t; elseif ((a * b) <= -2.8e-238) tmp = x * y; elseif ((a * b) <= -1.1e-282) tmp = z * t; elseif ((a * b) <= 1.05e-248) tmp = c * i; elseif ((a * b) <= 5.2e+74) tmp = x * y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1.5e+147], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2.55e+91], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.3e+73], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -5.8e-69], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2.8e-238], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.1e-282], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.05e-248], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.2e+74], N[(x * y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.5 \cdot 10^{+147}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -2.55 \cdot 10^{+91}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -1.3 \cdot 10^{+73}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -5.8 \cdot 10^{-69}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -2.8 \cdot 10^{-238}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -1.1 \cdot 10^{-282}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.05 \cdot 10^{-248}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 5.2 \cdot 10^{+74}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.49999999999999997e147 or -2.55000000000000007e91 < (*.f64 a b) < -1.3e73 or 5.2000000000000001e74 < (*.f64 a b) Initial program 94.8%
+-commutative94.8%
fma-def95.8%
+-commutative95.8%
fma-def96.9%
fma-def96.9%
Simplified96.9%
fma-udef95.8%
fma-def95.8%
fma-udef94.8%
+-commutative94.8%
associate-+l+94.8%
fma-udef95.8%
associate-+r+95.8%
Applied egg-rr95.8%
Taylor expanded in a around inf 69.7%
if -1.49999999999999997e147 < (*.f64 a b) < -2.55000000000000007e91 or -1.09999999999999991e-282 < (*.f64 a b) < 1.05e-248Initial program 100.0%
Taylor expanded in c around inf 50.1%
if -1.3e73 < (*.f64 a b) < -5.7999999999999997e-69 or -2.80000000000000004e-238 < (*.f64 a b) < -1.09999999999999991e-282Initial program 100.0%
+-commutative100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-def100.0%
fma-udef100.0%
+-commutative100.0%
associate-+l+100.0%
fma-udef100.0%
associate-+r+100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 50.7%
if -5.7999999999999997e-69 < (*.f64 a b) < -2.80000000000000004e-238 or 1.05e-248 < (*.f64 a b) < 5.2000000000000001e74Initial program 98.6%
+-commutative98.6%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef98.6%
fma-def98.6%
fma-udef98.6%
+-commutative98.6%
associate-+l+98.6%
fma-udef98.6%
associate-+r+98.6%
Applied egg-rr98.6%
Taylor expanded in x around inf 45.0%
Final simplification56.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.6e+147)
(* a b)
(if (<= (* a b) -1.15e+91)
(* c i)
(if (<= (* a b) -1.85e+73)
(* a b)
(if (<= (* a b) -1.55e-139)
(* z t)
(if (<= (* a b) 1.1e-248)
(* c i)
(if (<= (* a b) 7.3e+114) (* z t) (* a b))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.6e+147) {
tmp = a * b;
} else if ((a * b) <= -1.15e+91) {
tmp = c * i;
} else if ((a * b) <= -1.85e+73) {
tmp = a * b;
} else if ((a * b) <= -1.55e-139) {
tmp = z * t;
} else if ((a * b) <= 1.1e-248) {
tmp = c * i;
} else if ((a * b) <= 7.3e+114) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.6d+147)) then
tmp = a * b
else if ((a * b) <= (-1.15d+91)) then
tmp = c * i
else if ((a * b) <= (-1.85d+73)) then
tmp = a * b
else if ((a * b) <= (-1.55d-139)) then
tmp = z * t
else if ((a * b) <= 1.1d-248) then
tmp = c * i
else if ((a * b) <= 7.3d+114) then
tmp = z * t
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.6e+147) {
tmp = a * b;
} else if ((a * b) <= -1.15e+91) {
tmp = c * i;
} else if ((a * b) <= -1.85e+73) {
tmp = a * b;
} else if ((a * b) <= -1.55e-139) {
tmp = z * t;
} else if ((a * b) <= 1.1e-248) {
tmp = c * i;
} else if ((a * b) <= 7.3e+114) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.6e+147: tmp = a * b elif (a * b) <= -1.15e+91: tmp = c * i elif (a * b) <= -1.85e+73: tmp = a * b elif (a * b) <= -1.55e-139: tmp = z * t elif (a * b) <= 1.1e-248: tmp = c * i elif (a * b) <= 7.3e+114: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.6e+147) tmp = Float64(a * b); elseif (Float64(a * b) <= -1.15e+91) tmp = Float64(c * i); elseif (Float64(a * b) <= -1.85e+73) tmp = Float64(a * b); elseif (Float64(a * b) <= -1.55e-139) tmp = Float64(z * t); elseif (Float64(a * b) <= 1.1e-248) tmp = Float64(c * i); elseif (Float64(a * b) <= 7.3e+114) tmp = Float64(z * t); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.6e+147) tmp = a * b; elseif ((a * b) <= -1.15e+91) tmp = c * i; elseif ((a * b) <= -1.85e+73) tmp = a * b; elseif ((a * b) <= -1.55e-139) tmp = z * t; elseif ((a * b) <= 1.1e-248) tmp = c * i; elseif ((a * b) <= 7.3e+114) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1.6e+147], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.15e+91], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.85e+73], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.55e-139], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.1e-248], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 7.3e+114], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.6 \cdot 10^{+147}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.15 \cdot 10^{+91}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -1.85 \cdot 10^{+73}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.55 \cdot 10^{-139}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.1 \cdot 10^{-248}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 7.3 \cdot 10^{+114}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.59999999999999989e147 or -1.14999999999999996e91 < (*.f64 a b) < -1.84999999999999987e73 or 7.3000000000000001e114 < (*.f64 a b) Initial program 94.4%
+-commutative94.4%
fma-def95.5%
+-commutative95.5%
fma-def96.6%
fma-def96.6%
Simplified96.6%
fma-udef95.5%
fma-def95.5%
fma-udef94.4%
+-commutative94.4%
associate-+l+94.4%
fma-udef95.6%
associate-+r+95.6%
Applied egg-rr95.6%
Taylor expanded in a around inf 73.1%
if -1.59999999999999989e147 < (*.f64 a b) < -1.14999999999999996e91 or -1.55e-139 < (*.f64 a b) < 1.1e-248Initial program 100.0%
Taylor expanded in c around inf 45.6%
if -1.84999999999999987e73 < (*.f64 a b) < -1.55e-139 or 1.1e-248 < (*.f64 a b) < 7.3000000000000001e114Initial program 98.9%
+-commutative98.9%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef98.9%
fma-def98.9%
fma-udef98.9%
+-commutative98.9%
associate-+l+98.9%
fma-udef98.9%
associate-+r+98.9%
Applied egg-rr98.9%
Taylor expanded in z around inf 37.9%
Final simplification52.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (+ (* x y) (* z t)))) (t_2 (+ (* a b) (* c i))))
(if (<= (* c i) -1.25e+188)
t_2
(if (<= (* c i) -4.1e+123)
t_1
(if (<= (* c i) -4.7e+55)
t_2
(if (<= (* c i) 1.4e+110) t_1 (+ (* x y) (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + ((x * y) + (z * t));
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.25e+188) {
tmp = t_2;
} else if ((c * i) <= -4.1e+123) {
tmp = t_1;
} else if ((c * i) <= -4.7e+55) {
tmp = t_2;
} else if ((c * i) <= 1.4e+110) {
tmp = t_1;
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + ((x * y) + (z * t))
t_2 = (a * b) + (c * i)
if ((c * i) <= (-1.25d+188)) then
tmp = t_2
else if ((c * i) <= (-4.1d+123)) then
tmp = t_1
else if ((c * i) <= (-4.7d+55)) then
tmp = t_2
else if ((c * i) <= 1.4d+110) then
tmp = t_1
else
tmp = (x * y) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + ((x * y) + (z * t));
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.25e+188) {
tmp = t_2;
} else if ((c * i) <= -4.1e+123) {
tmp = t_1;
} else if ((c * i) <= -4.7e+55) {
tmp = t_2;
} else if ((c * i) <= 1.4e+110) {
tmp = t_1;
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + ((x * y) + (z * t)) t_2 = (a * b) + (c * i) tmp = 0 if (c * i) <= -1.25e+188: tmp = t_2 elif (c * i) <= -4.1e+123: tmp = t_1 elif (c * i) <= -4.7e+55: tmp = t_2 elif (c * i) <= 1.4e+110: tmp = t_1 else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) t_2 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -1.25e+188) tmp = t_2; elseif (Float64(c * i) <= -4.1e+123) tmp = t_1; elseif (Float64(c * i) <= -4.7e+55) tmp = t_2; elseif (Float64(c * i) <= 1.4e+110) tmp = t_1; else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + ((x * y) + (z * t)); t_2 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -1.25e+188) tmp = t_2; elseif ((c * i) <= -4.1e+123) tmp = t_1; elseif ((c * i) <= -4.7e+55) tmp = t_2; elseif ((c * i) <= 1.4e+110) tmp = t_1; else tmp = (x * y) + (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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.25e+188], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -4.1e+123], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -4.7e+55], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 1.4e+110], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + \left(x \cdot y + z \cdot t\right)\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -1.25 \cdot 10^{+188}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq -4.1 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -4.7 \cdot 10^{+55}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 1.4 \cdot 10^{+110}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.25e188 or -4.09999999999999989e123 < (*.f64 c i) < -4.7000000000000001e55Initial program 94.6%
Taylor expanded in a around inf 87.8%
if -1.25e188 < (*.f64 c i) < -4.09999999999999989e123 or -4.7000000000000001e55 < (*.f64 c i) < 1.39999999999999993e110Initial program 98.3%
+-commutative98.3%
fma-def98.3%
+-commutative98.3%
fma-def98.9%
fma-def98.9%
Simplified98.9%
fma-udef98.9%
fma-def98.9%
fma-udef98.3%
+-commutative98.3%
associate-+l+98.3%
fma-udef98.9%
associate-+r+98.9%
Applied egg-rr98.9%
Taylor expanded in c around 0 93.4%
if 1.39999999999999993e110 < (*.f64 c i) Initial program 97.3%
Taylor expanded in x around inf 84.5%
Final simplification91.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ (* a b) (* c i))))
(if (<= (* a b) -1.25e+48)
t_2
(if (<= (* a b) -6e-268)
t_1
(if (<= (* a b) 1.45e-249)
(+ (* c i) (* z t))
(if (<= (* a b) 8.5e+73) t_1 t_2))))))
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) + (c * i);
double tmp;
if ((a * b) <= -1.25e+48) {
tmp = t_2;
} else if ((a * b) <= -6e-268) {
tmp = t_1;
} else if ((a * b) <= 1.45e-249) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 8.5e+73) {
tmp = t_1;
} 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 = (x * y) + (z * t)
t_2 = (a * b) + (c * i)
if ((a * b) <= (-1.25d+48)) then
tmp = t_2
else if ((a * b) <= (-6d-268)) then
tmp = t_1
else if ((a * b) <= 1.45d-249) then
tmp = (c * i) + (z * t)
else if ((a * b) <= 8.5d+73) then
tmp = t_1
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 = (x * y) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -1.25e+48) {
tmp = t_2;
} else if ((a * b) <= -6e-268) {
tmp = t_1;
} else if ((a * b) <= 1.45e-249) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 8.5e+73) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = (a * b) + (c * i) tmp = 0 if (a * b) <= -1.25e+48: tmp = t_2 elif (a * b) <= -6e-268: tmp = t_1 elif (a * b) <= 1.45e-249: tmp = (c * i) + (z * t) elif (a * b) <= 8.5e+73: tmp = t_1 else: tmp = t_2 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(c * i)) tmp = 0.0 if (Float64(a * b) <= -1.25e+48) tmp = t_2; elseif (Float64(a * b) <= -6e-268) tmp = t_1; elseif (Float64(a * b) <= 1.45e-249) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(a * b) <= 8.5e+73) tmp = t_1; else tmp = t_2; 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) + (c * i); tmp = 0.0; if ((a * b) <= -1.25e+48) tmp = t_2; elseif ((a * b) <= -6e-268) tmp = t_1; elseif ((a * b) <= 1.45e-249) tmp = (c * i) + (z * t); elseif ((a * b) <= 8.5e+73) tmp = t_1; else tmp = t_2; 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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.25e+48], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -6e-268], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.45e-249], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 8.5e+73], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -1.25 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -6 \cdot 10^{-268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 1.45 \cdot 10^{-249}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 8.5 \cdot 10^{+73}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.24999999999999993e48 or 8.4999999999999998e73 < (*.f64 a b) Initial program 95.5%
Taylor expanded in a around inf 77.7%
if -1.24999999999999993e48 < (*.f64 a b) < -5.9999999999999995e-268 or 1.45000000000000011e-249 < (*.f64 a b) < 8.4999999999999998e73Initial program 99.0%
Taylor expanded in a around 0 92.5%
Taylor expanded in c around 0 73.6%
if -5.9999999999999995e-268 < (*.f64 a b) < 1.45000000000000011e-249Initial program 100.0%
Taylor expanded in z around inf 70.3%
Final simplification74.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ (* a b) (* c i))))
(if (<= (* a b) -8.8e+46)
t_2
(if (<= (* a b) -4.8e-290)
t_1
(if (<= (* a b) 3.3e-248)
(+ (* x y) (* c i))
(if (<= (* a b) 2.8e+74) t_1 t_2))))))
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) + (c * i);
double tmp;
if ((a * b) <= -8.8e+46) {
tmp = t_2;
} else if ((a * b) <= -4.8e-290) {
tmp = t_1;
} else if ((a * b) <= 3.3e-248) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 2.8e+74) {
tmp = t_1;
} 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 = (x * y) + (z * t)
t_2 = (a * b) + (c * i)
if ((a * b) <= (-8.8d+46)) then
tmp = t_2
else if ((a * b) <= (-4.8d-290)) then
tmp = t_1
else if ((a * b) <= 3.3d-248) then
tmp = (x * y) + (c * i)
else if ((a * b) <= 2.8d+74) then
tmp = t_1
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 = (x * y) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -8.8e+46) {
tmp = t_2;
} else if ((a * b) <= -4.8e-290) {
tmp = t_1;
} else if ((a * b) <= 3.3e-248) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 2.8e+74) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = (a * b) + (c * i) tmp = 0 if (a * b) <= -8.8e+46: tmp = t_2 elif (a * b) <= -4.8e-290: tmp = t_1 elif (a * b) <= 3.3e-248: tmp = (x * y) + (c * i) elif (a * b) <= 2.8e+74: tmp = t_1 else: tmp = t_2 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(c * i)) tmp = 0.0 if (Float64(a * b) <= -8.8e+46) tmp = t_2; elseif (Float64(a * b) <= -4.8e-290) tmp = t_1; elseif (Float64(a * b) <= 3.3e-248) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(a * b) <= 2.8e+74) tmp = t_1; else tmp = t_2; 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) + (c * i); tmp = 0.0; if ((a * b) <= -8.8e+46) tmp = t_2; elseif ((a * b) <= -4.8e-290) tmp = t_1; elseif ((a * b) <= 3.3e-248) tmp = (x * y) + (c * i); elseif ((a * b) <= 2.8e+74) tmp = t_1; else tmp = t_2; 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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -8.8e+46], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -4.8e-290], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 3.3e-248], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.8e+74], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -8.8 \cdot 10^{+46}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -4.8 \cdot 10^{-290}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 3.3 \cdot 10^{-248}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 2.8 \cdot 10^{+74}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -8.8000000000000001e46 or 2.80000000000000002e74 < (*.f64 a b) Initial program 95.5%
Taylor expanded in a around inf 77.7%
if -8.8000000000000001e46 < (*.f64 a b) < -4.8000000000000001e-290 or 3.3000000000000002e-248 < (*.f64 a b) < 2.80000000000000002e74Initial program 99.0%
Taylor expanded in a around 0 92.5%
Taylor expanded in c around 0 73.9%
if -4.8000000000000001e-290 < (*.f64 a b) < 3.3000000000000002e-248Initial program 100.0%
Taylor expanded in x around inf 78.7%
Final simplification76.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -1.2e+46) (not (<= (* c i) 1.95e+105))) (+ (+ (* a b) (* x y)) (* c i)) (+ (* a b) (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1.2e+46) || !((c * i) <= 1.95e+105)) {
tmp = ((a * b) + (x * y)) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-1.2d+46)) .or. (.not. ((c * i) <= 1.95d+105))) then
tmp = ((a * b) + (x * y)) + (c * i)
else
tmp = (a * b) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1.2e+46) || !((c * i) <= 1.95e+105)) {
tmp = ((a * b) + (x * y)) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -1.2e+46) or not ((c * i) <= 1.95e+105): tmp = ((a * b) + (x * y)) + (c * i) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -1.2e+46) || !(Float64(c * i) <= 1.95e+105)) tmp = Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -1.2e+46) || ~(((c * i) <= 1.95e+105))) tmp = ((a * b) + (x * y)) + (c * i); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1.2e+46], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.95e+105]], $MachinePrecision]], N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.2 \cdot 10^{+46} \lor \neg \left(c \cdot i \leq 1.95 \cdot 10^{+105}\right):\\
\;\;\;\;\left(a \cdot b + x \cdot y\right) + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -1.20000000000000004e46 or 1.94999999999999989e105 < (*.f64 c i) Initial program 96.7%
Taylor expanded in z around 0 89.5%
if -1.20000000000000004e46 < (*.f64 c i) < 1.94999999999999989e105Initial program 98.1%
+-commutative98.1%
fma-def98.1%
+-commutative98.1%
fma-def98.8%
fma-def98.8%
Simplified98.8%
fma-udef98.8%
fma-def98.8%
fma-udef98.1%
+-commutative98.1%
associate-+l+98.1%
fma-udef98.8%
associate-+r+98.8%
Applied egg-rr98.8%
Taylor expanded in c around 0 95.0%
Final simplification93.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* c i) -6.6e+45)
(+ (+ (* a b) (* x y)) (* c i))
(if (<= (* c i) 1.1e+107) (+ (* a b) t_1) (+ (* c i) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -6.6e+45) {
tmp = ((a * b) + (x * y)) + (c * i);
} else if ((c * i) <= 1.1e+107) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
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 = (x * y) + (z * t)
if ((c * i) <= (-6.6d+45)) then
tmp = ((a * b) + (x * y)) + (c * i)
else if ((c * i) <= 1.1d+107) then
tmp = (a * b) + t_1
else
tmp = (c * i) + t_1
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 tmp;
if ((c * i) <= -6.6e+45) {
tmp = ((a * b) + (x * y)) + (c * i);
} else if ((c * i) <= 1.1e+107) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (c * i) <= -6.6e+45: tmp = ((a * b) + (x * y)) + (c * i) elif (c * i) <= 1.1e+107: tmp = (a * b) + t_1 else: tmp = (c * i) + t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -6.6e+45) tmp = Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(c * i)); elseif (Float64(c * i) <= 1.1e+107) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((c * i) <= -6.6e+45) tmp = ((a * b) + (x * y)) + (c * i); elseif ((c * i) <= 1.1e+107) tmp = (a * b) + t_1; else tmp = (c * i) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -6.6e+45], N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.1e+107], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -6.6 \cdot 10^{+45}:\\
\;\;\;\;\left(a \cdot b + x \cdot y\right) + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 1.1 \cdot 10^{+107}:\\
\;\;\;\;a \cdot b + t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t_1\\
\end{array}
\end{array}
if (*.f64 c i) < -6.6000000000000001e45Initial program 96.3%
Taylor expanded in z around 0 89.2%
if -6.6000000000000001e45 < (*.f64 c i) < 1.1e107Initial program 98.2%
+-commutative98.2%
fma-def98.2%
+-commutative98.2%
fma-def98.8%
fma-def98.8%
Simplified98.8%
fma-udef98.8%
fma-def98.8%
fma-udef98.2%
+-commutative98.2%
associate-+l+98.2%
fma-udef98.8%
associate-+r+98.8%
Applied egg-rr98.8%
Taylor expanded in c around 0 95.0%
if 1.1e107 < (*.f64 c i) Initial program 97.3%
Taylor expanded in a around 0 92.2%
Final simplification93.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -3.5e+119) (not (<= (* x y) 9e+229))) (* 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) <= -3.5e+119) || !((x * y) <= 9e+229)) {
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) <= (-3.5d+119)) .or. (.not. ((x * y) <= 9d+229))) 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) <= -3.5e+119) || !((x * y) <= 9e+229)) {
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) <= -3.5e+119) or not ((x * y) <= 9e+229): 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) <= -3.5e+119) || !(Float64(x * y) <= 9e+229)) 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) <= -3.5e+119) || ~(((x * y) <= 9e+229))) 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], -3.5e+119], N[Not[LessEqual[N[(x * y), $MachinePrecision], 9e+229]], $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 -3.5 \cdot 10^{+119} \lor \neg \left(x \cdot y \leq 9 \cdot 10^{+229}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -3.5000000000000001e119 or 9.00000000000000047e229 < (*.f64 x y) Initial program 97.0%
+-commutative97.0%
fma-def97.0%
+-commutative97.0%
fma-def98.5%
fma-def98.5%
Simplified98.5%
fma-udef98.5%
fma-def98.5%
fma-udef97.0%
+-commutative97.0%
associate-+l+97.0%
fma-udef97.0%
associate-+r+97.0%
Applied egg-rr97.0%
Taylor expanded in x around inf 69.8%
if -3.5000000000000001e119 < (*.f64 x y) < 9.00000000000000047e229Initial program 97.9%
Taylor expanded in a around inf 65.3%
Final simplification66.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.5e+73) (not (<= (* a b) 1.26e+113))) (+ (* a b) (* 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 (((a * b) <= -1.5e+73) || !((a * b) <= 1.26e+113)) {
tmp = (a * b) + (c * i);
} 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) :: tmp
if (((a * b) <= (-1.5d+73)) .or. (.not. ((a * b) <= 1.26d+113))) then
tmp = (a * b) + (c * i)
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 tmp;
if (((a * b) <= -1.5e+73) || !((a * b) <= 1.26e+113)) {
tmp = (a * b) + (c * i);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.5e+73) or not ((a * b) <= 1.26e+113): tmp = (a * b) + (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(a * b) <= -1.5e+73) || !(Float64(a * b) <= 1.26e+113)) tmp = Float64(Float64(a * b) + Float64(c * i)); 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) tmp = 0.0; if (((a * b) <= -1.5e+73) || ~(((a * b) <= 1.26e+113))) tmp = (a * b) + (c * i); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.5e+73], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.26e+113]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.5 \cdot 10^{+73} \lor \neg \left(a \cdot b \leq 1.26 \cdot 10^{+113}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -1.50000000000000005e73 or 1.2599999999999999e113 < (*.f64 a b) Initial program 95.0%
Taylor expanded in a around inf 79.2%
if -1.50000000000000005e73 < (*.f64 a b) < 1.2599999999999999e113Initial program 99.3%
Taylor expanded in z around inf 60.6%
Final simplification67.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.5e+147) (not (<= (* a b) 1.28e+92))) (* a b) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.5e+147) || !((a * b) <= 1.28e+92)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-1.5d+147)) .or. (.not. ((a * b) <= 1.28d+92))) then
tmp = a * b
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.5e+147) || !((a * b) <= 1.28e+92)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.5e+147) or not ((a * b) <= 1.28e+92): tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1.5e+147) || !(Float64(a * b) <= 1.28e+92)) tmp = Float64(a * b); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -1.5e+147) || ~(((a * b) <= 1.28e+92))) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.5e+147], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.28e+92]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.5 \cdot 10^{+147} \lor \neg \left(a \cdot b \leq 1.28 \cdot 10^{+92}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.49999999999999997e147 or 1.27999999999999996e92 < (*.f64 a b) Initial program 94.2%
+-commutative94.2%
fma-def95.3%
+-commutative95.3%
fma-def96.5%
fma-def96.5%
Simplified96.5%
fma-udef95.3%
fma-def95.3%
fma-udef94.2%
+-commutative94.2%
associate-+l+94.2%
fma-udef95.3%
associate-+r+95.3%
Applied egg-rr95.3%
Taylor expanded in a around inf 74.0%
if -1.49999999999999997e147 < (*.f64 a b) < 1.27999999999999996e92Initial program 99.4%
Taylor expanded in c around inf 31.7%
Final simplification45.9%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (* 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) {
return ((x * y) + (c * i)) + ((a * b) + (z * t));
}
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) + (c * i)) + ((a * b) + (z * t))
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) + (c * i)) + ((a * b) + (z * t));
}
def code(x, y, z, t, a, b, c, i): return ((x * y) + (c * i)) + ((a * b) + (z * t))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(x * y) + Float64(c * i)) + Float64(Float64(a * b) + Float64(z * t))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((x * y) + (c * i)) + ((a * b) + (z * t)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot y + c \cdot i\right) + \left(a \cdot b + z \cdot t\right)
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-def98.4%
+-commutative98.4%
fma-def98.8%
fma-def98.8%
Simplified98.8%
fma-udef98.0%
fma-def98.0%
fma-udef97.6%
+-commutative97.6%
associate-+l+97.6%
fma-udef98.0%
associate-+r+98.0%
Applied egg-rr98.0%
fma-udef97.6%
Applied egg-rr97.6%
Final simplification97.6%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 97.6%
+-commutative97.6%
fma-def98.4%
+-commutative98.4%
fma-def98.8%
fma-def98.8%
Simplified98.8%
fma-udef98.0%
fma-def98.0%
fma-udef97.6%
+-commutative97.6%
associate-+l+97.6%
fma-udef98.0%
associate-+r+98.0%
Applied egg-rr98.0%
Taylor expanded in a around inf 31.0%
Final simplification31.0%
herbie shell --seed 2024018
(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)))