
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma 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.5%
+-commutative96.5%
fma-define97.3%
+-commutative97.3%
fma-define98.0%
fma-define98.4%
Simplified98.4%
(FPCore (x y z t a b c i) :precision binary64 (+ (fma 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 fma(x, y, (z * t)) + ((a * b) + (c * i));
}
function code(x, y, z, t, a, b, c, i) return Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)
\end{array}
Initial program 96.5%
associate-+l+96.5%
fma-define96.9%
Simplified96.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))))
(if (<= (* x y) -1.3e+89)
(+ (* a b) (* x y))
(if (<= (* x y) -3.1e-211)
t_1
(if (<= (* x y) 1e-164)
(+ (* a b) (* c i))
(if (<= (* x y) 0.76) t_1 (+ (* c i) (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double tmp;
if ((x * y) <= -1.3e+89) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= -3.1e-211) {
tmp = t_1;
} else if ((x * y) <= 1e-164) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 0.76) {
tmp = t_1;
} else {
tmp = (c * i) + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * i) + (z * t)
if ((x * y) <= (-1.3d+89)) then
tmp = (a * b) + (x * y)
else if ((x * y) <= (-3.1d-211)) then
tmp = t_1
else if ((x * y) <= 1d-164) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 0.76d0) then
tmp = t_1
else
tmp = (c * i) + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double tmp;
if ((x * y) <= -1.3e+89) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= -3.1e-211) {
tmp = t_1;
} else if ((x * y) <= 1e-164) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 0.76) {
tmp = t_1;
} else {
tmp = (c * i) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) tmp = 0 if (x * y) <= -1.3e+89: tmp = (a * b) + (x * y) elif (x * y) <= -3.1e-211: tmp = t_1 elif (x * y) <= 1e-164: tmp = (a * b) + (c * i) elif (x * y) <= 0.76: tmp = t_1 else: tmp = (c * i) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -1.3e+89) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(x * y) <= -3.1e-211) tmp = t_1; elseif (Float64(x * y) <= 1e-164) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 0.76) tmp = t_1; else tmp = Float64(Float64(c * i) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); tmp = 0.0; if ((x * y) <= -1.3e+89) tmp = (a * b) + (x * y); elseif ((x * y) <= -3.1e-211) tmp = t_1; elseif ((x * y) <= 1e-164) tmp = (a * b) + (c * i); elseif ((x * y) <= 0.76) tmp = t_1; else tmp = (c * i) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.3e+89], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.1e-211], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-164], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.76], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -1.3 \cdot 10^{+89}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.1 \cdot 10^{-211}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-164}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 0.76:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.3e89Initial program 90.7%
associate-+l+90.7%
fma-define93.0%
Simplified93.0%
Taylor expanded in x around inf 90.7%
Taylor expanded in c around 0 88.5%
if -1.3e89 < (*.f64 x y) < -3.09999999999999995e-211 or 9.99999999999999962e-165 < (*.f64 x y) < 0.76000000000000001Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 92.6%
Taylor expanded in a around 0 76.9%
if -3.09999999999999995e-211 < (*.f64 x y) < 9.99999999999999962e-165Initial program 98.6%
+-commutative98.6%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 98.6%
Taylor expanded in c around inf 76.5%
if 0.76000000000000001 < (*.f64 x y) Initial program 93.4%
+-commutative93.4%
fma-define95.1%
+-commutative95.1%
fma-define96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in a around 0 87.0%
Taylor expanded in t around 0 77.5%
Final simplification78.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* a b) (* x y))))
(if (<= (* x y) -2.5e+100)
t_2
(if (<= (* x y) -4.6e-184)
t_1
(if (<= (* x y) 4.8e-164)
(+ (* a b) (* c i))
(if (<= (* x y) 3.6e+203) 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 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -2.5e+100) {
tmp = t_2;
} else if ((x * y) <= -4.6e-184) {
tmp = t_1;
} else if ((x * y) <= 4.8e-164) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 3.6e+203) {
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 = (a * b) + (x * y)
if ((x * y) <= (-2.5d+100)) then
tmp = t_2
else if ((x * y) <= (-4.6d-184)) then
tmp = t_1
else if ((x * y) <= 4.8d-164) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 3.6d+203) 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 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -2.5e+100) {
tmp = t_2;
} else if ((x * y) <= -4.6e-184) {
tmp = t_1;
} else if ((x * y) <= 4.8e-164) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 3.6e+203) {
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 = (a * b) + (x * y) tmp = 0 if (x * y) <= -2.5e+100: tmp = t_2 elif (x * y) <= -4.6e-184: tmp = t_1 elif (x * y) <= 4.8e-164: tmp = (a * b) + (c * i) elif (x * y) <= 3.6e+203: 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(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2.5e+100) tmp = t_2; elseif (Float64(x * y) <= -4.6e-184) tmp = t_1; elseif (Float64(x * y) <= 4.8e-164) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 3.6e+203) 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 = (a * b) + (x * y); tmp = 0.0; if ((x * y) <= -2.5e+100) tmp = t_2; elseif ((x * y) <= -4.6e-184) tmp = t_1; elseif ((x * y) <= 4.8e-164) tmp = (a * b) + (c * i); elseif ((x * y) <= 3.6e+203) 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[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.5e+100], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -4.6e-184], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.8e-164], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.6e+203], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := a \cdot b + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -2.5 \cdot 10^{+100}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -4.6 \cdot 10^{-184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{-164}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 3.6 \cdot 10^{+203}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.4999999999999999e100 or 3.59999999999999982e203 < (*.f64 x y) Initial program 89.3%
associate-+l+89.3%
fma-define90.6%
Simplified90.6%
Taylor expanded in x around inf 89.3%
Taylor expanded in c around 0 88.2%
if -2.4999999999999999e100 < (*.f64 x y) < -4.5999999999999999e-184 or 4.79999999999999966e-164 < (*.f64 x y) < 3.59999999999999982e203Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 86.2%
Taylor expanded in a around 0 71.9%
if -4.5999999999999999e-184 < (*.f64 x y) < 4.79999999999999966e-164Initial program 98.6%
+-commutative98.6%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 98.6%
Taylor expanded in c around inf 76.5%
Final simplification78.0%
(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 (* z (+ t (/ (* a b) z))))))
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 = z * (t + ((a * b) / z));
}
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 = z * (t + ((a * b) / z));
}
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 = z * (t + ((a * b) / z)) 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(z * Float64(t + Float64(Float64(a * b) / z))); 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 = z * (t + ((a * b) / z)); 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[(z * N[(t + N[(N[(a * b), $MachinePrecision] / z), $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}:\\
\;\;\;\;z \cdot \left(t + \frac{a \cdot b}{z}\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-define22.2%
+-commutative22.2%
fma-define44.4%
fma-define55.6%
Simplified55.6%
Taylor expanded in x around 0 33.3%
Taylor expanded in c around 0 33.9%
Taylor expanded in z around inf 45.1%
Final simplification98.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.02e+139)
(* c i)
(if (<= (* c i) -5.4e-132)
(* a b)
(if (<= (* c i) 2.9e+66)
(* x y)
(if (<= (* c i) 2.15e+122) (* 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 ((c * i) <= -1.02e+139) {
tmp = c * i;
} else if ((c * i) <= -5.4e-132) {
tmp = a * b;
} else if ((c * i) <= 2.9e+66) {
tmp = x * y;
} else if ((c * i) <= 2.15e+122) {
tmp = z * t;
} 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 ((c * i) <= (-1.02d+139)) then
tmp = c * i
else if ((c * i) <= (-5.4d-132)) then
tmp = a * b
else if ((c * i) <= 2.9d+66) then
tmp = x * y
else if ((c * i) <= 2.15d+122) then
tmp = z * t
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 ((c * i) <= -1.02e+139) {
tmp = c * i;
} else if ((c * i) <= -5.4e-132) {
tmp = a * b;
} else if ((c * i) <= 2.9e+66) {
tmp = x * y;
} else if ((c * i) <= 2.15e+122) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.02e+139: tmp = c * i elif (c * i) <= -5.4e-132: tmp = a * b elif (c * i) <= 2.9e+66: tmp = x * y elif (c * i) <= 2.15e+122: tmp = z * t else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1.02e+139) tmp = Float64(c * i); elseif (Float64(c * i) <= -5.4e-132) tmp = Float64(a * b); elseif (Float64(c * i) <= 2.9e+66) tmp = Float64(x * y); elseif (Float64(c * i) <= 2.15e+122) tmp = Float64(z * t); 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 ((c * i) <= -1.02e+139) tmp = c * i; elseif ((c * i) <= -5.4e-132) tmp = a * b; elseif ((c * i) <= 2.9e+66) tmp = x * y; elseif ((c * i) <= 2.15e+122) tmp = z * t; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1.02e+139], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5.4e-132], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.9e+66], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.15e+122], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.02 \cdot 10^{+139}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -5.4 \cdot 10^{-132}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 2.9 \cdot 10^{+66}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 2.15 \cdot 10^{+122}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.02e139 or 2.14999999999999986e122 < (*.f64 c i) Initial program 93.6%
+-commutative93.6%
fma-define96.2%
+-commutative96.2%
fma-define96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in c around inf 74.6%
if -1.02e139 < (*.f64 c i) < -5.3999999999999998e-132Initial program 97.8%
+-commutative97.8%
fma-define97.8%
+-commutative97.8%
fma-define97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in a around inf 46.8%
if -5.3999999999999998e-132 < (*.f64 c i) < 2.89999999999999986e66Initial program 97.5%
+-commutative97.5%
fma-define97.5%
+-commutative97.5%
fma-define99.2%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 76.6%
Taylor expanded in t around 0 46.7%
Taylor expanded in c around 0 42.6%
if 2.89999999999999986e66 < (*.f64 c i) < 2.14999999999999986e122Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 87.7%
Taylor expanded in c around 0 67.8%
Taylor expanded in a around 0 67.6%
Final simplification54.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= (* x y) -5.2e+100)
t_1
(if (<= (* x y) -1.16e-176)
(+ (* a b) (* z t))
(if (<= (* x y) 2.5e+121) (+ (* a b) (* 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 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -5.2e+100) {
tmp = t_1;
} else if ((x * y) <= -1.16e-176) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 2.5e+121) {
tmp = (a * b) + (c * i);
} 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) + (x * y)
if ((x * y) <= (-5.2d+100)) then
tmp = t_1
else if ((x * y) <= (-1.16d-176)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 2.5d+121) then
tmp = (a * b) + (c * i)
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) + (x * y);
double tmp;
if ((x * y) <= -5.2e+100) {
tmp = t_1;
} else if ((x * y) <= -1.16e-176) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 2.5e+121) {
tmp = (a * b) + (c * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) tmp = 0 if (x * y) <= -5.2e+100: tmp = t_1 elif (x * y) <= -1.16e-176: tmp = (a * b) + (z * t) elif (x * y) <= 2.5e+121: tmp = (a * b) + (c * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -5.2e+100) tmp = t_1; elseif (Float64(x * y) <= -1.16e-176) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 2.5e+121) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); tmp = 0.0; if ((x * y) <= -5.2e+100) tmp = t_1; elseif ((x * y) <= -1.16e-176) tmp = (a * b) + (z * t); elseif ((x * y) <= 2.5e+121) tmp = (a * b) + (c * i); 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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5.2e+100], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.16e-176], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.5e+121], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -5.2 \cdot 10^{+100}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.16 \cdot 10^{-176}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+121}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -5.2000000000000003e100 or 2.50000000000000004e121 < (*.f64 x y) Initial program 90.3%
associate-+l+90.3%
fma-define91.5%
Simplified91.5%
Taylor expanded in x around inf 88.0%
Taylor expanded in c around 0 83.6%
if -5.2000000000000003e100 < (*.f64 x y) < -1.15999999999999999e-176Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 91.1%
Taylor expanded in c around 0 65.1%
if -1.15999999999999999e-176 < (*.f64 x y) < 2.50000000000000004e121Initial program 99.2%
+-commutative99.2%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 93.7%
Taylor expanded in c around inf 67.1%
Final simplification72.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2e+197)
(* x y)
(if (<= (* x y) -3.7e-177)
(+ (* a b) (* z t))
(if (<= (* x y) 9.5e+121) (+ (* a b) (* c i)) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2e+197) {
tmp = x * y;
} else if ((x * y) <= -3.7e-177) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 9.5e+121) {
tmp = (a * b) + (c * i);
} 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) <= (-2d+197)) then
tmp = x * y
else if ((x * y) <= (-3.7d-177)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 9.5d+121) then
tmp = (a * b) + (c * i)
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) <= -2e+197) {
tmp = x * y;
} else if ((x * y) <= -3.7e-177) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 9.5e+121) {
tmp = (a * b) + (c * i);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2e+197: tmp = x * y elif (x * y) <= -3.7e-177: tmp = (a * b) + (z * t) elif (x * y) <= 9.5e+121: tmp = (a * b) + (c * i) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2e+197) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.7e-177) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 9.5e+121) tmp = Float64(Float64(a * b) + Float64(c * i)); 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) <= -2e+197) tmp = x * y; elseif ((x * y) <= -3.7e-177) tmp = (a * b) + (z * t); elseif ((x * y) <= 9.5e+121) tmp = (a * b) + (c * i); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+197], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.7e-177], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9.5e+121], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+197}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.7 \cdot 10^{-177}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{+121}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e197 or 9.49999999999999949e121 < (*.f64 x y) Initial program 89.3%
+-commutative89.3%
fma-define90.7%
+-commutative90.7%
fma-define93.3%
fma-define94.7%
Simplified94.7%
Taylor expanded in a around 0 88.2%
Taylor expanded in t around 0 85.6%
Taylor expanded in c around 0 79.3%
if -1.9999999999999999e197 < (*.f64 x y) < -3.69999999999999993e-177Initial program 99.9%
+-commutative99.9%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 86.1%
Taylor expanded in c around 0 63.6%
if -3.69999999999999993e-177 < (*.f64 x y) < 9.49999999999999949e121Initial program 99.2%
+-commutative99.2%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 93.7%
Taylor expanded in c around inf 67.1%
Final simplification69.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -1e+164) (not (<= (* c i) 4e+56))) (+ (* a b) (+ (* c i) (* z t))) (+ (* a b) (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1e+164) || !((c * i) <= 4e+56)) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-1d+164)) .or. (.not. ((c * i) <= 4d+56))) then
tmp = (a * b) + ((c * i) + (z * t))
else
tmp = (a * b) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1e+164) || !((c * i) <= 4e+56)) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -1e+164) or not ((c * i) <= 4e+56): tmp = (a * b) + ((c * i) + (z * t)) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -1e+164) || !(Float64(c * i) <= 4e+56)) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); else tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -1e+164) || ~(((c * i) <= 4e+56))) tmp = (a * b) + ((c * i) + (z * t)); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1e+164], N[Not[LessEqual[N[(c * i), $MachinePrecision], 4e+56]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+164} \lor \neg \left(c \cdot i \leq 4 \cdot 10^{+56}\right):\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -1e164 or 4.00000000000000037e56 < (*.f64 c i) Initial program 94.5%
+-commutative94.5%
fma-define96.7%
+-commutative96.7%
fma-define96.7%
fma-define96.7%
Simplified96.7%
Taylor expanded in x around 0 90.3%
if -1e164 < (*.f64 c i) < 4.00000000000000037e56Initial program 97.5%
+-commutative97.5%
fma-define97.5%
+-commutative97.5%
fma-define98.8%
fma-define99.4%
Simplified99.4%
Taylor expanded in c around 0 92.2%
Final simplification91.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* c i) -1e+164)
(+ (* a b) (* c (+ i (/ (* z t) c))))
(if (<= (* c i) 1e+43) (+ (* a b) t_1) (+ (* c i) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -1e+164) {
tmp = (a * b) + (c * (i + ((z * t) / c)));
} else if ((c * i) <= 1e+43) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((c * i) <= (-1d+164)) then
tmp = (a * b) + (c * (i + ((z * t) / c)))
else if ((c * i) <= 1d+43) then
tmp = (a * b) + t_1
else
tmp = (c * i) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -1e+164) {
tmp = (a * b) + (c * (i + ((z * t) / c)));
} else if ((c * i) <= 1e+43) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (c * i) <= -1e+164: tmp = (a * b) + (c * (i + ((z * t) / c))) elif (c * i) <= 1e+43: tmp = (a * b) + t_1 else: tmp = (c * i) + t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -1e+164) tmp = Float64(Float64(a * b) + Float64(c * Float64(i + Float64(Float64(z * t) / c)))); elseif (Float64(c * i) <= 1e+43) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((c * i) <= -1e+164) tmp = (a * b) + (c * (i + ((z * t) / c))); elseif ((c * i) <= 1e+43) tmp = (a * b) + t_1; else tmp = (c * i) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1e+164], N[(N[(a * b), $MachinePrecision] + N[(c * N[(i + N[(N[(z * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e+43], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+164}:\\
\;\;\;\;a \cdot b + c \cdot \left(i + \frac{z \cdot t}{c}\right)\\
\mathbf{elif}\;c \cdot i \leq 10^{+43}:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -1e164Initial program 91.2%
+-commutative91.2%
fma-define97.1%
+-commutative97.1%
fma-define97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in x around 0 94.1%
Taylor expanded in c around inf 97.1%
if -1e164 < (*.f64 c i) < 1.00000000000000001e43Initial program 97.5%
+-commutative97.5%
fma-define97.5%
+-commutative97.5%
fma-define98.7%
fma-define99.4%
Simplified99.4%
Taylor expanded in c around 0 92.6%
if 1.00000000000000001e43 < (*.f64 c i) Initial program 96.8%
+-commutative96.8%
fma-define96.8%
+-commutative96.8%
fma-define96.8%
fma-define96.8%
Simplified96.8%
Taylor expanded in a around 0 91.1%
Final simplification92.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* x y) -2.2e+73)
(+ (* a b) t_1)
(if (<= (* x y) 2.25e+36)
(+ (* a b) (+ (* c i) (* z t)))
(+ (* 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 ((x * y) <= -2.2e+73) {
tmp = (a * b) + t_1;
} else if ((x * y) <= 2.25e+36) {
tmp = (a * b) + ((c * i) + (z * t));
} 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 ((x * y) <= (-2.2d+73)) then
tmp = (a * b) + t_1
else if ((x * y) <= 2.25d+36) then
tmp = (a * b) + ((c * i) + (z * t))
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 ((x * y) <= -2.2e+73) {
tmp = (a * b) + t_1;
} else if ((x * y) <= 2.25e+36) {
tmp = (a * b) + ((c * i) + (z * t));
} 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 (x * y) <= -2.2e+73: tmp = (a * b) + t_1 elif (x * y) <= 2.25e+36: tmp = (a * b) + ((c * i) + (z * t)) 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(x * y) <= -2.2e+73) tmp = Float64(Float64(a * b) + t_1); elseif (Float64(x * y) <= 2.25e+36) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); 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 ((x * y) <= -2.2e+73) tmp = (a * b) + t_1; elseif ((x * y) <= 2.25e+36) tmp = (a * b) + ((c * i) + (z * t)); else tmp = (c * i) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.2e+73], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.25e+36], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $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}\;x \cdot y \leq -2.2 \cdot 10^{+73}:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{elif}\;x \cdot y \leq 2.25 \cdot 10^{+36}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.2e73Initial program 91.3%
+-commutative91.3%
fma-define91.3%
+-commutative91.3%
fma-define93.5%
fma-define95.7%
Simplified95.7%
Taylor expanded in c around 0 89.2%
if -2.2e73 < (*.f64 x y) < 2.24999999999999998e36Initial program 99.3%
+-commutative99.3%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 94.4%
if 2.24999999999999998e36 < (*.f64 x y) Initial program 92.6%
+-commutative92.6%
fma-define94.4%
+-commutative94.4%
fma-define96.3%
fma-define96.3%
Simplified96.3%
Taylor expanded in a around 0 90.8%
Final simplification92.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -7.4e+102)
(+ (* a b) (* x y))
(if (<= (* x y) 5.2e+68)
(+ (* a b) (+ (* c i) (* z t)))
(+ (* c i) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -7.4e+102) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 5.2e+68) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (c * i) + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-7.4d+102)) then
tmp = (a * b) + (x * y)
else if ((x * y) <= 5.2d+68) then
tmp = (a * b) + ((c * i) + (z * t))
else
tmp = (c * i) + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -7.4e+102) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 5.2e+68) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (c * i) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -7.4e+102: tmp = (a * b) + (x * y) elif (x * y) <= 5.2e+68: tmp = (a * b) + ((c * i) + (z * t)) else: tmp = (c * i) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -7.4e+102) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(x * y) <= 5.2e+68) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -7.4e+102) tmp = (a * b) + (x * y); elseif ((x * y) <= 5.2e+68) tmp = (a * b) + ((c * i) + (z * t)); else tmp = (c * i) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -7.4e+102], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.2e+68], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.4 \cdot 10^{+102}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 5.2 \cdot 10^{+68}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -7.40000000000000045e102Initial program 90.4%
associate-+l+90.4%
fma-define92.8%
Simplified92.8%
Taylor expanded in x around inf 90.4%
Taylor expanded in c around 0 88.2%
if -7.40000000000000045e102 < (*.f64 x y) < 5.1999999999999996e68Initial program 99.4%
+-commutative99.4%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 93.3%
if 5.1999999999999996e68 < (*.f64 x y) Initial program 91.5%
+-commutative91.5%
fma-define93.6%
+-commutative93.6%
fma-define95.7%
fma-define95.7%
Simplified95.7%
Taylor expanded in a around 0 89.5%
Taylor expanded in t around 0 85.4%
Final simplification91.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -3.5e+150)
(* c i)
(if (<= (* c i) -4.8e-97)
(* a b)
(if (<= (* c i) 4.9e+124) (* 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 ((c * i) <= -3.5e+150) {
tmp = c * i;
} else if ((c * i) <= -4.8e-97) {
tmp = a * b;
} else if ((c * i) <= 4.9e+124) {
tmp = z * t;
} 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 ((c * i) <= (-3.5d+150)) then
tmp = c * i
else if ((c * i) <= (-4.8d-97)) then
tmp = a * b
else if ((c * i) <= 4.9d+124) then
tmp = z * t
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 ((c * i) <= -3.5e+150) {
tmp = c * i;
} else if ((c * i) <= -4.8e-97) {
tmp = a * b;
} else if ((c * i) <= 4.9e+124) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -3.5e+150: tmp = c * i elif (c * i) <= -4.8e-97: tmp = a * b elif (c * i) <= 4.9e+124: tmp = z * t else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -3.5e+150) tmp = Float64(c * i); elseif (Float64(c * i) <= -4.8e-97) tmp = Float64(a * b); elseif (Float64(c * i) <= 4.9e+124) tmp = Float64(z * t); 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 ((c * i) <= -3.5e+150) tmp = c * i; elseif ((c * i) <= -4.8e-97) tmp = a * b; elseif ((c * i) <= 4.9e+124) tmp = z * t; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -3.5e+150], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -4.8e-97], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.9e+124], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.5 \cdot 10^{+150}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -4.8 \cdot 10^{-97}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 4.9 \cdot 10^{+124}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -3.49999999999999984e150 or 4.90000000000000035e124 < (*.f64 c i) Initial program 93.6%
+-commutative93.6%
fma-define96.2%
+-commutative96.2%
fma-define96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in c around inf 74.6%
if -3.49999999999999984e150 < (*.f64 c i) < -4.8e-97Initial program 97.6%
+-commutative97.6%
fma-define97.6%
+-commutative97.6%
fma-define97.6%
fma-define97.6%
Simplified97.6%
Taylor expanded in a around inf 46.4%
if -4.8e-97 < (*.f64 c i) < 4.90000000000000035e124Initial program 97.8%
+-commutative97.8%
fma-define97.8%
+-commutative97.8%
fma-define99.3%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 66.2%
Taylor expanded in c around 0 60.4%
Taylor expanded in a around 0 38.0%
Final simplification50.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -4.8e+206) (not (<= (* x y) 4.9e+122))) (* 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+206) || !((x * y) <= 4.9e+122)) {
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+206)) .or. (.not. ((x * y) <= 4.9d+122))) 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+206) || !((x * y) <= 4.9e+122)) {
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+206) or not ((x * y) <= 4.9e+122): 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+206) || !(Float64(x * y) <= 4.9e+122)) 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+206) || ~(((x * y) <= 4.9e+122))) 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+206], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4.9e+122]], $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^{+206} \lor \neg \left(x \cdot y \leq 4.9 \cdot 10^{+122}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -4.7999999999999999e206 or 4.8999999999999998e122 < (*.f64 x y) Initial program 90.4%
+-commutative90.4%
fma-define91.8%
+-commutative91.8%
fma-define94.5%
fma-define95.9%
Simplified95.9%
Taylor expanded in a around 0 89.2%
Taylor expanded in t around 0 85.2%
Taylor expanded in c around 0 80.1%
if -4.7999999999999999e206 < (*.f64 x y) < 4.8999999999999998e122Initial program 98.9%
+-commutative98.9%
fma-define99.4%
+-commutative99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 90.3%
Taylor expanded in c around inf 61.9%
Final simplification67.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -8e+136) (not (<= (* c i) 1.55e+50))) (* 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 (((c * i) <= -8e+136) || !((c * i) <= 1.55e+50)) {
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 (((c * i) <= (-8d+136)) .or. (.not. ((c * i) <= 1.55d+50))) 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 (((c * i) <= -8e+136) || !((c * i) <= 1.55e+50)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -8e+136) or not ((c * i) <= 1.55e+50): tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -8e+136) || !(Float64(c * i) <= 1.55e+50)) 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 (((c * i) <= -8e+136) || ~(((c * i) <= 1.55e+50))) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -8e+136], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.55e+50]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8 \cdot 10^{+136} \lor \neg \left(c \cdot i \leq 1.55 \cdot 10^{+50}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -8.00000000000000047e136 or 1.55000000000000001e50 < (*.f64 c i) Initial program 94.8%
+-commutative94.8%
fma-define96.9%
+-commutative96.9%
fma-define96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in c around inf 64.8%
if -8.00000000000000047e136 < (*.f64 c i) < 1.55000000000000001e50Initial program 97.5%
+-commutative97.5%
fma-define97.5%
+-commutative97.5%
fma-define98.7%
fma-define99.4%
Simplified99.4%
Taylor expanded in a around inf 34.0%
Final simplification45.6%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.5%
+-commutative96.5%
fma-define97.3%
+-commutative97.3%
fma-define98.0%
fma-define98.4%
Simplified98.4%
Taylor expanded in a around inf 26.3%
herbie shell --seed 2024185
(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)))