
(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 16 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 (+ (* 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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a * b) + (z * t);
}
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 = (a * b) + (z * t);
}
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 = (a * b) + (z * t) 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(a * b) + Float64(z * t)); 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 = (a * b) + (z * t); 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[(a * b), $MachinePrecision] + N[(z * t), $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}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\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 33.3%
Taylor expanded in t around inf 55.6%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (fma z t (fma c i (fma x y (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(z, t, fma(c, i, fma(x, y, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(z, t, fma(c, i, fma(x, y, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z * t + N[(c * i + N[(x * y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)
\end{array}
Initial program 96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+l+96.5%
fma-def97.6%
associate-+r+97.6%
+-commutative97.6%
fma-def98.4%
fma-def98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b c i) :precision binary64 (fma a b (fma x y (fma c i (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(a, b, fma(x, y, fma(c, i, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(a, b, fma(x, y, fma(c, i, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b + N[(x * y + N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, z \cdot t\right)\right)\right)
\end{array}
Initial program 96.5%
+-commutative96.5%
associate-+l+96.5%
fma-def96.9%
associate-+l+96.9%
fma-def97.7%
+-commutative97.7%
fma-def98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (+ (fma 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 fma(x, y, (z * t)) + ((a * b) + (c * i));
}
function code(x, y, z, t, a, b, c, i) return Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)
\end{array}
Initial program 96.5%
associate-+l+96.5%
fma-def97.2%
Simplified97.2%
Final simplification97.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -2.35e+89)
(* c i)
(if (<= (* c i) -1.3e+19)
(* x y)
(if (<= (* c i) -1.3e-22)
(* a b)
(if (<= (* c i) -1.8e-105)
(* x y)
(if (<= (* c i) 3.7e-209)
(* z t)
(if (<= (* c i) 1.15e+111) (* 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) <= -2.35e+89) {
tmp = c * i;
} else if ((c * i) <= -1.3e+19) {
tmp = x * y;
} else if ((c * i) <= -1.3e-22) {
tmp = a * b;
} else if ((c * i) <= -1.8e-105) {
tmp = x * y;
} else if ((c * i) <= 3.7e-209) {
tmp = z * t;
} else if ((c * i) <= 1.15e+111) {
tmp = x * y;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-2.35d+89)) then
tmp = c * i
else if ((c * i) <= (-1.3d+19)) then
tmp = x * y
else if ((c * i) <= (-1.3d-22)) then
tmp = a * b
else if ((c * i) <= (-1.8d-105)) then
tmp = x * y
else if ((c * i) <= 3.7d-209) then
tmp = z * t
else if ((c * i) <= 1.15d+111) then
tmp = x * y
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -2.35e+89) {
tmp = c * i;
} else if ((c * i) <= -1.3e+19) {
tmp = x * y;
} else if ((c * i) <= -1.3e-22) {
tmp = a * b;
} else if ((c * i) <= -1.8e-105) {
tmp = x * y;
} else if ((c * i) <= 3.7e-209) {
tmp = z * t;
} else if ((c * i) <= 1.15e+111) {
tmp = x * y;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -2.35e+89: tmp = c * i elif (c * i) <= -1.3e+19: tmp = x * y elif (c * i) <= -1.3e-22: tmp = a * b elif (c * i) <= -1.8e-105: tmp = x * y elif (c * i) <= 3.7e-209: tmp = z * t elif (c * i) <= 1.15e+111: tmp = x * y else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -2.35e+89) tmp = Float64(c * i); elseif (Float64(c * i) <= -1.3e+19) tmp = Float64(x * y); elseif (Float64(c * i) <= -1.3e-22) tmp = Float64(a * b); elseif (Float64(c * i) <= -1.8e-105) tmp = Float64(x * y); elseif (Float64(c * i) <= 3.7e-209) tmp = Float64(z * t); elseif (Float64(c * i) <= 1.15e+111) tmp = Float64(x * y); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -2.35e+89) tmp = c * i; elseif ((c * i) <= -1.3e+19) tmp = x * y; elseif ((c * i) <= -1.3e-22) tmp = a * b; elseif ((c * i) <= -1.8e-105) tmp = x * y; elseif ((c * i) <= 3.7e-209) tmp = z * t; elseif ((c * i) <= 1.15e+111) tmp = x * y; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -2.35e+89], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.3e+19], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.3e-22], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.8e-105], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.7e-209], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.15e+111], N[(x * y), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.35 \cdot 10^{+89}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -1.3 \cdot 10^{+19}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -1.3 \cdot 10^{-22}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq -1.8 \cdot 10^{-105}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 3.7 \cdot 10^{-209}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 1.15 \cdot 10^{+111}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.35000000000000011e89 or 1.15000000000000001e111 < (*.f64 c i) Initial program 94.1%
Taylor expanded in c around inf 69.4%
if -2.35000000000000011e89 < (*.f64 c i) < -1.3e19 or -1.3e-22 < (*.f64 c i) < -1.79999999999999982e-105 or 3.6999999999999998e-209 < (*.f64 c i) < 1.15000000000000001e111Initial program 97.7%
Taylor expanded in x around inf 46.4%
if -1.3e19 < (*.f64 c i) < -1.3e-22Initial program 100.0%
Taylor expanded in a around inf 68.6%
if -1.79999999999999982e-105 < (*.f64 c i) < 3.6999999999999998e-209Initial program 97.1%
Taylor expanded in z around inf 48.1%
Final simplification55.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* a b) (* x y))))
(if (<= (* x y) -1.4e+47)
t_2
(if (<= (* x y) -3.1e-107)
t_1
(if (<= (* x y) -2.75e-306)
(+ (* a b) (* z t))
(if (<= (* x y) 2.2e-105)
t_1
(if (<= (* x y) 7e+67) (+ (* a b) (* c i)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -1.4e+47) {
tmp = t_2;
} else if ((x * y) <= -3.1e-107) {
tmp = t_1;
} else if ((x * y) <= -2.75e-306) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 2.2e-105) {
tmp = t_1;
} else if ((x * y) <= 7e+67) {
tmp = (a * b) + (c * i);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (c * i) + (z * t)
t_2 = (a * b) + (x * y)
if ((x * y) <= (-1.4d+47)) then
tmp = t_2
else if ((x * y) <= (-3.1d-107)) then
tmp = t_1
else if ((x * y) <= (-2.75d-306)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 2.2d-105) then
tmp = t_1
else if ((x * y) <= 7d+67) then
tmp = (a * b) + (c * i)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -1.4e+47) {
tmp = t_2;
} else if ((x * y) <= -3.1e-107) {
tmp = t_1;
} else if ((x * y) <= -2.75e-306) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 2.2e-105) {
tmp = t_1;
} else if ((x * y) <= 7e+67) {
tmp = (a * b) + (c * i);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = (a * b) + (x * y) tmp = 0 if (x * y) <= -1.4e+47: tmp = t_2 elif (x * y) <= -3.1e-107: tmp = t_1 elif (x * y) <= -2.75e-306: tmp = (a * b) + (z * t) elif (x * y) <= 2.2e-105: tmp = t_1 elif (x * y) <= 7e+67: tmp = (a * b) + (c * i) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) t_2 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -1.4e+47) tmp = t_2; elseif (Float64(x * y) <= -3.1e-107) tmp = t_1; elseif (Float64(x * y) <= -2.75e-306) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 2.2e-105) tmp = t_1; elseif (Float64(x * y) <= 7e+67) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); t_2 = (a * b) + (x * y); tmp = 0.0; if ((x * y) <= -1.4e+47) tmp = t_2; elseif ((x * y) <= -3.1e-107) tmp = t_1; elseif ((x * y) <= -2.75e-306) tmp = (a * b) + (z * t); elseif ((x * y) <= 2.2e-105) tmp = t_1; elseif ((x * y) <= 7e+67) tmp = (a * b) + (c * i); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.4e+47], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -3.1e-107], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.75e-306], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-105], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 7e+67], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := a \cdot b + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+47}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -3.1 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -2.75 \cdot 10^{-306}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 7 \cdot 10^{+67}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -1.39999999999999994e47 or 7e67 < (*.f64 x y) Initial program 92.7%
Taylor expanded in c around 0 86.1%
Taylor expanded in t around 0 77.9%
if -1.39999999999999994e47 < (*.f64 x y) < -3.10000000000000022e-107 or -2.74999999999999996e-306 < (*.f64 x y) < 2.20000000000000004e-105Initial program 100.0%
Taylor expanded in a around 0 86.0%
Taylor expanded in t around inf 80.4%
if -3.10000000000000022e-107 < (*.f64 x y) < -2.74999999999999996e-306Initial program 95.7%
Taylor expanded in c around 0 85.5%
Taylor expanded in t around inf 85.4%
if 2.20000000000000004e-105 < (*.f64 x y) < 7e67Initial program 96.9%
+-commutative96.9%
associate-+l+96.9%
fma-def97.0%
associate-+l+97.0%
fma-def97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in z around 0 88.2%
Taylor expanded in x around 0 85.1%
Final simplification80.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -1e+259)
(* x y)
(if (<= (* x y) 3.7e-268)
t_1
(if (<= (* x y) 1.45e-192)
(* z t)
(if (<= (* x y) 1.8e+129) 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) <= -1e+259) {
tmp = x * y;
} else if ((x * y) <= 3.7e-268) {
tmp = t_1;
} else if ((x * y) <= 1.45e-192) {
tmp = z * t;
} else if ((x * y) <= 1.8e+129) {
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) <= (-1d+259)) then
tmp = x * y
else if ((x * y) <= 3.7d-268) then
tmp = t_1
else if ((x * y) <= 1.45d-192) then
tmp = z * t
else if ((x * y) <= 1.8d+129) 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) <= -1e+259) {
tmp = x * y;
} else if ((x * y) <= 3.7e-268) {
tmp = t_1;
} else if ((x * y) <= 1.45e-192) {
tmp = z * t;
} else if ((x * y) <= 1.8e+129) {
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) <= -1e+259: tmp = x * y elif (x * y) <= 3.7e-268: tmp = t_1 elif (x * y) <= 1.45e-192: tmp = z * t elif (x * y) <= 1.8e+129: 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) <= -1e+259) tmp = Float64(x * y); elseif (Float64(x * y) <= 3.7e-268) tmp = t_1; elseif (Float64(x * y) <= 1.45e-192) tmp = Float64(z * t); elseif (Float64(x * y) <= 1.8e+129) 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) <= -1e+259) tmp = x * y; elseif ((x * y) <= 3.7e-268) tmp = t_1; elseif ((x * y) <= 1.45e-192) tmp = z * t; elseif ((x * y) <= 1.8e+129) 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], -1e+259], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.7e-268], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.45e-192], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.8e+129], 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 -1 \cdot 10^{+259}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 3.7 \cdot 10^{-268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.45 \cdot 10^{-192}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.8 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -9.999999999999999e258 or 1.8000000000000001e129 < (*.f64 x y) Initial program 94.4%
Taylor expanded in x around inf 83.8%
if -9.999999999999999e258 < (*.f64 x y) < 3.70000000000000018e-268 or 1.45000000000000008e-192 < (*.f64 x y) < 1.8000000000000001e129Initial program 96.9%
+-commutative96.9%
associate-+l+96.9%
fma-def97.4%
associate-+l+97.4%
fma-def97.4%
+-commutative97.4%
fma-def97.9%
Simplified97.9%
Taylor expanded in z around 0 73.4%
Taylor expanded in x around 0 63.2%
if 3.70000000000000018e-268 < (*.f64 x y) < 1.45000000000000008e-192Initial program 100.0%
Taylor expanded in z around inf 78.3%
Final simplification68.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -1.1e+259)
(* x y)
(if (<= (* x y) -2.4e-80)
t_1
(if (<= (* x y) 1.05e-190)
(+ (* a b) (* z t))
(if (<= (* x y) 2.5e+129) 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) <= -1.1e+259) {
tmp = x * y;
} else if ((x * y) <= -2.4e-80) {
tmp = t_1;
} else if ((x * y) <= 1.05e-190) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 2.5e+129) {
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) <= (-1.1d+259)) then
tmp = x * y
else if ((x * y) <= (-2.4d-80)) then
tmp = t_1
else if ((x * y) <= 1.05d-190) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 2.5d+129) 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) <= -1.1e+259) {
tmp = x * y;
} else if ((x * y) <= -2.4e-80) {
tmp = t_1;
} else if ((x * y) <= 1.05e-190) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 2.5e+129) {
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) <= -1.1e+259: tmp = x * y elif (x * y) <= -2.4e-80: tmp = t_1 elif (x * y) <= 1.05e-190: tmp = (a * b) + (z * t) elif (x * y) <= 2.5e+129: 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) <= -1.1e+259) tmp = Float64(x * y); elseif (Float64(x * y) <= -2.4e-80) tmp = t_1; elseif (Float64(x * y) <= 1.05e-190) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 2.5e+129) 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) <= -1.1e+259) tmp = x * y; elseif ((x * y) <= -2.4e-80) tmp = t_1; elseif ((x * y) <= 1.05e-190) tmp = (a * b) + (z * t); elseif ((x * y) <= 2.5e+129) 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], -1.1e+259], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.4e-80], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.05e-190], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.5e+129], 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 -1.1 \cdot 10^{+259}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2.4 \cdot 10^{-80}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.05 \cdot 10^{-190}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.09999999999999996e259 or 2.5000000000000001e129 < (*.f64 x y) Initial program 94.4%
Taylor expanded in x around inf 83.8%
if -1.09999999999999996e259 < (*.f64 x y) < -2.3999999999999999e-80 or 1.04999999999999996e-190 < (*.f64 x y) < 2.5000000000000001e129Initial program 95.6%
+-commutative95.6%
associate-+l+95.6%
fma-def96.5%
associate-+l+96.5%
fma-def96.5%
+-commutative96.5%
fma-def97.4%
Simplified97.4%
Taylor expanded in z around 0 82.6%
Taylor expanded in x around 0 65.8%
if -2.3999999999999999e-80 < (*.f64 x y) < 1.04999999999999996e-190Initial program 98.8%
Taylor expanded in c around 0 70.3%
Taylor expanded in t around inf 69.2%
Final simplification70.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))) (t_2 (+ (* a b) (* x y))))
(if (<= (* x y) -7e+48)
t_2
(if (<= (* x y) -2.3e-84)
t_1
(if (<= (* x y) 3.8e-184)
(+ (* a b) (* z t))
(if (<= (* x y) 1.5e+67) 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) + (c * i);
double t_2 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -7e+48) {
tmp = t_2;
} else if ((x * y) <= -2.3e-84) {
tmp = t_1;
} else if ((x * y) <= 3.8e-184) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 1.5e+67) {
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) + (c * i)
t_2 = (a * b) + (x * y)
if ((x * y) <= (-7d+48)) then
tmp = t_2
else if ((x * y) <= (-2.3d-84)) then
tmp = t_1
else if ((x * y) <= 3.8d-184) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 1.5d+67) 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) + (c * i);
double t_2 = (a * b) + (x * y);
double tmp;
if ((x * y) <= -7e+48) {
tmp = t_2;
} else if ((x * y) <= -2.3e-84) {
tmp = t_1;
} else if ((x * y) <= 3.8e-184) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 1.5e+67) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) t_2 = (a * b) + (x * y) tmp = 0 if (x * y) <= -7e+48: tmp = t_2 elif (x * y) <= -2.3e-84: tmp = t_1 elif (x * y) <= 3.8e-184: tmp = (a * b) + (z * t) elif (x * y) <= 1.5e+67: 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(c * i)) t_2 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -7e+48) tmp = t_2; elseif (Float64(x * y) <= -2.3e-84) tmp = t_1; elseif (Float64(x * y) <= 3.8e-184) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 1.5e+67) 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) + (c * i); t_2 = (a * b) + (x * y); tmp = 0.0; if ((x * y) <= -7e+48) tmp = t_2; elseif ((x * y) <= -2.3e-84) tmp = t_1; elseif ((x * y) <= 3.8e-184) tmp = (a * b) + (z * t); elseif ((x * y) <= 1.5e+67) 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[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7e+48], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.3e-84], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.8e-184], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.5e+67], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
t_2 := a \cdot b + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -7 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq -2.3 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.8 \cdot 10^{-184}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 x y) < -6.9999999999999995e48 or 1.50000000000000005e67 < (*.f64 x y) Initial program 92.7%
Taylor expanded in c around 0 86.0%
Taylor expanded in t around 0 77.7%
if -6.9999999999999995e48 < (*.f64 x y) < -2.29999999999999981e-84 or 3.80000000000000017e-184 < (*.f64 x y) < 1.50000000000000005e67Initial program 98.6%
+-commutative98.6%
associate-+l+98.6%
fma-def98.6%
associate-+l+98.6%
fma-def98.6%
+-commutative98.6%
fma-def98.6%
Simplified98.6%
Taylor expanded in z around 0 84.2%
Taylor expanded in x around 0 76.4%
if -2.29999999999999981e-84 < (*.f64 x y) < 3.80000000000000017e-184Initial program 98.8%
Taylor expanded in c around 0 70.3%
Taylor expanded in t around inf 69.2%
Final simplification74.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2.05e-66)
(+ (* c i) (* x y))
(if (<= (* x y) -1.22e-306)
(+ (* a b) (* z t))
(if (<= (* x y) 4.4e-106)
(+ (* c i) (* z t))
(if (<= (* x y) 2.2e+67) (+ (* a b) (* c i)) (+ (* a b) (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2.05e-66) {
tmp = (c * i) + (x * y);
} else if ((x * y) <= -1.22e-306) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 4.4e-106) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 2.2e+67) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-2.05d-66)) then
tmp = (c * i) + (x * y)
else if ((x * y) <= (-1.22d-306)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 4.4d-106) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 2.2d+67) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2.05e-66) {
tmp = (c * i) + (x * y);
} else if ((x * y) <= -1.22e-306) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 4.4e-106) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 2.2e+67) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2.05e-66: tmp = (c * i) + (x * y) elif (x * y) <= -1.22e-306: tmp = (a * b) + (z * t) elif (x * y) <= 4.4e-106: tmp = (c * i) + (z * t) elif (x * y) <= 2.2e+67: tmp = (a * b) + (c * i) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2.05e-66) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (Float64(x * y) <= -1.22e-306) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 4.4e-106) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 2.2e+67) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -2.05e-66) tmp = (c * i) + (x * y); elseif ((x * y) <= -1.22e-306) tmp = (a * b) + (z * t); elseif ((x * y) <= 4.4e-106) tmp = (c * i) + (z * t); elseif ((x * y) <= 2.2e+67) tmp = (a * b) + (c * i); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2.05e-66], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.22e-306], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.4e-106], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.2e+67], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.05 \cdot 10^{-66}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.22 \cdot 10^{-306}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 4.4 \cdot 10^{-106}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{+67}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.04999999999999999e-66Initial program 95.8%
Taylor expanded in a around 0 83.6%
Taylor expanded in t around 0 68.5%
if -2.04999999999999999e-66 < (*.f64 x y) < -1.21999999999999995e-306Initial program 96.7%
Taylor expanded in c around 0 85.6%
Taylor expanded in t around inf 82.3%
if -1.21999999999999995e-306 < (*.f64 x y) < 4.39999999999999989e-106Initial program 100.0%
Taylor expanded in a around 0 84.5%
Taylor expanded in t around inf 84.5%
if 4.39999999999999989e-106 < (*.f64 x y) < 2.2e67Initial program 96.9%
+-commutative96.9%
associate-+l+96.9%
fma-def97.0%
associate-+l+97.0%
fma-def97.0%
+-commutative97.0%
fma-def97.0%
Simplified97.0%
Taylor expanded in z around 0 88.2%
Taylor expanded in x around 0 85.1%
if 2.2e67 < (*.f64 x y) Initial program 92.3%
Taylor expanded in c around 0 86.7%
Taylor expanded in t around 0 86.5%
Final simplification80.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -3.5e+140) (not (<= (* c i) 4.4e+101))) (+ (* c i) (* x y)) (+ (* 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+140) || !((c * i) <= 4.4e+101)) {
tmp = (c * i) + (x * y);
} 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+140)) .or. (.not. ((c * i) <= 4.4d+101))) then
tmp = (c * i) + (x * y)
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+140) || !((c * i) <= 4.4e+101)) {
tmp = (c * i) + (x * y);
} 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+140) or not ((c * i) <= 4.4e+101): tmp = (c * i) + (x * y) 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+140) || !(Float64(c * i) <= 4.4e+101)) tmp = Float64(Float64(c * i) + Float64(x * y)); 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+140) || ~(((c * i) <= 4.4e+101))) tmp = (c * i) + (x * y); 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+140], N[Not[LessEqual[N[(c * i), $MachinePrecision], 4.4e+101]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(x * y), $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^{+140} \lor \neg \left(c \cdot i \leq 4.4 \cdot 10^{+101}\right):\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -3.49999999999999989e140 or 4.4000000000000001e101 < (*.f64 c i) Initial program 93.3%
Taylor expanded in a around 0 91.9%
Taylor expanded in t around 0 86.9%
if -3.49999999999999989e140 < (*.f64 c i) < 4.4000000000000001e101Initial program 97.8%
Taylor expanded in c around 0 89.4%
Final simplification88.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= (* c i) -3.2e+110) (not (<= (* c i) 5.3e+94)))
(+ (* c i) t_1)
(+ (* a b) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((c * i) <= -3.2e+110) || !((c * i) <= 5.3e+94)) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if (((c * i) <= (-3.2d+110)) .or. (.not. ((c * i) <= 5.3d+94))) then
tmp = (c * i) + t_1
else
tmp = (a * b) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((c * i) <= -3.2e+110) || !((c * i) <= 5.3e+94)) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if ((c * i) <= -3.2e+110) or not ((c * i) <= 5.3e+94): tmp = (c * i) + t_1 else: tmp = (a * b) + t_1 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) <= -3.2e+110) || !(Float64(c * i) <= 5.3e+94)) tmp = Float64(Float64(c * i) + t_1); else tmp = Float64(Float64(a * b) + t_1); 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) <= -3.2e+110) || ~(((c * i) <= 5.3e+94))) tmp = (c * i) + t_1; else tmp = (a * b) + t_1; 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[Or[LessEqual[N[(c * i), $MachinePrecision], -3.2e+110], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5.3e+94]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -3.2 \cdot 10^{+110} \lor \neg \left(c \cdot i \leq 5.3 \cdot 10^{+94}\right):\\
\;\;\;\;c \cdot i + t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + t_1\\
\end{array}
\end{array}
if (*.f64 c i) < -3.19999999999999994e110 or 5.30000000000000003e94 < (*.f64 c i) Initial program 93.9%
Taylor expanded in a around 0 90.5%
if -3.19999999999999994e110 < (*.f64 c i) < 5.30000000000000003e94Initial program 97.7%
Taylor expanded in c around 0 90.1%
Final simplification90.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* x y) -1.5e-12)
(+ (* c i) t_1)
(if (<= (* x y) 1.9e+71)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* a b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((x * y) <= -1.5e-12) {
tmp = (c * i) + t_1;
} else if ((x * y) <= 1.9e+71) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((x * y) <= (-1.5d-12)) then
tmp = (c * i) + t_1
else if ((x * y) <= 1.9d+71) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (a * b) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((x * y) <= -1.5e-12) {
tmp = (c * i) + t_1;
} else if ((x * y) <= 1.9e+71) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (x * y) <= -1.5e-12: tmp = (c * i) + t_1 elif (x * y) <= 1.9e+71: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (a * b) + t_1 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(x * y) <= -1.5e-12) tmp = Float64(Float64(c * i) + t_1); elseif (Float64(x * y) <= 1.9e+71) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(a * b) + t_1); 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 ((x * y) <= -1.5e-12) tmp = (c * i) + t_1; elseif ((x * y) <= 1.9e+71) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (a * b) + t_1; 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[(x * y), $MachinePrecision], -1.5e-12], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.9e+71], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -1.5 \cdot 10^{-12}:\\
\;\;\;\;c \cdot i + t_1\\
\mathbf{elif}\;x \cdot y \leq 1.9 \cdot 10^{+71}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + t_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.5000000000000001e-12Initial program 95.0%
Taylor expanded in a around 0 83.5%
if -1.5000000000000001e-12 < (*.f64 x y) < 1.9e71Initial program 98.6%
Taylor expanded in x around 0 97.2%
if 1.9e71 < (*.f64 x y) Initial program 92.3%
Taylor expanded in c around 0 86.7%
Final simplification91.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -5.5e+117)
(* c i)
(if (<= (* c i) -8e-102)
(* a b)
(if (<= (* c i) 7.5e+107) (* 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) <= -5.5e+117) {
tmp = c * i;
} else if ((c * i) <= -8e-102) {
tmp = a * b;
} else if ((c * i) <= 7.5e+107) {
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) <= (-5.5d+117)) then
tmp = c * i
else if ((c * i) <= (-8d-102)) then
tmp = a * b
else if ((c * i) <= 7.5d+107) 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) <= -5.5e+117) {
tmp = c * i;
} else if ((c * i) <= -8e-102) {
tmp = a * b;
} else if ((c * i) <= 7.5e+107) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -5.5e+117: tmp = c * i elif (c * i) <= -8e-102: tmp = a * b elif (c * i) <= 7.5e+107: 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) <= -5.5e+117) tmp = Float64(c * i); elseif (Float64(c * i) <= -8e-102) tmp = Float64(a * b); elseif (Float64(c * i) <= 7.5e+107) 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) <= -5.5e+117) tmp = c * i; elseif ((c * i) <= -8e-102) tmp = a * b; elseif ((c * i) <= 7.5e+107) 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], -5.5e+117], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -8e-102], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 7.5e+107], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5.5 \cdot 10^{+117}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -8 \cdot 10^{-102}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 7.5 \cdot 10^{+107}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -5.49999999999999965e117 or 7.4999999999999996e107 < (*.f64 c i) Initial program 93.5%
Taylor expanded in c around inf 72.5%
if -5.49999999999999965e117 < (*.f64 c i) < -7.99999999999999946e-102Initial program 98.2%
Taylor expanded in a around inf 38.3%
if -7.99999999999999946e-102 < (*.f64 c i) < 7.4999999999999996e107Initial program 97.5%
Taylor expanded in z around inf 38.7%
Final simplification48.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -3.8e+117) (not (<= (* c i) 7e+107))) (* 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) <= -3.8e+117) || !((c * i) <= 7e+107)) {
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) <= (-3.8d+117)) .or. (.not. ((c * i) <= 7d+107))) 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) <= -3.8e+117) || !((c * i) <= 7e+107)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -3.8e+117) or not ((c * i) <= 7e+107): 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) <= -3.8e+117) || !(Float64(c * i) <= 7e+107)) 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) <= -3.8e+117) || ~(((c * i) <= 7e+107))) 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], -3.8e+117], N[Not[LessEqual[N[(c * i), $MachinePrecision], 7e+107]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+117} \lor \neg \left(c \cdot i \leq 7 \cdot 10^{+107}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -3.8000000000000002e117 or 6.9999999999999995e107 < (*.f64 c i) Initial program 93.5%
Taylor expanded in c around inf 72.5%
if -3.8000000000000002e117 < (*.f64 c i) < 6.9999999999999995e107Initial program 97.7%
Taylor expanded in a around inf 32.0%
Final simplification44.2%
(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 25.1%
Final simplification25.1%
herbie shell --seed 2023310
(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)))