
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma 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 96.1%
+-commutative96.1%
fma-define98.0%
+-commutative98.0%
fma-define98.8%
fma-define98.8%
Simplified98.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.8e+53)
(* a b)
(if (<= (* a b) -3.05e+16)
(* c i)
(if (<= (* a b) 4.9e-160)
(* z t)
(if (<= (* a b) 4.5e-97)
(* x y)
(if (<= (* a b) 8.5e+158) (* 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.8e+53) {
tmp = a * b;
} else if ((a * b) <= -3.05e+16) {
tmp = c * i;
} else if ((a * b) <= 4.9e-160) {
tmp = z * t;
} else if ((a * b) <= 4.5e-97) {
tmp = x * y;
} else if ((a * b) <= 8.5e+158) {
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.8d+53)) then
tmp = a * b
else if ((a * b) <= (-3.05d+16)) then
tmp = c * i
else if ((a * b) <= 4.9d-160) then
tmp = z * t
else if ((a * b) <= 4.5d-97) then
tmp = x * y
else if ((a * b) <= 8.5d+158) 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.8e+53) {
tmp = a * b;
} else if ((a * b) <= -3.05e+16) {
tmp = c * i;
} else if ((a * b) <= 4.9e-160) {
tmp = z * t;
} else if ((a * b) <= 4.5e-97) {
tmp = x * y;
} else if ((a * b) <= 8.5e+158) {
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.8e+53: tmp = a * b elif (a * b) <= -3.05e+16: tmp = c * i elif (a * b) <= 4.9e-160: tmp = z * t elif (a * b) <= 4.5e-97: tmp = x * y elif (a * b) <= 8.5e+158: 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.8e+53) tmp = Float64(a * b); elseif (Float64(a * b) <= -3.05e+16) tmp = Float64(c * i); elseif (Float64(a * b) <= 4.9e-160) tmp = Float64(z * t); elseif (Float64(a * b) <= 4.5e-97) tmp = Float64(x * y); elseif (Float64(a * b) <= 8.5e+158) 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.8e+53) tmp = a * b; elseif ((a * b) <= -3.05e+16) tmp = c * i; elseif ((a * b) <= 4.9e-160) tmp = z * t; elseif ((a * b) <= 4.5e-97) tmp = x * y; elseif ((a * b) <= 8.5e+158) 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.8e+53], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3.05e+16], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.9e-160], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.5e-97], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 8.5e+158], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.8 \cdot 10^{+53}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -3.05 \cdot 10^{+16}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 4.9 \cdot 10^{-160}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 4.5 \cdot 10^{-97}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 8.5 \cdot 10^{+158}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.8e53 or 8.49999999999999978e158 < (*.f64 a b) Initial program 92.8%
+-commutative92.8%
fma-define95.2%
+-commutative95.2%
fma-define97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in a around inf 75.8%
if -1.8e53 < (*.f64 a b) < -3.05e16 or 4.5000000000000001e-97 < (*.f64 a b) < 8.49999999999999978e158Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around inf 46.9%
if -3.05e16 < (*.f64 a b) < 4.8999999999999999e-160Initial program 96.7%
+-commutative96.7%
fma-define98.9%
+-commutative98.9%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in a around 0 94.1%
Taylor expanded in z around inf 87.0%
Taylor expanded in c around 0 63.9%
Taylor expanded in t around inf 43.7%
if 4.8999999999999999e-160 < (*.f64 a b) < 4.5000000000000001e-97Initial program 93.7%
+-commutative93.7%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around inf 59.8%
(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 (+ (* z t) (* 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 = (z * t) + (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 = (z * t) + (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 = (z * t) + (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(Float64(z * t) + 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 = (z * t) + (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[(N[(z * t), $MachinePrecision] + N[(a * b), $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}:\\
\;\;\;\;z \cdot t + 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-define50.0%
+-commutative50.0%
fma-define70.0%
fma-define70.0%
Simplified70.0%
Taylor expanded in x around 0 20.0%
Taylor expanded in c around 0 70.0%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -6.5e+53)
(* a b)
(if (<= (* a b) 7.2e-185)
(* c i)
(if (<= (* a b) 1e-92)
(* x y)
(if (<= (* a b) 7.5e+159) (* 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) <= -6.5e+53) {
tmp = a * b;
} else if ((a * b) <= 7.2e-185) {
tmp = c * i;
} else if ((a * b) <= 1e-92) {
tmp = x * y;
} else if ((a * b) <= 7.5e+159) {
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) <= (-6.5d+53)) then
tmp = a * b
else if ((a * b) <= 7.2d-185) then
tmp = c * i
else if ((a * b) <= 1d-92) then
tmp = x * y
else if ((a * b) <= 7.5d+159) 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) <= -6.5e+53) {
tmp = a * b;
} else if ((a * b) <= 7.2e-185) {
tmp = c * i;
} else if ((a * b) <= 1e-92) {
tmp = x * y;
} else if ((a * b) <= 7.5e+159) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -6.5e+53: tmp = a * b elif (a * b) <= 7.2e-185: tmp = c * i elif (a * b) <= 1e-92: tmp = x * y elif (a * b) <= 7.5e+159: 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) <= -6.5e+53) tmp = Float64(a * b); elseif (Float64(a * b) <= 7.2e-185) tmp = Float64(c * i); elseif (Float64(a * b) <= 1e-92) tmp = Float64(x * y); elseif (Float64(a * b) <= 7.5e+159) 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) <= -6.5e+53) tmp = a * b; elseif ((a * b) <= 7.2e-185) tmp = c * i; elseif ((a * b) <= 1e-92) tmp = x * y; elseif ((a * b) <= 7.5e+159) 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], -6.5e+53], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 7.2e-185], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e-92], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 7.5e+159], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -6.5 \cdot 10^{+53}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 7.2 \cdot 10^{-185}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 10^{-92}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 7.5 \cdot 10^{+159}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -6.50000000000000017e53 or 7.4999999999999997e159 < (*.f64 a b) Initial program 92.8%
+-commutative92.8%
fma-define95.2%
+-commutative95.2%
fma-define97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in a around inf 75.8%
if -6.50000000000000017e53 < (*.f64 a b) < 7.1999999999999997e-185 or 9.99999999999999988e-93 < (*.f64 a b) < 7.4999999999999997e159Initial program 98.1%
+-commutative98.1%
fma-define99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in c around inf 38.1%
if 7.1999999999999997e-185 < (*.f64 a b) < 9.99999999999999988e-93Initial program 94.0%
+-commutative94.0%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around inf 56.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -2e+70) (not (<= (* a b) 1e+155))) (* a (+ b (+ (* c (/ i a)) (* x (/ y a))))) (+ (* c i) (+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -2e+70) || !((a * b) <= 1e+155)) {
tmp = a * (b + ((c * (i / a)) + (x * (y / a))));
} else {
tmp = (c * i) + ((z * t) + (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 (((a * b) <= (-2d+70)) .or. (.not. ((a * b) <= 1d+155))) then
tmp = a * (b + ((c * (i / a)) + (x * (y / a))))
else
tmp = (c * i) + ((z * t) + (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 (((a * b) <= -2e+70) || !((a * b) <= 1e+155)) {
tmp = a * (b + ((c * (i / a)) + (x * (y / a))));
} else {
tmp = (c * i) + ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -2e+70) or not ((a * b) <= 1e+155): tmp = a * (b + ((c * (i / a)) + (x * (y / a)))) else: tmp = (c * i) + ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -2e+70) || !(Float64(a * b) <= 1e+155)) tmp = Float64(a * Float64(b + Float64(Float64(c * Float64(i / a)) + Float64(x * Float64(y / a))))); else tmp = Float64(Float64(c * i) + Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -2e+70) || ~(((a * b) <= 1e+155))) tmp = a * (b + ((c * (i / a)) + (x * (y / a)))); else tmp = (c * i) + ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -2e+70], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+155]], $MachinePrecision]], N[(a * N[(b + N[(N[(c * N[(i / a), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+70} \lor \neg \left(a \cdot b \leq 10^{+155}\right):\\
\;\;\;\;a \cdot \left(b + \left(c \cdot \frac{i}{a} + x \cdot \frac{y}{a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000015e70 or 1.00000000000000001e155 < (*.f64 a b) Initial program 92.6%
+-commutative92.6%
fma-define95.1%
+-commutative95.1%
fma-define97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in z around 0 91.5%
Taylor expanded in a around inf 90.3%
associate-/l*92.7%
associate-/l*95.2%
Simplified95.2%
if -2.00000000000000015e70 < (*.f64 a b) < 1.00000000000000001e155Initial program 97.7%
+-commutative97.7%
fma-define99.4%
+-commutative99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in a around 0 91.8%
Final simplification92.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (/ y a))))
(if (<= (* a b) -2e+70)
(* a (+ b (+ (* c (/ i a)) t_1)))
(if (<= (* a b) 1e+155)
(+ (* c i) (+ (* z t) (* x y)))
(* a (+ b (+ t_1 (* i (/ c a)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * (y / a);
double tmp;
if ((a * b) <= -2e+70) {
tmp = a * (b + ((c * (i / a)) + t_1));
} else if ((a * b) <= 1e+155) {
tmp = (c * i) + ((z * t) + (x * y));
} else {
tmp = a * (b + (t_1 + (i * (c / a))));
}
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)
if ((a * b) <= (-2d+70)) then
tmp = a * (b + ((c * (i / a)) + t_1))
else if ((a * b) <= 1d+155) then
tmp = (c * i) + ((z * t) + (x * y))
else
tmp = a * (b + (t_1 + (i * (c / a))))
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);
double tmp;
if ((a * b) <= -2e+70) {
tmp = a * (b + ((c * (i / a)) + t_1));
} else if ((a * b) <= 1e+155) {
tmp = (c * i) + ((z * t) + (x * y));
} else {
tmp = a * (b + (t_1 + (i * (c / a))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x * (y / a) tmp = 0 if (a * b) <= -2e+70: tmp = a * (b + ((c * (i / a)) + t_1)) elif (a * b) <= 1e+155: tmp = (c * i) + ((z * t) + (x * y)) else: tmp = a * (b + (t_1 + (i * (c / a)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * Float64(y / a)) tmp = 0.0 if (Float64(a * b) <= -2e+70) tmp = Float64(a * Float64(b + Float64(Float64(c * Float64(i / a)) + t_1))); elseif (Float64(a * b) <= 1e+155) tmp = Float64(Float64(c * i) + Float64(Float64(z * t) + Float64(x * y))); else tmp = Float64(a * Float64(b + Float64(t_1 + Float64(i * Float64(c / a))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x * (y / a); tmp = 0.0; if ((a * b) <= -2e+70) tmp = a * (b + ((c * (i / a)) + t_1)); elseif ((a * b) <= 1e+155) tmp = (c * i) + ((z * t) + (x * y)); else tmp = a * (b + (t_1 + (i * (c / a)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+70], N[(a * N[(b + N[(N[(c * N[(i / a), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+155], N[(N[(c * i), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(b + N[(t$95$1 + N[(i * N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{a}\\
\mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+70}:\\
\;\;\;\;a \cdot \left(b + \left(c \cdot \frac{i}{a} + t\_1\right)\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+155}:\\
\;\;\;\;c \cdot i + \left(z \cdot t + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b + \left(t\_1 + i \cdot \frac{c}{a}\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.00000000000000015e70Initial program 95.5%
+-commutative95.5%
fma-define97.7%
+-commutative97.7%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around 0 93.3%
Taylor expanded in a around inf 91.1%
associate-/l*93.3%
associate-/l*93.3%
Simplified93.3%
if -2.00000000000000015e70 < (*.f64 a b) < 1.00000000000000001e155Initial program 97.7%
+-commutative97.7%
fma-define99.4%
+-commutative99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in a around 0 91.8%
if 1.00000000000000001e155 < (*.f64 a b) Initial program 89.1%
+-commutative89.1%
fma-define91.9%
+-commutative91.9%
fma-define94.6%
fma-define94.6%
Simplified94.6%
Taylor expanded in z around 0 89.4%
Taylor expanded in a around inf 89.3%
associate-/l*92.0%
associate-/l*97.4%
Simplified97.4%
clear-num97.5%
un-div-inv97.5%
Applied egg-rr97.5%
associate-/r/97.4%
Simplified97.4%
Final simplification92.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* c i) -2e+225)
t_1
(if (<= (* c i) -2e-124)
(+ (* z t) (* x y))
(if (<= (* c i) 1e+112) (+ (* z t) (* a b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -2e+225) {
tmp = t_1;
} else if ((c * i) <= -2e-124) {
tmp = (z * t) + (x * y);
} else if ((c * i) <= 1e+112) {
tmp = (z * t) + (a * b);
} 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 = (a * b) + (c * i)
if ((c * i) <= (-2d+225)) then
tmp = t_1
else if ((c * i) <= (-2d-124)) then
tmp = (z * t) + (x * y)
else if ((c * i) <= 1d+112) then
tmp = (z * t) + (a * b)
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 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -2e+225) {
tmp = t_1;
} else if ((c * i) <= -2e-124) {
tmp = (z * t) + (x * y);
} else if ((c * i) <= 1e+112) {
tmp = (z * t) + (a * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (c * i) <= -2e+225: tmp = t_1 elif (c * i) <= -2e-124: tmp = (z * t) + (x * y) elif (c * i) <= 1e+112: tmp = (z * t) + (a * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -2e+225) tmp = t_1; elseif (Float64(c * i) <= -2e-124) tmp = Float64(Float64(z * t) + Float64(x * y)); elseif (Float64(c * i) <= 1e+112) tmp = Float64(Float64(z * t) + Float64(a * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -2e+225) tmp = t_1; elseif ((c * i) <= -2e-124) tmp = (z * t) + (x * y); elseif ((c * i) <= 1e+112) tmp = (z * t) + (a * b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2e+225], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -2e-124], N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e+112], N[(N[(z * t), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+225}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-124}:\\
\;\;\;\;z \cdot t + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 10^{+112}:\\
\;\;\;\;z \cdot t + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -1.99999999999999986e225 or 9.9999999999999993e111 < (*.f64 c i) Initial program 92.7%
+-commutative92.7%
fma-define98.8%
+-commutative98.8%
fma-define98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in x around 0 85.9%
Taylor expanded in c around inf 80.1%
if -1.99999999999999986e225 < (*.f64 c i) < -1.99999999999999987e-124Initial program 98.4%
+-commutative98.4%
fma-define98.4%
+-commutative98.4%
fma-define98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in a around 0 83.3%
Taylor expanded in c around 0 71.3%
if -1.99999999999999987e-124 < (*.f64 c i) < 9.9999999999999993e111Initial program 97.2%
+-commutative97.2%
fma-define97.2%
+-commutative97.2%
fma-define99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in x around 0 76.2%
Taylor expanded in c around 0 71.9%
Final simplification74.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5e-37) (not (<= (* x y) 5e+139))) (+ (* a b) (+ (* z t) (* x y))) (+ (* a b) (+ (* z t) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5e-37) || !((x * y) <= 5e+139)) {
tmp = (a * b) + ((z * t) + (x * y));
} else {
tmp = (a * b) + ((z * t) + (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) <= (-5d-37)) .or. (.not. ((x * y) <= 5d+139))) then
tmp = (a * b) + ((z * t) + (x * y))
else
tmp = (a * b) + ((z * t) + (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) <= -5e-37) || !((x * y) <= 5e+139)) {
tmp = (a * b) + ((z * t) + (x * y));
} else {
tmp = (a * b) + ((z * t) + (c * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5e-37) or not ((x * y) <= 5e+139): tmp = (a * b) + ((z * t) + (x * y)) else: tmp = (a * b) + ((z * t) + (c * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -5e-37) || !(Float64(x * y) <= 5e+139)) tmp = Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y))); else tmp = Float64(Float64(a * b) + Float64(Float64(z * t) + 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) <= -5e-37) || ~(((x * y) <= 5e+139))) tmp = (a * b) + ((z * t) + (x * y)); else tmp = (a * b) + ((z * t) + (c * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e-37], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+139]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-37} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+139}\right):\\
\;\;\;\;a \cdot b + \left(z \cdot t + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(z \cdot t + c \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999997e-37 or 5.0000000000000003e139 < (*.f64 x y) Initial program 95.7%
+-commutative95.7%
fma-define96.8%
+-commutative96.8%
fma-define97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in c around 0 85.4%
if -4.9999999999999997e-37 < (*.f64 x y) < 5.0000000000000003e139Initial program 96.3%
+-commutative96.3%
fma-define98.8%
+-commutative98.8%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 92.8%
Final simplification90.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5e+119) (not (<= (* x y) 1e+224))) (+ (* x y) (* c i)) (+ (* a b) (+ (* z t) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -5e+119) || !((x * y) <= 1e+224)) {
tmp = (x * y) + (c * i);
} else {
tmp = (a * b) + ((z * t) + (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) <= (-5d+119)) .or. (.not. ((x * y) <= 1d+224))) then
tmp = (x * y) + (c * i)
else
tmp = (a * b) + ((z * t) + (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) <= -5e+119) || !((x * y) <= 1e+224)) {
tmp = (x * y) + (c * i);
} else {
tmp = (a * b) + ((z * t) + (c * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5e+119) or not ((x * y) <= 1e+224): tmp = (x * y) + (c * i) else: tmp = (a * b) + ((z * t) + (c * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -5e+119) || !(Float64(x * y) <= 1e+224)) tmp = Float64(Float64(x * y) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(Float64(z * t) + 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) <= -5e+119) || ~(((x * y) <= 1e+224))) tmp = (x * y) + (c * i); else tmp = (a * b) + ((z * t) + (c * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e+119], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+224]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+119} \lor \neg \left(x \cdot y \leq 10^{+224}\right):\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(z \cdot t + c \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999999e119 or 9.9999999999999997e223 < (*.f64 x y) Initial program 95.0%
+-commutative95.0%
fma-define95.0%
+-commutative95.0%
fma-define96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in a around 0 90.2%
Taylor expanded in t around 0 85.3%
if -4.9999999999999999e119 < (*.f64 x y) < 9.9999999999999997e223Initial program 96.4%
+-commutative96.4%
fma-define99.0%
+-commutative99.0%
fma-define99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in x around 0 88.9%
Final simplification88.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -4e+58)
(+ (* a b) (+ (* z t) (* c i)))
(if (<= (* a b) 1e+155)
(+ (* c i) (+ (* z t) (* x y)))
(* a (+ b (* c (/ i a)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4e+58) {
tmp = (a * b) + ((z * t) + (c * i));
} else if ((a * b) <= 1e+155) {
tmp = (c * i) + ((z * t) + (x * y));
} else {
tmp = a * (b + (c * (i / a)));
}
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) <= (-4d+58)) then
tmp = (a * b) + ((z * t) + (c * i))
else if ((a * b) <= 1d+155) then
tmp = (c * i) + ((z * t) + (x * y))
else
tmp = a * (b + (c * (i / a)))
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) <= -4e+58) {
tmp = (a * b) + ((z * t) + (c * i));
} else if ((a * b) <= 1e+155) {
tmp = (c * i) + ((z * t) + (x * y));
} else {
tmp = a * (b + (c * (i / a)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -4e+58: tmp = (a * b) + ((z * t) + (c * i)) elif (a * b) <= 1e+155: tmp = (c * i) + ((z * t) + (x * y)) else: tmp = a * (b + (c * (i / a))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -4e+58) tmp = Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(c * i))); elseif (Float64(a * b) <= 1e+155) tmp = Float64(Float64(c * i) + Float64(Float64(z * t) + Float64(x * y))); else tmp = Float64(a * Float64(b + Float64(c * Float64(i / a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -4e+58) tmp = (a * b) + ((z * t) + (c * i)); elseif ((a * b) <= 1e+155) tmp = (c * i) + ((z * t) + (x * y)); else tmp = a * (b + (c * (i / a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -4e+58], N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+155], N[(N[(c * i), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(b + N[(c * N[(i / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+58}:\\
\;\;\;\;a \cdot b + \left(z \cdot t + c \cdot i\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+155}:\\
\;\;\;\;c \cdot i + \left(z \cdot t + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(b + c \cdot \frac{i}{a}\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -3.99999999999999978e58Initial program 95.7%
+-commutative95.7%
fma-define97.8%
+-commutative97.8%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 87.6%
if -3.99999999999999978e58 < (*.f64 a b) < 1.00000000000000001e155Initial program 97.7%
+-commutative97.7%
fma-define99.4%
+-commutative99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in a around 0 92.3%
if 1.00000000000000001e155 < (*.f64 a b) Initial program 89.1%
+-commutative89.1%
fma-define91.9%
+-commutative91.9%
fma-define94.6%
fma-define94.6%
Simplified94.6%
Taylor expanded in z around 0 89.4%
Taylor expanded in a around inf 89.3%
associate-/l*92.0%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in x around 0 87.3%
associate-*r/90.1%
Simplified90.1%
Final simplification91.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -1e+104) (not (<= (* z t) 2e+76))) (+ (* z t) (* a b)) (+ (* a b) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -1e+104) || !((z * t) <= 2e+76)) {
tmp = (z * t) + (a * b);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((z * t) <= (-1d+104)) .or. (.not. ((z * t) <= 2d+76))) then
tmp = (z * t) + (a * b)
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -1e+104) || !((z * t) <= 2e+76)) {
tmp = (z * t) + (a * b);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -1e+104) or not ((z * t) <= 2e+76): tmp = (z * t) + (a * b) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -1e+104) || !(Float64(z * t) <= 2e+76)) tmp = Float64(Float64(z * t) + Float64(a * b)); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((z * t) <= -1e+104) || ~(((z * t) <= 2e+76))) tmp = (z * t) + (a * b); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -1e+104], N[Not[LessEqual[N[(z * t), $MachinePrecision], 2e+76]], $MachinePrecision]], N[(N[(z * t), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+104} \lor \neg \left(z \cdot t \leq 2 \cdot 10^{+76}\right):\\
\;\;\;\;z \cdot t + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 z t) < -1e104 or 2.0000000000000001e76 < (*.f64 z t) Initial program 92.9%
+-commutative92.9%
fma-define97.0%
+-commutative97.0%
fma-define98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in x around 0 83.9%
Taylor expanded in c around 0 74.3%
if -1e104 < (*.f64 z t) < 2.0000000000000001e76Initial program 98.0%
+-commutative98.0%
fma-define98.7%
+-commutative98.7%
fma-define99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in x around 0 72.7%
Taylor expanded in c around inf 68.7%
Final simplification70.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -5.5e+144) (not (<= (* z t) 1.75e+196))) (* z t) (+ (* a b) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -5.5e+144) || !((z * t) <= 1.75e+196)) {
tmp = z * t;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((z * t) <= (-5.5d+144)) .or. (.not. ((z * t) <= 1.75d+196))) then
tmp = z * t
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -5.5e+144) || !((z * t) <= 1.75e+196)) {
tmp = z * t;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -5.5e+144) or not ((z * t) <= 1.75e+196): tmp = z * t else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -5.5e+144) || !(Float64(z * t) <= 1.75e+196)) tmp = Float64(z * t); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((z * t) <= -5.5e+144) || ~(((z * t) <= 1.75e+196))) tmp = z * t; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -5.5e+144], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1.75e+196]], $MachinePrecision]], N[(z * t), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5.5 \cdot 10^{+144} \lor \neg \left(z \cdot t \leq 1.75 \cdot 10^{+196}\right):\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 z t) < -5.50000000000000022e144 or 1.7499999999999999e196 < (*.f64 z t) Initial program 91.5%
+-commutative91.5%
fma-define95.8%
+-commutative95.8%
fma-define97.2%
fma-define97.2%
Simplified97.2%
Taylor expanded in a around 0 90.1%
Taylor expanded in z around inf 90.1%
Taylor expanded in c around 0 81.0%
Taylor expanded in t around inf 76.3%
if -5.50000000000000022e144 < (*.f64 z t) < 1.7499999999999999e196Initial program 97.8%
+-commutative97.8%
fma-define98.9%
+-commutative98.9%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 72.7%
Taylor expanded in c around inf 64.5%
Final simplification67.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -3.2e+60) (+ (* x y) (* c i)) (if (<= (* c i) 2.9e+112) (+ (* z t) (* a b)) (+ (* 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 ((c * i) <= -3.2e+60) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 2.9e+112) {
tmp = (z * t) + (a * b);
} 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 ((c * i) <= (-3.2d+60)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= 2.9d+112) then
tmp = (z * t) + (a * b)
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 ((c * i) <= -3.2e+60) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 2.9e+112) {
tmp = (z * t) + (a * b);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -3.2e+60: tmp = (x * y) + (c * i) elif (c * i) <= 2.9e+112: tmp = (z * t) + (a * b) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -3.2e+60) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= 2.9e+112) tmp = Float64(Float64(z * t) + Float64(a * b)); 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 ((c * i) <= -3.2e+60) tmp = (x * y) + (c * i); elseif ((c * i) <= 2.9e+112) tmp = (z * t) + (a * b); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -3.2e+60], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.9e+112], N[(N[(z * t), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.2 \cdot 10^{+60}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 2.9 \cdot 10^{+112}:\\
\;\;\;\;z \cdot t + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -3.19999999999999991e60Initial program 96.9%
+-commutative96.9%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 88.9%
Taylor expanded in t around 0 73.9%
if -3.19999999999999991e60 < (*.f64 c i) < 2.9000000000000002e112Initial program 97.2%
+-commutative97.2%
fma-define97.2%
+-commutative97.2%
fma-define98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in x around 0 74.8%
Taylor expanded in c around 0 70.2%
if 2.9000000000000002e112 < (*.f64 c i) Initial program 91.6%
+-commutative91.6%
fma-define97.9%
+-commutative97.9%
fma-define97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in x around 0 79.9%
Taylor expanded in c around inf 71.7%
Final simplification71.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -2.1e+58) (not (<= (* a b) 4.9e+156))) (* 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) <= -2.1e+58) || !((a * b) <= 4.9e+156)) {
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) <= (-2.1d+58)) .or. (.not. ((a * b) <= 4.9d+156))) 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) <= -2.1e+58) || !((a * b) <= 4.9e+156)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -2.1e+58) or not ((a * b) <= 4.9e+156): 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) <= -2.1e+58) || !(Float64(a * b) <= 4.9e+156)) 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) <= -2.1e+58) || ~(((a * b) <= 4.9e+156))) 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], -2.1e+58], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.9e+156]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.1 \cdot 10^{+58} \lor \neg \left(a \cdot b \leq 4.9 \cdot 10^{+156}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -2.10000000000000012e58 or 4.89999999999999969e156 < (*.f64 a b) Initial program 92.8%
+-commutative92.8%
fma-define95.2%
+-commutative95.2%
fma-define97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in a around inf 75.8%
if -2.10000000000000012e58 < (*.f64 a b) < 4.89999999999999969e156Initial program 97.7%
+-commutative97.7%
fma-define99.4%
+-commutative99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in c around inf 35.1%
Final simplification48.5%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.1%
+-commutative96.1%
fma-define98.0%
+-commutative98.0%
fma-define98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in a around inf 29.8%
herbie shell --seed 2024180
(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)))