
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (fma t z (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(t, z, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(t, z, Float64(x * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, z, x \cdot y\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%
Taylor expanded in c around 0 22.2%
Taylor expanded in a around 0 44.4%
fma-def66.7%
Simplified66.7%
Final simplification98.8%
(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-def97.3%
+-commutative97.3%
fma-def98.0%
fma-def98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t)))
(t_2 (+ (* x y) (* a b)))
(t_3 (+ (* a b) (* c i))))
(if (<= (* c i) -2.9e+59)
t_3
(if (<= (* c i) -2e-18)
t_1
(if (<= (* c i) -4e-279)
t_2
(if (<= (* c i) 2.6e-227)
t_1
(if (<= (* c i) 4.8e-136)
t_2
(if (<= (* c i) 6.8e+68) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (a * b);
double t_3 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -2.9e+59) {
tmp = t_3;
} else if ((c * i) <= -2e-18) {
tmp = t_1;
} else if ((c * i) <= -4e-279) {
tmp = t_2;
} else if ((c * i) <= 2.6e-227) {
tmp = t_1;
} else if ((c * i) <= 4.8e-136) {
tmp = t_2;
} else if ((c * i) <= 6.8e+68) {
tmp = t_1;
} else {
tmp = t_3;
}
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 = (a * b) + (z * t)
t_2 = (x * y) + (a * b)
t_3 = (a * b) + (c * i)
if ((c * i) <= (-2.9d+59)) then
tmp = t_3
else if ((c * i) <= (-2d-18)) then
tmp = t_1
else if ((c * i) <= (-4d-279)) then
tmp = t_2
else if ((c * i) <= 2.6d-227) then
tmp = t_1
else if ((c * i) <= 4.8d-136) then
tmp = t_2
else if ((c * i) <= 6.8d+68) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (a * b);
double t_3 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -2.9e+59) {
tmp = t_3;
} else if ((c * i) <= -2e-18) {
tmp = t_1;
} else if ((c * i) <= -4e-279) {
tmp = t_2;
} else if ((c * i) <= 2.6e-227) {
tmp = t_1;
} else if ((c * i) <= 4.8e-136) {
tmp = t_2;
} else if ((c * i) <= 6.8e+68) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (x * y) + (a * b) t_3 = (a * b) + (c * i) tmp = 0 if (c * i) <= -2.9e+59: tmp = t_3 elif (c * i) <= -2e-18: tmp = t_1 elif (c * i) <= -4e-279: tmp = t_2 elif (c * i) <= 2.6e-227: tmp = t_1 elif (c * i) <= 4.8e-136: tmp = t_2 elif (c * i) <= 6.8e+68: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(x * y) + Float64(a * b)) t_3 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -2.9e+59) tmp = t_3; elseif (Float64(c * i) <= -2e-18) tmp = t_1; elseif (Float64(c * i) <= -4e-279) tmp = t_2; elseif (Float64(c * i) <= 2.6e-227) tmp = t_1; elseif (Float64(c * i) <= 4.8e-136) tmp = t_2; elseif (Float64(c * i) <= 6.8e+68) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); t_2 = (x * y) + (a * b); t_3 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -2.9e+59) tmp = t_3; elseif ((c * i) <= -2e-18) tmp = t_1; elseif ((c * i) <= -4e-279) tmp = t_2; elseif ((c * i) <= 2.6e-227) tmp = t_1; elseif ((c * i) <= 4.8e-136) tmp = t_2; elseif ((c * i) <= 6.8e+68) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2.9e+59], t$95$3, If[LessEqual[N[(c * i), $MachinePrecision], -2e-18], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -4e-279], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 2.6e-227], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 4.8e-136], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 6.8e+68], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := x \cdot y + a \cdot b\\
t_3 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -2.9 \cdot 10^{+59}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -4 \cdot 10^{-279}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 2.6 \cdot 10^{-227}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 4.8 \cdot 10^{-136}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 6.8 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 c i) < -2.89999999999999991e59 or 6.8000000000000003e68 < (*.f64 c i) Initial program 93.1%
Taylor expanded in x around 0 84.2%
fma-def84.2%
Simplified84.2%
Taylor expanded in t around 0 75.9%
if -2.89999999999999991e59 < (*.f64 c i) < -2.0000000000000001e-18 or -4.00000000000000022e-279 < (*.f64 c i) < 2.60000000000000011e-227 or 4.7999999999999997e-136 < (*.f64 c i) < 6.8000000000000003e68Initial program 100.0%
Taylor expanded in x around 0 81.4%
fma-def81.4%
Simplified81.4%
Taylor expanded in c around 0 80.7%
if -2.0000000000000001e-18 < (*.f64 c i) < -4.00000000000000022e-279 or 2.60000000000000011e-227 < (*.f64 c i) < 4.7999999999999997e-136Initial program 96.7%
Taylor expanded in c around 0 92.1%
Taylor expanded in t around 0 74.2%
Final simplification77.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* x y) (* a b))))
(if (<= (* c i) -2.1e+55)
(+ (* x y) (* c i))
(if (<= (* c i) -2.1e-18)
t_1
(if (<= (* c i) -9.5e-278)
t_2
(if (<= (* c i) 6.2e-226)
t_1
(if (<= (* c i) 3.2e-136)
t_2
(if (<= (* c i) 6e+69) t_1 (+ (* a b) (* c i))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (a * b);
double tmp;
if ((c * i) <= -2.1e+55) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= -2.1e-18) {
tmp = t_1;
} else if ((c * i) <= -9.5e-278) {
tmp = t_2;
} else if ((c * i) <= 6.2e-226) {
tmp = t_1;
} else if ((c * i) <= 3.2e-136) {
tmp = t_2;
} else if ((c * i) <= 6e+69) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (x * y) + (a * b)
if ((c * i) <= (-2.1d+55)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= (-2.1d-18)) then
tmp = t_1
else if ((c * i) <= (-9.5d-278)) then
tmp = t_2
else if ((c * i) <= 6.2d-226) then
tmp = t_1
else if ((c * i) <= 3.2d-136) then
tmp = t_2
else if ((c * i) <= 6d+69) then
tmp = t_1
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 t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (a * b);
double tmp;
if ((c * i) <= -2.1e+55) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= -2.1e-18) {
tmp = t_1;
} else if ((c * i) <= -9.5e-278) {
tmp = t_2;
} else if ((c * i) <= 6.2e-226) {
tmp = t_1;
} else if ((c * i) <= 3.2e-136) {
tmp = t_2;
} else if ((c * i) <= 6e+69) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (x * y) + (a * b) tmp = 0 if (c * i) <= -2.1e+55: tmp = (x * y) + (c * i) elif (c * i) <= -2.1e-18: tmp = t_1 elif (c * i) <= -9.5e-278: tmp = t_2 elif (c * i) <= 6.2e-226: tmp = t_1 elif (c * i) <= 3.2e-136: tmp = t_2 elif (c * i) <= 6e+69: tmp = t_1 else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(c * i) <= -2.1e+55) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= -2.1e-18) tmp = t_1; elseif (Float64(c * i) <= -9.5e-278) tmp = t_2; elseif (Float64(c * i) <= 6.2e-226) tmp = t_1; elseif (Float64(c * i) <= 3.2e-136) tmp = t_2; elseif (Float64(c * i) <= 6e+69) tmp = t_1; 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) t_1 = (a * b) + (z * t); t_2 = (x * y) + (a * b); tmp = 0.0; if ((c * i) <= -2.1e+55) tmp = (x * y) + (c * i); elseif ((c * i) <= -2.1e-18) tmp = t_1; elseif ((c * i) <= -9.5e-278) tmp = t_2; elseif ((c * i) <= 6.2e-226) tmp = t_1; elseif ((c * i) <= 3.2e-136) tmp = t_2; elseif ((c * i) <= 6e+69) tmp = t_1; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2.1e+55], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.1e-18], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -9.5e-278], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 6.2e-226], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 3.2e-136], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 6e+69], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := x \cdot y + a \cdot b\\
\mathbf{if}\;c \cdot i \leq -2.1 \cdot 10^{+55}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -2.1 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -9.5 \cdot 10^{-278}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 6.2 \cdot 10^{-226}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 3.2 \cdot 10^{-136}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 6 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.1000000000000001e55Initial program 96.6%
Taylor expanded in a around 0 85.0%
fma-def85.0%
Simplified85.0%
Taylor expanded in t around 0 81.6%
if -2.1000000000000001e55 < (*.f64 c i) < -2.1e-18 or -9.49999999999999964e-278 < (*.f64 c i) < 6.19999999999999978e-226 or 3.19999999999999993e-136 < (*.f64 c i) < 5.99999999999999967e69Initial program 100.0%
Taylor expanded in x around 0 81.4%
fma-def81.4%
Simplified81.4%
Taylor expanded in c around 0 80.7%
if -2.1e-18 < (*.f64 c i) < -9.49999999999999964e-278 or 6.19999999999999978e-226 < (*.f64 c i) < 3.19999999999999993e-136Initial program 96.7%
Taylor expanded in c around 0 92.1%
Taylor expanded in t around 0 74.2%
if 5.99999999999999967e69 < (*.f64 c i) Initial program 88.6%
Taylor expanded in x around 0 83.6%
fma-def83.6%
Simplified83.6%
Taylor expanded in t around 0 71.0%
Final simplification77.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* a b) (* c i))))
(if (<= (* c i) -1.6e+56)
t_2
(if (<= (* c i) -1.8e-101)
t_1
(if (<= (* c i) -2.3e-162)
(* x y)
(if (<= (* c i) 2.4e+69) 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 = (a * b) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.6e+56) {
tmp = t_2;
} else if ((c * i) <= -1.8e-101) {
tmp = t_1;
} else if ((c * i) <= -2.3e-162) {
tmp = x * y;
} else if ((c * i) <= 2.4e+69) {
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 = (a * b) + (z * t)
t_2 = (a * b) + (c * i)
if ((c * i) <= (-1.6d+56)) then
tmp = t_2
else if ((c * i) <= (-1.8d-101)) then
tmp = t_1
else if ((c * i) <= (-2.3d-162)) then
tmp = x * y
else if ((c * i) <= 2.4d+69) 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 = (a * b) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.6e+56) {
tmp = t_2;
} else if ((c * i) <= -1.8e-101) {
tmp = t_1;
} else if ((c * i) <= -2.3e-162) {
tmp = x * y;
} else if ((c * i) <= 2.4e+69) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (a * b) + (c * i) tmp = 0 if (c * i) <= -1.6e+56: tmp = t_2 elif (c * i) <= -1.8e-101: tmp = t_1 elif (c * i) <= -2.3e-162: tmp = x * y elif (c * i) <= 2.4e+69: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -1.6e+56) tmp = t_2; elseif (Float64(c * i) <= -1.8e-101) tmp = t_1; elseif (Float64(c * i) <= -2.3e-162) tmp = Float64(x * y); elseif (Float64(c * i) <= 2.4e+69) 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 = (a * b) + (z * t); t_2 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -1.6e+56) tmp = t_2; elseif ((c * i) <= -1.8e-101) tmp = t_1; elseif ((c * i) <= -2.3e-162) tmp = x * y; elseif ((c * i) <= 2.4e+69) 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[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.6e+56], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -1.8e-101], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -2.3e-162], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.4e+69], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -1.6 \cdot 10^{+56}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq -1.8 \cdot 10^{-101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -2.3 \cdot 10^{-162}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 2.4 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 c i) < -1.60000000000000002e56 or 2.4000000000000002e69 < (*.f64 c i) Initial program 93.1%
Taylor expanded in x around 0 84.2%
fma-def84.2%
Simplified84.2%
Taylor expanded in t around 0 75.9%
if -1.60000000000000002e56 < (*.f64 c i) < -1.8e-101 or -2.2999999999999998e-162 < (*.f64 c i) < 2.4000000000000002e69Initial program 98.6%
Taylor expanded in x around 0 74.3%
fma-def74.3%
Simplified74.3%
Taylor expanded in c around 0 72.6%
if -1.8e-101 < (*.f64 c i) < -2.2999999999999998e-162Initial program 100.0%
Taylor expanded in x around inf 74.0%
Final simplification74.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* c i) -1.45e+57)
(+ (* x y) (* c i))
(if (<= (* c i) -2.2e-20)
t_1
(if (<= (* c i) 1.75e-197)
(+ (* x y) (* z t))
(if (<= (* c i) 7e+69) t_1 (+ (* a b) (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -1.45e+57) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= -2.2e-20) {
tmp = t_1;
} else if ((c * i) <= 1.75e-197) {
tmp = (x * y) + (z * t);
} else if ((c * i) <= 7e+69) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (z * t)
if ((c * i) <= (-1.45d+57)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= (-2.2d-20)) then
tmp = t_1
else if ((c * i) <= 1.75d-197) then
tmp = (x * y) + (z * t)
else if ((c * i) <= 7d+69) then
tmp = t_1
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 t_1 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -1.45e+57) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= -2.2e-20) {
tmp = t_1;
} else if ((c * i) <= 1.75e-197) {
tmp = (x * y) + (z * t);
} else if ((c * i) <= 7e+69) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (c * i) <= -1.45e+57: tmp = (x * y) + (c * i) elif (c * i) <= -2.2e-20: tmp = t_1 elif (c * i) <= 1.75e-197: tmp = (x * y) + (z * t) elif (c * i) <= 7e+69: tmp = t_1 else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -1.45e+57) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= -2.2e-20) tmp = t_1; elseif (Float64(c * i) <= 1.75e-197) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(c * i) <= 7e+69) tmp = t_1; 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) t_1 = (a * b) + (z * t); tmp = 0.0; if ((c * i) <= -1.45e+57) tmp = (x * y) + (c * i); elseif ((c * i) <= -2.2e-20) tmp = t_1; elseif ((c * i) <= 1.75e-197) tmp = (x * y) + (z * t); elseif ((c * i) <= 7e+69) tmp = t_1; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.45e+57], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.2e-20], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.75e-197], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 7e+69], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1.45 \cdot 10^{+57}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -2.2 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 1.75 \cdot 10^{-197}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 7 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.4500000000000001e57Initial program 96.6%
Taylor expanded in a around 0 85.0%
fma-def85.0%
Simplified85.0%
Taylor expanded in t around 0 81.6%
if -1.4500000000000001e57 < (*.f64 c i) < -2.19999999999999991e-20 or 1.7499999999999999e-197 < (*.f64 c i) < 6.99999999999999974e69Initial program 98.4%
Taylor expanded in x around 0 84.9%
fma-def84.9%
Simplified84.9%
Taylor expanded in c around 0 84.0%
if -2.19999999999999991e-20 < (*.f64 c i) < 1.7499999999999999e-197Initial program 98.9%
Taylor expanded in c around 0 95.7%
Taylor expanded in a around 0 73.5%
if 6.99999999999999974e69 < (*.f64 c i) Initial program 88.6%
Taylor expanded in x around 0 83.6%
fma-def83.6%
Simplified83.6%
Taylor expanded in t around 0 71.0%
Final simplification77.5%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\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 x around inf 55.9%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.15e+80)
(* a b)
(if (<= (* a b) -3e-194)
(* z t)
(if (<= (* a b) 2.3e-54)
(* c i)
(if (<= (* a b) 3.8e+176) (* x y) (* 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.15e+80) {
tmp = a * b;
} else if ((a * b) <= -3e-194) {
tmp = z * t;
} else if ((a * b) <= 2.3e-54) {
tmp = c * i;
} else if ((a * b) <= 3.8e+176) {
tmp = x * y;
} 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.15d+80)) then
tmp = a * b
else if ((a * b) <= (-3d-194)) then
tmp = z * t
else if ((a * b) <= 2.3d-54) then
tmp = c * i
else if ((a * b) <= 3.8d+176) then
tmp = x * y
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.15e+80) {
tmp = a * b;
} else if ((a * b) <= -3e-194) {
tmp = z * t;
} else if ((a * b) <= 2.3e-54) {
tmp = c * i;
} else if ((a * b) <= 3.8e+176) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.15e+80: tmp = a * b elif (a * b) <= -3e-194: tmp = z * t elif (a * b) <= 2.3e-54: tmp = c * i elif (a * b) <= 3.8e+176: tmp = x * y else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.15e+80) tmp = Float64(a * b); elseif (Float64(a * b) <= -3e-194) tmp = Float64(z * t); elseif (Float64(a * b) <= 2.3e-54) tmp = Float64(c * i); elseif (Float64(a * b) <= 3.8e+176) tmp = Float64(x * y); 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.15e+80) tmp = a * b; elseif ((a * b) <= -3e-194) tmp = z * t; elseif ((a * b) <= 2.3e-54) tmp = c * i; elseif ((a * b) <= 3.8e+176) tmp = x * y; 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.15e+80], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3e-194], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.3e-54], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.8e+176], N[(x * y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.15 \cdot 10^{+80}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -3 \cdot 10^{-194}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.3 \cdot 10^{-54}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{+176}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.15000000000000002e80 or 3.8000000000000003e176 < (*.f64 a b) Initial program 94.3%
Taylor expanded in a around inf 79.2%
if -1.15000000000000002e80 < (*.f64 a b) < -3e-194Initial program 96.4%
Taylor expanded in z around inf 38.5%
if -3e-194 < (*.f64 a b) < 2.2999999999999999e-54Initial program 98.8%
Taylor expanded in c around inf 46.0%
if 2.2999999999999999e-54 < (*.f64 a b) < 3.8000000000000003e176Initial program 95.3%
Taylor expanded in x around inf 43.3%
Final simplification53.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -3.5e+142) (not (<= (* c i) 2.5e+184))) (+ (* a b) (* c i)) (+ (* a b) (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -3.5e+142) || !((c * i) <= 2.5e+184)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-3.5d+142)) .or. (.not. ((c * i) <= 2.5d+184))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -3.5e+142) || !((c * i) <= 2.5e+184)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -3.5e+142) or not ((c * i) <= 2.5e+184): tmp = (a * b) + (c * i) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -3.5e+142) || !(Float64(c * i) <= 2.5e+184)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -3.5e+142) || ~(((c * i) <= 2.5e+184))) tmp = (a * b) + (c * i); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -3.5e+142], N[Not[LessEqual[N[(c * i), $MachinePrecision], 2.5e+184]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.5 \cdot 10^{+142} \lor \neg \left(c \cdot i \leq 2.5 \cdot 10^{+184}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -3.49999999999999997e142 or 2.4999999999999999e184 < (*.f64 c i) Initial program 91.8%
Taylor expanded in x around 0 89.2%
fma-def89.2%
Simplified89.2%
Taylor expanded in t around 0 84.1%
if -3.49999999999999997e142 < (*.f64 c i) < 2.4999999999999999e184Initial program 98.3%
Taylor expanded in c around 0 90.8%
Final simplification88.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -3.8e+59) (not (<= (* c i) 5.8e+69))) (+ (* c i) (+ (* x y) (* a b))) (+ (* a b) (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -3.8e+59) || !((c * i) <= 5.8e+69)) {
tmp = (c * i) + ((x * y) + (a * b));
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-3.8d+59)) .or. (.not. ((c * i) <= 5.8d+69))) then
tmp = (c * i) + ((x * y) + (a * b))
else
tmp = (a * b) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -3.8e+59) || !((c * i) <= 5.8e+69)) {
tmp = (c * i) + ((x * y) + (a * b));
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -3.8e+59) or not ((c * i) <= 5.8e+69): tmp = (c * i) + ((x * y) + (a * b)) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -3.8e+59) || !(Float64(c * i) <= 5.8e+69)) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(a * b))); else tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -3.8e+59) || ~(((c * i) <= 5.8e+69))) tmp = (c * i) + ((x * y) + (a * b)); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -3.8e+59], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5.8e+69]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+59} \lor \neg \left(c \cdot i \leq 5.8 \cdot 10^{+69}\right):\\
\;\;\;\;c \cdot i + \left(x \cdot y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -3.8000000000000001e59 or 5.7999999999999997e69 < (*.f64 c i) Initial program 93.1%
Taylor expanded in z around 0 87.4%
if -3.8000000000000001e59 < (*.f64 c i) < 5.7999999999999997e69Initial program 98.7%
Taylor expanded in c around 0 96.1%
Final simplification92.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.1e+81)
(* a b)
(if (<= (* a b) -1.3e-193)
(* z t)
(if (<= (* a b) 1.05e+93) (* 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) <= -2.1e+81) {
tmp = a * b;
} else if ((a * b) <= -1.3e-193) {
tmp = z * t;
} else if ((a * b) <= 1.05e+93) {
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) <= (-2.1d+81)) then
tmp = a * b
else if ((a * b) <= (-1.3d-193)) then
tmp = z * t
else if ((a * b) <= 1.05d+93) 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) <= -2.1e+81) {
tmp = a * b;
} else if ((a * b) <= -1.3e-193) {
tmp = z * t;
} else if ((a * b) <= 1.05e+93) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.1e+81: tmp = a * b elif (a * b) <= -1.3e-193: tmp = z * t elif (a * b) <= 1.05e+93: 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) <= -2.1e+81) tmp = Float64(a * b); elseif (Float64(a * b) <= -1.3e-193) tmp = Float64(z * t); elseif (Float64(a * b) <= 1.05e+93) 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) <= -2.1e+81) tmp = a * b; elseif ((a * b) <= -1.3e-193) tmp = z * t; elseif ((a * b) <= 1.05e+93) 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], -2.1e+81], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.3e-193], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.05e+93], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.1 \cdot 10^{+81}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.3 \cdot 10^{-193}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.05 \cdot 10^{+93}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.0999999999999999e81 or 1.0499999999999999e93 < (*.f64 a b) Initial program 95.4%
Taylor expanded in a around inf 69.8%
if -2.0999999999999999e81 < (*.f64 a b) < -1.30000000000000004e-193Initial program 96.4%
Taylor expanded in z around inf 38.5%
if -1.30000000000000004e-193 < (*.f64 a b) < 1.0499999999999999e93Initial program 97.3%
Taylor expanded in c around inf 41.2%
Final simplification50.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -3.1e+155) (not (<= (* x y) 2.7e+196))) (* x y) (+ (* a b) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -3.1e+155) || !((x * y) <= 2.7e+196)) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-3.1d+155)) .or. (.not. ((x * y) <= 2.7d+196))) then
tmp = x * y
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -3.1e+155) || !((x * y) <= 2.7e+196)) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -3.1e+155) or not ((x * y) <= 2.7e+196): tmp = x * y else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -3.1e+155) || !(Float64(x * y) <= 2.7e+196)) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -3.1e+155) || ~(((x * y) <= 2.7e+196))) tmp = x * y; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -3.1e+155], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.7e+196]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.1 \cdot 10^{+155} \lor \neg \left(x \cdot y \leq 2.7 \cdot 10^{+196}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -3.09999999999999989e155 or 2.69999999999999995e196 < (*.f64 x y) Initial program 89.4%
Taylor expanded in x around inf 81.2%
if -3.09999999999999989e155 < (*.f64 x y) < 2.69999999999999995e196Initial program 98.9%
Taylor expanded in x around 0 91.2%
fma-def91.2%
Simplified91.2%
Taylor expanded in t around 0 63.8%
Final simplification68.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.6e+79) (not (<= (* a b) 8.5e+95))) (* a b) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.6e+79) || !((a * b) <= 8.5e+95)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-1.6d+79)) .or. (.not. ((a * b) <= 8.5d+95))) then
tmp = a * b
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.6e+79) || !((a * b) <= 8.5e+95)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.6e+79) or not ((a * b) <= 8.5e+95): tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1.6e+79) || !(Float64(a * b) <= 8.5e+95)) tmp = Float64(a * b); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -1.6e+79) || ~(((a * b) <= 8.5e+95))) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.6e+79], N[Not[LessEqual[N[(a * b), $MachinePrecision], 8.5e+95]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.6 \cdot 10^{+79} \lor \neg \left(a \cdot b \leq 8.5 \cdot 10^{+95}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.60000000000000001e79 or 8.5000000000000002e95 < (*.f64 a b) Initial program 95.4%
Taylor expanded in a around inf 69.8%
if -1.60000000000000001e79 < (*.f64 a b) < 8.5000000000000002e95Initial program 97.0%
Taylor expanded in c around inf 37.1%
Final simplification48.3%
(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%
Taylor expanded in a around inf 28.0%
Final simplification28.0%
herbie shell --seed 2024019
(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)))