
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 96.1%
+-commutative96.1%
fma-define98.0%
associate-+l+98.0%
fma-define98.4%
fma-define98.8%
Simplified98.8%
(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) -4.7e+165)
t_2
(if (<= (* x y) -3.6e-269)
t_1
(if (<= (* x y) 2e-316)
(+ (* c i) (* z t))
(if (<= (* x y) 2.55e-117)
t_1
(if (<= (* x y) 3.5e+149)
(+ (* a b) (* c i))
(if (<= (* x y) 1.52e+199) 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) <= -4.7e+165) {
tmp = t_2;
} else if ((x * y) <= -3.6e-269) {
tmp = t_1;
} else if ((x * y) <= 2e-316) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 2.55e-117) {
tmp = t_1;
} else if ((x * y) <= 3.5e+149) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.52e+199) {
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) <= (-4.7d+165)) then
tmp = t_2
else if ((x * y) <= (-3.6d-269)) then
tmp = t_1
else if ((x * y) <= 2d-316) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 2.55d-117) then
tmp = t_1
else if ((x * y) <= 3.5d+149) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 1.52d+199) 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) <= -4.7e+165) {
tmp = t_2;
} else if ((x * y) <= -3.6e-269) {
tmp = t_1;
} else if ((x * y) <= 2e-316) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 2.55e-117) {
tmp = t_1;
} else if ((x * y) <= 3.5e+149) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.52e+199) {
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) <= -4.7e+165: tmp = t_2 elif (x * y) <= -3.6e-269: tmp = t_1 elif (x * y) <= 2e-316: tmp = (c * i) + (z * t) elif (x * y) <= 2.55e-117: tmp = t_1 elif (x * y) <= 3.5e+149: tmp = (a * b) + (c * i) elif (x * y) <= 1.52e+199: 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) <= -4.7e+165) tmp = t_2; elseif (Float64(x * y) <= -3.6e-269) tmp = t_1; elseif (Float64(x * y) <= 2e-316) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 2.55e-117) tmp = t_1; elseif (Float64(x * y) <= 3.5e+149) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 1.52e+199) 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) <= -4.7e+165) tmp = t_2; elseif ((x * y) <= -3.6e-269) tmp = t_1; elseif ((x * y) <= 2e-316) tmp = (c * i) + (z * t); elseif ((x * y) <= 2.55e-117) tmp = t_1; elseif ((x * y) <= 3.5e+149) tmp = (a * b) + (c * i); elseif ((x * y) <= 1.52e+199) 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], -4.7e+165], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -3.6e-269], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-316], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.55e-117], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.5e+149], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.52e+199], 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 -4.7 \cdot 10^{+165}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -3.6 \cdot 10^{-269}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-316}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.55 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{+149}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 1.52 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -4.70000000000000016e165 or 1.51999999999999995e199 < (*.f64 x y) Initial program 94.1%
Taylor expanded in a around 0 86.7%
Taylor expanded in t around 0 85.4%
if -4.70000000000000016e165 < (*.f64 x y) < -3.59999999999999998e-269 or 2.000000017e-316 < (*.f64 x y) < 2.5500000000000001e-117 or 3.50000000000000011e149 < (*.f64 x y) < 1.51999999999999995e199Initial program 96.3%
Taylor expanded in z around inf 91.8%
Taylor expanded in z around inf 86.9%
Taylor expanded in c around 0 78.3%
if -3.59999999999999998e-269 < (*.f64 x y) < 2.000000017e-316Initial program 94.9%
Taylor expanded in a around 0 82.6%
Taylor expanded in x around 0 82.6%
if 2.5500000000000001e-117 < (*.f64 x y) < 3.50000000000000011e149Initial program 100.0%
Taylor expanded in z around inf 95.3%
Taylor expanded in z around inf 80.9%
Taylor expanded in t around 0 66.5%
Final simplification78.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* x y) -9.4e+225)
(* x y)
(if (<= (* x y) -4e-271)
t_1
(if (<= (* x y) 2e-316)
(+ (* c i) (* z t))
(if (<= (* x y) 5.1e-111)
t_1
(if (<= (* x y) 7.5e+149)
(+ (* a b) (* c i))
(if (<= (* x y) 2.25e+204) 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) + (z * t);
double tmp;
if ((x * y) <= -9.4e+225) {
tmp = x * y;
} else if ((x * y) <= -4e-271) {
tmp = t_1;
} else if ((x * y) <= 2e-316) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 5.1e-111) {
tmp = t_1;
} else if ((x * y) <= 7.5e+149) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 2.25e+204) {
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) + (z * t)
if ((x * y) <= (-9.4d+225)) then
tmp = x * y
else if ((x * y) <= (-4d-271)) then
tmp = t_1
else if ((x * y) <= 2d-316) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 5.1d-111) then
tmp = t_1
else if ((x * y) <= 7.5d+149) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 2.25d+204) 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) + (z * t);
double tmp;
if ((x * y) <= -9.4e+225) {
tmp = x * y;
} else if ((x * y) <= -4e-271) {
tmp = t_1;
} else if ((x * y) <= 2e-316) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 5.1e-111) {
tmp = t_1;
} else if ((x * y) <= 7.5e+149) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 2.25e+204) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (x * y) <= -9.4e+225: tmp = x * y elif (x * y) <= -4e-271: tmp = t_1 elif (x * y) <= 2e-316: tmp = (c * i) + (z * t) elif (x * y) <= 5.1e-111: tmp = t_1 elif (x * y) <= 7.5e+149: tmp = (a * b) + (c * i) elif (x * y) <= 2.25e+204: 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(z * t)) tmp = 0.0 if (Float64(x * y) <= -9.4e+225) tmp = Float64(x * y); elseif (Float64(x * y) <= -4e-271) tmp = t_1; elseif (Float64(x * y) <= 2e-316) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 5.1e-111) tmp = t_1; elseif (Float64(x * y) <= 7.5e+149) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 2.25e+204) 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) + (z * t); tmp = 0.0; if ((x * y) <= -9.4e+225) tmp = x * y; elseif ((x * y) <= -4e-271) tmp = t_1; elseif ((x * y) <= 2e-316) tmp = (c * i) + (z * t); elseif ((x * y) <= 5.1e-111) tmp = t_1; elseif ((x * y) <= 7.5e+149) tmp = (a * b) + (c * i); elseif ((x * y) <= 2.25e+204) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -9.4e+225], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-271], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-316], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.1e-111], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 7.5e+149], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.25e+204], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -9.4 \cdot 10^{+225}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-271}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-316}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5.1 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 7.5 \cdot 10^{+149}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 2.25 \cdot 10^{+204}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -9.40000000000000008e225 or 2.25000000000000001e204 < (*.f64 x y) Initial program 93.1%
Taylor expanded in x around inf 82.9%
if -9.40000000000000008e225 < (*.f64 x y) < -3.99999999999999985e-271 or 2.000000017e-316 < (*.f64 x y) < 5.10000000000000032e-111 or 7.50000000000000031e149 < (*.f64 x y) < 2.25000000000000001e204Initial program 96.6%
Taylor expanded in z around inf 90.1%
Taylor expanded in z around inf 85.7%
Taylor expanded in c around 0 75.9%
if -3.99999999999999985e-271 < (*.f64 x y) < 2.000000017e-316Initial program 94.9%
Taylor expanded in a around 0 82.6%
Taylor expanded in x around 0 82.6%
if 5.10000000000000032e-111 < (*.f64 x y) < 7.50000000000000031e149Initial program 100.0%
Taylor expanded in z around inf 95.3%
Taylor expanded in z around inf 80.9%
Taylor expanded in t around 0 66.5%
Final simplification77.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -3.8e+136)
(* a b)
(if (<= (* a b) -1.35e-176)
(* x y)
(if (<= (* a b) 2.2e-149)
(* z t)
(if (<= (* a b) 4.4e-64)
(* x y)
(if (<= (* a b) 1.45e+140) (* z t) (* 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.8e+136) {
tmp = a * b;
} else if ((a * b) <= -1.35e-176) {
tmp = x * y;
} else if ((a * b) <= 2.2e-149) {
tmp = z * t;
} else if ((a * b) <= 4.4e-64) {
tmp = x * y;
} else if ((a * b) <= 1.45e+140) {
tmp = z * t;
} 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.8d+136)) then
tmp = a * b
else if ((a * b) <= (-1.35d-176)) then
tmp = x * y
else if ((a * b) <= 2.2d-149) then
tmp = z * t
else if ((a * b) <= 4.4d-64) then
tmp = x * y
else if ((a * b) <= 1.45d+140) then
tmp = z * t
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.8e+136) {
tmp = a * b;
} else if ((a * b) <= -1.35e-176) {
tmp = x * y;
} else if ((a * b) <= 2.2e-149) {
tmp = z * t;
} else if ((a * b) <= 4.4e-64) {
tmp = x * y;
} else if ((a * b) <= 1.45e+140) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -3.8e+136: tmp = a * b elif (a * b) <= -1.35e-176: tmp = x * y elif (a * b) <= 2.2e-149: tmp = z * t elif (a * b) <= 4.4e-64: tmp = x * y elif (a * b) <= 1.45e+140: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -3.8e+136) tmp = Float64(a * b); elseif (Float64(a * b) <= -1.35e-176) tmp = Float64(x * y); elseif (Float64(a * b) <= 2.2e-149) tmp = Float64(z * t); elseif (Float64(a * b) <= 4.4e-64) tmp = Float64(x * y); elseif (Float64(a * b) <= 1.45e+140) tmp = Float64(z * t); 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.8e+136) tmp = a * b; elseif ((a * b) <= -1.35e-176) tmp = x * y; elseif ((a * b) <= 2.2e-149) tmp = z * t; elseif ((a * b) <= 4.4e-64) tmp = x * y; elseif ((a * b) <= 1.45e+140) tmp = z * t; 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.8e+136], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.35e-176], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.2e-149], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.4e-64], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.45e+140], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -3.8 \cdot 10^{+136}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.35 \cdot 10^{-176}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 2.2 \cdot 10^{-149}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 4.4 \cdot 10^{-64}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.45 \cdot 10^{+140}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -3.80000000000000015e136 or 1.4499999999999999e140 < (*.f64 a b) Initial program 92.3%
Taylor expanded in a around inf 74.0%
if -3.80000000000000015e136 < (*.f64 a b) < -1.3499999999999999e-176 or 2.1999999999999998e-149 < (*.f64 a b) < 4.3999999999999999e-64Initial program 98.5%
Taylor expanded in x around inf 50.8%
if -1.3499999999999999e-176 < (*.f64 a b) < 2.1999999999999998e-149 or 4.3999999999999999e-64 < (*.f64 a b) < 1.4499999999999999e140Initial program 97.3%
Taylor expanded in z around inf 45.8%
Final simplification55.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -6e+225)
(* x y)
(if (<= (* x y) -1e-108)
t_1
(if (<= (* x y) -4.5e-169)
(* z t)
(if (<= (* x y) 2.8e+131) 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) <= -6e+225) {
tmp = x * y;
} else if ((x * y) <= -1e-108) {
tmp = t_1;
} else if ((x * y) <= -4.5e-169) {
tmp = z * t;
} else if ((x * y) <= 2.8e+131) {
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) <= (-6d+225)) then
tmp = x * y
else if ((x * y) <= (-1d-108)) then
tmp = t_1
else if ((x * y) <= (-4.5d-169)) then
tmp = z * t
else if ((x * y) <= 2.8d+131) 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) <= -6e+225) {
tmp = x * y;
} else if ((x * y) <= -1e-108) {
tmp = t_1;
} else if ((x * y) <= -4.5e-169) {
tmp = z * t;
} else if ((x * y) <= 2.8e+131) {
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) <= -6e+225: tmp = x * y elif (x * y) <= -1e-108: tmp = t_1 elif (x * y) <= -4.5e-169: tmp = z * t elif (x * y) <= 2.8e+131: 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) <= -6e+225) tmp = Float64(x * y); elseif (Float64(x * y) <= -1e-108) tmp = t_1; elseif (Float64(x * y) <= -4.5e-169) tmp = Float64(z * t); elseif (Float64(x * y) <= 2.8e+131) 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) <= -6e+225) tmp = x * y; elseif ((x * y) <= -1e-108) tmp = t_1; elseif ((x * y) <= -4.5e-169) tmp = z * t; elseif ((x * y) <= 2.8e+131) 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], -6e+225], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-108], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -4.5e-169], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.8e+131], 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 -6 \cdot 10^{+225}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-169}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -6.000000000000001e225 or 2.8000000000000001e131 < (*.f64 x y) Initial program 92.8%
Taylor expanded in x around inf 74.3%
if -6.000000000000001e225 < (*.f64 x y) < -1.00000000000000004e-108 or -4.4999999999999999e-169 < (*.f64 x y) < 2.8000000000000001e131Initial program 97.7%
Taylor expanded in z around inf 92.8%
Taylor expanded in z around inf 88.1%
Taylor expanded in t around 0 62.4%
if -1.00000000000000004e-108 < (*.f64 x y) < -4.4999999999999999e-169Initial program 90.9%
Taylor expanded in z around inf 82.3%
Final simplification66.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 (* z (+ t (/ (* x y) z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (t + ((x * y) / z));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (t + ((x * y) / z));
}
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 = z * (t + ((x * y) / z)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(t + Float64(Float64(x * y) / z))); 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 = z * (t + ((x * y) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \frac{x \cdot y}{z}\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 z around inf 10.0%
Taylor expanded in a around 0 20.0%
Taylor expanded in c around 0 50.4%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.65e+24)
(* a b)
(if (<= (* a b) 1.25e-8)
(* z t)
(if (<= (* a b) 2.5e+35)
(* c i)
(if (<= (* a b) 1.06e+143) (* z t) (* 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.65e+24) {
tmp = a * b;
} else if ((a * b) <= 1.25e-8) {
tmp = z * t;
} else if ((a * b) <= 2.5e+35) {
tmp = c * i;
} else if ((a * b) <= 1.06e+143) {
tmp = z * t;
} 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.65d+24)) then
tmp = a * b
else if ((a * b) <= 1.25d-8) then
tmp = z * t
else if ((a * b) <= 2.5d+35) then
tmp = c * i
else if ((a * b) <= 1.06d+143) then
tmp = z * t
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.65e+24) {
tmp = a * b;
} else if ((a * b) <= 1.25e-8) {
tmp = z * t;
} else if ((a * b) <= 2.5e+35) {
tmp = c * i;
} else if ((a * b) <= 1.06e+143) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.65e+24: tmp = a * b elif (a * b) <= 1.25e-8: tmp = z * t elif (a * b) <= 2.5e+35: tmp = c * i elif (a * b) <= 1.06e+143: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.65e+24) tmp = Float64(a * b); elseif (Float64(a * b) <= 1.25e-8) tmp = Float64(z * t); elseif (Float64(a * b) <= 2.5e+35) tmp = Float64(c * i); elseif (Float64(a * b) <= 1.06e+143) tmp = Float64(z * t); 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.65e+24) tmp = a * b; elseif ((a * b) <= 1.25e-8) tmp = z * t; elseif ((a * b) <= 2.5e+35) tmp = c * i; elseif ((a * b) <= 1.06e+143) tmp = z * t; 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.65e+24], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.25e-8], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.5e+35], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.06e+143], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.65 \cdot 10^{+24}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 1.25 \cdot 10^{-8}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.5 \cdot 10^{+35}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.06 \cdot 10^{+143}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.6499999999999999e24 or 1.06e143 < (*.f64 a b) Initial program 93.7%
Taylor expanded in a around inf 64.5%
if -1.6499999999999999e24 < (*.f64 a b) < 1.2499999999999999e-8 or 2.50000000000000011e35 < (*.f64 a b) < 1.06e143Initial program 97.3%
Taylor expanded in z around inf 40.8%
if 1.2499999999999999e-8 < (*.f64 a b) < 2.50000000000000011e35Initial program 100.0%
Taylor expanded in c around inf 64.8%
Final simplification50.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -4.2e+140)
(+ (* a b) (* z t))
(if (<= (* a b) 4.5e-18)
(+ (* x y) (* z t))
(if (<= (* a b) 7.4e+140) (+ (* c i) (* z t)) (+ (* a b) (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4.2e+140) {
tmp = (a * b) + (z * t);
} else if ((a * b) <= 4.5e-18) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 7.4e+140) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-4.2d+140)) then
tmp = (a * b) + (z * t)
else if ((a * b) <= 4.5d-18) then
tmp = (x * y) + (z * t)
else if ((a * b) <= 7.4d+140) then
tmp = (c * i) + (z * t)
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4.2e+140) {
tmp = (a * b) + (z * t);
} else if ((a * b) <= 4.5e-18) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 7.4e+140) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -4.2e+140: tmp = (a * b) + (z * t) elif (a * b) <= 4.5e-18: tmp = (x * y) + (z * t) elif (a * b) <= 7.4e+140: tmp = (c * i) + (z * t) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -4.2e+140) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(a * b) <= 4.5e-18) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(a * b) <= 7.4e+140) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -4.2e+140) tmp = (a * b) + (z * t); elseif ((a * b) <= 4.5e-18) tmp = (x * y) + (z * t); elseif ((a * b) <= 7.4e+140) tmp = (c * i) + (z * t); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -4.2e+140], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.5e-18], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 7.4e+140], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4.2 \cdot 10^{+140}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 4.5 \cdot 10^{-18}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 7.4 \cdot 10^{+140}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -4.2000000000000004e140Initial program 90.6%
Taylor expanded in z around inf 84.6%
Taylor expanded in z around inf 90.6%
Taylor expanded in c around 0 85.1%
if -4.2000000000000004e140 < (*.f64 a b) < 4.49999999999999994e-18Initial program 97.9%
Taylor expanded in a around 0 90.6%
associate-+l+90.6%
+-commutative90.6%
fma-define90.6%
*-commutative90.6%
Applied egg-rr90.6%
Taylor expanded in c around 0 73.0%
if 4.49999999999999994e-18 < (*.f64 a b) < 7.40000000000000006e140Initial program 96.8%
Taylor expanded in a around 0 90.9%
Taylor expanded in x around 0 70.1%
if 7.40000000000000006e140 < (*.f64 a b) Initial program 93.4%
Taylor expanded in z around inf 86.9%
Taylor expanded in z around inf 85.0%
Taylor expanded in t around 0 87.1%
Final simplification76.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2.9e-16) (not (<= (* x y) 6e+59))) (+ (* a b) (+ (* x y) (* z t))) (+ (* c i) (+ (* a b) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2.9e-16) || !((x * y) <= 6e+59)) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-2.9d-16)) .or. (.not. ((x * y) <= 6d+59))) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -2.9e-16) || !((x * y) <= 6e+59)) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -2.9e-16) or not ((x * y) <= 6e+59): tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -2.9e-16) || !(Float64(x * y) <= 6e+59)) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -2.9e-16) || ~(((x * y) <= 6e+59))) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2.9e-16], N[Not[LessEqual[N[(x * y), $MachinePrecision], 6e+59]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.9 \cdot 10^{-16} \lor \neg \left(x \cdot y \leq 6 \cdot 10^{+59}\right):\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -2.8999999999999998e-16 or 6.0000000000000001e59 < (*.f64 x y) Initial program 95.5%
Taylor expanded in c around 0 88.5%
if -2.8999999999999998e-16 < (*.f64 x y) < 6.0000000000000001e59Initial program 96.5%
Taylor expanded in x around 0 92.8%
Final simplification90.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* c i) -2.7e+119)
(+ (* c i) t_1)
(if (<= (* c i) 1.22e-52)
(+ (* a b) t_1)
(+ (* c i) (+ (* a b) (* z t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -2.7e+119) {
tmp = (c * i) + t_1;
} else if ((c * i) <= 1.22e-52) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((c * i) <= (-2.7d+119)) then
tmp = (c * i) + t_1
else if ((c * i) <= 1.22d-52) then
tmp = (a * b) + t_1
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((c * i) <= -2.7e+119) {
tmp = (c * i) + t_1;
} else if ((c * i) <= 1.22e-52) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (c * i) <= -2.7e+119: tmp = (c * i) + t_1 elif (c * i) <= 1.22e-52: tmp = (a * b) + t_1 else: tmp = (c * i) + ((a * b) + (z * t)) 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(c * i) <= -2.7e+119) tmp = Float64(Float64(c * i) + t_1); elseif (Float64(c * i) <= 1.22e-52) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((c * i) <= -2.7e+119) tmp = (c * i) + t_1; elseif ((c * i) <= 1.22e-52) tmp = (a * b) + t_1; else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = 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[(c * i), $MachinePrecision], -2.7e+119], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.22e-52], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -2.7 \cdot 10^{+119}:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{elif}\;c \cdot i \leq 1.22 \cdot 10^{-52}:\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -2.6999999999999998e119Initial program 92.5%
Taylor expanded in a around 0 85.3%
if -2.6999999999999998e119 < (*.f64 c i) < 1.22e-52Initial program 98.0%
Taylor expanded in c around 0 95.2%
if 1.22e-52 < (*.f64 c i) Initial program 93.5%
Taylor expanded in x around 0 84.3%
Final simplification91.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.8e+119)
(+ (* x y) (* c i))
(if (<= (* c i) 9.2e+194)
(+ (* a b) (+ (* 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) {
double tmp;
if ((c * i) <= -1.8e+119) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 9.2e+194) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-1.8d+119)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= 9.2d+194) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.8e+119) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 9.2e+194) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.8e+119: tmp = (x * y) + (c * i) elif (c * i) <= 9.2e+194: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1.8e+119) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= 9.2e+194) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -1.8e+119) tmp = (x * y) + (c * i); elseif ((c * i) <= 9.2e+194) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1.8e+119], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 9.2e+194], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.8 \cdot 10^{+119}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 9.2 \cdot 10^{+194}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.80000000000000001e119Initial program 92.5%
Taylor expanded in a around 0 85.3%
Taylor expanded in t around 0 80.6%
if -1.80000000000000001e119 < (*.f64 c i) < 9.2000000000000002e194Initial program 98.4%
Taylor expanded in c around 0 92.4%
if 9.2000000000000002e194 < (*.f64 c i) Initial program 86.6%
Taylor expanded in z around inf 83.3%
Taylor expanded in z around inf 80.3%
Taylor expanded in t around 0 83.7%
Final simplification89.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -1.45e+56) (not (<= (* c i) 580000000000.0))) (+ (* a b) (* c i)) (+ (* a b) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1.45e+56) || !((c * i) <= 580000000000.0)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-1.45d+56)) .or. (.not. ((c * i) <= 580000000000.0d0))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -1.45e+56) || !((c * i) <= 580000000000.0)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -1.45e+56) or not ((c * i) <= 580000000000.0): tmp = (a * b) + (c * i) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -1.45e+56) || !(Float64(c * i) <= 580000000000.0)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -1.45e+56) || ~(((c * i) <= 580000000000.0))) tmp = (a * b) + (c * i); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1.45e+56], N[Not[LessEqual[N[(c * i), $MachinePrecision], 580000000000.0]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.45 \cdot 10^{+56} \lor \neg \left(c \cdot i \leq 580000000000\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -1.45000000000000004e56 or 5.8e11 < (*.f64 c i) Initial program 93.1%
Taylor expanded in z around inf 87.5%
Taylor expanded in z around inf 78.1%
Taylor expanded in t around 0 72.5%
if -1.45000000000000004e56 < (*.f64 c i) < 5.8e11Initial program 98.0%
Taylor expanded in z around inf 88.2%
Taylor expanded in z around inf 68.3%
Taylor expanded in c around 0 66.1%
Final simplification68.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -2.6e+22) (not (<= (* a b) 1.2e+126))) (* 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) <= -2.6e+22) || !((a * b) <= 1.2e+126)) {
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) <= (-2.6d+22)) .or. (.not. ((a * b) <= 1.2d+126))) 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) <= -2.6e+22) || !((a * b) <= 1.2e+126)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -2.6e+22) or not ((a * b) <= 1.2e+126): 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) <= -2.6e+22) || !(Float64(a * b) <= 1.2e+126)) 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) <= -2.6e+22) || ~(((a * b) <= 1.2e+126))) 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], -2.6e+22], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.2e+126]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.6 \cdot 10^{+22} \lor \neg \left(a \cdot b \leq 1.2 \cdot 10^{+126}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -2.6e22 or 1.20000000000000006e126 < (*.f64 a b) Initial program 93.8%
Taylor expanded in a around inf 64.2%
if -2.6e22 < (*.f64 a b) < 1.20000000000000006e126Initial program 97.5%
Taylor expanded in c around inf 30.9%
Final simplification43.5%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.1%
Taylor expanded in a around inf 28.6%
herbie shell --seed 2024096
(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)))