
(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
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (+ (* a b) t_1) INFINITY)
(fma c i (+ (* z t) (+ (* a b) (* x y))))
(+ t_1 (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((a * b) + t_1) <= ((double) INFINITY)) {
tmp = fma(c, i, ((z * t) + ((a * b) + (x * y))));
} else {
tmp = t_1 + (c * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(Float64(a * b) + t_1) <= Inf) tmp = fma(c, i, Float64(Float64(z * t) + Float64(Float64(a * b) + Float64(x * y)))); else tmp = Float64(t_1 + Float64(c * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], Infinity], N[(c * i + N[(N[(z * t), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b + t_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t + \left(a \cdot b + x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + c \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 97.6%
+-commutative97.6%
fma-def99.6%
associate-+l+99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
fma-udef99.6%
fma-udef99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
Applied egg-rr99.6%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
Taylor expanded in a around 0 55.6%
Final simplification98.0%
(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 94.1%
+-commutative94.1%
fma-def96.1%
associate-+l+96.1%
fma-def97.3%
fma-def97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (fma c i (* z t)))))
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) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(c, i, (z * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(c, i, Float64(z * t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot 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%
+-commutative0.0%
fma-def33.3%
associate-+l+33.3%
fma-def53.3%
fma-def60.0%
Simplified60.0%
fma-udef40.0%
fma-udef33.3%
associate-+l+33.3%
+-commutative33.3%
associate-+r+33.3%
Applied egg-rr33.3%
Taylor expanded in z around inf 47.3%
Final simplification96.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* c i)))
(t_2 (+ (* a b) (* x y)))
(t_3 (+ (* x y) (* c i))))
(if (<= (* a b) -2.6e+141)
t_2
(if (<= (* a b) -1.85e-125)
t_1
(if (<= (* a b) -2e-316)
t_3
(if (<= (* a b) 5.8e-218)
t_1
(if (<= (* a b) 1.4e-105)
t_3
(if (<= (* a b) 2.4e-73)
t_1
(if (<= (* a b) 7.2e+87) t_3 t_2)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (c * i);
double t_2 = (a * b) + (x * y);
double t_3 = (x * y) + (c * i);
double tmp;
if ((a * b) <= -2.6e+141) {
tmp = t_2;
} else if ((a * b) <= -1.85e-125) {
tmp = t_1;
} else if ((a * b) <= -2e-316) {
tmp = t_3;
} else if ((a * b) <= 5.8e-218) {
tmp = t_1;
} else if ((a * b) <= 1.4e-105) {
tmp = t_3;
} else if ((a * b) <= 2.4e-73) {
tmp = t_1;
} else if ((a * b) <= 7.2e+87) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (z * t) + (c * i)
t_2 = (a * b) + (x * y)
t_3 = (x * y) + (c * i)
if ((a * b) <= (-2.6d+141)) then
tmp = t_2
else if ((a * b) <= (-1.85d-125)) then
tmp = t_1
else if ((a * b) <= (-2d-316)) then
tmp = t_3
else if ((a * b) <= 5.8d-218) then
tmp = t_1
else if ((a * b) <= 1.4d-105) then
tmp = t_3
else if ((a * b) <= 2.4d-73) then
tmp = t_1
else if ((a * b) <= 7.2d+87) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (c * i);
double t_2 = (a * b) + (x * y);
double t_3 = (x * y) + (c * i);
double tmp;
if ((a * b) <= -2.6e+141) {
tmp = t_2;
} else if ((a * b) <= -1.85e-125) {
tmp = t_1;
} else if ((a * b) <= -2e-316) {
tmp = t_3;
} else if ((a * b) <= 5.8e-218) {
tmp = t_1;
} else if ((a * b) <= 1.4e-105) {
tmp = t_3;
} else if ((a * b) <= 2.4e-73) {
tmp = t_1;
} else if ((a * b) <= 7.2e+87) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (c * i) t_2 = (a * b) + (x * y) t_3 = (x * y) + (c * i) tmp = 0 if (a * b) <= -2.6e+141: tmp = t_2 elif (a * b) <= -1.85e-125: tmp = t_1 elif (a * b) <= -2e-316: tmp = t_3 elif (a * b) <= 5.8e-218: tmp = t_1 elif (a * b) <= 1.4e-105: tmp = t_3 elif (a * b) <= 2.4e-73: tmp = t_1 elif (a * b) <= 7.2e+87: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(c * i)) t_2 = Float64(Float64(a * b) + Float64(x * y)) t_3 = Float64(Float64(x * y) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -2.6e+141) tmp = t_2; elseif (Float64(a * b) <= -1.85e-125) tmp = t_1; elseif (Float64(a * b) <= -2e-316) tmp = t_3; elseif (Float64(a * b) <= 5.8e-218) tmp = t_1; elseif (Float64(a * b) <= 1.4e-105) tmp = t_3; elseif (Float64(a * b) <= 2.4e-73) tmp = t_1; elseif (Float64(a * b) <= 7.2e+87) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (c * i); t_2 = (a * b) + (x * y); t_3 = (x * y) + (c * i); tmp = 0.0; if ((a * b) <= -2.6e+141) tmp = t_2; elseif ((a * b) <= -1.85e-125) tmp = t_1; elseif ((a * b) <= -2e-316) tmp = t_3; elseif ((a * b) <= 5.8e-218) tmp = t_1; elseif ((a * b) <= 1.4e-105) tmp = t_3; elseif ((a * b) <= 2.4e-73) tmp = t_1; elseif ((a * b) <= 7.2e+87) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2.6e+141], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1.85e-125], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2e-316], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 5.8e-218], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.4e-105], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 2.4e-73], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 7.2e+87], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + c \cdot i\\
t_2 := a \cdot b + x \cdot y\\
t_3 := x \cdot y + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -2.6 \cdot 10^{+141}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -1.85 \cdot 10^{-125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-316}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 5.8 \cdot 10^{-218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 1.4 \cdot 10^{-105}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 2.4 \cdot 10^{-73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 7.2 \cdot 10^{+87}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2.5999999999999999e141 or 7.19999999999999988e87 < (*.f64 a b) Initial program 87.3%
Taylor expanded in z around 0 75.9%
Taylor expanded in c around 0 75.0%
if -2.5999999999999999e141 < (*.f64 a b) < -1.85e-125 or -2.000000017e-316 < (*.f64 a b) < 5.8000000000000004e-218 or 1.4e-105 < (*.f64 a b) < 2.40000000000000006e-73Initial program 97.6%
Taylor expanded in x around 0 83.8%
Taylor expanded in a around 0 79.4%
if -1.85e-125 < (*.f64 a b) < -2.000000017e-316 or 5.8000000000000004e-218 < (*.f64 a b) < 1.4e-105 or 2.40000000000000006e-73 < (*.f64 a b) < 7.19999999999999988e87Initial program 100.0%
Taylor expanded in a around 0 91.6%
Taylor expanded in t around 0 78.0%
Final simplification77.3%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (* a b))))
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) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around inf 47.2%
Final simplification96.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* z t) (* c i))) (t_2 (+ (* a b) (* x y))))
(if (<= (* a b) -1.15e+144)
t_2
(if (<= (* a b) 3.5e-33)
t_1
(if (<= (* a b) 1.22e+128)
t_2
(if (<= (* a b) 1.65e+143)
t_1
(if (<= (* a b) 3.2e+211) (+ (* a b) (* c i)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (c * i);
double t_2 = (a * b) + (x * y);
double tmp;
if ((a * b) <= -1.15e+144) {
tmp = t_2;
} else if ((a * b) <= 3.5e-33) {
tmp = t_1;
} else if ((a * b) <= 1.22e+128) {
tmp = t_2;
} else if ((a * b) <= 1.65e+143) {
tmp = t_1;
} else if ((a * b) <= 3.2e+211) {
tmp = (a * b) + (c * i);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * t) + (c * i)
t_2 = (a * b) + (x * y)
if ((a * b) <= (-1.15d+144)) then
tmp = t_2
else if ((a * b) <= 3.5d-33) then
tmp = t_1
else if ((a * b) <= 1.22d+128) then
tmp = t_2
else if ((a * b) <= 1.65d+143) then
tmp = t_1
else if ((a * b) <= 3.2d+211) then
tmp = (a * b) + (c * i)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z * t) + (c * i);
double t_2 = (a * b) + (x * y);
double tmp;
if ((a * b) <= -1.15e+144) {
tmp = t_2;
} else if ((a * b) <= 3.5e-33) {
tmp = t_1;
} else if ((a * b) <= 1.22e+128) {
tmp = t_2;
} else if ((a * b) <= 1.65e+143) {
tmp = t_1;
} else if ((a * b) <= 3.2e+211) {
tmp = (a * b) + (c * i);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (z * t) + (c * i) t_2 = (a * b) + (x * y) tmp = 0 if (a * b) <= -1.15e+144: tmp = t_2 elif (a * b) <= 3.5e-33: tmp = t_1 elif (a * b) <= 1.22e+128: tmp = t_2 elif (a * b) <= 1.65e+143: tmp = t_1 elif (a * b) <= 3.2e+211: tmp = (a * b) + (c * i) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z * t) + Float64(c * i)) t_2 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(a * b) <= -1.15e+144) tmp = t_2; elseif (Float64(a * b) <= 3.5e-33) tmp = t_1; elseif (Float64(a * b) <= 1.22e+128) tmp = t_2; elseif (Float64(a * b) <= 1.65e+143) tmp = t_1; elseif (Float64(a * b) <= 3.2e+211) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (z * t) + (c * i); t_2 = (a * b) + (x * y); tmp = 0.0; if ((a * b) <= -1.15e+144) tmp = t_2; elseif ((a * b) <= 3.5e-33) tmp = t_1; elseif ((a * b) <= 1.22e+128) tmp = t_2; elseif ((a * b) <= 1.65e+143) tmp = t_1; elseif ((a * b) <= 3.2e+211) tmp = (a * b) + (c * i); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.15e+144], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 3.5e-33], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.22e+128], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 1.65e+143], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 3.2e+211], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t + c \cdot i\\
t_2 := a \cdot b + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -1.15 \cdot 10^{+144}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 3.5 \cdot 10^{-33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 1.22 \cdot 10^{+128}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 1.65 \cdot 10^{+143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 3.2 \cdot 10^{+211}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.1500000000000001e144 or 3.4999999999999999e-33 < (*.f64 a b) < 1.22000000000000009e128 or 3.19999999999999977e211 < (*.f64 a b) Initial program 87.0%
Taylor expanded in z around 0 79.2%
Taylor expanded in c around 0 77.4%
if -1.1500000000000001e144 < (*.f64 a b) < 3.4999999999999999e-33 or 1.22000000000000009e128 < (*.f64 a b) < 1.65e143Initial program 98.6%
Taylor expanded in x around 0 74.7%
Taylor expanded in a around 0 70.2%
if 1.65e143 < (*.f64 a b) < 3.19999999999999977e211Initial program 100.0%
Taylor expanded in x around 0 90.6%
Taylor expanded in t around 0 81.2%
Final simplification73.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.6e+138)
(* a b)
(if (<= (* a b) -1.6e-92)
(* z t)
(if (<= (* a b) 2.7e-217)
(* c i)
(if (<= (* a b) 9.5e-112)
(* x y)
(if (<= (* a b) 6.8e+48) (* c i) (* a b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.6e+138) {
tmp = a * b;
} else if ((a * b) <= -1.6e-92) {
tmp = z * t;
} else if ((a * b) <= 2.7e-217) {
tmp = c * i;
} else if ((a * b) <= 9.5e-112) {
tmp = x * y;
} else if ((a * b) <= 6.8e+48) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.6d+138)) then
tmp = a * b
else if ((a * b) <= (-1.6d-92)) then
tmp = z * t
else if ((a * b) <= 2.7d-217) then
tmp = c * i
else if ((a * b) <= 9.5d-112) then
tmp = x * y
else if ((a * b) <= 6.8d+48) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.6e+138) {
tmp = a * b;
} else if ((a * b) <= -1.6e-92) {
tmp = z * t;
} else if ((a * b) <= 2.7e-217) {
tmp = c * i;
} else if ((a * b) <= 9.5e-112) {
tmp = x * y;
} else if ((a * b) <= 6.8e+48) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.6e+138: tmp = a * b elif (a * b) <= -1.6e-92: tmp = z * t elif (a * b) <= 2.7e-217: tmp = c * i elif (a * b) <= 9.5e-112: tmp = x * y elif (a * b) <= 6.8e+48: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.6e+138) tmp = Float64(a * b); elseif (Float64(a * b) <= -1.6e-92) tmp = Float64(z * t); elseif (Float64(a * b) <= 2.7e-217) tmp = Float64(c * i); elseif (Float64(a * b) <= 9.5e-112) tmp = Float64(x * y); elseif (Float64(a * b) <= 6.8e+48) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.6e+138) tmp = a * b; elseif ((a * b) <= -1.6e-92) tmp = z * t; elseif ((a * b) <= 2.7e-217) tmp = c * i; elseif ((a * b) <= 9.5e-112) tmp = x * y; elseif ((a * b) <= 6.8e+48) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1.6e+138], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.6e-92], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.7e-217], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 9.5e-112], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 6.8e+48], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.6 \cdot 10^{+138}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.6 \cdot 10^{-92}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.7 \cdot 10^{-217}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 9.5 \cdot 10^{-112}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 6.8 \cdot 10^{+48}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.6000000000000001e138 or 6.8000000000000006e48 < (*.f64 a b) Initial program 87.9%
Taylor expanded in a around inf 65.5%
if -1.6000000000000001e138 < (*.f64 a b) < -1.5999999999999998e-92Initial program 96.2%
Taylor expanded in z around inf 47.3%
if -1.5999999999999998e-92 < (*.f64 a b) < 2.70000000000000016e-217 or 9.50000000000000056e-112 < (*.f64 a b) < 6.8000000000000006e48Initial program 99.0%
Taylor expanded in c around inf 43.8%
if 2.70000000000000016e-217 < (*.f64 a b) < 9.50000000000000056e-112Initial program 99.9%
Taylor expanded in x around inf 56.4%
Final simplification54.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (+ (* a b) (* z t)))) (t_2 (+ (* x y) (* c i))))
(if (<= y -1.1e+48)
t_2
(if (<= y 7.4e+146)
t_1
(if (<= y 4.8e+222)
(+ (* a b) (* x y))
(if (<= y 1.6e+251) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + (z * t));
double t_2 = (x * y) + (c * i);
double tmp;
if (y <= -1.1e+48) {
tmp = t_2;
} else if (y <= 7.4e+146) {
tmp = t_1;
} else if (y <= 4.8e+222) {
tmp = (a * b) + (x * y);
} else if (y <= 1.6e+251) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (c * i) + ((a * b) + (z * t))
t_2 = (x * y) + (c * i)
if (y <= (-1.1d+48)) then
tmp = t_2
else if (y <= 7.4d+146) then
tmp = t_1
else if (y <= 4.8d+222) then
tmp = (a * b) + (x * y)
else if (y <= 1.6d+251) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + (z * t));
double t_2 = (x * y) + (c * i);
double tmp;
if (y <= -1.1e+48) {
tmp = t_2;
} else if (y <= 7.4e+146) {
tmp = t_1;
} else if (y <= 4.8e+222) {
tmp = (a * b) + (x * y);
} else if (y <= 1.6e+251) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + (z * t)) t_2 = (x * y) + (c * i) tmp = 0 if y <= -1.1e+48: tmp = t_2 elif y <= 7.4e+146: tmp = t_1 elif y <= 4.8e+222: tmp = (a * b) + (x * y) elif y <= 1.6e+251: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))) t_2 = Float64(Float64(x * y) + Float64(c * i)) tmp = 0.0 if (y <= -1.1e+48) tmp = t_2; elseif (y <= 7.4e+146) tmp = t_1; elseif (y <= 4.8e+222) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (y <= 1.6e+251) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + (z * t)); t_2 = (x * y) + (c * i); tmp = 0.0; if (y <= -1.1e+48) tmp = t_2; elseif (y <= 7.4e+146) tmp = t_1; elseif (y <= 4.8e+222) tmp = (a * b) + (x * y); elseif (y <= 1.6e+251) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e+48], t$95$2, If[LessEqual[y, 7.4e+146], t$95$1, If[LessEqual[y, 4.8e+222], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+251], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + z \cdot t\right)\\
t_2 := x \cdot y + c \cdot i\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{+146}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+222}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+251}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.1e48 or 1.5999999999999999e251 < y Initial program 91.9%
Taylor expanded in a around 0 74.8%
Taylor expanded in t around 0 63.7%
if -1.1e48 < y < 7.40000000000000009e146 or 4.8000000000000002e222 < y < 1.5999999999999999e251Initial program 95.1%
Taylor expanded in x around 0 85.8%
if 7.40000000000000009e146 < y < 4.8000000000000002e222Initial program 90.0%
Taylor expanded in z around 0 90.0%
Taylor expanded in c around 0 80.5%
Final simplification80.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= z -2.8e+161)
(+ (+ (* x y) (* z t)) (* c i))
(if (or (<= z -1.2e-27) (not (<= z 0.0029)))
(+ (* c i) (+ (* a b) (* z t)))
(+ (* c i) (+ (* a b) (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.8e+161) {
tmp = ((x * y) + (z * t)) + (c * i);
} else if ((z <= -1.2e-27) || !(z <= 0.0029)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (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 (z <= (-2.8d+161)) then
tmp = ((x * y) + (z * t)) + (c * i)
else if ((z <= (-1.2d-27)) .or. (.not. (z <= 0.0029d0))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((a * b) + (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 (z <= -2.8e+161) {
tmp = ((x * y) + (z * t)) + (c * i);
} else if ((z <= -1.2e-27) || !(z <= 0.0029)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.8e+161: tmp = ((x * y) + (z * t)) + (c * i) elif (z <= -1.2e-27) or not (z <= 0.0029): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((a * b) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.8e+161) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(c * i)); elseif ((z <= -1.2e-27) || !(z <= 0.0029)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -2.8e+161) tmp = ((x * y) + (z * t)) + (c * i); elseif ((z <= -1.2e-27) || ~((z <= 0.0029))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((a * b) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.8e+161], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.2e-27], N[Not[LessEqual[z, 0.0029]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+161}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) + c \cdot i\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-27} \lor \neg \left(z \leq 0.0029\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if z < -2.80000000000000021e161Initial program 94.1%
Taylor expanded in a around 0 91.3%
if -2.80000000000000021e161 < z < -1.20000000000000001e-27 or 0.0029 < z Initial program 91.3%
Taylor expanded in x around 0 87.7%
if -1.20000000000000001e-27 < z < 0.0029Initial program 96.6%
Taylor expanded in z around 0 91.5%
Final simplification89.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -5e+141)
(* a b)
(if (<= (* a b) -1.4e-92)
(* z t)
(if (<= (* a b) 2.1e+50) (* c i) (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -5e+141) {
tmp = a * b;
} else if ((a * b) <= -1.4e-92) {
tmp = z * t;
} else if ((a * b) <= 2.1e+50) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-5d+141)) then
tmp = a * b
else if ((a * b) <= (-1.4d-92)) then
tmp = z * t
else if ((a * b) <= 2.1d+50) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -5e+141) {
tmp = a * b;
} else if ((a * b) <= -1.4e-92) {
tmp = z * t;
} else if ((a * b) <= 2.1e+50) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -5e+141: tmp = a * b elif (a * b) <= -1.4e-92: tmp = z * t elif (a * b) <= 2.1e+50: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -5e+141) tmp = Float64(a * b); elseif (Float64(a * b) <= -1.4e-92) tmp = Float64(z * t); elseif (Float64(a * b) <= 2.1e+50) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -5e+141) tmp = a * b; elseif ((a * b) <= -1.4e-92) tmp = z * t; elseif ((a * b) <= 2.1e+50) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+141], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.4e-92], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.1e+50], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+141}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.4 \cdot 10^{-92}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.1 \cdot 10^{+50}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -5.00000000000000025e141 or 2.1e50 < (*.f64 a b) Initial program 87.9%
Taylor expanded in a around inf 65.5%
if -5.00000000000000025e141 < (*.f64 a b) < -1.4e-92Initial program 96.2%
Taylor expanded in z around inf 47.3%
if -1.4e-92 < (*.f64 a b) < 2.1e50Initial program 99.2%
Taylor expanded in c around inf 41.2%
Final simplification51.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -5200.0) (not (<= (* c i) 8.5e+218))) (+ (* a b) (* c i)) (+ (* a b) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -5200.0) || !((c * i) <= 8.5e+218)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (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) <= (-5200.0d0)) .or. (.not. ((c * i) <= 8.5d+218))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + (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) <= -5200.0) || !((c * i) <= 8.5e+218)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -5200.0) or not ((c * i) <= 8.5e+218): tmp = (a * b) + (c * i) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -5200.0) || !(Float64(c * i) <= 8.5e+218)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + 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) <= -5200.0) || ~(((c * i) <= 8.5e+218))) tmp = (a * b) + (c * i); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -5200.0], N[Not[LessEqual[N[(c * i), $MachinePrecision], 8.5e+218]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5200 \lor \neg \left(c \cdot i \leq 8.5 \cdot 10^{+218}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 c i) < -5200 or 8.50000000000000041e218 < (*.f64 c i) Initial program 88.3%
Taylor expanded in x around 0 86.3%
Taylor expanded in t around 0 77.1%
if -5200 < (*.f64 c i) < 8.50000000000000041e218Initial program 97.5%
Taylor expanded in z around 0 68.1%
Taylor expanded in c around 0 63.7%
Final simplification68.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -2.8e-73) (not (<= t 1.1e+82))) (+ (* c i) (+ (* a b) (* z t))) (+ (* c i) (+ (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -2.8e-73) || !(t <= 1.1e+82)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (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 ((t <= (-2.8d-73)) .or. (.not. (t <= 1.1d+82))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((a * b) + (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 ((t <= -2.8e-73) || !(t <= 1.1e+82)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -2.8e-73) or not (t <= 1.1e+82): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((a * b) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -2.8e-73) || !(t <= 1.1e+82)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -2.8e-73) || ~((t <= 1.1e+82))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((a * b) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -2.8e-73], N[Not[LessEqual[t, 1.1e+82]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-73} \lor \neg \left(t \leq 1.1 \cdot 10^{+82}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if t < -2.80000000000000012e-73 or 1.1000000000000001e82 < t Initial program 91.7%
Taylor expanded in x around 0 80.4%
if -2.80000000000000012e-73 < t < 1.1000000000000001e82Initial program 96.3%
Taylor expanded in z around 0 86.7%
Final simplification83.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -1e+99) (* c i) (if (<= (* c i) 3.6e+235) (+ (* a b) (* 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) <= -1e+99) {
tmp = c * i;
} else if ((c * i) <= 3.6e+235) {
tmp = (a * b) + (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) <= (-1d+99)) then
tmp = c * i
else if ((c * i) <= 3.6d+235) then
tmp = (a * b) + (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) <= -1e+99) {
tmp = c * i;
} else if ((c * i) <= 3.6e+235) {
tmp = (a * b) + (x * y);
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1e+99: tmp = c * i elif (c * i) <= 3.6e+235: tmp = (a * b) + (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) <= -1e+99) tmp = Float64(c * i); elseif (Float64(c * i) <= 3.6e+235) tmp = Float64(Float64(a * b) + 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) <= -1e+99) tmp = c * i; elseif ((c * i) <= 3.6e+235) tmp = (a * b) + (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], -1e+99], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.6e+235], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+99}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 3.6 \cdot 10^{+235}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -9.9999999999999997e98 or 3.59999999999999985e235 < (*.f64 c i) Initial program 86.3%
Taylor expanded in c around inf 70.7%
if -9.9999999999999997e98 < (*.f64 c i) < 3.59999999999999985e235Initial program 97.3%
Taylor expanded in z around 0 70.2%
Taylor expanded in c around 0 63.1%
Final simplification65.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -3.2e+38) (* a b) (if (<= (* a b) 3e+46) (* c i) (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -3.2e+38) {
tmp = a * b;
} else if ((a * b) <= 3e+46) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-3.2d+38)) then
tmp = a * b
else if ((a * b) <= 3d+46) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -3.2e+38) {
tmp = a * b;
} else if ((a * b) <= 3e+46) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -3.2e+38: tmp = a * b elif (a * b) <= 3e+46: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -3.2e+38) tmp = Float64(a * b); elseif (Float64(a * b) <= 3e+46) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -3.2e+38) tmp = a * b; elseif ((a * b) <= 3e+46) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -3.2e+38], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3e+46], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -3.2 \cdot 10^{+38}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 3 \cdot 10^{+46}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -3.19999999999999985e38 or 3.00000000000000023e46 < (*.f64 a b) Initial program 88.7%
Taylor expanded in a around inf 61.9%
if -3.19999999999999985e38 < (*.f64 a b) < 3.00000000000000023e46Initial program 98.6%
Taylor expanded in c around inf 40.3%
Final simplification50.0%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 94.1%
Taylor expanded in a around inf 31.7%
Final simplification31.7%
herbie shell --seed 2023182
(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)))