
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 96.5%
+-commutative96.5%
fma-define97.7%
+-commutative97.7%
fma-define98.4%
fma-define98.8%
Simplified98.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* a b))))
(if (<= (* c i) -8.6e+97)
(+ (* a b) (* c i))
(if (<= (* c i) -2.85e-117)
t_1
(if (<= (* c i) -5e-322)
(+ (* x y) (* a b))
(if (<= (* c i) 550.0)
t_1
(if (<= (* c i) 1.2e+121)
(+ (* z t) (* x y))
(+ (* z t) (* c i)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (a * b);
double tmp;
if ((c * i) <= -8.6e+97) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= -2.85e-117) {
tmp = t_1;
} else if ((c * i) <= -5e-322) {
tmp = (x * y) + (a * b);
} else if ((c * i) <= 550.0) {
tmp = t_1;
} else if ((c * i) <= 1.2e+121) {
tmp = (z * t) + (x * y);
} else {
tmp = (z * t) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (z * t) + (a * b)
if ((c * i) <= (-8.6d+97)) then
tmp = (a * b) + (c * i)
else if ((c * i) <= (-2.85d-117)) then
tmp = t_1
else if ((c * i) <= (-5d-322)) then
tmp = (x * y) + (a * b)
else if ((c * i) <= 550.0d0) then
tmp = t_1
else if ((c * i) <= 1.2d+121) then
tmp = (z * t) + (x * y)
else
tmp = (z * t) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (a * b);
double tmp;
if ((c * i) <= -8.6e+97) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= -2.85e-117) {
tmp = t_1;
} else if ((c * i) <= -5e-322) {
tmp = (x * y) + (a * b);
} else if ((c * i) <= 550.0) {
tmp = t_1;
} else if ((c * i) <= 1.2e+121) {
tmp = (z * t) + (x * y);
} else {
tmp = (z * t) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (a * b) tmp = 0 if (c * i) <= -8.6e+97: tmp = (a * b) + (c * i) elif (c * i) <= -2.85e-117: tmp = t_1 elif (c * i) <= -5e-322: tmp = (x * y) + (a * b) elif (c * i) <= 550.0: tmp = t_1 elif (c * i) <= 1.2e+121: tmp = (z * t) + (x * y) else: tmp = (z * t) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(a * b)) tmp = 0.0 if (Float64(c * i) <= -8.6e+97) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(c * i) <= -2.85e-117) tmp = t_1; elseif (Float64(c * i) <= -5e-322) tmp = Float64(Float64(x * y) + Float64(a * b)); elseif (Float64(c * i) <= 550.0) tmp = t_1; elseif (Float64(c * i) <= 1.2e+121) tmp = Float64(Float64(z * t) + Float64(x * y)); else tmp = Float64(Float64(z * t) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (a * b); tmp = 0.0; if ((c * i) <= -8.6e+97) tmp = (a * b) + (c * i); elseif ((c * i) <= -2.85e-117) tmp = t_1; elseif ((c * i) <= -5e-322) tmp = (x * y) + (a * b); elseif ((c * i) <= 550.0) tmp = t_1; elseif ((c * i) <= 1.2e+121) tmp = (z * t) + (x * y); else tmp = (z * t) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -8.6e+97], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.85e-117], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -5e-322], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 550.0], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.2e+121], N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + a \cdot b\\
\mathbf{if}\;c \cdot i \leq -8.6 \cdot 10^{+97}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -2.85 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-322}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 550:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 1.2 \cdot 10^{+121}:\\
\;\;\;\;z \cdot t + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot t + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -8.5999999999999996e97Initial program 92.5%
+-commutative92.5%
fma-define95.0%
+-commutative95.0%
fma-define97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in x around 0 81.9%
Taylor expanded in c around inf 73.5%
if -8.5999999999999996e97 < (*.f64 c i) < -2.85e-117 or -4.99006e-322 < (*.f64 c i) < 550Initial program 99.1%
+-commutative99.1%
fma-define99.1%
+-commutative99.1%
fma-define99.1%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 77.4%
Taylor expanded in c around 0 74.6%
*-commutative74.6%
Simplified74.6%
if -2.85e-117 < (*.f64 c i) < -4.99006e-322Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 100.0%
Taylor expanded in t around 0 90.0%
if 550 < (*.f64 c i) < 1.2e121Initial program 92.3%
+-commutative92.3%
fma-define92.3%
+-commutative92.3%
fma-define96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in c around 0 88.5%
Taylor expanded in a around 0 84.9%
if 1.2e121 < (*.f64 c i) Initial program 93.5%
+-commutative93.5%
fma-define97.8%
+-commutative97.8%
fma-define97.8%
fma-define97.8%
Simplified97.8%
Taylor expanded in x around 0 87.2%
Taylor expanded in a around 0 78.6%
Final simplification77.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* a b))) (t_2 (+ (* x y) (* a b))))
(if (<= (* c i) -2.45e+97)
(+ (* a b) (* c i))
(if (<= (* c i) -5e-114)
t_1
(if (<= (* c i) -5e-322)
t_2
(if (<= (* c i) 1.82e-72)
t_1
(if (<= (* c i) 9.5e+35) t_2 (+ (* z t) (* c i)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (a * b);
double t_2 = (x * y) + (a * b);
double tmp;
if ((c * i) <= -2.45e+97) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= -5e-114) {
tmp = t_1;
} else if ((c * i) <= -5e-322) {
tmp = t_2;
} else if ((c * i) <= 1.82e-72) {
tmp = t_1;
} else if ((c * i) <= 9.5e+35) {
tmp = t_2;
} else {
tmp = (z * t) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * t) + (a * b)
t_2 = (x * y) + (a * b)
if ((c * i) <= (-2.45d+97)) then
tmp = (a * b) + (c * i)
else if ((c * i) <= (-5d-114)) then
tmp = t_1
else if ((c * i) <= (-5d-322)) then
tmp = t_2
else if ((c * i) <= 1.82d-72) then
tmp = t_1
else if ((c * i) <= 9.5d+35) then
tmp = t_2
else
tmp = (z * t) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (a * b);
double t_2 = (x * y) + (a * b);
double tmp;
if ((c * i) <= -2.45e+97) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= -5e-114) {
tmp = t_1;
} else if ((c * i) <= -5e-322) {
tmp = t_2;
} else if ((c * i) <= 1.82e-72) {
tmp = t_1;
} else if ((c * i) <= 9.5e+35) {
tmp = t_2;
} else {
tmp = (z * t) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (a * b) t_2 = (x * y) + (a * b) tmp = 0 if (c * i) <= -2.45e+97: tmp = (a * b) + (c * i) elif (c * i) <= -5e-114: tmp = t_1 elif (c * i) <= -5e-322: tmp = t_2 elif (c * i) <= 1.82e-72: tmp = t_1 elif (c * i) <= 9.5e+35: tmp = t_2 else: tmp = (z * t) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(a * b)) t_2 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(c * i) <= -2.45e+97) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(c * i) <= -5e-114) tmp = t_1; elseif (Float64(c * i) <= -5e-322) tmp = t_2; elseif (Float64(c * i) <= 1.82e-72) tmp = t_1; elseif (Float64(c * i) <= 9.5e+35) tmp = t_2; else tmp = Float64(Float64(z * t) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (a * b); t_2 = (x * y) + (a * b); tmp = 0.0; if ((c * i) <= -2.45e+97) tmp = (a * b) + (c * i); elseif ((c * i) <= -5e-114) tmp = t_1; elseif ((c * i) <= -5e-322) tmp = t_2; elseif ((c * i) <= 1.82e-72) tmp = t_1; elseif ((c * i) <= 9.5e+35) tmp = t_2; else tmp = (z * t) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2.45e+97], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5e-114], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -5e-322], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 1.82e-72], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 9.5e+35], t$95$2, N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + a \cdot b\\
t_2 := x \cdot y + a \cdot b\\
\mathbf{if}\;c \cdot i \leq -2.45 \cdot 10^{+97}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-322}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq 1.82 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 9.5 \cdot 10^{+35}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;z \cdot t + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.44999999999999982e97Initial program 92.5%
+-commutative92.5%
fma-define95.0%
+-commutative95.0%
fma-define97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in x around 0 81.9%
Taylor expanded in c around inf 73.5%
if -2.44999999999999982e97 < (*.f64 c i) < -4.99999999999999989e-114 or -4.99006e-322 < (*.f64 c i) < 1.8200000000000001e-72Initial program 99.1%
+-commutative99.1%
fma-define99.1%
+-commutative99.1%
fma-define99.1%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 77.9%
Taylor expanded in c around 0 75.8%
*-commutative75.8%
Simplified75.8%
if -4.99999999999999989e-114 < (*.f64 c i) < -4.99006e-322 or 1.8200000000000001e-72 < (*.f64 c i) < 9.50000000000000062e35Initial program 97.7%
+-commutative97.7%
fma-define97.7%
+-commutative97.7%
fma-define97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in c around 0 95.6%
Taylor expanded in t around 0 87.2%
if 9.50000000000000062e35 < (*.f64 c i) Initial program 93.5%
+-commutative93.5%
fma-define96.8%
+-commutative96.8%
fma-define98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in x around 0 84.0%
Taylor expanded in a around 0 75.9%
Final simplification77.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y))))))
(if (<= t_1 INFINITY)
t_1
(* z (+ t (+ (* a (/ b z)) (+ (/ (* x y) z) (* c (/ i 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) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (t + ((a * (b / z)) + (((x * y) / z) + (c * (i / 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) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (t + ((a * (b / z)) + (((x * y) / z) + (c * (i / z)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((z * t) + (x * y))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (t + ((a * (b / z)) + (((x * y) / z) + (c * (i / 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(z * t) + Float64(x * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(t + Float64(Float64(a * Float64(b / z)) + Float64(Float64(Float64(x * y) / z) + Float64(c * Float64(i / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((z * t) + (x * y))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (t + ((a * (b / z)) + (((x * y) / z) + (c * (i / 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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(t + N[(N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision] + N[(c * N[(i / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \left(a \cdot \frac{b}{z} + \left(\frac{x \cdot y}{z} + c \cdot \frac{i}{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
+-commutative0.0%
fma-define33.3%
+-commutative33.3%
fma-define55.6%
fma-define66.7%
Simplified66.7%
Taylor expanded in z around inf 11.1%
associate-/l*11.1%
+-commutative11.1%
associate-/l*44.4%
Simplified44.4%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* z t) (* x y))) (t_2 (+ (* c i) (+ (* a b) t_1)))) (if (<= t_2 INFINITY) t_2 t_1)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (x * y);
double t_2 = (c * i) + ((a * b) + t_1);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = t_1;
}
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 = (z * t) + (x * y);
double t_2 = (c * i) + ((a * b) + t_1);
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (x * y) t_2 = (c * i) + ((a * b) + t_1) tmp = 0 if t_2 <= math.inf: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(x * y)) t_2 = Float64(Float64(c * i) + Float64(Float64(a * b) + t_1)) tmp = 0.0 if (t_2 <= Inf) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (x * y); t_2 = (c * i) + ((a * b) + t_1); tmp = 0.0; if (t_2 <= Inf) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], t$95$2, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + x \cdot y\\
t_2 := c \cdot i + \left(a \cdot b + t\_1\right)\\
\mathbf{if}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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-define33.3%
+-commutative33.3%
fma-define55.6%
fma-define66.7%
Simplified66.7%
Taylor expanded in c around 0 33.3%
Taylor expanded in a around 0 45.4%
Final simplification98.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* a b))))
(if (<= (* z t) -9e+201)
t_1
(if (<= (* z t) -1.65e-78)
(+ (* a b) (* c i))
(if (<= (* z t) 1.6e+130) (+ (* x y) (* a b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (a * b);
double tmp;
if ((z * t) <= -9e+201) {
tmp = t_1;
} else if ((z * t) <= -1.65e-78) {
tmp = (a * b) + (c * i);
} else if ((z * t) <= 1.6e+130) {
tmp = (x * y) + (a * b);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (z * t) + (a * b)
if ((z * t) <= (-9d+201)) then
tmp = t_1
else if ((z * t) <= (-1.65d-78)) then
tmp = (a * b) + (c * i)
else if ((z * t) <= 1.6d+130) then
tmp = (x * y) + (a * b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (a * b);
double tmp;
if ((z * t) <= -9e+201) {
tmp = t_1;
} else if ((z * t) <= -1.65e-78) {
tmp = (a * b) + (c * i);
} else if ((z * t) <= 1.6e+130) {
tmp = (x * y) + (a * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (a * b) tmp = 0 if (z * t) <= -9e+201: tmp = t_1 elif (z * t) <= -1.65e-78: tmp = (a * b) + (c * i) elif (z * t) <= 1.6e+130: tmp = (x * y) + (a * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(a * b)) tmp = 0.0 if (Float64(z * t) <= -9e+201) tmp = t_1; elseif (Float64(z * t) <= -1.65e-78) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(z * t) <= 1.6e+130) tmp = Float64(Float64(x * y) + Float64(a * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (a * b); tmp = 0.0; if ((z * t) <= -9e+201) tmp = t_1; elseif ((z * t) <= -1.65e-78) tmp = (a * b) + (c * i); elseif ((z * t) <= 1.6e+130) tmp = (x * y) + (a * b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -9e+201], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], -1.65e-78], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1.6e+130], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + a \cdot b\\
\mathbf{if}\;z \cdot t \leq -9 \cdot 10^{+201}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq -1.65 \cdot 10^{-78}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;z \cdot t \leq 1.6 \cdot 10^{+130}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -9.0000000000000002e201 or 1.6e130 < (*.f64 z t) Initial program 91.4%
+-commutative91.4%
fma-define94.3%
+-commutative94.3%
fma-define95.7%
fma-define97.1%
Simplified97.1%
Taylor expanded in x around 0 86.6%
Taylor expanded in c around 0 85.4%
*-commutative85.4%
Simplified85.4%
if -9.0000000000000002e201 < (*.f64 z t) < -1.64999999999999991e-78Initial program 98.0%
+-commutative98.0%
fma-define98.0%
+-commutative98.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 79.5%
Taylor expanded in c around inf 65.3%
if -1.64999999999999991e-78 < (*.f64 z t) < 1.6e130Initial program 98.5%
+-commutative98.5%
fma-define99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in c around 0 73.6%
Taylor expanded in t around 0 69.6%
Final simplification73.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* z t) -1e+206)
(* z t)
(if (<= (* z t) -9.5e-79)
(+ (* a b) (* c i))
(if (<= (* z t) 1.15e+151) (+ (* x y) (* 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 ((z * t) <= -1e+206) {
tmp = z * t;
} else if ((z * t) <= -9.5e-79) {
tmp = (a * b) + (c * i);
} else if ((z * t) <= 1.15e+151) {
tmp = (x * y) + (a * b);
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((z * t) <= (-1d+206)) then
tmp = z * t
else if ((z * t) <= (-9.5d-79)) then
tmp = (a * b) + (c * i)
else if ((z * t) <= 1.15d+151) then
tmp = (x * y) + (a * b)
else
tmp = z * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -1e+206) {
tmp = z * t;
} else if ((z * t) <= -9.5e-79) {
tmp = (a * b) + (c * i);
} else if ((z * t) <= 1.15e+151) {
tmp = (x * y) + (a * b);
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z * t) <= -1e+206: tmp = z * t elif (z * t) <= -9.5e-79: tmp = (a * b) + (c * i) elif (z * t) <= 1.15e+151: tmp = (x * y) + (a * b) else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(z * t) <= -1e+206) tmp = Float64(z * t); elseif (Float64(z * t) <= -9.5e-79) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(z * t) <= 1.15e+151) tmp = Float64(Float64(x * y) + Float64(a * b)); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z * t) <= -1e+206) tmp = z * t; elseif ((z * t) <= -9.5e-79) tmp = (a * b) + (c * i); elseif ((z * t) <= 1.15e+151) tmp = (x * y) + (a * b); else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e+206], N[(z * t), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], -9.5e-79], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1.15e+151], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(z * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+206}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;z \cdot t \leq -9.5 \cdot 10^{-79}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;z \cdot t \leq 1.15 \cdot 10^{+151}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 z t) < -1e206 or 1.15e151 < (*.f64 z t) Initial program 91.9%
+-commutative91.9%
fma-define95.2%
+-commutative95.2%
fma-define96.8%
fma-define98.4%
Simplified98.4%
Taylor expanded in x around 0 88.1%
Taylor expanded in a around 0 81.9%
Taylor expanded in c around 0 83.7%
*-commutative88.3%
Simplified83.7%
if -1e206 < (*.f64 z t) < -9.4999999999999997e-79Initial program 98.0%
+-commutative98.0%
fma-define98.0%
+-commutative98.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 79.5%
Taylor expanded in c around inf 65.3%
if -9.4999999999999997e-79 < (*.f64 z t) < 1.15e151Initial program 97.9%
+-commutative97.9%
fma-define98.6%
+-commutative98.6%
fma-define98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in c around 0 73.7%
Taylor expanded in t around 0 68.5%
Final simplification71.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -4.4e+103) (not (<= (* c i) 5.8e+117))) (+ (* a b) (+ (* z t) (* c i))) (+ (* a b) (+ (* 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 (((c * i) <= -4.4e+103) || !((c * i) <= 5.8e+117)) {
tmp = (a * b) + ((z * t) + (c * i));
} else {
tmp = (a * b) + ((z * t) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-4.4d+103)) .or. (.not. ((c * i) <= 5.8d+117))) then
tmp = (a * b) + ((z * t) + (c * i))
else
tmp = (a * b) + ((z * t) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -4.4e+103) || !((c * i) <= 5.8e+117)) {
tmp = (a * b) + ((z * t) + (c * i));
} else {
tmp = (a * b) + ((z * t) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -4.4e+103) or not ((c * i) <= 5.8e+117): tmp = (a * b) + ((z * t) + (c * i)) else: tmp = (a * b) + ((z * t) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -4.4e+103) || !(Float64(c * i) <= 5.8e+117)) tmp = Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(c * i))); else tmp = Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -4.4e+103) || ~(((c * i) <= 5.8e+117))) tmp = (a * b) + ((z * t) + (c * i)); else tmp = (a * b) + ((z * t) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -4.4e+103], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5.8e+117]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4.4 \cdot 10^{+103} \lor \neg \left(c \cdot i \leq 5.8 \cdot 10^{+117}\right):\\
\;\;\;\;a \cdot b + \left(z \cdot t + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(z \cdot t + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -4.39999999999999985e103 or 5.80000000000000055e117 < (*.f64 c i) Initial program 92.0%
+-commutative92.0%
fma-define95.4%
+-commutative95.4%
fma-define97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in x around 0 84.9%
if -4.39999999999999985e103 < (*.f64 c i) < 5.80000000000000055e117Initial program 98.8%
+-commutative98.8%
fma-define98.8%
+-commutative98.8%
fma-define98.8%
fma-define99.4%
Simplified99.4%
Taylor expanded in c around 0 95.0%
Final simplification91.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* x y))))
(if (<= (* c i) -4.5e+104)
(+ (* a b) (+ (* z t) (* c i)))
(if (<= (* c i) 1.25e+58) (+ (* 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 = (z * t) + (x * y);
double tmp;
if ((c * i) <= -4.5e+104) {
tmp = (a * b) + ((z * t) + (c * i));
} else if ((c * i) <= 1.25e+58) {
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 = (z * t) + (x * y)
if ((c * i) <= (-4.5d+104)) then
tmp = (a * b) + ((z * t) + (c * i))
else if ((c * i) <= 1.25d+58) 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 = (z * t) + (x * y);
double tmp;
if ((c * i) <= -4.5e+104) {
tmp = (a * b) + ((z * t) + (c * i));
} else if ((c * i) <= 1.25e+58) {
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 = (z * t) + (x * y) tmp = 0 if (c * i) <= -4.5e+104: tmp = (a * b) + ((z * t) + (c * i)) elif (c * i) <= 1.25e+58: 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(z * t) + Float64(x * y)) tmp = 0.0 if (Float64(c * i) <= -4.5e+104) tmp = Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(c * i))); elseif (Float64(c * i) <= 1.25e+58) 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 = (z * t) + (x * y); tmp = 0.0; if ((c * i) <= -4.5e+104) tmp = (a * b) + ((z * t) + (c * i)); elseif ((c * i) <= 1.25e+58) 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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -4.5e+104], N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.25e+58], 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 := z \cdot t + x \cdot y\\
\mathbf{if}\;c \cdot i \leq -4.5 \cdot 10^{+104}:\\
\;\;\;\;a \cdot b + \left(z \cdot t + c \cdot i\right)\\
\mathbf{elif}\;c \cdot i \leq 1.25 \cdot 10^{+58}:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -4.4999999999999998e104Initial program 92.1%
+-commutative92.1%
fma-define94.7%
+-commutative94.7%
fma-define97.4%
fma-define97.4%
Simplified97.4%
Taylor expanded in x around 0 83.5%
if -4.4999999999999998e104 < (*.f64 c i) < 1.24999999999999996e58Initial program 98.8%
+-commutative98.8%
fma-define98.8%
+-commutative98.8%
fma-define98.8%
fma-define99.4%
Simplified99.4%
Taylor expanded in c around 0 95.3%
if 1.24999999999999996e58 < (*.f64 c i) Initial program 93.1%
+-commutative93.1%
fma-define96.6%
+-commutative96.6%
fma-define98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in a around 0 89.6%
Final simplification92.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5.6e+152)
(+ (* x y) (* c i))
(if (<= (* x y) 6.6e+215)
(+ (* a b) (+ (* z t) (* c i)))
(+ (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5.6e+152) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= 6.6e+215) {
tmp = (a * b) + ((z * t) + (c * i));
} else {
tmp = (z * t) + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-5.6d+152)) then
tmp = (x * y) + (c * i)
else if ((x * y) <= 6.6d+215) then
tmp = (a * b) + ((z * t) + (c * i))
else
tmp = (z * t) + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5.6e+152) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= 6.6e+215) {
tmp = (a * b) + ((z * t) + (c * i));
} else {
tmp = (z * t) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -5.6e+152: tmp = (x * y) + (c * i) elif (x * y) <= 6.6e+215: tmp = (a * b) + ((z * t) + (c * i)) else: tmp = (z * t) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5.6e+152) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(x * y) <= 6.6e+215) tmp = Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(c * i))); else tmp = Float64(Float64(z * t) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -5.6e+152) tmp = (x * y) + (c * i); elseif ((x * y) <= 6.6e+215) tmp = (a * b) + ((z * t) + (c * i)); else tmp = (z * t) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5.6e+152], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.6e+215], N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.6 \cdot 10^{+152}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{+215}:\\
\;\;\;\;a \cdot b + \left(z \cdot t + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot t + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -5.6000000000000004e152Initial program 92.1%
+-commutative92.1%
fma-define92.1%
+-commutative92.1%
fma-define92.1%
fma-define94.7%
Simplified94.7%
Taylor expanded in a around 0 87.6%
Taylor expanded in t around 0 77.6%
if -5.6000000000000004e152 < (*.f64 x y) < 6.5999999999999997e215Initial program 98.4%
+-commutative98.4%
fma-define99.5%
+-commutative99.5%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 87.8%
if 6.5999999999999997e215 < (*.f64 x y) Initial program 88.5%
+-commutative88.5%
fma-define92.3%
+-commutative92.3%
fma-define96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in c around 0 85.2%
Taylor expanded in a around 0 89.0%
Final simplification86.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* z t) -9.2e+201)
(* z t)
(if (<= (* z t) -7.5e-278)
(* c i)
(if (<= (* z t) 1.08e+136) (* 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 ((z * t) <= -9.2e+201) {
tmp = z * t;
} else if ((z * t) <= -7.5e-278) {
tmp = c * i;
} else if ((z * t) <= 1.08e+136) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((z * t) <= (-9.2d+201)) then
tmp = z * t
else if ((z * t) <= (-7.5d-278)) then
tmp = c * i
else if ((z * t) <= 1.08d+136) then
tmp = a * b
else
tmp = z * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -9.2e+201) {
tmp = z * t;
} else if ((z * t) <= -7.5e-278) {
tmp = c * i;
} else if ((z * t) <= 1.08e+136) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z * t) <= -9.2e+201: tmp = z * t elif (z * t) <= -7.5e-278: tmp = c * i elif (z * t) <= 1.08e+136: tmp = a * b else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(z * t) <= -9.2e+201) tmp = Float64(z * t); elseif (Float64(z * t) <= -7.5e-278) tmp = Float64(c * i); elseif (Float64(z * t) <= 1.08e+136) tmp = Float64(a * b); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z * t) <= -9.2e+201) tmp = z * t; elseif ((z * t) <= -7.5e-278) tmp = c * i; elseif ((z * t) <= 1.08e+136) tmp = a * b; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -9.2e+201], N[(z * t), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], -7.5e-278], N[(c * i), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1.08e+136], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -9.2 \cdot 10^{+201}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;z \cdot t \leq -7.5 \cdot 10^{-278}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;z \cdot t \leq 1.08 \cdot 10^{+136}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 z t) < -9.2000000000000004e201 or 1.07999999999999994e136 < (*.f64 z t) Initial program 92.6%
+-commutative92.6%
fma-define95.6%
+-commutative95.6%
fma-define97.1%
fma-define98.5%
Simplified98.5%
Taylor expanded in x around 0 86.2%
Taylor expanded in a around 0 79.1%
Taylor expanded in c around 0 79.3%
*-commutative85.0%
Simplified79.3%
if -9.2000000000000004e201 < (*.f64 z t) < -7.49999999999999946e-278Initial program 97.6%
+-commutative97.6%
fma-define97.6%
+-commutative97.6%
fma-define98.8%
fma-define98.8%
Simplified98.8%
Taylor expanded in c around inf 40.8%
if -7.49999999999999946e-278 < (*.f64 z t) < 1.07999999999999994e136Initial program 98.1%
+-commutative98.1%
fma-define99.0%
+-commutative99.0%
fma-define99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in a around inf 41.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -6.8e+97) (* c i) (if (<= (* c i) 0.27) (* a b) (if (<= (* c i) 8.2e+127) (* 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 ((c * i) <= -6.8e+97) {
tmp = c * i;
} else if ((c * i) <= 0.27) {
tmp = a * b;
} else if ((c * i) <= 8.2e+127) {
tmp = x * y;
} 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) <= (-6.8d+97)) then
tmp = c * i
else if ((c * i) <= 0.27d0) then
tmp = a * b
else if ((c * i) <= 8.2d+127) then
tmp = x * y
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) <= -6.8e+97) {
tmp = c * i;
} else if ((c * i) <= 0.27) {
tmp = a * b;
} else if ((c * i) <= 8.2e+127) {
tmp = x * y;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -6.8e+97: tmp = c * i elif (c * i) <= 0.27: tmp = a * b elif (c * i) <= 8.2e+127: tmp = x * y else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -6.8e+97) tmp = Float64(c * i); elseif (Float64(c * i) <= 0.27) tmp = Float64(a * b); elseif (Float64(c * i) <= 8.2e+127) tmp = Float64(x * y); 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) <= -6.8e+97) tmp = c * i; elseif ((c * i) <= 0.27) tmp = a * b; elseif ((c * i) <= 8.2e+127) tmp = x * y; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -6.8e+97], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 0.27], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 8.2e+127], N[(x * y), $MachinePrecision], N[(c * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6.8 \cdot 10^{+97}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 0.27:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 8.2 \cdot 10^{+127}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -6.8000000000000002e97 or 8.19999999999999965e127 < (*.f64 c i) Initial program 93.0%
+-commutative93.0%
fma-define96.5%
+-commutative96.5%
fma-define97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in c around inf 65.3%
if -6.8000000000000002e97 < (*.f64 c i) < 0.27000000000000002Initial program 99.3%
+-commutative99.3%
fma-define99.3%
+-commutative99.3%
fma-define99.3%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around inf 40.7%
if 0.27000000000000002 < (*.f64 c i) < 8.19999999999999965e127Initial program 92.3%
+-commutative92.3%
fma-define92.3%
+-commutative92.3%
fma-define96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in c around 0 88.5%
Taylor expanded in t around 0 55.2%
Taylor expanded in a around 0 43.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -3.3e+202) (not (<= (* z t) 9.5e+150))) (* z t) (+ (* a b) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -3.3e+202) || !((z * t) <= 9.5e+150)) {
tmp = z * t;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((z * t) <= (-3.3d+202)) .or. (.not. ((z * t) <= 9.5d+150))) then
tmp = z * t
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((z * t) <= -3.3e+202) || !((z * t) <= 9.5e+150)) {
tmp = z * t;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((z * t) <= -3.3e+202) or not ((z * t) <= 9.5e+150): tmp = z * t else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(z * t) <= -3.3e+202) || !(Float64(z * t) <= 9.5e+150)) tmp = Float64(z * t); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((z * t) <= -3.3e+202) || ~(((z * t) <= 9.5e+150))) tmp = z * t; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -3.3e+202], N[Not[LessEqual[N[(z * t), $MachinePrecision], 9.5e+150]], $MachinePrecision]], N[(z * t), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -3.3 \cdot 10^{+202} \lor \neg \left(z \cdot t \leq 9.5 \cdot 10^{+150}\right):\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 z t) < -3.2999999999999999e202 or 9.5000000000000001e150 < (*.f64 z t) Initial program 91.9%
+-commutative91.9%
fma-define95.2%
+-commutative95.2%
fma-define96.8%
fma-define98.4%
Simplified98.4%
Taylor expanded in x around 0 88.1%
Taylor expanded in a around 0 81.9%
Taylor expanded in c around 0 83.7%
*-commutative88.3%
Simplified83.7%
if -3.2999999999999999e202 < (*.f64 z t) < 9.5000000000000001e150Initial program 97.9%
+-commutative97.9%
fma-define98.5%
+-commutative98.5%
fma-define99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in x around 0 70.4%
Taylor expanded in c around inf 62.9%
Final simplification67.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -6.4e+97) (not (<= (* c i) 1.55e+58))) (* 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) <= -6.4e+97) || !((c * i) <= 1.55e+58)) {
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) <= (-6.4d+97)) .or. (.not. ((c * i) <= 1.55d+58))) 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) <= -6.4e+97) || !((c * i) <= 1.55e+58)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -6.4e+97) or not ((c * i) <= 1.55e+58): 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) <= -6.4e+97) || !(Float64(c * i) <= 1.55e+58)) 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) <= -6.4e+97) || ~(((c * i) <= 1.55e+58))) 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], -6.4e+97], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.55e+58]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6.4 \cdot 10^{+97} \lor \neg \left(c \cdot i \leq 1.55 \cdot 10^{+58}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -6.40000000000000032e97 or 1.55e58 < (*.f64 c i) Initial program 92.9%
+-commutative92.9%
fma-define95.9%
+-commutative95.9%
fma-define98.0%
fma-define98.0%
Simplified98.0%
Taylor expanded in c around inf 58.7%
if -6.40000000000000032e97 < (*.f64 c i) < 1.55e58Initial program 98.7%
+-commutative98.7%
fma-define98.7%
+-commutative98.7%
fma-define98.7%
fma-define99.4%
Simplified99.4%
Taylor expanded in a around inf 39.2%
Final simplification46.7%
(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.7%
+-commutative97.7%
fma-define98.4%
fma-define98.8%
Simplified98.8%
Taylor expanded in a around inf 29.5%
herbie shell --seed 2024137
(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)))