
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 95.7%
+-commutative95.7%
fma-define96.5%
associate-+l+96.5%
fma-define97.6%
fma-define98.0%
Simplified98.0%
(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 95.7%
+-commutative95.7%
fma-define96.5%
+-commutative96.5%
fma-define96.9%
fma-define97.6%
Simplified97.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -4.1e+73)
(* x y)
(if (<= (* x y) -5.9e-9)
(* z t)
(if (<= (* x y) -1.05e-151)
(* c i)
(if (<= (* x y) 7.5e-148)
(* z t)
(if (<= (* x y) 57000.0)
(* a b)
(if (<= (* x y) 7e+127) (* 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 ((x * y) <= -4.1e+73) {
tmp = x * y;
} else if ((x * y) <= -5.9e-9) {
tmp = z * t;
} else if ((x * y) <= -1.05e-151) {
tmp = c * i;
} else if ((x * y) <= 7.5e-148) {
tmp = z * t;
} else if ((x * y) <= 57000.0) {
tmp = a * b;
} else if ((x * y) <= 7e+127) {
tmp = z * t;
} 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) <= (-4.1d+73)) then
tmp = x * y
else if ((x * y) <= (-5.9d-9)) then
tmp = z * t
else if ((x * y) <= (-1.05d-151)) then
tmp = c * i
else if ((x * y) <= 7.5d-148) then
tmp = z * t
else if ((x * y) <= 57000.0d0) then
tmp = a * b
else if ((x * y) <= 7d+127) then
tmp = z * t
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) <= -4.1e+73) {
tmp = x * y;
} else if ((x * y) <= -5.9e-9) {
tmp = z * t;
} else if ((x * y) <= -1.05e-151) {
tmp = c * i;
} else if ((x * y) <= 7.5e-148) {
tmp = z * t;
} else if ((x * y) <= 57000.0) {
tmp = a * b;
} else if ((x * y) <= 7e+127) {
tmp = z * t;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -4.1e+73: tmp = x * y elif (x * y) <= -5.9e-9: tmp = z * t elif (x * y) <= -1.05e-151: tmp = c * i elif (x * y) <= 7.5e-148: tmp = z * t elif (x * y) <= 57000.0: tmp = a * b elif (x * y) <= 7e+127: tmp = z * t else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -4.1e+73) tmp = Float64(x * y); elseif (Float64(x * y) <= -5.9e-9) tmp = Float64(z * t); elseif (Float64(x * y) <= -1.05e-151) tmp = Float64(c * i); elseif (Float64(x * y) <= 7.5e-148) tmp = Float64(z * t); elseif (Float64(x * y) <= 57000.0) tmp = Float64(a * b); elseif (Float64(x * y) <= 7e+127) tmp = Float64(z * t); 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) <= -4.1e+73) tmp = x * y; elseif ((x * y) <= -5.9e-9) tmp = z * t; elseif ((x * y) <= -1.05e-151) tmp = c * i; elseif ((x * y) <= 7.5e-148) tmp = z * t; elseif ((x * y) <= 57000.0) tmp = a * b; elseif ((x * y) <= 7e+127) tmp = z * t; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -4.1e+73], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5.9e-9], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.05e-151], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7.5e-148], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 57000.0], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7e+127], N[(z * t), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.1 \cdot 10^{+73}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -5.9 \cdot 10^{-9}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-151}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 7.5 \cdot 10^{-148}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 57000:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{+127}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.0999999999999998e73 or 6.99999999999999956e127 < (*.f64 x y) Initial program 90.6%
+-commutative90.6%
fma-define91.7%
+-commutative91.7%
fma-define92.9%
fma-define95.3%
Simplified95.3%
Taylor expanded in a around 0 79.4%
Taylor expanded in t around 0 74.7%
Taylor expanded in c around 0 63.6%
if -4.0999999999999998e73 < (*.f64 x y) < -5.8999999999999999e-9 or -1.04999999999999995e-151 < (*.f64 x y) < 7.5000000000000005e-148 or 57000 < (*.f64 x y) < 6.99999999999999956e127Initial program 97.4%
+-commutative97.4%
fma-define98.3%
+-commutative98.3%
fma-define98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in x around 0 93.7%
Taylor expanded in c around 0 71.9%
Taylor expanded in a around 0 48.0%
if -5.8999999999999999e-9 < (*.f64 x y) < -1.04999999999999995e-151Initial program 99.9%
+-commutative99.9%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around inf 56.2%
if 7.5000000000000005e-148 < (*.f64 x y) < 57000Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around inf 55.2%
Final simplification54.8%
(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 (* t (+ z (/ (* x y) t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = t * (z + ((x * y) / t));
}
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 = t * (z + ((x * y) / t));
}
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 = t * (z + ((x * y) / t)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(t * Float64(z + Float64(Float64(x * y) / t))); 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 = t * (z + ((x * y) / t)); 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[(t * N[(z + N[(N[(x * y), $MachinePrecision] / t), $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}:\\
\;\;\;\;t \cdot \left(z + \frac{x \cdot y}{t}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
associate-+l+0.0%
fma-define18.2%
Simplified18.2%
Taylor expanded in t around inf 18.2%
Taylor expanded in c around 0 45.5%
Taylor expanded in a around 0 54.6%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2.2e+56)
(+ (* a b) (* x y))
(if (<= (* x y) -6.5e-208)
(+ (* c i) (* z t))
(if (<= (* x y) 2.8e+113) (+ (* a b) (* z t)) (+ (* x y) (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2.2e+56) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= -6.5e-208) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 2.8e+113) {
tmp = (a * b) + (z * t);
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-2.2d+56)) then
tmp = (a * b) + (x * y)
else if ((x * y) <= (-6.5d-208)) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 2.8d+113) then
tmp = (a * b) + (z * t)
else
tmp = (x * y) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2.2e+56) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= -6.5e-208) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 2.8e+113) {
tmp = (a * b) + (z * t);
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2.2e+56: tmp = (a * b) + (x * y) elif (x * y) <= -6.5e-208: tmp = (c * i) + (z * t) elif (x * y) <= 2.8e+113: tmp = (a * b) + (z * t) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2.2e+56) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(x * y) <= -6.5e-208) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 2.8e+113) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -2.2e+56) tmp = (a * b) + (x * y); elseif ((x * y) <= -6.5e-208) tmp = (c * i) + (z * t); elseif ((x * y) <= 2.8e+113) tmp = (a * b) + (z * t); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2.2e+56], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -6.5e-208], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.8e+113], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.2 \cdot 10^{+56}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -6.5 \cdot 10^{-208}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{+113}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -2.20000000000000016e56Initial program 90.0%
+-commutative90.0%
fma-define90.0%
+-commutative90.0%
fma-define90.0%
fma-define94.0%
Simplified94.0%
Taylor expanded in c around 0 79.1%
Taylor expanded in t around 0 78.9%
if -2.20000000000000016e56 < (*.f64 x y) < -6.4999999999999998e-208Initial program 97.8%
+-commutative97.8%
fma-define97.8%
+-commutative97.8%
fma-define97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in x around 0 92.3%
Taylor expanded in a around 0 76.2%
if -6.4999999999999998e-208 < (*.f64 x y) < 2.79999999999999998e113Initial program 98.4%
+-commutative98.4%
fma-define99.2%
+-commutative99.2%
fma-define99.2%
fma-define99.2%
Simplified99.2%
Taylor expanded in x around 0 95.6%
Taylor expanded in c around 0 72.4%
if 2.79999999999999998e113 < (*.f64 x y) Initial program 91.8%
+-commutative91.8%
fma-define94.5%
+-commutative94.5%
fma-define97.2%
fma-define97.2%
Simplified97.2%
Taylor expanded in a around 0 84.3%
Taylor expanded in t around 0 76.6%
Final simplification75.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= (* x y) -4.4e+56)
t_1
(if (<= (* x y) -5.4e-207)
(+ (* c i) (* z t))
(if (<= (* x y) 6.8e+120) (+ (* a b) (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -4.4e+56) {
tmp = t_1;
} else if ((x * y) <= -5.4e-207) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 6.8e+120) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (x * y)
if ((x * y) <= (-4.4d+56)) then
tmp = t_1
else if ((x * y) <= (-5.4d-207)) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 6.8d+120) then
tmp = (a * b) + (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -4.4e+56) {
tmp = t_1;
} else if ((x * y) <= -5.4e-207) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 6.8e+120) {
tmp = (a * b) + (z * t);
} 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) <= -4.4e+56: tmp = t_1 elif (x * y) <= -5.4e-207: tmp = (c * i) + (z * t) elif (x * y) <= 6.8e+120: tmp = (a * b) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -4.4e+56) tmp = t_1; elseif (Float64(x * y) <= -5.4e-207) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 6.8e+120) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); tmp = 0.0; if ((x * y) <= -4.4e+56) tmp = t_1; elseif ((x * y) <= -5.4e-207) tmp = (c * i) + (z * t); elseif ((x * y) <= 6.8e+120) tmp = (a * b) + (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.4e+56], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5.4e-207], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.8e+120], N[(N[(a * b), $MachinePrecision] + N[(z * t), $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 -4.4 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -5.4 \cdot 10^{-207}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 6.8 \cdot 10^{+120}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -4.40000000000000032e56 or 6.79999999999999998e120 < (*.f64 x y) Initial program 90.7%
+-commutative90.7%
fma-define91.8%
+-commutative91.8%
fma-define93.0%
fma-define95.3%
Simplified95.3%
Taylor expanded in c around 0 80.0%
Taylor expanded in t around 0 76.5%
if -4.40000000000000032e56 < (*.f64 x y) < -5.4e-207Initial program 97.8%
+-commutative97.8%
fma-define97.8%
+-commutative97.8%
fma-define97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in x around 0 92.3%
Taylor expanded in a around 0 76.2%
if -5.4e-207 < (*.f64 x y) < 6.79999999999999998e120Initial program 98.4%
+-commutative98.4%
fma-define99.2%
+-commutative99.2%
fma-define99.2%
fma-define99.2%
Simplified99.2%
Taylor expanded in x around 0 95.6%
Taylor expanded in c around 0 71.9%
Final simplification74.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= (* x y) -2.5e+113)
t_1
(if (<= (* x y) -2.35e-156)
(+ (* a b) (* c i))
(if (<= (* x y) 2e+127) (+ (* a b) (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -2.5e+113) {
tmp = t_1;
} else if ((x * y) <= -2.35e-156) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 2e+127) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (x * y)
if ((x * y) <= (-2.5d+113)) then
tmp = t_1
else if ((x * y) <= (-2.35d-156)) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 2d+127) then
tmp = (a * b) + (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -2.5e+113) {
tmp = t_1;
} else if ((x * y) <= -2.35e-156) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 2e+127) {
tmp = (a * b) + (z * t);
} 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) <= -2.5e+113: tmp = t_1 elif (x * y) <= -2.35e-156: tmp = (a * b) + (c * i) elif (x * y) <= 2e+127: tmp = (a * b) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2.5e+113) tmp = t_1; elseif (Float64(x * y) <= -2.35e-156) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 2e+127) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); tmp = 0.0; if ((x * y) <= -2.5e+113) tmp = t_1; elseif ((x * y) <= -2.35e-156) tmp = (a * b) + (c * i); elseif ((x * y) <= 2e+127) tmp = (a * b) + (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.5e+113], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.35e-156], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+127], N[(N[(a * b), $MachinePrecision] + N[(z * t), $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 -2.5 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.35 \cdot 10^{-156}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+127}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -2.5e113 or 1.99999999999999991e127 < (*.f64 x y) Initial program 89.6%
+-commutative89.6%
fma-define90.9%
+-commutative90.9%
fma-define92.2%
fma-define94.8%
Simplified94.8%
Taylor expanded in c around 0 82.3%
Taylor expanded in t around 0 79.7%
if -2.5e113 < (*.f64 x y) < -2.35000000000000023e-156Initial program 97.9%
+-commutative97.9%
fma-define97.9%
+-commutative97.9%
fma-define97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in x around 0 88.2%
Taylor expanded in c around inf 64.3%
if -2.35000000000000023e-156 < (*.f64 x y) < 1.99999999999999991e127Initial program 98.5%
+-commutative98.5%
fma-define99.2%
+-commutative99.2%
fma-define99.2%
fma-define99.2%
Simplified99.2%
Taylor expanded in x around 0 95.9%
Taylor expanded in c around 0 71.9%
Final simplification72.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -5.0) (not (<= (* c i) 2e+106))) (+ (* 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) <= -5.0) || !((c * i) <= 2e+106)) {
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) <= (-5.0d0)) .or. (.not. ((c * i) <= 2d+106))) 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) <= -5.0) || !((c * i) <= 2e+106)) {
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) <= -5.0) or not ((c * i) <= 2e+106): 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) <= -5.0) || !(Float64(c * i) <= 2e+106)) 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) <= -5.0) || ~(((c * i) <= 2e+106))) 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], -5.0], N[Not[LessEqual[N[(c * i), $MachinePrecision], 2e+106]], $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 -5 \lor \neg \left(c \cdot i \leq 2 \cdot 10^{+106}\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) < -5 or 2.00000000000000018e106 < (*.f64 c i) Initial program 93.0%
+-commutative93.0%
fma-define95.0%
+-commutative95.0%
fma-define95.0%
fma-define96.0%
Simplified96.0%
Taylor expanded in x around 0 88.5%
if -5 < (*.f64 c i) < 2.00000000000000018e106Initial program 97.4%
+-commutative97.4%
fma-define97.4%
+-commutative97.4%
fma-define98.0%
fma-define98.7%
Simplified98.7%
Taylor expanded in c around 0 95.7%
Final simplification92.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -7.8e+118)
(+ (* a b) (* x y))
(if (<= (* x y) 8e+158)
(+ (* a b) (+ (* c i) (* z t)))
(+ (* 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 ((x * y) <= -7.8e+118) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 8e+158) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (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 ((x * y) <= (-7.8d+118)) then
tmp = (a * b) + (x * y)
else if ((x * y) <= 8d+158) then
tmp = (a * b) + ((c * i) + (z * t))
else
tmp = (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 ((x * y) <= -7.8e+118) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 8e+158) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -7.8e+118: tmp = (a * b) + (x * y) elif (x * y) <= 8e+158: tmp = (a * b) + ((c * i) + (z * t)) else: tmp = (x * y) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -7.8e+118) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(x * y) <= 8e+158) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); else tmp = 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 ((x * y) <= -7.8e+118) tmp = (a * b) + (x * y); elseif ((x * y) <= 8e+158) tmp = (a * b) + ((c * i) + (z * t)); else tmp = (x * y) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -7.8e+118], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8e+158], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.8 \cdot 10^{+118}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{+158}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -7.8e118Initial program 87.8%
+-commutative87.8%
fma-define87.8%
+-commutative87.8%
fma-define87.8%
fma-define92.7%
Simplified92.7%
Taylor expanded in c around 0 83.2%
Taylor expanded in t around 0 85.3%
if -7.8e118 < (*.f64 x y) < 7.99999999999999962e158Initial program 98.4%
+-commutative98.4%
fma-define98.9%
+-commutative98.9%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in x around 0 93.5%
if 7.99999999999999962e158 < (*.f64 x y) Initial program 89.5%
+-commutative89.5%
fma-define93.0%
+-commutative93.0%
fma-define96.4%
fma-define96.4%
Simplified96.4%
Taylor expanded in c around 0 86.5%
Taylor expanded in a around 0 86.5%
Final simplification91.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -4.5e+183) (not (<= (* c i) 6.5e+106))) (+ (* a b) (* c i)) (+ (* a b) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -4.5e+183) || !((c * i) <= 6.5e+106)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-4.5d+183)) .or. (.not. ((c * i) <= 6.5d+106))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -4.5e+183) || !((c * i) <= 6.5e+106)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -4.5e+183) or not ((c * i) <= 6.5e+106): tmp = (a * b) + (c * i) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -4.5e+183) || !(Float64(c * i) <= 6.5e+106)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -4.5e+183) || ~(((c * i) <= 6.5e+106))) tmp = (a * b) + (c * i); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -4.5e+183], N[Not[LessEqual[N[(c * i), $MachinePrecision], 6.5e+106]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4.5 \cdot 10^{+183} \lor \neg \left(c \cdot i \leq 6.5 \cdot 10^{+106}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -4.50000000000000017e183 or 6.5000000000000003e106 < (*.f64 c i) Initial program 90.3%
+-commutative90.3%
fma-define93.0%
+-commutative93.0%
fma-define93.0%
fma-define94.4%
Simplified94.4%
Taylor expanded in x around 0 86.6%
Taylor expanded in c around inf 81.2%
if -4.50000000000000017e183 < (*.f64 c i) < 6.5000000000000003e106Initial program 97.8%
+-commutative97.8%
fma-define97.8%
+-commutative97.8%
fma-define98.4%
fma-define98.9%
Simplified98.9%
Taylor expanded in x around 0 71.4%
Taylor expanded in c around 0 65.1%
Final simplification69.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -9.6e+113) (not (<= (* x y) 1.35e+161))) (* 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) <= -9.6e+113) || !((x * y) <= 1.35e+161)) {
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) <= (-9.6d+113)) .or. (.not. ((x * y) <= 1.35d+161))) 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) <= -9.6e+113) || !((x * y) <= 1.35e+161)) {
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) <= -9.6e+113) or not ((x * y) <= 1.35e+161): 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) <= -9.6e+113) || !(Float64(x * y) <= 1.35e+161)) 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) <= -9.6e+113) || ~(((x * y) <= 1.35e+161))) 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], -9.6e+113], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.35e+161]], $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 -9.6 \cdot 10^{+113} \lor \neg \left(x \cdot y \leq 1.35 \cdot 10^{+161}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -9.59999999999999933e113 or 1.3499999999999999e161 < (*.f64 x y) Initial program 88.5%
+-commutative88.5%
fma-define90.0%
+-commutative90.0%
fma-define91.4%
fma-define94.2%
Simplified94.2%
Taylor expanded in a around 0 81.6%
Taylor expanded in t around 0 77.3%
Taylor expanded in c around 0 73.4%
if -9.59999999999999933e113 < (*.f64 x y) < 1.3499999999999999e161Initial program 98.4%
+-commutative98.4%
fma-define98.9%
+-commutative98.9%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in x around 0 93.5%
Taylor expanded in c around inf 62.0%
Final simplification65.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -4.5e+183) (not (<= (* c i) 3.6e+194))) (* c i) (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -4.5e+183) || !((c * i) <= 3.6e+194)) {
tmp = c * i;
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-4.5d+183)) .or. (.not. ((c * i) <= 3.6d+194))) then
tmp = c * i
else
tmp = z * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -4.5e+183) || !((c * i) <= 3.6e+194)) {
tmp = c * i;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -4.5e+183) or not ((c * i) <= 3.6e+194): tmp = c * i else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -4.5e+183) || !(Float64(c * i) <= 3.6e+194)) tmp = Float64(c * i); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -4.5e+183) || ~(((c * i) <= 3.6e+194))) tmp = c * i; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -4.5e+183], N[Not[LessEqual[N[(c * i), $MachinePrecision], 3.6e+194]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4.5 \cdot 10^{+183} \lor \neg \left(c \cdot i \leq 3.6 \cdot 10^{+194}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -4.50000000000000017e183 or 3.6e194 < (*.f64 c i) Initial program 91.8%
+-commutative91.8%
fma-define95.1%
+-commutative95.1%
fma-define95.1%
fma-define95.1%
Simplified95.1%
Taylor expanded in c around inf 78.1%
if -4.50000000000000017e183 < (*.f64 c i) < 3.6e194Initial program 96.9%
+-commutative96.9%
fma-define96.9%
+-commutative96.9%
fma-define97.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in x around 0 71.5%
Taylor expanded in c around 0 63.8%
Taylor expanded in a around 0 37.0%
Final simplification46.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -9.5e+23) (not (<= (* c i) 5.8e-19))) (* 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) <= -9.5e+23) || !((c * i) <= 5.8e-19)) {
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) <= (-9.5d+23)) .or. (.not. ((c * i) <= 5.8d-19))) 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) <= -9.5e+23) || !((c * i) <= 5.8e-19)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -9.5e+23) or not ((c * i) <= 5.8e-19): 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) <= -9.5e+23) || !(Float64(c * i) <= 5.8e-19)) 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) <= -9.5e+23) || ~(((c * i) <= 5.8e-19))) 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], -9.5e+23], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5.8e-19]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -9.5 \cdot 10^{+23} \lor \neg \left(c \cdot i \leq 5.8 \cdot 10^{-19}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -9.50000000000000038e23 or 5.8e-19 < (*.f64 c i) Initial program 94.1%
+-commutative94.1%
fma-define95.8%
+-commutative95.8%
fma-define95.8%
fma-define96.6%
Simplified96.6%
Taylor expanded in c around inf 52.6%
if -9.50000000000000038e23 < (*.f64 c i) < 5.8e-19Initial program 97.1%
+-commutative97.1%
fma-define97.1%
+-commutative97.1%
fma-define97.8%
fma-define98.5%
Simplified98.5%
Taylor expanded in a around inf 37.5%
Final simplification44.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 95.7%
+-commutative95.7%
fma-define96.5%
+-commutative96.5%
fma-define96.9%
fma-define97.6%
Simplified97.6%
Taylor expanded in a around inf 27.0%
herbie shell --seed 2024146
(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)))