
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))) INFINITY) (+ (* c i) (fma y x (fma z t (* a b)))) (fma y x (* 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) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = (c * i) + fma(y, x, fma(z, t, (a * b)));
} else {
tmp = fma(y, x, (a * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) <= Inf) tmp = Float64(Float64(c * i) + fma(y, x, fma(z, t, Float64(a * b)))); else tmp = fma(y, x, Float64(a * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(c * i), $MachinePrecision] + N[(y * x + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) \leq \infty:\\
\;\;\;\;c \cdot i + \mathsf{fma}\left(y, x, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, a \cdot b\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%
associate-+l+100.0%
fma-udef100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in z around 0 18.2%
+-commutative18.2%
*-commutative18.2%
fma-def27.3%
Applied egg-rr27.3%
Taylor expanded in c around 0 73.0%
+-commutative18.2%
*-commutative18.2%
fma-def27.3%
Applied egg-rr82.1%
Final simplification99.2%
(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 95.7%
+-commutative95.7%
fma-def98.0%
associate-+l+98.0%
fma-def98.4%
fma-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (fma y x (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(y, x, (a * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(y, x, Float64(a * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(y * x + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, a \cdot b\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 0 18.2%
+-commutative18.2%
*-commutative18.2%
fma-def27.3%
Applied egg-rr27.3%
Taylor expanded in c around 0 73.0%
+-commutative18.2%
*-commutative18.2%
fma-def27.3%
Applied egg-rr82.1%
Final simplification99.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y)))
(t_2 (+ (* c i) (* z t)))
(t_3 (+ (* a b) (* c i))))
(if (<= (* x y) -1.55e+185)
t_1
(if (<= (* x y) -2.3e+156)
t_2
(if (<= (* x y) -5e+19)
t_1
(if (<= (* x y) -7.8e-164)
t_2
(if (<= (* x y) -1.45e-296)
t_3
(if (<= (* x y) 240.0)
t_2
(if (<= (* x y) 1.9e+97) t_3 t_1)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double t_2 = (c * i) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.55e+185) {
tmp = t_1;
} else if ((x * y) <= -2.3e+156) {
tmp = t_2;
} else if ((x * y) <= -5e+19) {
tmp = t_1;
} else if ((x * y) <= -7.8e-164) {
tmp = t_2;
} else if ((x * y) <= -1.45e-296) {
tmp = t_3;
} else if ((x * y) <= 240.0) {
tmp = t_2;
} else if ((x * y) <= 1.9e+97) {
tmp = t_3;
} else {
tmp = 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (a * b) + (x * y)
t_2 = (c * i) + (z * t)
t_3 = (a * b) + (c * i)
if ((x * y) <= (-1.55d+185)) then
tmp = t_1
else if ((x * y) <= (-2.3d+156)) then
tmp = t_2
else if ((x * y) <= (-5d+19)) then
tmp = t_1
else if ((x * y) <= (-7.8d-164)) then
tmp = t_2
else if ((x * y) <= (-1.45d-296)) then
tmp = t_3
else if ((x * y) <= 240.0d0) then
tmp = t_2
else if ((x * y) <= 1.9d+97) then
tmp = t_3
else
tmp = 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 = (a * b) + (x * y);
double t_2 = (c * i) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.55e+185) {
tmp = t_1;
} else if ((x * y) <= -2.3e+156) {
tmp = t_2;
} else if ((x * y) <= -5e+19) {
tmp = t_1;
} else if ((x * y) <= -7.8e-164) {
tmp = t_2;
} else if ((x * y) <= -1.45e-296) {
tmp = t_3;
} else if ((x * y) <= 240.0) {
tmp = t_2;
} else if ((x * y) <= 1.9e+97) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) t_2 = (c * i) + (z * t) t_3 = (a * b) + (c * i) tmp = 0 if (x * y) <= -1.55e+185: tmp = t_1 elif (x * y) <= -2.3e+156: tmp = t_2 elif (x * y) <= -5e+19: tmp = t_1 elif (x * y) <= -7.8e-164: tmp = t_2 elif (x * y) <= -1.45e-296: tmp = t_3 elif (x * y) <= 240.0: tmp = t_2 elif (x * y) <= 1.9e+97: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) t_2 = Float64(Float64(c * i) + Float64(z * t)) t_3 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -1.55e+185) tmp = t_1; elseif (Float64(x * y) <= -2.3e+156) tmp = t_2; elseif (Float64(x * y) <= -5e+19) tmp = t_1; elseif (Float64(x * y) <= -7.8e-164) tmp = t_2; elseif (Float64(x * y) <= -1.45e-296) tmp = t_3; elseif (Float64(x * y) <= 240.0) tmp = t_2; elseif (Float64(x * y) <= 1.9e+97) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); t_2 = (c * i) + (z * t); t_3 = (a * b) + (c * i); tmp = 0.0; if ((x * y) <= -1.55e+185) tmp = t_1; elseif ((x * y) <= -2.3e+156) tmp = t_2; elseif ((x * y) <= -5e+19) tmp = t_1; elseif ((x * y) <= -7.8e-164) tmp = t_2; elseif ((x * y) <= -1.45e-296) tmp = t_3; elseif ((x * y) <= 240.0) tmp = t_2; elseif ((x * y) <= 1.9e+97) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.55e+185], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.3e+156], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5e+19], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -7.8e-164], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1.45e-296], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 240.0], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.9e+97], t$95$3, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := c \cdot i + z \cdot t\\
t_3 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.55 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -2.3 \cdot 10^{+156}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -7.8 \cdot 10^{-164}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -1.45 \cdot 10^{-296}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot y \leq 240:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 1.9 \cdot 10^{+97}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.55e185 or -2.2999999999999999e156 < (*.f64 x y) < -5e19 or 1.90000000000000018e97 < (*.f64 x y) Initial program 93.2%
Taylor expanded in z around 0 84.8%
+-commutative84.8%
*-commutative84.8%
fma-def85.9%
Applied egg-rr85.9%
Taylor expanded in c around 0 83.9%
if -1.55e185 < (*.f64 x y) < -2.2999999999999999e156 or -5e19 < (*.f64 x y) < -7.7999999999999997e-164 or -1.44999999999999991e-296 < (*.f64 x y) < 240Initial program 96.9%
associate-+l+96.9%
fma-udef96.9%
*-commutative96.9%
fma-def96.9%
Applied egg-rr96.9%
Taylor expanded in a around 0 76.4%
Taylor expanded in x around 0 72.5%
if -7.7999999999999997e-164 < (*.f64 x y) < -1.44999999999999991e-296 or 240 < (*.f64 x y) < 1.90000000000000018e97Initial program 97.4%
Taylor expanded in z around 0 91.9%
Taylor expanded in x around 0 84.5%
Final simplification78.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -1.55e+185)
(* x y)
(if (<= (* x y) -1.75e+149)
t_1
(if (<= (* x y) -5.8e+128)
(* x y)
(if (<= (* x y) -2.2e-118)
t_1
(if (<= (* x y) -1.18e-147)
(* z t)
(if (<= (* x y) 4.4e+158) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.55e+185) {
tmp = x * y;
} else if ((x * y) <= -1.75e+149) {
tmp = t_1;
} else if ((x * y) <= -5.8e+128) {
tmp = x * y;
} else if ((x * y) <= -2.2e-118) {
tmp = t_1;
} else if ((x * y) <= -1.18e-147) {
tmp = z * t;
} else if ((x * y) <= 4.4e+158) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((x * y) <= (-1.55d+185)) then
tmp = x * y
else if ((x * y) <= (-1.75d+149)) then
tmp = t_1
else if ((x * y) <= (-5.8d+128)) then
tmp = x * y
else if ((x * y) <= (-2.2d-118)) then
tmp = t_1
else if ((x * y) <= (-1.18d-147)) then
tmp = z * t
else if ((x * y) <= 4.4d+158) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -1.55e+185) {
tmp = x * y;
} else if ((x * y) <= -1.75e+149) {
tmp = t_1;
} else if ((x * y) <= -5.8e+128) {
tmp = x * y;
} else if ((x * y) <= -2.2e-118) {
tmp = t_1;
} else if ((x * y) <= -1.18e-147) {
tmp = z * t;
} else if ((x * y) <= 4.4e+158) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (x * y) <= -1.55e+185: tmp = x * y elif (x * y) <= -1.75e+149: tmp = t_1 elif (x * y) <= -5.8e+128: tmp = x * y elif (x * y) <= -2.2e-118: tmp = t_1 elif (x * y) <= -1.18e-147: tmp = z * t elif (x * y) <= 4.4e+158: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -1.55e+185) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.75e+149) tmp = t_1; elseif (Float64(x * y) <= -5.8e+128) tmp = Float64(x * y); elseif (Float64(x * y) <= -2.2e-118) tmp = t_1; elseif (Float64(x * y) <= -1.18e-147) tmp = Float64(z * t); elseif (Float64(x * y) <= 4.4e+158) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); tmp = 0.0; if ((x * y) <= -1.55e+185) tmp = x * y; elseif ((x * y) <= -1.75e+149) tmp = t_1; elseif ((x * y) <= -5.8e+128) tmp = x * y; elseif ((x * y) <= -2.2e-118) tmp = t_1; elseif ((x * y) <= -1.18e-147) tmp = z * t; elseif ((x * y) <= 4.4e+158) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.55e+185], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.75e+149], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5.8e+128], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.2e-118], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.18e-147], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.4e+158], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.55 \cdot 10^{+185}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.75 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -5.8 \cdot 10^{+128}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2.2 \cdot 10^{-118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1.18 \cdot 10^{-147}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 4.4 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.55e185 or -1.75000000000000006e149 < (*.f64 x y) < -5.8000000000000001e128 or 4.4000000000000002e158 < (*.f64 x y) Initial program 90.3%
Taylor expanded in x around inf 82.7%
if -1.55e185 < (*.f64 x y) < -1.75000000000000006e149 or -5.8000000000000001e128 < (*.f64 x y) < -2.19999999999999984e-118 or -1.18000000000000003e-147 < (*.f64 x y) < 4.4000000000000002e158Initial program 97.3%
Taylor expanded in z around 0 73.1%
Taylor expanded in x around 0 65.1%
if -2.19999999999999984e-118 < (*.f64 x y) < -1.18000000000000003e-147Initial program 100.0%
Taylor expanded in z around inf 97.9%
Final simplification70.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= (* a b) -1.95e+98)
t_1
(if (<= (* a b) 9.5e-253)
(+ (* x y) (* c i))
(if (or (<= (* a b) 4.2e+32)
(and (not (<= (* a b) 1.9e+146)) (<= (* a b) 5.2e+172)))
(+ (* c i) (* z t))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double tmp;
if ((a * b) <= -1.95e+98) {
tmp = t_1;
} else if ((a * b) <= 9.5e-253) {
tmp = (x * y) + (c * i);
} else if (((a * b) <= 4.2e+32) || (!((a * b) <= 1.9e+146) && ((a * b) <= 5.2e+172))) {
tmp = (c * i) + (z * t);
} else {
tmp = 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 = (a * b) + (x * y)
if ((a * b) <= (-1.95d+98)) then
tmp = t_1
else if ((a * b) <= 9.5d-253) then
tmp = (x * y) + (c * i)
else if (((a * b) <= 4.2d+32) .or. (.not. ((a * b) <= 1.9d+146)) .and. ((a * b) <= 5.2d+172)) then
tmp = (c * i) + (z * t)
else
tmp = 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 = (a * b) + (x * y);
double tmp;
if ((a * b) <= -1.95e+98) {
tmp = t_1;
} else if ((a * b) <= 9.5e-253) {
tmp = (x * y) + (c * i);
} else if (((a * b) <= 4.2e+32) || (!((a * b) <= 1.9e+146) && ((a * b) <= 5.2e+172))) {
tmp = (c * i) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) tmp = 0 if (a * b) <= -1.95e+98: tmp = t_1 elif (a * b) <= 9.5e-253: tmp = (x * y) + (c * i) elif ((a * b) <= 4.2e+32) or (not ((a * b) <= 1.9e+146) and ((a * b) <= 5.2e+172)): tmp = (c * i) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(a * b) <= -1.95e+98) tmp = t_1; elseif (Float64(a * b) <= 9.5e-253) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif ((Float64(a * b) <= 4.2e+32) || (!(Float64(a * b) <= 1.9e+146) && (Float64(a * b) <= 5.2e+172))) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); tmp = 0.0; if ((a * b) <= -1.95e+98) tmp = t_1; elseif ((a * b) <= 9.5e-253) tmp = (x * y) + (c * i); elseif (((a * b) <= 4.2e+32) || (~(((a * b) <= 1.9e+146)) && ((a * b) <= 5.2e+172))) tmp = (c * i) + (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.95e+98], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 9.5e-253], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], 4.2e+32], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.9e+146]], $MachinePrecision], LessEqual[N[(a * b), $MachinePrecision], 5.2e+172]]], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -1.95 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 9.5 \cdot 10^{-253}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 4.2 \cdot 10^{+32} \lor \neg \left(a \cdot b \leq 1.9 \cdot 10^{+146}\right) \land a \cdot b \leq 5.2 \cdot 10^{+172}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.95e98 or 4.2000000000000001e32 < (*.f64 a b) < 1.8999999999999999e146 or 5.2e172 < (*.f64 a b) Initial program 91.4%
Taylor expanded in z around 0 82.0%
+-commutative82.0%
*-commutative82.0%
fma-def83.1%
Applied egg-rr83.1%
Taylor expanded in c around 0 81.0%
if -1.95e98 < (*.f64 a b) < 9.5e-253Initial program 97.2%
Taylor expanded in z around 0 76.1%
Taylor expanded in a around 0 71.9%
if 9.5e-253 < (*.f64 a b) < 4.2000000000000001e32 or 1.8999999999999999e146 < (*.f64 a b) < 5.2e172Initial program 100.0%
associate-+l+100.0%
fma-udef100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 96.4%
Taylor expanded in x around 0 81.4%
Final simplification77.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (+ (* x y) (* z t)))) (t_2 (+ (* a b) (* c i))))
(if (<= (* c i) -5.2e+118)
t_2
(if (<= (* c i) 1.9e-16)
t_1
(if (<= (* c i) 3250000.0)
t_2
(if (<= (* c i) 3.9e+140) t_1 (+ (* c i) (* z t))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + ((x * y) + (z * t));
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -5.2e+118) {
tmp = t_2;
} else if ((c * i) <= 1.9e-16) {
tmp = t_1;
} else if ((c * i) <= 3250000.0) {
tmp = t_2;
} else if ((c * i) <= 3.9e+140) {
tmp = t_1;
} else {
tmp = (c * i) + (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) :: t_2
real(8) :: tmp
t_1 = (a * b) + ((x * y) + (z * t))
t_2 = (a * b) + (c * i)
if ((c * i) <= (-5.2d+118)) then
tmp = t_2
else if ((c * i) <= 1.9d-16) then
tmp = t_1
else if ((c * i) <= 3250000.0d0) then
tmp = t_2
else if ((c * i) <= 3.9d+140) then
tmp = t_1
else
tmp = (c * i) + (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 = (a * b) + ((x * y) + (z * t));
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -5.2e+118) {
tmp = t_2;
} else if ((c * i) <= 1.9e-16) {
tmp = t_1;
} else if ((c * i) <= 3250000.0) {
tmp = t_2;
} else if ((c * i) <= 3.9e+140) {
tmp = t_1;
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + ((x * y) + (z * t)) t_2 = (a * b) + (c * i) tmp = 0 if (c * i) <= -5.2e+118: tmp = t_2 elif (c * i) <= 1.9e-16: tmp = t_1 elif (c * i) <= 3250000.0: tmp = t_2 elif (c * i) <= 3.9e+140: tmp = t_1 else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) t_2 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -5.2e+118) tmp = t_2; elseif (Float64(c * i) <= 1.9e-16) tmp = t_1; elseif (Float64(c * i) <= 3250000.0) tmp = t_2; elseif (Float64(c * i) <= 3.9e+140) tmp = t_1; else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + ((x * y) + (z * t)); t_2 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -5.2e+118) tmp = t_2; elseif ((c * i) <= 1.9e-16) tmp = t_1; elseif ((c * i) <= 3250000.0) tmp = t_2; elseif ((c * i) <= 3.9e+140) tmp = t_1; else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -5.2e+118], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 1.9e-16], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 3250000.0], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 3.9e+140], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + \left(x \cdot y + z \cdot t\right)\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -5.2 \cdot 10^{+118}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq 1.9 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 3250000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq 3.9 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -5.20000000000000032e118 or 1.90000000000000006e-16 < (*.f64 c i) < 3.25e6Initial program 92.2%
Taylor expanded in z around 0 88.5%
Taylor expanded in x around 0 84.7%
if -5.20000000000000032e118 < (*.f64 c i) < 1.90000000000000006e-16 or 3.25e6 < (*.f64 c i) < 3.89999999999999974e140Initial program 99.4%
Taylor expanded in c around 0 93.8%
if 3.89999999999999974e140 < (*.f64 c i) Initial program 84.2%
associate-+l+84.2%
fma-udef84.2%
*-commutative84.2%
fma-def84.2%
Applied egg-rr84.2%
Taylor expanded in a around 0 86.8%
Taylor expanded in x around 0 79.3%
Final simplification89.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.85e+98)
(* a b)
(if (<= (* a b) -5.5e-275)
(* c i)
(if (<= (* a b) 6.1e-227)
(* x y)
(if (<= (* a b) 7.2e-15)
(* z t)
(if (<= (* a b) 2.9e+133) (* x y) (* a b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.85e+98) {
tmp = a * b;
} else if ((a * b) <= -5.5e-275) {
tmp = c * i;
} else if ((a * b) <= 6.1e-227) {
tmp = x * y;
} else if ((a * b) <= 7.2e-15) {
tmp = z * t;
} else if ((a * b) <= 2.9e+133) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.85d+98)) then
tmp = a * b
else if ((a * b) <= (-5.5d-275)) then
tmp = c * i
else if ((a * b) <= 6.1d-227) then
tmp = x * y
else if ((a * b) <= 7.2d-15) then
tmp = z * t
else if ((a * b) <= 2.9d+133) then
tmp = x * y
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.85e+98) {
tmp = a * b;
} else if ((a * b) <= -5.5e-275) {
tmp = c * i;
} else if ((a * b) <= 6.1e-227) {
tmp = x * y;
} else if ((a * b) <= 7.2e-15) {
tmp = z * t;
} else if ((a * b) <= 2.9e+133) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.85e+98: tmp = a * b elif (a * b) <= -5.5e-275: tmp = c * i elif (a * b) <= 6.1e-227: tmp = x * y elif (a * b) <= 7.2e-15: tmp = z * t elif (a * b) <= 2.9e+133: tmp = x * y else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.85e+98) tmp = Float64(a * b); elseif (Float64(a * b) <= -5.5e-275) tmp = Float64(c * i); elseif (Float64(a * b) <= 6.1e-227) tmp = Float64(x * y); elseif (Float64(a * b) <= 7.2e-15) tmp = Float64(z * t); elseif (Float64(a * b) <= 2.9e+133) tmp = Float64(x * y); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.85e+98) tmp = a * b; elseif ((a * b) <= -5.5e-275) tmp = c * i; elseif ((a * b) <= 6.1e-227) tmp = x * y; elseif ((a * b) <= 7.2e-15) tmp = z * t; elseif ((a * b) <= 2.9e+133) tmp = x * y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1.85e+98], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -5.5e-275], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 6.1e-227], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 7.2e-15], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.9e+133], N[(x * y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.85 \cdot 10^{+98}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -5.5 \cdot 10^{-275}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 6.1 \cdot 10^{-227}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 7.2 \cdot 10^{-15}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 2.9 \cdot 10^{+133}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.8499999999999999e98 or 2.9000000000000001e133 < (*.f64 a b) Initial program 92.9%
Taylor expanded in a around inf 71.4%
if -1.8499999999999999e98 < (*.f64 a b) < -5.49999999999999988e-275Initial program 97.0%
Taylor expanded in c around inf 39.4%
if -5.49999999999999988e-275 < (*.f64 a b) < 6.1000000000000002e-227 or 7.2000000000000002e-15 < (*.f64 a b) < 2.9000000000000001e133Initial program 95.6%
Taylor expanded in x around inf 51.1%
if 6.1000000000000002e-227 < (*.f64 a b) < 7.2000000000000002e-15Initial program 100.0%
Taylor expanded in z around inf 52.8%
Final simplification55.1%
(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) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in z around 0 18.2%
+-commutative18.2%
*-commutative18.2%
fma-def27.3%
Applied egg-rr27.3%
Taylor expanded in c around 0 73.0%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.95e+98)
(* a b)
(if (<= (* a b) 4.3e-150)
(* c i)
(if (<= (* a b) 3.4e-23)
(* z t)
(if (<= (* a b) 5.8e+80) (* c i) (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.95e+98) {
tmp = a * b;
} else if ((a * b) <= 4.3e-150) {
tmp = c * i;
} else if ((a * b) <= 3.4e-23) {
tmp = z * t;
} else if ((a * b) <= 5.8e+80) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.95d+98)) then
tmp = a * b
else if ((a * b) <= 4.3d-150) then
tmp = c * i
else if ((a * b) <= 3.4d-23) then
tmp = z * t
else if ((a * b) <= 5.8d+80) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.95e+98) {
tmp = a * b;
} else if ((a * b) <= 4.3e-150) {
tmp = c * i;
} else if ((a * b) <= 3.4e-23) {
tmp = z * t;
} else if ((a * b) <= 5.8e+80) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.95e+98: tmp = a * b elif (a * b) <= 4.3e-150: tmp = c * i elif (a * b) <= 3.4e-23: tmp = z * t elif (a * b) <= 5.8e+80: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.95e+98) tmp = Float64(a * b); elseif (Float64(a * b) <= 4.3e-150) tmp = Float64(c * i); elseif (Float64(a * b) <= 3.4e-23) tmp = Float64(z * t); elseif (Float64(a * b) <= 5.8e+80) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.95e+98) tmp = a * b; elseif ((a * b) <= 4.3e-150) tmp = c * i; elseif ((a * b) <= 3.4e-23) tmp = z * t; elseif ((a * b) <= 5.8e+80) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1.95e+98], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.3e-150], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.4e-23], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.8e+80], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.95 \cdot 10^{+98}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 4.3 \cdot 10^{-150}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 3.4 \cdot 10^{-23}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 5.8 \cdot 10^{+80}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1.95e98 or 5.79999999999999971e80 < (*.f64 a b) Initial program 93.5%
Taylor expanded in a around inf 68.0%
if -1.95e98 < (*.f64 a b) < 4.30000000000000004e-150 or 3.4000000000000001e-23 < (*.f64 a b) < 5.79999999999999971e80Initial program 96.4%
Taylor expanded in c around inf 38.2%
if 4.30000000000000004e-150 < (*.f64 a b) < 3.4000000000000001e-23Initial program 100.0%
Taylor expanded in z around inf 61.4%
Final simplification51.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -48000000000.0) (not (<= (* x y) 1.02e+95))) (+ (* 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) <= -48000000000.0) || !((x * y) <= 1.02e+95)) {
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) <= (-48000000000.0d0)) .or. (.not. ((x * y) <= 1.02d+95))) 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) <= -48000000000.0) || !((x * y) <= 1.02e+95)) {
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) <= -48000000000.0) or not ((x * y) <= 1.02e+95): 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) <= -48000000000.0) || !(Float64(x * y) <= 1.02e+95)) 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) <= -48000000000.0) || ~(((x * y) <= 1.02e+95))) 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], -48000000000.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.02e+95]], $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 -48000000000 \lor \neg \left(x \cdot y \leq 1.02 \cdot 10^{+95}\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) < -4.8e10 or 1.0200000000000001e95 < (*.f64 x y) Initial program 94.1%
Taylor expanded in c around 0 91.4%
if -4.8e10 < (*.f64 x y) < 1.0200000000000001e95Initial program 96.8%
Taylor expanded in x around 0 92.2%
Final simplification91.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= (* a b) -4.2e+99) (not (<= (* a b) 7.8e+31)))
(+ (* a b) t_1)
(+ (* c i) 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 (((a * b) <= -4.2e+99) || !((a * b) <= 7.8e+31)) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + 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 (((a * b) <= (-4.2d+99)) .or. (.not. ((a * b) <= 7.8d+31))) then
tmp = (a * b) + t_1
else
tmp = (c * i) + 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 (((a * b) <= -4.2e+99) || !((a * b) <= 7.8e+31)) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if ((a * b) <= -4.2e+99) or not ((a * b) <= 7.8e+31): tmp = (a * b) + t_1 else: tmp = (c * i) + 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(a * b) <= -4.2e+99) || !(Float64(a * b) <= 7.8e+31)) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + 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 (((a * b) <= -4.2e+99) || ~(((a * b) <= 7.8e+31))) tmp = (a * b) + t_1; else tmp = (c * i) + 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[(a * b), $MachinePrecision], -4.2e+99], N[Not[LessEqual[N[(a * b), $MachinePrecision], 7.8e+31]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -4.2 \cdot 10^{+99} \lor \neg \left(a \cdot b \leq 7.8 \cdot 10^{+31}\right):\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.2000000000000002e99 or 7.79999999999999999e31 < (*.f64 a b) Initial program 91.9%
Taylor expanded in c around 0 88.0%
if -4.2000000000000002e99 < (*.f64 a b) < 7.79999999999999999e31Initial program 98.1%
associate-+l+98.1%
fma-udef98.1%
*-commutative98.1%
fma-def98.1%
Applied egg-rr98.1%
Taylor expanded in a around 0 94.6%
Final simplification92.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -35000000000.0) (not (<= (* x y) 3.8e+94))) (+ (* a b) (* x y)) (+ (* a b) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -35000000000.0) || !((x * y) <= 3.8e+94)) {
tmp = (a * b) + (x * y);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-35000000000.0d0)) .or. (.not. ((x * y) <= 3.8d+94))) then
tmp = (a * b) + (x * y)
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -35000000000.0) || !((x * y) <= 3.8e+94)) {
tmp = (a * b) + (x * y);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -35000000000.0) or not ((x * y) <= 3.8e+94): tmp = (a * b) + (x * y) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -35000000000.0) || !(Float64(x * y) <= 3.8e+94)) tmp = Float64(Float64(a * b) + Float64(x * y)); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -35000000000.0) || ~(((x * y) <= 3.8e+94))) tmp = (a * b) + (x * y); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -35000000000.0], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.8e+94]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -35000000000 \lor \neg \left(x \cdot y \leq 3.8 \cdot 10^{+94}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -3.5e10 or 3.7999999999999996e94 < (*.f64 x y) Initial program 94.1%
Taylor expanded in z around 0 80.0%
+-commutative80.0%
*-commutative80.0%
fma-def81.0%
Applied egg-rr81.0%
Taylor expanded in c around 0 77.3%
if -3.5e10 < (*.f64 x y) < 3.7999999999999996e94Initial program 96.8%
Taylor expanded in z around 0 70.8%
Taylor expanded in x around 0 66.1%
Final simplification70.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.85e+98) (not (<= (* a b) 2.05e+85))) (* a b) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.85e+98) || !((a * b) <= 2.05e+85)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-1.85d+98)) .or. (.not. ((a * b) <= 2.05d+85))) then
tmp = a * b
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -1.85e+98) || !((a * b) <= 2.05e+85)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -1.85e+98) or not ((a * b) <= 2.05e+85): tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -1.85e+98) || !(Float64(a * b) <= 2.05e+85)) tmp = Float64(a * b); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -1.85e+98) || ~(((a * b) <= 2.05e+85))) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.85e+98], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.05e+85]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.85 \cdot 10^{+98} \lor \neg \left(a \cdot b \leq 2.05 \cdot 10^{+85}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.8499999999999999e98 or 2.04999999999999989e85 < (*.f64 a b) Initial program 93.5%
Taylor expanded in a around inf 68.0%
if -1.8499999999999999e98 < (*.f64 a b) < 2.04999999999999989e85Initial program 97.0%
Taylor expanded in c around inf 36.3%
Final simplification47.7%
(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 95.7%
Taylor expanded in a around inf 27.9%
Final simplification27.9%
herbie shell --seed 2024026
(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)))