
(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 13 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 93.4%
+-commutative93.4%
fma-define94.9%
+-commutative94.9%
fma-define96.5%
fma-define96.9%
Simplified96.9%
Final simplification96.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* x y) (* c i))))
(if (<= (* x y) -1.06e+102)
t_2
(if (<= (* x y) 2.3e-217)
t_1
(if (<= (* x y) 7e-40)
(+ (* a b) (* c i))
(if (or (<= (* x y) 6000000000000.0)
(and (not (<= (* x y) 1.28e+92)) (<= (* x y) 2.4e+156)))
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 = (x * y) + (c * i);
double tmp;
if ((x * y) <= -1.06e+102) {
tmp = t_2;
} else if ((x * y) <= 2.3e-217) {
tmp = t_1;
} else if ((x * y) <= 7e-40) {
tmp = (a * b) + (c * i);
} else if (((x * y) <= 6000000000000.0) || (!((x * y) <= 1.28e+92) && ((x * y) <= 2.4e+156))) {
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 = (x * y) + (c * i)
if ((x * y) <= (-1.06d+102)) then
tmp = t_2
else if ((x * y) <= 2.3d-217) then
tmp = t_1
else if ((x * y) <= 7d-40) then
tmp = (a * b) + (c * i)
else if (((x * y) <= 6000000000000.0d0) .or. (.not. ((x * y) <= 1.28d+92)) .and. ((x * y) <= 2.4d+156)) 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 = (x * y) + (c * i);
double tmp;
if ((x * y) <= -1.06e+102) {
tmp = t_2;
} else if ((x * y) <= 2.3e-217) {
tmp = t_1;
} else if ((x * y) <= 7e-40) {
tmp = (a * b) + (c * i);
} else if (((x * y) <= 6000000000000.0) || (!((x * y) <= 1.28e+92) && ((x * y) <= 2.4e+156))) {
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 = (x * y) + (c * i) tmp = 0 if (x * y) <= -1.06e+102: tmp = t_2 elif (x * y) <= 2.3e-217: tmp = t_1 elif (x * y) <= 7e-40: tmp = (a * b) + (c * i) elif ((x * y) <= 6000000000000.0) or (not ((x * y) <= 1.28e+92) and ((x * y) <= 2.4e+156)): 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(x * y) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -1.06e+102) tmp = t_2; elseif (Float64(x * y) <= 2.3e-217) tmp = t_1; elseif (Float64(x * y) <= 7e-40) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif ((Float64(x * y) <= 6000000000000.0) || (!(Float64(x * y) <= 1.28e+92) && (Float64(x * y) <= 2.4e+156))) 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 = (x * y) + (c * i); tmp = 0.0; if ((x * y) <= -1.06e+102) tmp = t_2; elseif ((x * y) <= 2.3e-217) tmp = t_1; elseif ((x * y) <= 7e-40) tmp = (a * b) + (c * i); elseif (((x * y) <= 6000000000000.0) || (~(((x * y) <= 1.28e+92)) && ((x * y) <= 2.4e+156))) 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[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.06e+102], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2.3e-217], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 7e-40], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], 6000000000000.0], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.28e+92]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 2.4e+156]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := x \cdot y + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.06 \cdot 10^{+102}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 2.3 \cdot 10^{-217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{-40}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 6000000000000 \lor \neg \left(x \cdot y \leq 1.28 \cdot 10^{+92}\right) \land x \cdot y \leq 2.4 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.06000000000000001e102 or 6e12 < (*.f64 x y) < 1.27999999999999996e92 or 2.4000000000000001e156 < (*.f64 x y) Initial program 89.4%
Taylor expanded in z around 0 86.1%
Taylor expanded in a around 0 81.4%
if -1.06000000000000001e102 < (*.f64 x y) < 2.30000000000000005e-217 or 7.0000000000000003e-40 < (*.f64 x y) < 6e12 or 1.27999999999999996e92 < (*.f64 x y) < 2.4000000000000001e156Initial program 94.9%
Taylor expanded in c around 0 78.7%
Taylor expanded in x around 0 75.2%
if 2.30000000000000005e-217 < (*.f64 x y) < 7.0000000000000003e-40Initial program 97.1%
Taylor expanded in x around 0 94.2%
Taylor expanded in t around 0 80.2%
Final simplification77.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -2.9e+190)
(* x y)
(if (<= (* x y) -1.7e+17)
t_1
(if (<= (* x y) -1.12e-43)
(* z t)
(if (<= (* x y) 9.2e-40)
t_1
(if (<= (* x y) 11000000000000.0)
(* z t)
(if (<= (* x y) 4.6e+158) 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 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -2.9e+190) {
tmp = x * y;
} else if ((x * y) <= -1.7e+17) {
tmp = t_1;
} else if ((x * y) <= -1.12e-43) {
tmp = z * t;
} else if ((x * y) <= 9.2e-40) {
tmp = t_1;
} else if ((x * y) <= 11000000000000.0) {
tmp = z * t;
} else if ((x * y) <= 4.6e+158) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((x * y) <= (-2.9d+190)) then
tmp = x * y
else if ((x * y) <= (-1.7d+17)) then
tmp = t_1
else if ((x * y) <= (-1.12d-43)) then
tmp = z * t
else if ((x * y) <= 9.2d-40) then
tmp = t_1
else if ((x * y) <= 11000000000000.0d0) then
tmp = z * t
else if ((x * y) <= 4.6d+158) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -2.9e+190) {
tmp = x * y;
} else if ((x * y) <= -1.7e+17) {
tmp = t_1;
} else if ((x * y) <= -1.12e-43) {
tmp = z * t;
} else if ((x * y) <= 9.2e-40) {
tmp = t_1;
} else if ((x * y) <= 11000000000000.0) {
tmp = z * t;
} else if ((x * y) <= 4.6e+158) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (x * y) <= -2.9e+190: tmp = x * y elif (x * y) <= -1.7e+17: tmp = t_1 elif (x * y) <= -1.12e-43: tmp = z * t elif (x * y) <= 9.2e-40: tmp = t_1 elif (x * y) <= 11000000000000.0: tmp = z * t elif (x * y) <= 4.6e+158: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -2.9e+190) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.7e+17) tmp = t_1; elseif (Float64(x * y) <= -1.12e-43) tmp = Float64(z * t); elseif (Float64(x * y) <= 9.2e-40) tmp = t_1; elseif (Float64(x * y) <= 11000000000000.0) tmp = Float64(z * t); elseif (Float64(x * y) <= 4.6e+158) 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 = (a * b) + (c * i); tmp = 0.0; if ((x * y) <= -2.9e+190) tmp = x * y; elseif ((x * y) <= -1.7e+17) tmp = t_1; elseif ((x * y) <= -1.12e-43) tmp = z * t; elseif ((x * y) <= 9.2e-40) tmp = t_1; elseif ((x * y) <= 11000000000000.0) tmp = z * t; elseif ((x * y) <= 4.6e+158) 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[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.9e+190], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.7e+17], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.12e-43], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9.2e-40], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 11000000000000.0], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.6e+158], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -2.9 \cdot 10^{+190}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.12 \cdot 10^{-43}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 9.2 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 11000000000000:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 4.6 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.89999999999999989e190 or 4.59999999999999971e158 < (*.f64 x y) Initial program 87.0%
Taylor expanded in x around inf 79.3%
if -2.89999999999999989e190 < (*.f64 x y) < -1.7e17 or -1.12e-43 < (*.f64 x y) < 9.2e-40 or 1.1e13 < (*.f64 x y) < 4.59999999999999971e158Initial program 96.1%
Taylor expanded in x around 0 88.1%
Taylor expanded in t around 0 63.8%
if -1.7e17 < (*.f64 x y) < -1.12e-43 or 9.2e-40 < (*.f64 x y) < 1.1e13Initial program 87.5%
Taylor expanded in z around inf 68.7%
Final simplification67.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t)))
(t_2 (+ (* a b) (* c i)))
(t_3 (+ (* x y) (* a b))))
(if (<= (* x y) -2.8e+66)
t_3
(if (<= (* x y) 3.6e-216)
t_1
(if (<= (* x y) 6.4e-40)
t_2
(if (<= (* x y) 5500000000000.0)
t_1
(if (<= (* x y) 2e+81) t_2 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 = (a * b) + (c * i);
double t_3 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -2.8e+66) {
tmp = t_3;
} else if ((x * y) <= 3.6e-216) {
tmp = t_1;
} else if ((x * y) <= 6.4e-40) {
tmp = t_2;
} else if ((x * y) <= 5500000000000.0) {
tmp = t_1;
} else if ((x * y) <= 2e+81) {
tmp = t_2;
} 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 = (a * b) + (c * i)
t_3 = (x * y) + (a * b)
if ((x * y) <= (-2.8d+66)) then
tmp = t_3
else if ((x * y) <= 3.6d-216) then
tmp = t_1
else if ((x * y) <= 6.4d-40) then
tmp = t_2
else if ((x * y) <= 5500000000000.0d0) then
tmp = t_1
else if ((x * y) <= 2d+81) then
tmp = t_2
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 = (a * b) + (c * i);
double t_3 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -2.8e+66) {
tmp = t_3;
} else if ((x * y) <= 3.6e-216) {
tmp = t_1;
} else if ((x * y) <= 6.4e-40) {
tmp = t_2;
} else if ((x * y) <= 5500000000000.0) {
tmp = t_1;
} else if ((x * y) <= 2e+81) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (a * b) + (c * i) t_3 = (x * y) + (a * b) tmp = 0 if (x * y) <= -2.8e+66: tmp = t_3 elif (x * y) <= 3.6e-216: tmp = t_1 elif (x * y) <= 6.4e-40: tmp = t_2 elif (x * y) <= 5500000000000.0: tmp = t_1 elif (x * y) <= 2e+81: tmp = t_2 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(a * b) + Float64(c * i)) t_3 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(x * y) <= -2.8e+66) tmp = t_3; elseif (Float64(x * y) <= 3.6e-216) tmp = t_1; elseif (Float64(x * y) <= 6.4e-40) tmp = t_2; elseif (Float64(x * y) <= 5500000000000.0) tmp = t_1; elseif (Float64(x * y) <= 2e+81) tmp = t_2; 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 = (a * b) + (c * i); t_3 = (x * y) + (a * b); tmp = 0.0; if ((x * y) <= -2.8e+66) tmp = t_3; elseif ((x * y) <= 3.6e-216) tmp = t_1; elseif ((x * y) <= 6.4e-40) tmp = t_2; elseif ((x * y) <= 5500000000000.0) tmp = t_1; elseif ((x * y) <= 2e+81) tmp = t_2; 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[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.8e+66], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 3.6e-216], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 6.4e-40], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5500000000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+81], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
t_3 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -2.8 \cdot 10^{+66}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq 3.6 \cdot 10^{-216}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{-40}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 5500000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+81}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 x y) < -2.8000000000000001e66 or 1.99999999999999984e81 < (*.f64 x y) Initial program 91.0%
Taylor expanded in c around 0 80.9%
Taylor expanded in t around 0 70.0%
if -2.8000000000000001e66 < (*.f64 x y) < 3.5999999999999999e-216 or 6.40000000000000004e-40 < (*.f64 x y) < 5.5e12Initial program 94.1%
Taylor expanded in c around 0 77.2%
Taylor expanded in x around 0 75.5%
if 3.5999999999999999e-216 < (*.f64 x y) < 6.40000000000000004e-40 or 5.5e12 < (*.f64 x y) < 1.99999999999999984e81Initial program 95.8%
Taylor expanded in x around 0 89.3%
Taylor expanded in t around 0 77.8%
Final simplification74.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.25e+127)
(* c i)
(if (<= (* c i) -2.05e+63)
(* a b)
(if (<= (* c i) -2.05e-8)
(* x y)
(if (<= (* c i) -4.7e-151)
(* a b)
(if (<= (* c i) 5e+152) (* z t) (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.25e+127) {
tmp = c * i;
} else if ((c * i) <= -2.05e+63) {
tmp = a * b;
} else if ((c * i) <= -2.05e-8) {
tmp = x * y;
} else if ((c * i) <= -4.7e-151) {
tmp = a * b;
} else if ((c * i) <= 5e+152) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-1.25d+127)) then
tmp = c * i
else if ((c * i) <= (-2.05d+63)) then
tmp = a * b
else if ((c * i) <= (-2.05d-8)) then
tmp = x * y
else if ((c * i) <= (-4.7d-151)) then
tmp = a * b
else if ((c * i) <= 5d+152) then
tmp = z * t
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.25e+127) {
tmp = c * i;
} else if ((c * i) <= -2.05e+63) {
tmp = a * b;
} else if ((c * i) <= -2.05e-8) {
tmp = x * y;
} else if ((c * i) <= -4.7e-151) {
tmp = a * b;
} else if ((c * i) <= 5e+152) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.25e+127: tmp = c * i elif (c * i) <= -2.05e+63: tmp = a * b elif (c * i) <= -2.05e-8: tmp = x * y elif (c * i) <= -4.7e-151: tmp = a * b elif (c * i) <= 5e+152: tmp = z * t else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1.25e+127) tmp = Float64(c * i); elseif (Float64(c * i) <= -2.05e+63) tmp = Float64(a * b); elseif (Float64(c * i) <= -2.05e-8) tmp = Float64(x * y); elseif (Float64(c * i) <= -4.7e-151) tmp = Float64(a * b); elseif (Float64(c * i) <= 5e+152) tmp = Float64(z * t); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -1.25e+127) tmp = c * i; elseif ((c * i) <= -2.05e+63) tmp = a * b; elseif ((c * i) <= -2.05e-8) tmp = x * y; elseif ((c * i) <= -4.7e-151) tmp = a * b; elseif ((c * i) <= 5e+152) tmp = z * t; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1.25e+127], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.05e+63], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.05e-8], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -4.7e-151], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+152], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.25 \cdot 10^{+127}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -2.05 \cdot 10^{+63}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq -2.05 \cdot 10^{-8}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -4.7 \cdot 10^{-151}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+152}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.2500000000000001e127 or 5e152 < (*.f64 c i) Initial program 84.2%
Taylor expanded in c around inf 66.1%
if -1.2500000000000001e127 < (*.f64 c i) < -2.04999999999999996e63 or -2.05000000000000016e-8 < (*.f64 c i) < -4.70000000000000029e-151Initial program 100.0%
Taylor expanded in a around inf 65.8%
if -2.04999999999999996e63 < (*.f64 c i) < -2.05000000000000016e-8Initial program 85.7%
Taylor expanded in x around inf 51.4%
if -4.70000000000000029e-151 < (*.f64 c i) < 5e152Initial program 97.7%
Taylor expanded in z around inf 43.1%
Final simplification53.6%
(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) (* c i)))))
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) + (c * i);
}
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) + (c * i);
}
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) + (c * i) 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(Float64(x * y) + Float64(c * i)); 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) + (c * i); 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[(N[(x * y), $MachinePrecision] + N[(c * i), $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}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\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 z around 0 17.6%
Taylor expanded in a around 0 47.4%
Final simplification96.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (+ (* x y) (* z t)))))
(if (<= (* x y) -4e+142)
t_1
(if (<= (* x y) 1.2e+77)
(+ (* c i) (+ (* a b) (* z t)))
(if (<= (* x y) 3.4e+217) t_1 (+ (* x y) (* 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) + ((x * y) + (z * t));
double tmp;
if ((x * y) <= -4e+142) {
tmp = t_1;
} else if ((x * y) <= 1.2e+77) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((x * y) <= 3.4e+217) {
tmp = t_1;
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + ((x * y) + (z * t))
if ((x * y) <= (-4d+142)) then
tmp = t_1
else if ((x * y) <= 1.2d+77) then
tmp = (c * i) + ((a * b) + (z * t))
else if ((x * y) <= 3.4d+217) then
tmp = t_1
else
tmp = (x * y) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + ((x * y) + (z * t));
double tmp;
if ((x * y) <= -4e+142) {
tmp = t_1;
} else if ((x * y) <= 1.2e+77) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((x * y) <= 3.4e+217) {
tmp = t_1;
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + ((x * y) + (z * t)) tmp = 0 if (x * y) <= -4e+142: tmp = t_1 elif (x * y) <= 1.2e+77: tmp = (c * i) + ((a * b) + (z * t)) elif (x * y) <= 3.4e+217: tmp = t_1 else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) tmp = 0.0 if (Float64(x * y) <= -4e+142) tmp = t_1; elseif (Float64(x * y) <= 1.2e+77) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); elseif (Float64(x * y) <= 3.4e+217) tmp = t_1; else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + ((x * y) + (z * t)); tmp = 0.0; if ((x * y) <= -4e+142) tmp = t_1; elseif ((x * y) <= 1.2e+77) tmp = (c * i) + ((a * b) + (z * t)); elseif ((x * y) <= 3.4e+217) tmp = t_1; else tmp = (x * y) + (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[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4e+142], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.2e+77], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.4e+217], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+77}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{elif}\;x \cdot y \leq 3.4 \cdot 10^{+217}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -4.0000000000000002e142 or 1.1999999999999999e77 < (*.f64 x y) < 3.3999999999999999e217Initial program 95.4%
Taylor expanded in c around 0 87.6%
if -4.0000000000000002e142 < (*.f64 x y) < 1.1999999999999999e77Initial program 94.7%
Taylor expanded in x around 0 90.5%
if 3.3999999999999999e217 < (*.f64 x y) Initial program 75.0%
Taylor expanded in z around 0 80.0%
Taylor expanded in a around 0 90.0%
Final simplification89.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.12e+195)
(* c i)
(if (<= (* c i) 5.2e+173)
(+ (* a b) (+ (* x y) (* z t)))
(+ (* x y) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.12e+195) {
tmp = c * i;
} else if ((c * i) <= 5.2e+173) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-1.12d+195)) then
tmp = c * i
else if ((c * i) <= 5.2d+173) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (x * y) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.12e+195) {
tmp = c * i;
} else if ((c * i) <= 5.2e+173) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.12e+195: tmp = c * i elif (c * i) <= 5.2e+173: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1.12e+195) tmp = Float64(c * i); elseif (Float64(c * i) <= 5.2e+173) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -1.12e+195) tmp = c * i; elseif ((c * i) <= 5.2e+173) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1.12e+195], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5.2e+173], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.12 \cdot 10^{+195}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 5.2 \cdot 10^{+173}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.12000000000000004e195Initial program 86.2%
Taylor expanded in c around inf 85.0%
if -1.12000000000000004e195 < (*.f64 c i) < 5.1999999999999997e173Initial program 97.4%
Taylor expanded in c around 0 88.7%
if 5.1999999999999997e173 < (*.f64 c i) Initial program 74.2%
Taylor expanded in z around 0 74.6%
Taylor expanded in a around 0 84.2%
Final simplification87.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -3.6e+52)
(+ (* c i) (+ (* x y) (* a b)))
(if (<= (* c i) 5.8e+174)
(+ (* a b) (+ (* x y) (* z t)))
(+ (* x y) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -3.6e+52) {
tmp = (c * i) + ((x * y) + (a * b));
} else if ((c * i) <= 5.8e+174) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-3.6d+52)) then
tmp = (c * i) + ((x * y) + (a * b))
else if ((c * i) <= 5.8d+174) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (x * y) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -3.6e+52) {
tmp = (c * i) + ((x * y) + (a * b));
} else if ((c * i) <= 5.8e+174) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -3.6e+52: tmp = (c * i) + ((x * y) + (a * b)) elif (c * i) <= 5.8e+174: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -3.6e+52) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(a * b))); elseif (Float64(c * i) <= 5.8e+174) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -3.6e+52) tmp = (c * i) + ((x * y) + (a * b)); elseif ((c * i) <= 5.8e+174) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -3.6e+52], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5.8e+174], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.6 \cdot 10^{+52}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + a \cdot b\right)\\
\mathbf{elif}\;c \cdot i \leq 5.8 \cdot 10^{+174}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -3.6e52Initial program 91.9%
Taylor expanded in z around 0 84.3%
if -3.6e52 < (*.f64 c i) < 5.7999999999999999e174Initial program 97.5%
Taylor expanded in c around 0 91.2%
if 5.7999999999999999e174 < (*.f64 c i) Initial program 74.2%
Taylor expanded in z around 0 74.6%
Taylor expanded in a around 0 84.2%
Final simplification88.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -3.9e+126)
(* c i)
(if (<= (* c i) -1.65e-147)
(* a b)
(if (<= (* c i) 1e+151) (* z t) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -3.9e+126) {
tmp = c * i;
} else if ((c * i) <= -1.65e-147) {
tmp = a * b;
} else if ((c * i) <= 1e+151) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-3.9d+126)) then
tmp = c * i
else if ((c * i) <= (-1.65d-147)) then
tmp = a * b
else if ((c * i) <= 1d+151) then
tmp = z * t
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -3.9e+126) {
tmp = c * i;
} else if ((c * i) <= -1.65e-147) {
tmp = a * b;
} else if ((c * i) <= 1e+151) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -3.9e+126: tmp = c * i elif (c * i) <= -1.65e-147: tmp = a * b elif (c * i) <= 1e+151: tmp = z * t else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -3.9e+126) tmp = Float64(c * i); elseif (Float64(c * i) <= -1.65e-147) tmp = Float64(a * b); elseif (Float64(c * i) <= 1e+151) tmp = Float64(z * t); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -3.9e+126) tmp = c * i; elseif ((c * i) <= -1.65e-147) tmp = a * b; elseif ((c * i) <= 1e+151) tmp = z * t; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -3.9e+126], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.65e-147], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e+151], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.9 \cdot 10^{+126}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -1.65 \cdot 10^{-147}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 10^{+151}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -3.89999999999999993e126 or 1.00000000000000002e151 < (*.f64 c i) Initial program 84.2%
Taylor expanded in c around inf 66.1%
if -3.89999999999999993e126 < (*.f64 c i) < -1.64999999999999994e-147Initial program 96.1%
Taylor expanded in a around inf 52.4%
if -1.64999999999999994e-147 < (*.f64 c i) < 1.00000000000000002e151Initial program 97.7%
Taylor expanded in z around inf 43.1%
Final simplification51.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -1.75e+53) (+ (* a b) (* c i)) (if (<= (* c i) 3e+177) (+ (* a b) (* z t)) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.75e+53) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= 3e+177) {
tmp = (a * b) + (z * t);
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-1.75d+53)) then
tmp = (a * b) + (c * i)
else if ((c * i) <= 3d+177) then
tmp = (a * b) + (z * t)
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.75e+53) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= 3e+177) {
tmp = (a * b) + (z * t);
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.75e+53: tmp = (a * b) + (c * i) elif (c * i) <= 3e+177: tmp = (a * b) + (z * t) else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1.75e+53) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(c * i) <= 3e+177) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -1.75e+53) tmp = (a * b) + (c * i); elseif ((c * i) <= 3e+177) tmp = (a * b) + (z * t); else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1.75e+53], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3e+177], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.75 \cdot 10^{+53}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 3 \cdot 10^{+177}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.75000000000000009e53Initial program 91.9%
Taylor expanded in x around 0 78.2%
Taylor expanded in t around 0 67.7%
if -1.75000000000000009e53 < (*.f64 c i) < 3e177Initial program 97.5%
Taylor expanded in c around 0 91.2%
Taylor expanded in x around 0 67.3%
if 3e177 < (*.f64 c i) Initial program 74.2%
Taylor expanded in c around inf 68.3%
Final simplification67.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -7e+128) (not (<= (* c i) 1e+173))) (* 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) <= -7e+128) || !((c * i) <= 1e+173)) {
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) <= (-7d+128)) .or. (.not. ((c * i) <= 1d+173))) 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) <= -7e+128) || !((c * i) <= 1e+173)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -7e+128) or not ((c * i) <= 1e+173): 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) <= -7e+128) || !(Float64(c * i) <= 1e+173)) 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) <= -7e+128) || ~(((c * i) <= 1e+173))) 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], -7e+128], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1e+173]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -7 \cdot 10^{+128} \lor \neg \left(c \cdot i \leq 10^{+173}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -6.99999999999999937e128 or 1e173 < (*.f64 c i) Initial program 83.5%
Taylor expanded in c around inf 68.5%
if -6.99999999999999937e128 < (*.f64 c i) < 1e173Initial program 97.3%
Taylor expanded in a around inf 34.6%
Final simplification44.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 93.4%
Taylor expanded in a around inf 27.4%
Final simplification27.4%
herbie shell --seed 2024080
(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)))