
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* a b) (+ (* z t) (* x y))) INFINITY) (fma c i (+ (* z t) (+ (* a b) (* x y)))) (fma b a (* 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) + ((z * t) + (x * y))) <= ((double) INFINITY)) {
tmp = fma(c, i, ((z * t) + ((a * b) + (x * y))));
} else {
tmp = fma(b, a, (c * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y))) <= Inf) tmp = fma(c, i, Float64(Float64(z * t) + Float64(Float64(a * b) + Float64(x * y)))); else tmp = fma(b, a, Float64(c * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(N[(z * t), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * a + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b + \left(z \cdot t + x \cdot y\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t + \left(a \cdot b + x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, c \cdot i\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 98.8%
+-commutative98.8%
fma-def99.6%
associate-+l+99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
fma-udef99.6%
fma-udef99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
Applied egg-rr99.6%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
Taylor expanded in a around inf 62.6%
*-commutative62.6%
fma-def75.1%
Applied egg-rr75.1%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (fma x y (fma z t (fma a b (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(x, y, fma(z, t, fma(a, b, (c * i))));
}
function code(x, y, z, t, a, b, c, i) return fma(x, y, fma(z, t, fma(a, b, Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(x * y + N[(z * t + N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\right)
\end{array}
Initial program 95.7%
associate-+l+95.7%
associate-+l+95.7%
fma-def97.2%
fma-def97.6%
fma-def98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 95.7%
+-commutative95.7%
fma-def96.5%
associate-+l+96.5%
fma-def98.0%
fma-def98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))) INFINITY) (+ (* z t) (+ (fma a b (* c i)) (* x y))) (fma b a (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) + ((a * b) + ((z * t) + (x * y)))) <= ((double) INFINITY)) {
tmp = (z * t) + (fma(a, b, (c * i)) + (x * y));
} else {
tmp = fma(b, a, (c * i));
}
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(z * t) + Float64(x * y)))) <= Inf) tmp = Float64(Float64(z * t) + Float64(fma(a, b, Float64(c * i)) + Float64(x * y))); else tmp = fma(b, a, Float64(c * i)); 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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * t), $MachinePrecision] + N[(N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * a + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right) \leq \infty:\\
\;\;\;\;z \cdot t + \left(\mathsf{fma}\left(a, b, c \cdot i\right) + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, c \cdot i\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
fma-udef100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
fma-def100.0%
Applied egg-rr100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around inf 45.5%
*-commutative45.5%
fma-def63.7%
Applied egg-rr63.7%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))))) (if (<= t_1 INFINITY) t_1 (fma a b (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(a, b, (z * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(a, b, Float64(z * t)); 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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * b + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b, z \cdot t\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in x around 0 36.4%
Taylor expanded in c around 0 54.5%
fma-def63.6%
Simplified63.6%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))))) (if (<= t_1 INFINITY) t_1 (fma b a (* c i)))))
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) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(b, a, (c * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(b, a, Float64(c * i)); 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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(b * a + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, c \cdot i\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around inf 45.5%
*-commutative45.5%
fma-def63.7%
Applied egg-rr63.7%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))))) (if (<= t_1 INFINITY) t_1 (* a b))))
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) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * b;
}
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) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((z * t) + (x * y))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((z * t) + (x * y))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * b; 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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
+-commutative0.0%
fma-def18.2%
associate-+l+18.2%
fma-def54.5%
fma-def63.6%
Simplified63.6%
fma-udef45.5%
fma-udef9.1%
fma-udef0.0%
associate-+l+0.0%
+-commutative0.0%
associate-+r+0.0%
+-commutative0.0%
associate-+r+0.0%
fma-def18.2%
Applied egg-rr18.2%
Taylor expanded in a around inf 54.5%
*-commutative54.5%
fma-def63.6%
Applied egg-rr63.6%
Taylor expanded in b around inf 54.8%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.2e+99)
(* a b)
(if (<= (* a b) -0.00095)
(* x y)
(if (<= (* a b) -3.6e-214)
(* c i)
(if (<= (* a b) 4.6e-306)
(* x y)
(if (<= (* a b) 25.0)
(* z t)
(if (<= (* a b) 3.9e+136) (* c i) (* a b))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.2e+99) {
tmp = a * b;
} else if ((a * b) <= -0.00095) {
tmp = x * y;
} else if ((a * b) <= -3.6e-214) {
tmp = c * i;
} else if ((a * b) <= 4.6e-306) {
tmp = x * y;
} else if ((a * b) <= 25.0) {
tmp = z * t;
} else if ((a * b) <= 3.9e+136) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.2d+99)) then
tmp = a * b
else if ((a * b) <= (-0.00095d0)) then
tmp = x * y
else if ((a * b) <= (-3.6d-214)) then
tmp = c * i
else if ((a * b) <= 4.6d-306) then
tmp = x * y
else if ((a * b) <= 25.0d0) then
tmp = z * t
else if ((a * b) <= 3.9d+136) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.2e+99) {
tmp = a * b;
} else if ((a * b) <= -0.00095) {
tmp = x * y;
} else if ((a * b) <= -3.6e-214) {
tmp = c * i;
} else if ((a * b) <= 4.6e-306) {
tmp = x * y;
} else if ((a * b) <= 25.0) {
tmp = z * t;
} else if ((a * b) <= 3.9e+136) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.2e+99: tmp = a * b elif (a * b) <= -0.00095: tmp = x * y elif (a * b) <= -3.6e-214: tmp = c * i elif (a * b) <= 4.6e-306: tmp = x * y elif (a * b) <= 25.0: tmp = z * t elif (a * b) <= 3.9e+136: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.2e+99) tmp = Float64(a * b); elseif (Float64(a * b) <= -0.00095) tmp = Float64(x * y); elseif (Float64(a * b) <= -3.6e-214) tmp = Float64(c * i); elseif (Float64(a * b) <= 4.6e-306) tmp = Float64(x * y); elseif (Float64(a * b) <= 25.0) tmp = Float64(z * t); elseif (Float64(a * b) <= 3.9e+136) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.2e+99) tmp = a * b; elseif ((a * b) <= -0.00095) tmp = x * y; elseif ((a * b) <= -3.6e-214) tmp = c * i; elseif ((a * b) <= 4.6e-306) tmp = x * y; elseif ((a * b) <= 25.0) tmp = z * t; elseif ((a * b) <= 3.9e+136) tmp = c * i; 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.2e+99], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -0.00095], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3.6e-214], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.6e-306], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 25.0], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.9e+136], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.2 \cdot 10^{+99}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -0.00095:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -3.6 \cdot 10^{-214}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 4.6 \cdot 10^{-306}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 25:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 3.9 \cdot 10^{+136}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.2000000000000001e99 or 3.90000000000000019e136 < (*.f64 a b) Initial program 91.4%
+-commutative91.4%
fma-def93.3%
associate-+l+93.3%
fma-def97.1%
fma-def98.1%
Simplified98.1%
fma-udef96.2%
fma-udef92.4%
fma-udef91.4%
associate-+l+91.4%
+-commutative91.4%
associate-+r+91.4%
+-commutative91.4%
associate-+r+91.4%
fma-def93.3%
Applied egg-rr93.3%
Taylor expanded in a around inf 80.3%
*-commutative80.3%
fma-def81.3%
Applied egg-rr81.3%
Taylor expanded in b around inf 70.1%
if -1.2000000000000001e99 < (*.f64 a b) < -9.49999999999999998e-4 or -3.6e-214 < (*.f64 a b) < 4.59999999999999978e-306Initial program 98.2%
associate-+l+98.2%
associate-+l+98.2%
fma-def98.2%
fma-def98.2%
fma-def98.2%
Simplified98.2%
Taylor expanded in a around 0 92.8%
Taylor expanded in x around inf 45.8%
if -9.49999999999999998e-4 < (*.f64 a b) < -3.6e-214 or 25 < (*.f64 a b) < 3.90000000000000019e136Initial program 100.0%
Taylor expanded in c around inf 45.0%
if 4.59999999999999978e-306 < (*.f64 a b) < 25Initial program 97.3%
+-commutative97.3%
fma-def97.3%
associate-+l+97.3%
fma-def97.3%
fma-def97.3%
Simplified97.3%
fma-udef97.3%
fma-udef97.3%
fma-udef97.3%
associate-+l+97.3%
+-commutative97.3%
associate-+r+97.3%
+-commutative97.3%
associate-+r+97.3%
fma-def97.3%
Applied egg-rr97.3%
Taylor expanded in z around inf 49.2%
Final simplification56.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t)))
(t_2 (+ (* c i) (* a b)))
(t_3 (+ (* a b) (* x y))))
(if (<= i -2.2e-81)
t_2
(if (<= i -2.4e-168)
t_1
(if (<= i 1.3e-252)
t_3
(if (<= i 1.35e-188)
t_1
(if (<= i 1e-101)
t_3
(if (<= i 1.25e+94) t_1 (if (<= i 1.45e+184) t_3 t_2)))))))))
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 = (c * i) + (a * b);
double t_3 = (a * b) + (x * y);
double tmp;
if (i <= -2.2e-81) {
tmp = t_2;
} else if (i <= -2.4e-168) {
tmp = t_1;
} else if (i <= 1.3e-252) {
tmp = t_3;
} else if (i <= 1.35e-188) {
tmp = t_1;
} else if (i <= 1e-101) {
tmp = t_3;
} else if (i <= 1.25e+94) {
tmp = t_1;
} else if (i <= 1.45e+184) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (c * i) + (a * b)
t_3 = (a * b) + (x * y)
if (i <= (-2.2d-81)) then
tmp = t_2
else if (i <= (-2.4d-168)) then
tmp = t_1
else if (i <= 1.3d-252) then
tmp = t_3
else if (i <= 1.35d-188) then
tmp = t_1
else if (i <= 1d-101) then
tmp = t_3
else if (i <= 1.25d+94) then
tmp = t_1
else if (i <= 1.45d+184) then
tmp = t_3
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 = (a * b) + (z * t);
double t_2 = (c * i) + (a * b);
double t_3 = (a * b) + (x * y);
double tmp;
if (i <= -2.2e-81) {
tmp = t_2;
} else if (i <= -2.4e-168) {
tmp = t_1;
} else if (i <= 1.3e-252) {
tmp = t_3;
} else if (i <= 1.35e-188) {
tmp = t_1;
} else if (i <= 1e-101) {
tmp = t_3;
} else if (i <= 1.25e+94) {
tmp = t_1;
} else if (i <= 1.45e+184) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (c * i) + (a * b) t_3 = (a * b) + (x * y) tmp = 0 if i <= -2.2e-81: tmp = t_2 elif i <= -2.4e-168: tmp = t_1 elif i <= 1.3e-252: tmp = t_3 elif i <= 1.35e-188: tmp = t_1 elif i <= 1e-101: tmp = t_3 elif i <= 1.25e+94: tmp = t_1 elif i <= 1.45e+184: tmp = t_3 else: tmp = t_2 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(c * i) + Float64(a * b)) t_3 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (i <= -2.2e-81) tmp = t_2; elseif (i <= -2.4e-168) tmp = t_1; elseif (i <= 1.3e-252) tmp = t_3; elseif (i <= 1.35e-188) tmp = t_1; elseif (i <= 1e-101) tmp = t_3; elseif (i <= 1.25e+94) tmp = t_1; elseif (i <= 1.45e+184) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); t_2 = (c * i) + (a * b); t_3 = (a * b) + (x * y); tmp = 0.0; if (i <= -2.2e-81) tmp = t_2; elseif (i <= -2.4e-168) tmp = t_1; elseif (i <= 1.3e-252) tmp = t_3; elseif (i <= 1.35e-188) tmp = t_1; elseif (i <= 1e-101) tmp = t_3; elseif (i <= 1.25e+94) tmp = t_1; elseif (i <= 1.45e+184) tmp = t_3; else tmp = t_2; 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[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.2e-81], t$95$2, If[LessEqual[i, -2.4e-168], t$95$1, If[LessEqual[i, 1.3e-252], t$95$3, If[LessEqual[i, 1.35e-188], t$95$1, If[LessEqual[i, 1e-101], t$95$3, If[LessEqual[i, 1.25e+94], t$95$1, If[LessEqual[i, 1.45e+184], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := c \cdot i + a \cdot b\\
t_3 := a \cdot b + x \cdot y\\
\mathbf{if}\;i \leq -2.2 \cdot 10^{-81}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq -2.4 \cdot 10^{-168}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 1.3 \cdot 10^{-252}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;i \leq 1.35 \cdot 10^{-188}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 10^{-101}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;i \leq 1.25 \cdot 10^{+94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 1.45 \cdot 10^{+184}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if i < -2.1999999999999999e-81 or 1.4499999999999999e184 < i Initial program 91.7%
Taylor expanded in a around inf 62.4%
if -2.1999999999999999e-81 < i < -2.3999999999999999e-168 or 1.3e-252 < i < 1.35e-188 or 1.00000000000000005e-101 < i < 1.25000000000000003e94Initial program 100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
fma-udef100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 68.4%
if -2.3999999999999999e-168 < i < 1.3e-252 or 1.35e-188 < i < 1.00000000000000005e-101 or 1.25000000000000003e94 < i < 1.4499999999999999e184Initial program 96.5%
+-commutative96.5%
fma-def97.6%
associate-+l+97.6%
fma-def98.8%
fma-def98.8%
Simplified98.8%
fma-udef97.6%
fma-udef96.5%
fma-udef96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r+96.5%
+-commutative96.5%
associate-+r+96.5%
fma-def97.6%
Applied egg-rr97.6%
Taylor expanded in c around 0 87.6%
Taylor expanded in z around 0 67.5%
Final simplification65.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.5e+19)
(* a b)
(if (<= (* a b) -1.12e-185)
(* c i)
(if (<= (* a b) 0.000315)
(* z t)
(if (<= (* a b) 8.2e+133) (* c i) (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.5e+19) {
tmp = a * b;
} else if ((a * b) <= -1.12e-185) {
tmp = c * i;
} else if ((a * b) <= 0.000315) {
tmp = z * t;
} else if ((a * b) <= 8.2e+133) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-2.5d+19)) then
tmp = a * b
else if ((a * b) <= (-1.12d-185)) then
tmp = c * i
else if ((a * b) <= 0.000315d0) then
tmp = z * t
else if ((a * b) <= 8.2d+133) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.5e+19) {
tmp = a * b;
} else if ((a * b) <= -1.12e-185) {
tmp = c * i;
} else if ((a * b) <= 0.000315) {
tmp = z * t;
} else if ((a * b) <= 8.2e+133) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.5e+19: tmp = a * b elif (a * b) <= -1.12e-185: tmp = c * i elif (a * b) <= 0.000315: tmp = z * t elif (a * b) <= 8.2e+133: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.5e+19) tmp = Float64(a * b); elseif (Float64(a * b) <= -1.12e-185) tmp = Float64(c * i); elseif (Float64(a * b) <= 0.000315) tmp = Float64(z * t); elseif (Float64(a * b) <= 8.2e+133) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -2.5e+19) tmp = a * b; elseif ((a * b) <= -1.12e-185) tmp = c * i; elseif ((a * b) <= 0.000315) tmp = z * t; elseif ((a * b) <= 8.2e+133) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.5e+19], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.12e-185], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 0.000315], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 8.2e+133], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.5 \cdot 10^{+19}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.12 \cdot 10^{-185}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 0.000315:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 8.2 \cdot 10^{+133}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.5e19 or 8.20000000000000008e133 < (*.f64 a b) Initial program 92.3%
+-commutative92.3%
fma-def94.0%
associate-+l+94.0%
fma-def97.4%
fma-def98.3%
Simplified98.3%
fma-udef96.5%
fma-udef93.1%
fma-udef92.3%
associate-+l+92.3%
+-commutative92.3%
associate-+r+92.3%
+-commutative92.3%
associate-+r+92.3%
fma-def94.0%
Applied egg-rr94.0%
Taylor expanded in a around inf 77.3%
*-commutative77.3%
fma-def78.2%
Applied egg-rr78.2%
Taylor expanded in b around inf 65.6%
if -2.5e19 < (*.f64 a b) < -1.11999999999999993e-185 or 3.15000000000000013e-4 < (*.f64 a b) < 8.20000000000000008e133Initial program 100.0%
Taylor expanded in c around inf 45.6%
if -1.11999999999999993e-185 < (*.f64 a b) < 3.15000000000000013e-4Initial program 97.5%
+-commutative97.5%
fma-def97.5%
associate-+l+97.5%
fma-def97.5%
fma-def97.5%
Simplified97.5%
fma-udef97.5%
fma-udef97.5%
fma-udef97.5%
associate-+l+97.5%
+-commutative97.5%
associate-+r+97.5%
+-commutative97.5%
associate-+r+97.5%
fma-def97.5%
Applied egg-rr97.5%
Taylor expanded in z around inf 40.8%
Final simplification53.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* x y)))
(t_2 (+ (* c i) (+ (* a b) (* z t))))
(t_3 (+ (* a b) (* x y))))
(if (<= y -9.2e-57)
t_3
(if (<= y 7.2e+149)
t_2
(if (<= y 1.15e+173)
t_1
(if (<= y 6.2e+212) t_2 (if (<= y 6.2e+237) t_1 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (x * y);
double t_2 = (c * i) + ((a * b) + (z * t));
double t_3 = (a * b) + (x * y);
double tmp;
if (y <= -9.2e-57) {
tmp = t_3;
} else if (y <= 7.2e+149) {
tmp = t_2;
} else if (y <= 1.15e+173) {
tmp = t_1;
} else if (y <= 6.2e+212) {
tmp = t_2;
} else if (y <= 6.2e+237) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (z * t) + (x * y)
t_2 = (c * i) + ((a * b) + (z * t))
t_3 = (a * b) + (x * y)
if (y <= (-9.2d-57)) then
tmp = t_3
else if (y <= 7.2d+149) then
tmp = t_2
else if (y <= 1.15d+173) then
tmp = t_1
else if (y <= 6.2d+212) then
tmp = t_2
else if (y <= 6.2d+237) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (x * y);
double t_2 = (c * i) + ((a * b) + (z * t));
double t_3 = (a * b) + (x * y);
double tmp;
if (y <= -9.2e-57) {
tmp = t_3;
} else if (y <= 7.2e+149) {
tmp = t_2;
} else if (y <= 1.15e+173) {
tmp = t_1;
} else if (y <= 6.2e+212) {
tmp = t_2;
} else if (y <= 6.2e+237) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (x * y) t_2 = (c * i) + ((a * b) + (z * t)) t_3 = (a * b) + (x * y) tmp = 0 if y <= -9.2e-57: tmp = t_3 elif y <= 7.2e+149: tmp = t_2 elif y <= 1.15e+173: tmp = t_1 elif y <= 6.2e+212: tmp = t_2 elif y <= 6.2e+237: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(x * y)) t_2 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))) t_3 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (y <= -9.2e-57) tmp = t_3; elseif (y <= 7.2e+149) tmp = t_2; elseif (y <= 1.15e+173) tmp = t_1; elseif (y <= 6.2e+212) tmp = t_2; elseif (y <= 6.2e+237) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (x * y); t_2 = (c * i) + ((a * b) + (z * t)); t_3 = (a * b) + (x * y); tmp = 0.0; if (y <= -9.2e-57) tmp = t_3; elseif (y <= 7.2e+149) tmp = t_2; elseif (y <= 1.15e+173) tmp = t_1; elseif (y <= 6.2e+212) tmp = t_2; elseif (y <= 6.2e+237) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.2e-57], t$95$3, If[LessEqual[y, 7.2e+149], t$95$2, If[LessEqual[y, 1.15e+173], t$95$1, If[LessEqual[y, 6.2e+212], t$95$2, If[LessEqual[y, 6.2e+237], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + x \cdot y\\
t_2 := c \cdot i + \left(a \cdot b + z \cdot t\right)\\
t_3 := a \cdot b + x \cdot y\\
\mathbf{if}\;y \leq -9.2 \cdot 10^{-57}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+173}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+212}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+237}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -9.2000000000000001e-57 or 6.19999999999999981e237 < y Initial program 92.5%
+-commutative92.5%
fma-def92.5%
associate-+l+92.5%
fma-def96.8%
fma-def96.8%
Simplified96.8%
fma-udef96.8%
fma-udef92.5%
fma-udef92.5%
associate-+l+92.5%
+-commutative92.5%
associate-+r+92.5%
+-commutative92.5%
associate-+r+92.5%
fma-def93.5%
Applied egg-rr93.5%
Taylor expanded in c around 0 78.5%
Taylor expanded in z around 0 66.0%
if -9.2000000000000001e-57 < y < 7.1999999999999999e149 or 1.14999999999999997e173 < y < 6.19999999999999996e212Initial program 97.4%
Taylor expanded in x around 0 87.2%
if 7.1999999999999999e149 < y < 1.14999999999999997e173 or 6.19999999999999996e212 < y < 6.19999999999999981e237Initial program 99.8%
+-commutative99.8%
fma-def99.8%
associate-+l+99.8%
fma-def99.8%
fma-def99.8%
Simplified99.8%
fma-udef99.8%
fma-udef99.8%
fma-udef99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 89.9%
Final simplification79.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -5.2e+31)
(+ (* a b) (* x y))
(if (<= (* a b) 1.5e-305)
(+ (* c i) (* x y))
(if (<= (* a b) 2.8e+127) (+ (* c i) (* z t)) (+ (* a b) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -5.2e+31) {
tmp = (a * b) + (x * y);
} else if ((a * b) <= 1.5e-305) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 2.8e+127) {
tmp = (c * i) + (z * t);
} 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 ((a * b) <= (-5.2d+31)) then
tmp = (a * b) + (x * y)
else if ((a * b) <= 1.5d-305) then
tmp = (c * i) + (x * y)
else if ((a * b) <= 2.8d+127) then
tmp = (c * i) + (z * t)
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 ((a * b) <= -5.2e+31) {
tmp = (a * b) + (x * y);
} else if ((a * b) <= 1.5e-305) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 2.8e+127) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -5.2e+31: tmp = (a * b) + (x * y) elif (a * b) <= 1.5e-305: tmp = (c * i) + (x * y) elif (a * b) <= 2.8e+127: tmp = (c * i) + (z * t) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -5.2e+31) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(a * b) <= 1.5e-305) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (Float64(a * b) <= 2.8e+127) tmp = Float64(Float64(c * i) + Float64(z * t)); 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 ((a * b) <= -5.2e+31) tmp = (a * b) + (x * y); elseif ((a * b) <= 1.5e-305) tmp = (c * i) + (x * y); elseif ((a * b) <= 2.8e+127) tmp = (c * i) + (z * t); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -5.2e+31], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.5e-305], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.8e+127], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5.2 \cdot 10^{+31}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.5 \cdot 10^{-305}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2.8 \cdot 10^{+127}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -5.2e31Initial program 93.4%
+-commutative93.4%
fma-def94.7%
associate-+l+94.7%
fma-def98.6%
fma-def98.6%
Simplified98.6%
fma-udef97.3%
fma-udef93.4%
fma-udef93.4%
associate-+l+93.4%
+-commutative93.4%
associate-+r+93.4%
+-commutative93.4%
associate-+r+93.4%
fma-def94.7%
Applied egg-rr94.7%
Taylor expanded in c around 0 85.4%
Taylor expanded in z around 0 75.9%
if -5.2e31 < (*.f64 a b) < 1.5000000000000001e-305Initial program 98.8%
Taylor expanded in x around inf 70.3%
if 1.5000000000000001e-305 < (*.f64 a b) < 2.8000000000000002e127Initial program 98.2%
Taylor expanded in z around inf 68.9%
if 2.8000000000000002e127 < (*.f64 a b) Initial program 89.7%
+-commutative89.7%
fma-def92.3%
associate-+l+92.3%
fma-def94.8%
fma-def97.4%
Simplified97.4%
fma-udef94.8%
fma-udef92.3%
fma-udef89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+r+89.7%
+-commutative89.7%
associate-+r+89.7%
fma-def92.3%
Applied egg-rr92.3%
Taylor expanded in a around inf 90.1%
Final simplification74.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -2e+46) (not (<= (* z t) 1e+177))) (+ (* c i) (+ (* a b) (* z t))) (+ (* c i) (+ (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -2e+46) || !((z * t) <= 1e+177)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((z * t) <= (-2d+46)) .or. (.not. ((z * t) <= 1d+177))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((a * b) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -2e+46) || !((z * t) <= 1e+177)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -2e+46) or not ((z * t) <= 1e+177): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((a * b) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -2e+46) || !(Float64(z * t) <= 1e+177)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((z * t) <= -2e+46) || ~(((z * t) <= 1e+177))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((a * b) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -2e+46], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1e+177]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+46} \lor \neg \left(z \cdot t \leq 10^{+177}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -2e46 or 1e177 < (*.f64 z t) Initial program 90.7%
Taylor expanded in x around 0 88.4%
if -2e46 < (*.f64 z t) < 1e177Initial program 98.2%
Taylor expanded in z around 0 89.2%
Final simplification88.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= (* c i) -4.2e+35)
(+ (* c i) t_1)
(if (<= (* c i) 1.25e+78)
(+ (* z t) t_1)
(+ (* 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 t_1 = (a * b) + (x * y);
double tmp;
if ((c * i) <= -4.2e+35) {
tmp = (c * i) + t_1;
} else if ((c * i) <= 1.25e+78) {
tmp = (z * t) + t_1;
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (x * y)
if ((c * i) <= (-4.2d+35)) then
tmp = (c * i) + t_1
else if ((c * i) <= 1.25d+78) then
tmp = (z * t) + t_1
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double tmp;
if ((c * i) <= -4.2e+35) {
tmp = (c * i) + t_1;
} else if ((c * i) <= 1.25e+78) {
tmp = (z * t) + t_1;
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) tmp = 0 if (c * i) <= -4.2e+35: tmp = (c * i) + t_1 elif (c * i) <= 1.25e+78: tmp = (z * t) + t_1 else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(c * i) <= -4.2e+35) tmp = Float64(Float64(c * i) + t_1); elseif (Float64(c * i) <= 1.25e+78) tmp = Float64(Float64(z * t) + t_1); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); tmp = 0.0; if ((c * i) <= -4.2e+35) tmp = (c * i) + t_1; elseif ((c * i) <= 1.25e+78) tmp = (z * t) + t_1; else tmp = (c * i) + ((a * b) + (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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -4.2e+35], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.25e+78], N[(N[(z * t), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;c \cdot i \leq -4.2 \cdot 10^{+35}:\\
\;\;\;\;c \cdot i + t_1\\
\mathbf{elif}\;c \cdot i \leq 1.25 \cdot 10^{+78}:\\
\;\;\;\;z \cdot t + t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -4.1999999999999998e35Initial program 94.4%
Taylor expanded in z around 0 85.3%
if -4.1999999999999998e35 < (*.f64 c i) < 1.24999999999999996e78Initial program 98.7%
+-commutative98.7%
fma-def98.7%
associate-+l+98.7%
fma-def99.3%
fma-def99.3%
Simplified99.3%
fma-udef99.3%
fma-udef98.7%
fma-udef98.7%
associate-+l+98.7%
+-commutative98.7%
associate-+r+98.7%
+-commutative98.7%
associate-+r+98.7%
fma-def98.7%
Applied egg-rr98.7%
Taylor expanded in c around 0 94.4%
if 1.24999999999999996e78 < (*.f64 c i) Initial program 87.5%
Taylor expanded in x around 0 85.7%
Final simplification90.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.25e+36)
(+ (* z t) (+ (* a b) (* x y)))
(if (<= (* a b) 4.5e+95)
(+ (* c i) (+ (* z t) (* x y)))
(+ (* c i) (+ (* a b) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.25e+36) {
tmp = (z * t) + ((a * b) + (x * y));
} else if ((a * b) <= 4.5e+95) {
tmp = (c * i) + ((z * t) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.25d+36)) then
tmp = (z * t) + ((a * b) + (x * y))
else if ((a * b) <= 4.5d+95) then
tmp = (c * i) + ((z * t) + (x * y))
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.25e+36) {
tmp = (z * t) + ((a * b) + (x * y));
} else if ((a * b) <= 4.5e+95) {
tmp = (c * i) + ((z * t) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.25e+36: tmp = (z * t) + ((a * b) + (x * y)) elif (a * b) <= 4.5e+95: tmp = (c * i) + ((z * t) + (x * y)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.25e+36) tmp = Float64(Float64(z * t) + Float64(Float64(a * b) + Float64(x * y))); elseif (Float64(a * b) <= 4.5e+95) tmp = Float64(Float64(c * i) + Float64(Float64(z * t) + Float64(x * y))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.25e+36) tmp = (z * t) + ((a * b) + (x * y)); elseif ((a * b) <= 4.5e+95) tmp = (c * i) + ((z * t) + (x * y)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1.25e+36], N[(N[(z * t), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.5e+95], N[(N[(c * i), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.25 \cdot 10^{+36}:\\
\;\;\;\;z \cdot t + \left(a \cdot b + x \cdot y\right)\\
\mathbf{elif}\;a \cdot b \leq 4.5 \cdot 10^{+95}:\\
\;\;\;\;c \cdot i + \left(z \cdot t + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.24999999999999994e36Initial program 93.4%
+-commutative93.4%
fma-def94.7%
associate-+l+94.7%
fma-def98.6%
fma-def98.6%
Simplified98.6%
fma-udef97.3%
fma-udef93.4%
fma-udef93.4%
associate-+l+93.4%
+-commutative93.4%
associate-+r+93.4%
+-commutative93.4%
associate-+r+93.4%
fma-def94.7%
Applied egg-rr94.7%
Taylor expanded in c around 0 85.4%
if -1.24999999999999994e36 < (*.f64 a b) < 4.50000000000000017e95Initial program 98.5%
Taylor expanded in a around 0 96.0%
if 4.50000000000000017e95 < (*.f64 a b) Initial program 90.7%
Taylor expanded in x around 0 90.8%
Final simplification92.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= t -600000000.0)
(* z t)
(if (or (<= t 3.15e+103) (and (not (<= t 3.1e+133)) (<= t 5.2e+169)))
(+ (* 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 (t <= -600000000.0) {
tmp = z * t;
} else if ((t <= 3.15e+103) || (!(t <= 3.1e+133) && (t <= 5.2e+169))) {
tmp = (c * i) + (a * b);
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (t <= (-600000000.0d0)) then
tmp = z * t
else if ((t <= 3.15d+103) .or. (.not. (t <= 3.1d+133)) .and. (t <= 5.2d+169)) then
tmp = (c * i) + (a * b)
else
tmp = z * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (t <= -600000000.0) {
tmp = z * t;
} else if ((t <= 3.15e+103) || (!(t <= 3.1e+133) && (t <= 5.2e+169))) {
tmp = (c * i) + (a * b);
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= -600000000.0: tmp = z * t elif (t <= 3.15e+103) or (not (t <= 3.1e+133) and (t <= 5.2e+169)): tmp = (c * i) + (a * b) else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= -600000000.0) tmp = Float64(z * t); elseif ((t <= 3.15e+103) || (!(t <= 3.1e+133) && (t <= 5.2e+169))) tmp = Float64(Float64(c * i) + Float64(a * b)); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (t <= -600000000.0) tmp = z * t; elseif ((t <= 3.15e+103) || (~((t <= 3.1e+133)) && (t <= 5.2e+169))) tmp = (c * i) + (a * b); else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, -600000000.0], N[(z * t), $MachinePrecision], If[Or[LessEqual[t, 3.15e+103], And[N[Not[LessEqual[t, 3.1e+133]], $MachinePrecision], LessEqual[t, 5.2e+169]]], N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(z * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -600000000:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;t \leq 3.15 \cdot 10^{+103} \lor \neg \left(t \leq 3.1 \cdot 10^{+133}\right) \land t \leq 5.2 \cdot 10^{+169}:\\
\;\;\;\;c \cdot i + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if t < -6e8 or 3.14999999999999985e103 < t < 3.1e133 or 5.19999999999999999e169 < t Initial program 92.7%
+-commutative92.7%
fma-def94.5%
associate-+l+94.5%
fma-def96.3%
fma-def97.2%
Simplified97.2%
fma-udef95.4%
fma-udef93.6%
fma-udef92.7%
associate-+l+92.7%
+-commutative92.7%
associate-+r+92.7%
+-commutative92.7%
associate-+r+92.7%
fma-def93.6%
Applied egg-rr93.6%
Taylor expanded in z around inf 51.7%
if -6e8 < t < 3.14999999999999985e103 or 3.1e133 < t < 5.19999999999999999e169Initial program 97.9%
Taylor expanded in a around inf 65.7%
Final simplification59.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -0.0009) (+ (* a b) (* x y)) (if (<= (* a b) 2.8e+127) (+ (* c i) (* z t)) (+ (* a b) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -0.0009) {
tmp = (a * b) + (x * y);
} else if ((a * b) <= 2.8e+127) {
tmp = (c * i) + (z * t);
} 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 ((a * b) <= (-0.0009d0)) then
tmp = (a * b) + (x * y)
else if ((a * b) <= 2.8d+127) then
tmp = (c * i) + (z * t)
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 ((a * b) <= -0.0009) {
tmp = (a * b) + (x * y);
} else if ((a * b) <= 2.8e+127) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -0.0009: tmp = (a * b) + (x * y) elif (a * b) <= 2.8e+127: tmp = (c * i) + (z * t) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -0.0009) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(a * b) <= 2.8e+127) tmp = Float64(Float64(c * i) + Float64(z * t)); 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 ((a * b) <= -0.0009) tmp = (a * b) + (x * y); elseif ((a * b) <= 2.8e+127) tmp = (c * i) + (z * t); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -0.0009], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.8e+127], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -0.0009:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2.8 \cdot 10^{+127}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -8.9999999999999998e-4Initial program 93.7%
+-commutative93.7%
fma-def95.0%
associate-+l+95.0%
fma-def98.7%
fma-def98.7%
Simplified98.7%
fma-udef97.5%
fma-udef93.7%
fma-udef93.7%
associate-+l+93.7%
+-commutative93.7%
associate-+r+93.7%
+-commutative93.7%
associate-+r+93.7%
fma-def95.0%
Applied egg-rr95.0%
Taylor expanded in c around 0 86.1%
Taylor expanded in z around 0 74.7%
if -8.9999999999999998e-4 < (*.f64 a b) < 2.8000000000000002e127Initial program 98.5%
Taylor expanded in z around inf 67.2%
if 2.8000000000000002e127 < (*.f64 a b) Initial program 89.7%
+-commutative89.7%
fma-def92.3%
associate-+l+92.3%
fma-def94.8%
fma-def97.4%
Simplified97.4%
fma-udef94.8%
fma-udef92.3%
fma-udef89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+r+89.7%
+-commutative89.7%
associate-+r+89.7%
fma-def92.3%
Applied egg-rr92.3%
Taylor expanded in a around inf 90.1%
Final simplification73.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -2.15e-66) (not (<= i 3.8e+184))) (+ (* c i) (* a b)) (+ (* a b) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -2.15e-66) || !(i <= 3.8e+184)) {
tmp = (c * i) + (a * b);
} 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) :: tmp
if ((i <= (-2.15d-66)) .or. (.not. (i <= 3.8d+184))) then
tmp = (c * i) + (a * b)
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 tmp;
if ((i <= -2.15e-66) || !(i <= 3.8e+184)) {
tmp = (c * i) + (a * b);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -2.15e-66) or not (i <= 3.8e+184): tmp = (c * i) + (a * b) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -2.15e-66) || !(i <= 3.8e+184)) tmp = Float64(Float64(c * i) + Float64(a * b)); 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) tmp = 0.0; if ((i <= -2.15e-66) || ~((i <= 3.8e+184))) tmp = (c * i) + (a * b); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -2.15e-66], N[Not[LessEqual[i, 3.8e+184]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.15 \cdot 10^{-66} \lor \neg \left(i \leq 3.8 \cdot 10^{+184}\right):\\
\;\;\;\;c \cdot i + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if i < -2.15000000000000007e-66 or 3.8000000000000001e184 < i Initial program 91.3%
Taylor expanded in a around inf 64.0%
if -2.15000000000000007e-66 < i < 3.8000000000000001e184Initial program 98.1%
+-commutative98.1%
fma-def98.8%
associate-+l+98.8%
fma-def99.4%
fma-def99.4%
Simplified99.4%
fma-udef98.8%
fma-udef98.1%
fma-udef98.1%
associate-+l+98.1%
+-commutative98.1%
associate-+r+98.1%
+-commutative98.1%
associate-+r+98.1%
fma-def98.8%
Applied egg-rr98.8%
Taylor expanded in c around 0 87.9%
Taylor expanded in z around 0 61.4%
Final simplification62.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -6e+26) (* a b) (if (<= (* a b) 1.15e+132) (* c i) (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -6e+26) {
tmp = a * b;
} else if ((a * b) <= 1.15e+132) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-6d+26)) then
tmp = a * b
else if ((a * b) <= 1.15d+132) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -6e+26) {
tmp = a * b;
} else if ((a * b) <= 1.15e+132) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -6e+26: tmp = a * b elif (a * b) <= 1.15e+132: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -6e+26) tmp = Float64(a * b); elseif (Float64(a * b) <= 1.15e+132) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -6e+26) tmp = a * b; elseif ((a * b) <= 1.15e+132) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -6e+26], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.15e+132], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -6 \cdot 10^{+26}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 1.15 \cdot 10^{+132}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -5.99999999999999994e26 or 1.1500000000000001e132 < (*.f64 a b) Initial program 92.3%
+-commutative92.3%
fma-def94.0%
associate-+l+94.0%
fma-def97.4%
fma-def98.3%
Simplified98.3%
fma-udef96.5%
fma-udef93.1%
fma-udef92.3%
associate-+l+92.3%
+-commutative92.3%
associate-+r+92.3%
+-commutative92.3%
associate-+r+92.3%
fma-def94.0%
Applied egg-rr94.0%
Taylor expanded in a around inf 77.3%
*-commutative77.3%
fma-def78.2%
Applied egg-rr78.2%
Taylor expanded in b around inf 65.6%
if -5.99999999999999994e26 < (*.f64 a b) < 1.1500000000000001e132Initial program 98.5%
Taylor expanded in c around inf 35.4%
Final simplification49.2%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 95.7%
+-commutative95.7%
fma-def96.5%
associate-+l+96.5%
fma-def98.0%
fma-def98.4%
Simplified98.4%
fma-udef97.6%
fma-udef96.1%
fma-udef95.7%
associate-+l+95.7%
+-commutative95.7%
associate-+r+95.7%
+-commutative95.7%
associate-+r+95.7%
fma-def96.5%
Applied egg-rr96.5%
Taylor expanded in a around inf 55.7%
*-commutative55.7%
fma-def56.1%
Applied egg-rr56.1%
Taylor expanded in b around inf 32.8%
Final simplification32.8%
herbie shell --seed 2023221
(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)))