
(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
(let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t))))))
(if (<= t_1 INFINITY)
t_1
(* b (+ a (+ (* c (/ i b)) (+ (* t (/ z b)) (* x (/ y 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) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = b * (a + ((c * (i / b)) + ((t * (z / b)) + (x * (y / 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) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = b * (a + ((c * (i / b)) + ((t * (z / b)) + (x * (y / b)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = b * (a + ((c * (i / b)) + ((t * (z / b)) + (x * (y / 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(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(b * Float64(a + Float64(Float64(c * Float64(i / b)) + Float64(Float64(t * Float64(z / b)) + Float64(x * Float64(y / b)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = b * (a + ((c * (i / b)) + ((t * (z / b)) + (x * (y / 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(b * N[(a + N[(N[(c * N[(i / b), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(z / b), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a + \left(c \cdot \frac{i}{b} + \left(t \cdot \frac{z}{b} + x \cdot \frac{y}{b}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
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-define15.4%
+-commutative15.4%
fma-define30.8%
fma-define38.5%
Simplified38.5%
Taylor expanded in b around inf 30.8%
associate-/l*46.2%
associate-/l*53.8%
associate-/l*69.2%
Simplified69.2%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 94.9%
+-commutative94.9%
fma-define95.7%
+-commutative95.7%
fma-define96.5%
fma-define96.9%
Simplified96.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* x y) (* a b))))
(if (<= (* x y) -7.6e+34)
t_2
(if (<= (* x y) -2.35e-209)
t_1
(if (<= (* x y) 1.8e+27)
(+ (* a b) (* z t))
(if (<= (* x y) 2.45e+67) 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 = (c * i) + (z * t);
double t_2 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -7.6e+34) {
tmp = t_2;
} else if ((x * y) <= -2.35e-209) {
tmp = t_1;
} else if ((x * y) <= 1.8e+27) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 2.45e+67) {
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 = (c * i) + (z * t)
t_2 = (x * y) + (a * b)
if ((x * y) <= (-7.6d+34)) then
tmp = t_2
else if ((x * y) <= (-2.35d-209)) then
tmp = t_1
else if ((x * y) <= 1.8d+27) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 2.45d+67) 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 = (c * i) + (z * t);
double t_2 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -7.6e+34) {
tmp = t_2;
} else if ((x * y) <= -2.35e-209) {
tmp = t_1;
} else if ((x * y) <= 1.8e+27) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 2.45e+67) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = (x * y) + (a * b) tmp = 0 if (x * y) <= -7.6e+34: tmp = t_2 elif (x * y) <= -2.35e-209: tmp = t_1 elif (x * y) <= 1.8e+27: tmp = (a * b) + (z * t) elif (x * y) <= 2.45e+67: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) t_2 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(x * y) <= -7.6e+34) tmp = t_2; elseif (Float64(x * y) <= -2.35e-209) tmp = t_1; elseif (Float64(x * y) <= 1.8e+27) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 2.45e+67) 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 = (c * i) + (z * t); t_2 = (x * y) + (a * b); tmp = 0.0; if ((x * y) <= -7.6e+34) tmp = t_2; elseif ((x * y) <= -2.35e-209) tmp = t_1; elseif ((x * y) <= 1.8e+27) tmp = (a * b) + (z * t); elseif ((x * y) <= 2.45e+67) 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[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7.6e+34], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.35e-209], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.8e+27], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.45e+67], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -7.6 \cdot 10^{+34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -2.35 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.8 \cdot 10^{+27}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.45 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -7.6000000000000003e34 or 2.44999999999999995e67 < (*.f64 x y) Initial program 92.9%
+-commutative92.9%
fma-define93.8%
+-commutative93.8%
fma-define94.7%
fma-define95.6%
Simplified95.6%
Taylor expanded in c around 0 87.3%
Taylor expanded in t around 0 79.1%
if -7.6000000000000003e34 < (*.f64 x y) < -2.35e-209 or 1.79999999999999991e27 < (*.f64 x y) < 2.44999999999999995e67Initial program 94.7%
+-commutative94.7%
fma-define94.7%
+-commutative94.7%
fma-define96.5%
fma-define96.5%
Simplified96.5%
Taylor expanded in a around 0 81.4%
Taylor expanded in t around inf 73.2%
if -2.35e-209 < (*.f64 x y) < 1.79999999999999991e27Initial program 97.7%
+-commutative97.7%
fma-define98.8%
+-commutative98.8%
fma-define98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in c around 0 82.5%
Taylor expanded in t around inf 77.9%
Final simplification77.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* x y) -1.95e+64)
(* x y)
(if (<= (* x y) -2.6e-32)
t_1
(if (<= (* x y) -9e-128)
(+ (* a b) (* c i))
(if (<= (* x y) 1.38e+91) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -1.95e+64) {
tmp = x * y;
} else if ((x * y) <= -2.6e-32) {
tmp = t_1;
} else if ((x * y) <= -9e-128) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.38e+91) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (z * t)
if ((x * y) <= (-1.95d+64)) then
tmp = x * y
else if ((x * y) <= (-2.6d-32)) then
tmp = t_1
else if ((x * y) <= (-9d-128)) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 1.38d+91) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -1.95e+64) {
tmp = x * y;
} else if ((x * y) <= -2.6e-32) {
tmp = t_1;
} else if ((x * y) <= -9e-128) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.38e+91) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (x * y) <= -1.95e+64: tmp = x * y elif (x * y) <= -2.6e-32: tmp = t_1 elif (x * y) <= -9e-128: tmp = (a * b) + (c * i) elif (x * y) <= 1.38e+91: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -1.95e+64) tmp = Float64(x * y); elseif (Float64(x * y) <= -2.6e-32) tmp = t_1; elseif (Float64(x * y) <= -9e-128) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 1.38e+91) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); tmp = 0.0; if ((x * y) <= -1.95e+64) tmp = x * y; elseif ((x * y) <= -2.6e-32) tmp = t_1; elseif ((x * y) <= -9e-128) tmp = (a * b) + (c * i); elseif ((x * y) <= 1.38e+91) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.95e+64], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.6e-32], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -9e-128], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.38e+91], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -1.95 \cdot 10^{+64}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -9 \cdot 10^{-128}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 1.38 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9499999999999999e64 or 1.37999999999999991e91 < (*.f64 x y) Initial program 92.3%
+-commutative92.3%
fma-define93.3%
+-commutative93.3%
fma-define94.2%
fma-define95.2%
Simplified95.2%
Taylor expanded in c around 0 86.7%
Taylor expanded in t around 0 80.1%
Taylor expanded in a around 0 71.7%
if -1.9499999999999999e64 < (*.f64 x y) < -2.5999999999999997e-32 or -8.9999999999999998e-128 < (*.f64 x y) < 1.37999999999999991e91Initial program 97.7%
+-commutative97.7%
fma-define98.4%
+-commutative98.4%
fma-define99.2%
fma-define99.2%
Simplified99.2%
Taylor expanded in c around 0 79.6%
Taylor expanded in t around inf 70.6%
if -2.5999999999999997e-32 < (*.f64 x y) < -8.9999999999999998e-128Initial program 90.9%
associate-+l+90.9%
fma-define90.9%
Simplified90.9%
Taylor expanded in x around inf 82.2%
Taylor expanded in x around 0 74.8%
Final simplification71.4%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* 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) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = c * i;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\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-define15.4%
+-commutative15.4%
fma-define30.8%
fma-define38.5%
Simplified38.5%
Taylor expanded in c around inf 46.9%
Final simplification97.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1.72e-12)
(* x y)
(if (<= (* x y) -4.6e-125)
(* c i)
(if (<= (* x y) 2.95e-235)
(* z t)
(if (<= (* x y) 1.85e+89) (* 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 ((x * y) <= -1.72e-12) {
tmp = x * y;
} else if ((x * y) <= -4.6e-125) {
tmp = c * i;
} else if ((x * y) <= 2.95e-235) {
tmp = z * t;
} else if ((x * y) <= 1.85e+89) {
tmp = a * b;
} else {
tmp = 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 ((x * y) <= (-1.72d-12)) then
tmp = x * y
else if ((x * y) <= (-4.6d-125)) then
tmp = c * i
else if ((x * y) <= 2.95d-235) then
tmp = z * t
else if ((x * y) <= 1.85d+89) then
tmp = a * b
else
tmp = 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 ((x * y) <= -1.72e-12) {
tmp = x * y;
} else if ((x * y) <= -4.6e-125) {
tmp = c * i;
} else if ((x * y) <= 2.95e-235) {
tmp = z * t;
} else if ((x * y) <= 1.85e+89) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1.72e-12: tmp = x * y elif (x * y) <= -4.6e-125: tmp = c * i elif (x * y) <= 2.95e-235: tmp = z * t elif (x * y) <= 1.85e+89: tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1.72e-12) tmp = Float64(x * y); elseif (Float64(x * y) <= -4.6e-125) tmp = Float64(c * i); elseif (Float64(x * y) <= 2.95e-235) tmp = Float64(z * t); elseif (Float64(x * y) <= 1.85e+89) tmp = Float64(a * b); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -1.72e-12) tmp = x * y; elseif ((x * y) <= -4.6e-125) tmp = c * i; elseif ((x * y) <= 2.95e-235) tmp = z * t; elseif ((x * y) <= 1.85e+89) tmp = a * b; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1.72e-12], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.6e-125], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.95e-235], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.85e+89], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.72 \cdot 10^{-12}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4.6 \cdot 10^{-125}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 2.95 \cdot 10^{-235}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{+89}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.7199999999999999e-12 or 1.8499999999999999e89 < (*.f64 x y) Initial program 93.3%
+-commutative93.3%
fma-define94.2%
+-commutative94.2%
fma-define95.0%
fma-define95.8%
Simplified95.8%
Taylor expanded in c around 0 87.8%
Taylor expanded in t around 0 77.1%
Taylor expanded in a around 0 66.2%
if -1.7199999999999999e-12 < (*.f64 x y) < -4.5999999999999998e-125Initial program 92.6%
+-commutative92.6%
fma-define92.6%
+-commutative92.6%
fma-define92.6%
fma-define92.6%
Simplified92.6%
Taylor expanded in c around inf 59.3%
if -4.5999999999999998e-125 < (*.f64 x y) < 2.9500000000000002e-235Initial program 97.9%
+-commutative97.9%
fma-define97.9%
+-commutative97.9%
fma-define97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in c around 0 78.5%
Taylor expanded in t around inf 78.5%
Taylor expanded in a around 0 49.3%
if 2.9500000000000002e-235 < (*.f64 x y) < 1.8499999999999999e89Initial program 96.7%
+-commutative96.7%
fma-define98.4%
+-commutative98.4%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around inf 42.1%
Final simplification56.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2.6e-14)
(+ (* x y) (* z t))
(if (<= (* x y) -1.05e-209)
(+ (* c i) (* z t))
(if (<= (* x y) 1.18e+32) (+ (* a b) (* z t)) (+ (* x y) (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2.6e-14) {
tmp = (x * y) + (z * t);
} else if ((x * y) <= -1.05e-209) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1.18e+32) {
tmp = (a * b) + (z * t);
} 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) :: tmp
if ((x * y) <= (-2.6d-14)) then
tmp = (x * y) + (z * t)
else if ((x * y) <= (-1.05d-209)) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 1.18d+32) then
tmp = (a * b) + (z * t)
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 tmp;
if ((x * y) <= -2.6e-14) {
tmp = (x * y) + (z * t);
} else if ((x * y) <= -1.05e-209) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1.18e+32) {
tmp = (a * b) + (z * t);
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2.6e-14: tmp = (x * y) + (z * t) elif (x * y) <= -1.05e-209: tmp = (c * i) + (z * t) elif (x * y) <= 1.18e+32: tmp = (a * b) + (z * t) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2.6e-14) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(x * y) <= -1.05e-209) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 1.18e+32) tmp = Float64(Float64(a * b) + Float64(z * t)); 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) tmp = 0.0; if ((x * y) <= -2.6e-14) tmp = (x * y) + (z * t); elseif ((x * y) <= -1.05e-209) tmp = (c * i) + (z * t); elseif ((x * y) <= 1.18e+32) tmp = (a * b) + (z * t); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2.6e-14], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.05e-209], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.18e+32], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.6 \cdot 10^{-14}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-209}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.18 \cdot 10^{+32}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -2.59999999999999997e-14Initial program 96.8%
+-commutative96.8%
fma-define98.4%
+-commutative98.4%
fma-define98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in c around 0 94.0%
Taylor expanded in a around 0 80.6%
if -2.59999999999999997e-14 < (*.f64 x y) < -1.04999999999999998e-209Initial program 94.6%
+-commutative94.6%
fma-define94.6%
+-commutative94.6%
fma-define94.6%
fma-define94.6%
Simplified94.6%
Taylor expanded in a around 0 80.7%
Taylor expanded in t around inf 77.2%
if -1.04999999999999998e-209 < (*.f64 x y) < 1.1800000000000001e32Initial program 96.6%
+-commutative96.6%
fma-define97.7%
+-commutative97.7%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in c around 0 81.7%
Taylor expanded in t around inf 77.3%
if 1.1800000000000001e32 < (*.f64 x y) Initial program 91.3%
+-commutative91.3%
fma-define91.3%
+-commutative91.3%
fma-define92.8%
fma-define94.2%
Simplified94.2%
Taylor expanded in a around 0 85.7%
Taylor expanded in t around 0 80.2%
Final simplification78.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1.65e+37)
(+ (* x y) (* a b))
(if (<= (* x y) -4e-209)
(+ (* c i) (* z t))
(if (<= (* x y) 5.6e+29) (+ (* a b) (* z t)) (+ (* x y) (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -1.65e+37) {
tmp = (x * y) + (a * b);
} else if ((x * y) <= -4e-209) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 5.6e+29) {
tmp = (a * b) + (z * t);
} 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) :: tmp
if ((x * y) <= (-1.65d+37)) then
tmp = (x * y) + (a * b)
else if ((x * y) <= (-4d-209)) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 5.6d+29) then
tmp = (a * b) + (z * t)
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 tmp;
if ((x * y) <= -1.65e+37) {
tmp = (x * y) + (a * b);
} else if ((x * y) <= -4e-209) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 5.6e+29) {
tmp = (a * b) + (z * t);
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1.65e+37: tmp = (x * y) + (a * b) elif (x * y) <= -4e-209: tmp = (c * i) + (z * t) elif (x * y) <= 5.6e+29: tmp = (a * b) + (z * t) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1.65e+37) tmp = Float64(Float64(x * y) + Float64(a * b)); elseif (Float64(x * y) <= -4e-209) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 5.6e+29) tmp = Float64(Float64(a * b) + Float64(z * t)); 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) tmp = 0.0; if ((x * y) <= -1.65e+37) tmp = (x * y) + (a * b); elseif ((x * y) <= -4e-209) tmp = (c * i) + (z * t); elseif ((x * y) <= 5.6e+29) tmp = (a * b) + (z * t); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1.65e+37], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-209], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.6e+29], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.65 \cdot 10^{+37}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-209}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5.6 \cdot 10^{+29}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.65e37Initial program 96.3%
+-commutative96.3%
fma-define98.1%
+-commutative98.1%
fma-define98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in c around 0 93.6%
Taylor expanded in t around 0 81.8%
if -1.65e37 < (*.f64 x y) < -4.0000000000000002e-209Initial program 95.6%
+-commutative95.6%
fma-define95.6%
+-commutative95.6%
fma-define95.6%
fma-define95.6%
Simplified95.6%
Taylor expanded in a around 0 78.6%
Taylor expanded in t around inf 72.7%
if -4.0000000000000002e-209 < (*.f64 x y) < 5.5999999999999999e29Initial program 96.6%
+-commutative96.6%
fma-define97.7%
+-commutative97.7%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in c around 0 81.7%
Taylor expanded in t around inf 77.3%
if 5.5999999999999999e29 < (*.f64 x y) Initial program 91.3%
+-commutative91.3%
fma-define91.3%
+-commutative91.3%
fma-define92.8%
fma-define94.2%
Simplified94.2%
Taylor expanded in a around 0 85.7%
Taylor expanded in t around 0 80.2%
Final simplification78.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* a b))))
(if (<= (* x y) -1.95e-13)
t_1
(if (<= (* x y) -1.35e-124)
(+ (* a b) (* c i))
(if (<= (* x y) 75000.0) (+ (* a b) (* z t)) 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) + (a * b);
double tmp;
if ((x * y) <= -1.95e-13) {
tmp = t_1;
} else if ((x * y) <= -1.35e-124) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 75000.0) {
tmp = (a * b) + (z * t);
} else {
tmp = 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) + (a * b)
if ((x * y) <= (-1.95d-13)) then
tmp = t_1
else if ((x * y) <= (-1.35d-124)) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 75000.0d0) then
tmp = (a * b) + (z * t)
else
tmp = 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) + (a * b);
double tmp;
if ((x * y) <= -1.95e-13) {
tmp = t_1;
} else if ((x * y) <= -1.35e-124) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 75000.0) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (a * b) tmp = 0 if (x * y) <= -1.95e-13: tmp = t_1 elif (x * y) <= -1.35e-124: tmp = (a * b) + (c * i) elif (x * y) <= 75000.0: tmp = (a * b) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(x * y) <= -1.95e-13) tmp = t_1; elseif (Float64(x * y) <= -1.35e-124) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 75000.0) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (a * b); tmp = 0.0; if ((x * y) <= -1.95e-13) tmp = t_1; elseif ((x * y) <= -1.35e-124) tmp = (a * b) + (c * i); elseif ((x * y) <= 75000.0) tmp = (a * b) + (z * t); else tmp = 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[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.95e-13], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.35e-124], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 75000.0], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -1.95 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.35 \cdot 10^{-124}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 75000:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.95000000000000002e-13 or 75000 < (*.f64 x y) Initial program 92.9%
+-commutative92.9%
fma-define94.3%
+-commutative94.3%
fma-define95.7%
fma-define96.4%
Simplified96.4%
Taylor expanded in c around 0 85.3%
Taylor expanded in t around 0 73.9%
if -1.95000000000000002e-13 < (*.f64 x y) < -1.35000000000000009e-124Initial program 92.6%
associate-+l+92.6%
fma-define92.6%
Simplified92.6%
Taylor expanded in x around inf 78.3%
Taylor expanded in x around 0 71.3%
if -1.35000000000000009e-124 < (*.f64 x y) < 75000Initial program 98.9%
+-commutative98.9%
fma-define98.9%
+-commutative98.9%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in c around 0 79.8%
Taylor expanded in t around inf 77.7%
Final simplification74.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= (* a b) -200000.0) (not (<= (* a b) 2e+36)))
(+ (* 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 (((a * b) <= -200000.0) || !((a * b) <= 2e+36)) {
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 (((a * b) <= (-200000.0d0)) .or. (.not. ((a * b) <= 2d+36))) 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 (((a * b) <= -200000.0) || !((a * b) <= 2e+36)) {
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 ((a * b) <= -200000.0) or not ((a * b) <= 2e+36): 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(a * b) <= -200000.0) || !(Float64(a * b) <= 2e+36)) 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 (((a * b) <= -200000.0) || ~(((a * b) <= 2e+36))) 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[Or[LessEqual[N[(a * b), $MachinePrecision], -200000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+36]], $MachinePrecision]], 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}\;a \cdot b \leq -200000 \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+36}\right):\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -2e5 or 2.00000000000000008e36 < (*.f64 a b) Initial program 90.9%
+-commutative90.9%
fma-define92.9%
+-commutative92.9%
fma-define94.9%
fma-define96.0%
Simplified96.0%
Taylor expanded in c around 0 84.4%
if -2e5 < (*.f64 a b) < 2.00000000000000008e36Initial program 97.4%
+-commutative97.4%
fma-define97.4%
+-commutative97.4%
fma-define97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in a around 0 93.0%
Final simplification89.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* a b) -200000.0)
(+ (* a b) t_1)
(if (<= (* a b) 5e+29) (+ (* c i) t_1) (+ (* 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 t_1 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -200000.0) {
tmp = (a * b) + t_1;
} else if ((a * b) <= 5e+29) {
tmp = (c * i) + t_1;
} else {
tmp = (x * y) + ((a * b) + (c * i));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((a * b) <= (-200000.0d0)) then
tmp = (a * b) + t_1
else if ((a * b) <= 5d+29) then
tmp = (c * i) + t_1
else
tmp = (x * y) + ((a * b) + (c * i))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -200000.0) {
tmp = (a * b) + t_1;
} else if ((a * b) <= 5e+29) {
tmp = (c * i) + t_1;
} else {
tmp = (x * y) + ((a * b) + (c * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (a * b) <= -200000.0: tmp = (a * b) + t_1 elif (a * b) <= 5e+29: tmp = (c * i) + t_1 else: tmp = (x * y) + ((a * b) + (c * i)) 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(a * b) <= -200000.0) tmp = Float64(Float64(a * b) + t_1); elseif (Float64(a * b) <= 5e+29) tmp = Float64(Float64(c * i) + t_1); else tmp = Float64(Float64(x * y) + Float64(Float64(a * b) + Float64(c * i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((a * b) <= -200000.0) tmp = (a * b) + t_1; elseif ((a * b) <= 5e+29) tmp = (c * i) + t_1; else tmp = (x * y) + ((a * b) + (c * i)); 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[(a * b), $MachinePrecision], -200000.0], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+29], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -200000:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+29}:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + \left(a \cdot b + c \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2e5Initial program 96.0%
+-commutative96.0%
fma-define98.0%
+-commutative98.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 88.4%
if -2e5 < (*.f64 a b) < 5.0000000000000001e29Initial program 97.4%
+-commutative97.4%
fma-define97.4%
+-commutative97.4%
fma-define97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in a around 0 92.9%
if 5.0000000000000001e29 < (*.f64 a b) Initial program 86.3%
associate-+l+86.3%
fma-define86.3%
Simplified86.3%
Taylor expanded in x around inf 84.6%
Final simplification90.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.3e+62)
(* a b)
(if (<= (* a b) 2.5e-204)
(* z t)
(if (<= (* a b) 2.3e+44) (* 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.3e+62) {
tmp = a * b;
} else if ((a * b) <= 2.5e-204) {
tmp = z * t;
} else if ((a * b) <= 2.3e+44) {
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.3d+62)) then
tmp = a * b
else if ((a * b) <= 2.5d-204) then
tmp = z * t
else if ((a * b) <= 2.3d+44) 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.3e+62) {
tmp = a * b;
} else if ((a * b) <= 2.5e-204) {
tmp = z * t;
} else if ((a * b) <= 2.3e+44) {
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.3e+62: tmp = a * b elif (a * b) <= 2.5e-204: tmp = z * t elif (a * b) <= 2.3e+44: 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.3e+62) tmp = Float64(a * b); elseif (Float64(a * b) <= 2.5e-204) tmp = Float64(z * t); elseif (Float64(a * b) <= 2.3e+44) 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.3e+62) tmp = a * b; elseif ((a * b) <= 2.5e-204) tmp = z * t; elseif ((a * b) <= 2.3e+44) 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.3e+62], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.5e-204], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.3e+44], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.3 \cdot 10^{+62}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 2.5 \cdot 10^{-204}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.3 \cdot 10^{+44}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.29999999999999984e62 or 2.30000000000000004e44 < (*.f64 a b) Initial program 89.5%
+-commutative89.5%
fma-define91.9%
+-commutative91.9%
fma-define94.2%
fma-define95.3%
Simplified95.3%
Taylor expanded in a around inf 60.1%
if -2.29999999999999984e62 < (*.f64 a b) < 2.5000000000000001e-204Initial program 97.4%
+-commutative97.4%
fma-define97.4%
+-commutative97.4%
fma-define97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in c around 0 82.7%
Taylor expanded in t around inf 40.3%
Taylor expanded in a around 0 36.4%
if 2.5000000000000001e-204 < (*.f64 a b) < 2.30000000000000004e44Initial program 98.1%
+-commutative98.1%
fma-define98.1%
+-commutative98.1%
fma-define98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in c around inf 39.0%
Final simplification44.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -4.8e+37) (not (<= (* x y) 8.8e+89))) (* 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) <= -4.8e+37) || !((x * y) <= 8.8e+89)) {
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) <= (-4.8d+37)) .or. (.not. ((x * y) <= 8.8d+89))) 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) <= -4.8e+37) || !((x * y) <= 8.8e+89)) {
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) <= -4.8e+37) or not ((x * y) <= 8.8e+89): 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) <= -4.8e+37) || !(Float64(x * y) <= 8.8e+89)) 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) <= -4.8e+37) || ~(((x * y) <= 8.8e+89))) 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], -4.8e+37], N[Not[LessEqual[N[(x * y), $MachinePrecision], 8.8e+89]], $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 -4.8 \cdot 10^{+37} \lor \neg \left(x \cdot y \leq 8.8 \cdot 10^{+89}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -4.8e37 or 8.8000000000000001e89 < (*.f64 x y) Initial program 92.9%
+-commutative92.9%
fma-define93.8%
+-commutative93.8%
fma-define94.6%
fma-define95.5%
Simplified95.5%
Taylor expanded in c around 0 87.1%
Taylor expanded in t around 0 78.9%
Taylor expanded in a around 0 69.4%
if -4.8e37 < (*.f64 x y) < 8.8000000000000001e89Initial program 96.5%
associate-+l+96.5%
fma-define96.5%
Simplified96.5%
Taylor expanded in x around inf 64.8%
Taylor expanded in x around 0 58.3%
Final simplification63.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= c -2.7e+140) (+ (* x y) (* c i)) (if (<= c 4.6e+40) (+ (* a b) (+ (* x y) (* z t))) (+ (* c i) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= -2.7e+140) {
tmp = (x * y) + (c * i);
} else if (c <= 4.6e+40) {
tmp = (a * b) + ((x * y) + (z * t));
} 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 (c <= (-2.7d+140)) then
tmp = (x * y) + (c * i)
else if (c <= 4.6d+40) then
tmp = (a * b) + ((x * y) + (z * t))
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 (c <= -2.7e+140) {
tmp = (x * y) + (c * i);
} else if (c <= 4.6e+40) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= -2.7e+140: tmp = (x * y) + (c * i) elif c <= 4.6e+40: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= -2.7e+140) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (c <= 4.6e+40) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); 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 (c <= -2.7e+140) tmp = (x * y) + (c * i); elseif (c <= 4.6e+40) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -2.7e+140], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.6e+40], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.7 \cdot 10^{+140}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \leq 4.6 \cdot 10^{+40}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if c < -2.70000000000000018e140Initial program 89.5%
+-commutative89.5%
fma-define89.5%
+-commutative89.5%
fma-define89.5%
fma-define89.5%
Simplified89.5%
Taylor expanded in a around 0 86.6%
Taylor expanded in t around 0 83.6%
if -2.70000000000000018e140 < c < 4.59999999999999987e40Initial program 97.7%
+-commutative97.7%
fma-define98.3%
+-commutative98.3%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in c around 0 90.1%
if 4.59999999999999987e40 < c Initial program 88.9%
+-commutative88.9%
fma-define91.1%
+-commutative91.1%
fma-define91.1%
fma-define93.3%
Simplified93.3%
Taylor expanded in a around 0 73.6%
Taylor expanded in t around inf 56.6%
Final simplification83.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -0.008) (not (<= (* a b) 4.4e+41))) (* 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) <= -0.008) || !((a * b) <= 4.4e+41)) {
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) <= (-0.008d0)) .or. (.not. ((a * b) <= 4.4d+41))) 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) <= -0.008) || !((a * b) <= 4.4e+41)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -0.008) or not ((a * b) <= 4.4e+41): 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) <= -0.008) || !(Float64(a * b) <= 4.4e+41)) 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) <= -0.008) || ~(((a * b) <= 4.4e+41))) 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], -0.008], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.4e+41]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -0.008 \lor \neg \left(a \cdot b \leq 4.4 \cdot 10^{+41}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -0.0080000000000000002 or 4.3999999999999998e41 < (*.f64 a b) Initial program 91.1%
+-commutative91.1%
fma-define93.1%
+-commutative93.1%
fma-define95.0%
fma-define96.0%
Simplified96.0%
Taylor expanded in a around inf 54.6%
if -0.0080000000000000002 < (*.f64 a b) < 4.3999999999999998e41Initial program 97.4%
+-commutative97.4%
fma-define97.4%
+-commutative97.4%
fma-define97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in c around inf 25.6%
Final simplification37.0%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 94.9%
+-commutative94.9%
fma-define95.7%
+-commutative95.7%
fma-define96.5%
fma-define96.9%
Simplified96.9%
Taylor expanded in a around inf 25.1%
herbie shell --seed 2024135
(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)))