
(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 (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (+ (fma z t (* a b)) (+ (* x y) (* c i))) (fma t z (* 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) + ((x * y) + (z * t))) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(z, t, (a * b)) + ((x * y) + (c * i));
} else {
tmp = fma(t, z, (a * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) <= Inf) tmp = Float64(fma(z, t, Float64(a * b)) + Float64(Float64(x * y) + Float64(c * i))); else tmp = fma(t, z, Float64(a * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * z + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\right) + \left(x \cdot y + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, z, 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%
+-commutative100.0%
fma-def100.0%
+-commutative100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
fma-udef100.0%
associate-+r+100.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 x around 0 33.3%
Taylor expanded in c around 0 47.0%
+-commutative47.0%
fma-udef60.3%
Simplified60.3%
Final simplification97.7%
(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 94.1%
+-commutative94.1%
fma-def95.3%
associate-+l+95.3%
fma-def96.9%
fma-def97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 94.1%
+-commutative94.1%
fma-def95.3%
+-commutative95.3%
fma-def95.7%
fma-def96.5%
Simplified96.5%
Final simplification96.5%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (fma t z (* a b)))))
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))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(t, z, (a * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(t, z, Float64(a * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(t * z + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, z, 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 x around 0 33.3%
Taylor expanded in c around 0 47.0%
+-commutative47.0%
fma-udef60.3%
Simplified60.3%
Final simplification97.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -8.5e+19)
(* a b)
(if (<= (* a b) -3e-145)
(* z t)
(if (<= (* a b) -6.4e-186)
(* x y)
(if (<= (* a b) 5.4e-142)
(* c i)
(if (<= (* a b) 6e-50)
(* x y)
(if (or (<= (* a b) 5.6e-25) (not (<= (* a b) 2.7e+54)))
(* 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 ((a * b) <= -8.5e+19) {
tmp = a * b;
} else if ((a * b) <= -3e-145) {
tmp = z * t;
} else if ((a * b) <= -6.4e-186) {
tmp = x * y;
} else if ((a * b) <= 5.4e-142) {
tmp = c * i;
} else if ((a * b) <= 6e-50) {
tmp = x * y;
} else if (((a * b) <= 5.6e-25) || !((a * b) <= 2.7e+54)) {
tmp = a * b;
} else {
tmp = 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 ((a * b) <= (-8.5d+19)) then
tmp = a * b
else if ((a * b) <= (-3d-145)) then
tmp = z * t
else if ((a * b) <= (-6.4d-186)) then
tmp = x * y
else if ((a * b) <= 5.4d-142) then
tmp = c * i
else if ((a * b) <= 6d-50) then
tmp = x * y
else if (((a * b) <= 5.6d-25) .or. (.not. ((a * b) <= 2.7d+54))) then
tmp = a * b
else
tmp = 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 ((a * b) <= -8.5e+19) {
tmp = a * b;
} else if ((a * b) <= -3e-145) {
tmp = z * t;
} else if ((a * b) <= -6.4e-186) {
tmp = x * y;
} else if ((a * b) <= 5.4e-142) {
tmp = c * i;
} else if ((a * b) <= 6e-50) {
tmp = x * y;
} else if (((a * b) <= 5.6e-25) || !((a * b) <= 2.7e+54)) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -8.5e+19: tmp = a * b elif (a * b) <= -3e-145: tmp = z * t elif (a * b) <= -6.4e-186: tmp = x * y elif (a * b) <= 5.4e-142: tmp = c * i elif (a * b) <= 6e-50: tmp = x * y elif ((a * b) <= 5.6e-25) or not ((a * b) <= 2.7e+54): tmp = a * b else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -8.5e+19) tmp = Float64(a * b); elseif (Float64(a * b) <= -3e-145) tmp = Float64(z * t); elseif (Float64(a * b) <= -6.4e-186) tmp = Float64(x * y); elseif (Float64(a * b) <= 5.4e-142) tmp = Float64(c * i); elseif (Float64(a * b) <= 6e-50) tmp = Float64(x * y); elseif ((Float64(a * b) <= 5.6e-25) || !(Float64(a * b) <= 2.7e+54)) tmp = Float64(a * b); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -8.5e+19) tmp = a * b; elseif ((a * b) <= -3e-145) tmp = z * t; elseif ((a * b) <= -6.4e-186) tmp = x * y; elseif ((a * b) <= 5.4e-142) tmp = c * i; elseif ((a * b) <= 6e-50) tmp = x * y; elseif (((a * b) <= 5.6e-25) || ~(((a * b) <= 2.7e+54))) tmp = a * b; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -8.5e+19], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3e-145], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -6.4e-186], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.4e-142], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 6e-50], N[(x * y), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], 5.6e-25], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.7e+54]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8.5 \cdot 10^{+19}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -3 \cdot 10^{-145}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -6.4 \cdot 10^{-186}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 5.4 \cdot 10^{-142}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 6 \cdot 10^{-50}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 5.6 \cdot 10^{-25} \lor \neg \left(a \cdot b \leq 2.7 \cdot 10^{+54}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -8.5e19 or 5.99999999999999981e-50 < (*.f64 a b) < 5.59999999999999976e-25 or 2.70000000000000011e54 < (*.f64 a b) Initial program 92.1%
Taylor expanded in a around inf 60.7%
if -8.5e19 < (*.f64 a b) < -2.99999999999999992e-145 or 5.59999999999999976e-25 < (*.f64 a b) < 2.70000000000000011e54Initial program 92.7%
Taylor expanded in z around inf 54.8%
if -2.99999999999999992e-145 < (*.f64 a b) < -6.4000000000000001e-186 or 5.3999999999999996e-142 < (*.f64 a b) < 5.99999999999999981e-50Initial program 100.0%
Taylor expanded in x around inf 60.3%
if -6.4000000000000001e-186 < (*.f64 a b) < 5.3999999999999996e-142Initial program 98.1%
Taylor expanded in c around inf 53.6%
Final simplification58.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -1.9e+199)
(* x y)
(if (<= (* x y) 2.2e+41)
t_1
(if (<= (* x y) 3.9e+95)
(* z t)
(if (<= (* x y) 1.6e+139) 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.9e+199) {
tmp = x * y;
} else if ((x * y) <= 2.2e+41) {
tmp = t_1;
} else if ((x * y) <= 3.9e+95) {
tmp = z * t;
} else if ((x * y) <= 1.6e+139) {
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.9d+199)) then
tmp = x * y
else if ((x * y) <= 2.2d+41) then
tmp = t_1
else if ((x * y) <= 3.9d+95) then
tmp = z * t
else if ((x * y) <= 1.6d+139) 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.9e+199) {
tmp = x * y;
} else if ((x * y) <= 2.2e+41) {
tmp = t_1;
} else if ((x * y) <= 3.9e+95) {
tmp = z * t;
} else if ((x * y) <= 1.6e+139) {
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.9e+199: tmp = x * y elif (x * y) <= 2.2e+41: tmp = t_1 elif (x * y) <= 3.9e+95: tmp = z * t elif (x * y) <= 1.6e+139: 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.9e+199) tmp = Float64(x * y); elseif (Float64(x * y) <= 2.2e+41) tmp = t_1; elseif (Float64(x * y) <= 3.9e+95) tmp = Float64(z * t); elseif (Float64(x * y) <= 1.6e+139) 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.9e+199) tmp = x * y; elseif ((x * y) <= 2.2e+41) tmp = t_1; elseif ((x * y) <= 3.9e+95) tmp = z * t; elseif ((x * y) <= 1.6e+139) 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.9e+199], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.2e+41], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.9e+95], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.6e+139], 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.9 \cdot 10^{+199}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 3.9 \cdot 10^{+95}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{+139}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9e199 or 1.6000000000000001e139 < (*.f64 x y) Initial program 88.5%
Taylor expanded in x around inf 74.8%
if -1.9e199 < (*.f64 x y) < 2.1999999999999999e41 or 3.8999999999999997e95 < (*.f64 x y) < 1.6000000000000001e139Initial program 96.2%
Taylor expanded in x around 0 89.8%
Taylor expanded in t around 0 70.3%
if 2.1999999999999999e41 < (*.f64 x y) < 3.8999999999999997e95Initial program 91.7%
Taylor expanded in z around inf 59.4%
Final simplification70.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* c i) -5.4e-32)
t_1
(if (<= (* c i) -2.65e-191)
(+ (* a b) (* x y))
(if (<= (* c i) 3.4e+31)
(+ (* a b) (* z t))
(if (<= (* c i) 1.4e+144) (+ (* x y) (* 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 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -5.4e-32) {
tmp = t_1;
} else if ((c * i) <= -2.65e-191) {
tmp = (a * b) + (x * y);
} else if ((c * i) <= 3.4e+31) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 1.4e+144) {
tmp = (x * y) + (c * i);
} 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) + (c * i)
if ((c * i) <= (-5.4d-32)) then
tmp = t_1
else if ((c * i) <= (-2.65d-191)) then
tmp = (a * b) + (x * y)
else if ((c * i) <= 3.4d+31) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 1.4d+144) then
tmp = (x * y) + (c * i)
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) + (c * i);
double tmp;
if ((c * i) <= -5.4e-32) {
tmp = t_1;
} else if ((c * i) <= -2.65e-191) {
tmp = (a * b) + (x * y);
} else if ((c * i) <= 3.4e+31) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 1.4e+144) {
tmp = (x * y) + (c * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (c * i) <= -5.4e-32: tmp = t_1 elif (c * i) <= -2.65e-191: tmp = (a * b) + (x * y) elif (c * i) <= 3.4e+31: tmp = (a * b) + (z * t) elif (c * i) <= 1.4e+144: tmp = (x * y) + (c * i) else: tmp = t_1 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(c * i) <= -5.4e-32) tmp = t_1; elseif (Float64(c * i) <= -2.65e-191) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(c * i) <= 3.4e+31) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 1.4e+144) tmp = Float64(Float64(x * y) + Float64(c * i)); else tmp = t_1; 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 ((c * i) <= -5.4e-32) tmp = t_1; elseif ((c * i) <= -2.65e-191) tmp = (a * b) + (x * y); elseif ((c * i) <= 3.4e+31) tmp = (a * b) + (z * t); elseif ((c * i) <= 1.4e+144) tmp = (x * y) + (c * i); 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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -5.4e-32], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -2.65e-191], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.4e+31], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.4e+144], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -5.4 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -2.65 \cdot 10^{-191}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 3.4 \cdot 10^{+31}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 1.4 \cdot 10^{+144}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -5.39999999999999962e-32 or 1.40000000000000003e144 < (*.f64 c i) Initial program 87.7%
Taylor expanded in x around 0 81.8%
Taylor expanded in t around 0 73.5%
if -5.39999999999999962e-32 < (*.f64 c i) < -2.64999999999999993e-191Initial program 100.0%
Taylor expanded in z around 0 88.7%
Taylor expanded in c around 0 82.6%
if -2.64999999999999993e-191 < (*.f64 c i) < 3.3999999999999998e31Initial program 98.0%
Taylor expanded in x around 0 77.3%
Taylor expanded in c around 0 76.4%
if 3.3999999999999998e31 < (*.f64 c i) < 1.40000000000000003e144Initial program 100.0%
Taylor expanded in z around 0 90.0%
Taylor expanded in a around 0 80.3%
Final simplification76.3%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (+ (* a b) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in x around 0 33.3%
Taylor expanded in t around 0 53.4%
Final simplification97.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.1e+17)
(* a b)
(if (<= (* a b) -4.4e-178)
(* z t)
(if (<= (* a b) 8.2e-141)
(* c i)
(if (<= (* a b) 2.2e+52) (* z t) (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.1e+17) {
tmp = a * b;
} else if ((a * b) <= -4.4e-178) {
tmp = z * t;
} else if ((a * b) <= 8.2e-141) {
tmp = c * i;
} else if ((a * b) <= 2.2e+52) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-2.1d+17)) then
tmp = a * b
else if ((a * b) <= (-4.4d-178)) then
tmp = z * t
else if ((a * b) <= 8.2d-141) then
tmp = c * i
else if ((a * b) <= 2.2d+52) then
tmp = z * t
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.1e+17) {
tmp = a * b;
} else if ((a * b) <= -4.4e-178) {
tmp = z * t;
} else if ((a * b) <= 8.2e-141) {
tmp = c * i;
} else if ((a * b) <= 2.2e+52) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.1e+17: tmp = a * b elif (a * b) <= -4.4e-178: tmp = z * t elif (a * b) <= 8.2e-141: tmp = c * i elif (a * b) <= 2.2e+52: tmp = z * t else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.1e+17) tmp = Float64(a * b); elseif (Float64(a * b) <= -4.4e-178) tmp = Float64(z * t); elseif (Float64(a * b) <= 8.2e-141) tmp = Float64(c * i); elseif (Float64(a * b) <= 2.2e+52) tmp = Float64(z * t); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -2.1e+17) tmp = a * b; elseif ((a * b) <= -4.4e-178) tmp = z * t; elseif ((a * b) <= 8.2e-141) tmp = c * i; elseif ((a * b) <= 2.2e+52) tmp = z * t; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.1e+17], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -4.4e-178], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 8.2e-141], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.2e+52], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.1 \cdot 10^{+17}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -4.4 \cdot 10^{-178}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 8.2 \cdot 10^{-141}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 2.2 \cdot 10^{+52}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.1e17 or 2.2e52 < (*.f64 a b) Initial program 92.4%
Taylor expanded in a around inf 61.4%
if -2.1e17 < (*.f64 a b) < -4.4000000000000002e-178 or 8.20000000000000005e-141 < (*.f64 a b) < 2.2e52Initial program 94.2%
Taylor expanded in z around inf 42.2%
if -4.4000000000000002e-178 < (*.f64 a b) < 8.20000000000000005e-141Initial program 98.2%
Taylor expanded in c around inf 52.7%
Final simplification54.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* c i) -1.1e-34)
t_1
(if (<= (* c i) -7e-193)
(+ (* a b) (* x y))
(if (<= (* c i) 3.6e+32) (+ (* a b) (* 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) + (c * i);
double tmp;
if ((c * i) <= -1.1e-34) {
tmp = t_1;
} else if ((c * i) <= -7e-193) {
tmp = (a * b) + (x * y);
} else if ((c * i) <= 3.6e+32) {
tmp = (a * b) + (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) + (c * i)
if ((c * i) <= (-1.1d-34)) then
tmp = t_1
else if ((c * i) <= (-7d-193)) then
tmp = (a * b) + (x * y)
else if ((c * i) <= 3.6d+32) then
tmp = (a * b) + (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) + (c * i);
double tmp;
if ((c * i) <= -1.1e-34) {
tmp = t_1;
} else if ((c * i) <= -7e-193) {
tmp = (a * b) + (x * y);
} else if ((c * i) <= 3.6e+32) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (c * i) <= -1.1e-34: tmp = t_1 elif (c * i) <= -7e-193: tmp = (a * b) + (x * y) elif (c * i) <= 3.6e+32: tmp = (a * b) + (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(c * i)) tmp = 0.0 if (Float64(c * i) <= -1.1e-34) tmp = t_1; elseif (Float64(c * i) <= -7e-193) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(c * i) <= 3.6e+32) tmp = Float64(Float64(a * b) + 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) + (c * i); tmp = 0.0; if ((c * i) <= -1.1e-34) tmp = t_1; elseif ((c * i) <= -7e-193) tmp = (a * b) + (x * y); elseif ((c * i) <= 3.6e+32) tmp = (a * b) + (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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.1e-34], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -7e-193], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.6e+32], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -1.1 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -7 \cdot 10^{-193}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 3.6 \cdot 10^{+32}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -1.0999999999999999e-34 or 3.5999999999999997e32 < (*.f64 c i) Initial program 89.6%
Taylor expanded in x around 0 79.2%
Taylor expanded in t around 0 70.5%
if -1.0999999999999999e-34 < (*.f64 c i) < -7.00000000000000009e-193Initial program 100.0%
Taylor expanded in z around 0 88.7%
Taylor expanded in c around 0 82.6%
if -7.00000000000000009e-193 < (*.f64 c i) < 3.5999999999999997e32Initial program 98.0%
Taylor expanded in x around 0 76.6%
Taylor expanded in c around 0 75.6%
Final simplification74.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -3.35e+103) (not (<= (* x y) 3e+93))) (+ (* c i) (+ (* a b) (* x y))) (+ (* 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) <= -3.35e+103) || !((x * y) <= 3e+93)) {
tmp = (c * i) + ((a * b) + (x * y));
} 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) <= (-3.35d+103)) .or. (.not. ((x * y) <= 3d+93))) then
tmp = (c * i) + ((a * b) + (x * y))
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) <= -3.35e+103) || !((x * y) <= 3e+93)) {
tmp = (c * i) + ((a * b) + (x * y));
} 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) <= -3.35e+103) or not ((x * y) <= 3e+93): tmp = (c * i) + ((a * b) + (x * y)) 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) <= -3.35e+103) || !(Float64(x * y) <= 3e+93)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); 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) <= -3.35e+103) || ~(((x * y) <= 3e+93))) tmp = (c * i) + ((a * b) + (x * y)); 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], -3.35e+103], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3e+93]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $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 -3.35 \cdot 10^{+103} \lor \neg \left(x \cdot y \leq 3 \cdot 10^{+93}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -3.35000000000000017e103 or 2.99999999999999978e93 < (*.f64 x y) Initial program 89.5%
Taylor expanded in z around 0 85.1%
if -3.35000000000000017e103 < (*.f64 x y) < 2.99999999999999978e93Initial program 96.5%
Taylor expanded in x around 0 93.0%
Final simplification90.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -9.5e+107)
(+ (* a b) (* x y))
(if (<= (* x y) 3.3e+93)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* x y) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -9.5e+107) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 3.3e+93) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-9.5d+107)) then
tmp = (a * b) + (x * y)
else if ((x * y) <= 3.3d+93) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (x * y) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -9.5e+107) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 3.3e+93) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -9.5e+107: tmp = (a * b) + (x * y) elif (x * y) <= 3.3e+93: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -9.5e+107) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(x * y) <= 3.3e+93) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -9.5e+107) tmp = (a * b) + (x * y); elseif ((x * y) <= 3.3e+93) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -9.5e+107], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.3e+93], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+107}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 3.3 \cdot 10^{+93}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -9.50000000000000019e107Initial program 87.5%
Taylor expanded in z around 0 90.2%
Taylor expanded in c around 0 82.6%
if -9.50000000000000019e107 < (*.f64 x y) < 3.30000000000000009e93Initial program 96.5%
Taylor expanded in x around 0 93.0%
if 3.30000000000000009e93 < (*.f64 x y) Initial program 91.3%
Taylor expanded in z around 0 80.8%
Taylor expanded in a around 0 74.2%
Final simplification88.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -2.05e-45) (not (<= (* c i) 7.5e+32))) (+ (* a b) (* c i)) (+ (* a b) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -2.05e-45) || !((c * i) <= 7.5e+32)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-2.05d-45)) .or. (.not. ((c * i) <= 7.5d+32))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -2.05e-45) || !((c * i) <= 7.5e+32)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -2.05e-45) or not ((c * i) <= 7.5e+32): tmp = (a * b) + (c * i) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -2.05e-45) || !(Float64(c * i) <= 7.5e+32)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -2.05e-45) || ~(((c * i) <= 7.5e+32))) tmp = (a * b) + (c * i); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -2.05e-45], N[Not[LessEqual[N[(c * i), $MachinePrecision], 7.5e+32]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.05 \cdot 10^{-45} \lor \neg \left(c \cdot i \leq 7.5 \cdot 10^{+32}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -2.05e-45 or 7.49999999999999959e32 < (*.f64 c i) Initial program 89.8%
Taylor expanded in x around 0 78.2%
Taylor expanded in t around 0 69.7%
if -2.05e-45 < (*.f64 c i) < 7.49999999999999959e32Initial program 98.4%
Taylor expanded in x around 0 75.1%
Taylor expanded in c around 0 73.6%
Final simplification71.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -5.8e-48) (not (<= (* a b) 5.8e+74))) (* 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) <= -5.8e-48) || !((a * b) <= 5.8e+74)) {
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) <= (-5.8d-48)) .or. (.not. ((a * b) <= 5.8d+74))) 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) <= -5.8e-48) || !((a * b) <= 5.8e+74)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -5.8e-48) or not ((a * b) <= 5.8e+74): 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) <= -5.8e-48) || !(Float64(a * b) <= 5.8e+74)) 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) <= -5.8e-48) || ~(((a * b) <= 5.8e+74))) 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], -5.8e-48], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5.8e+74]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5.8 \cdot 10^{-48} \lor \neg \left(a \cdot b \leq 5.8 \cdot 10^{+74}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -5.8000000000000006e-48 or 5.8000000000000005e74 < (*.f64 a b) Initial program 93.3%
Taylor expanded in a around inf 59.1%
if -5.8000000000000006e-48 < (*.f64 a b) < 5.8000000000000005e74Initial program 95.1%
Taylor expanded in c around inf 39.0%
Final simplification49.5%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 94.1%
Taylor expanded in a around inf 34.8%
Final simplification34.8%
herbie shell --seed 2024027
(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)))