
(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))) INFINITY) (fma c i (fma a b (fma x y (* z t)))) (* i (+ c (/ (* a b) i)))))
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))) <= ((double) INFINITY)) {
tmp = fma(c, i, fma(a, b, fma(x, y, (z * t))));
} else {
tmp = i * (c + ((a * b) / i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) <= Inf) tmp = fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))); else tmp = Float64(i * Float64(c + Float64(Float64(a * b) / i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * N[(c + N[(N[(a * b), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b + \left(x \cdot y + z \cdot t\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(c + \frac{a \cdot b}{i}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 99.2%
+-commutative99.2%
fma-define99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
Simplified99.6%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
Taylor expanded in a around inf 78.4%
Taylor expanded in i around inf 88.9%
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-define96.1%
associate-+l+96.1%
fma-define96.9%
fma-define98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (+ (fma x y (* z t)) (+ (* a b) (* c i))) (* i (+ c (/ (* a b) i)))))
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(x, y, (z * t)) + ((a * b) + (c * i));
} else {
tmp = i * (c + ((a * b) / i));
}
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(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))); else tmp = Float64(i * Float64(c + Float64(Float64(a * b) / i))); 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[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * N[(c + N[(N[(a * b), $MachinePrecision] / i), $MachinePrecision]), $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(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(c + \frac{a \cdot b}{i}\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-define100.0%
Simplified100.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 a around inf 64.1%
Taylor expanded in i around inf 81.8%
Final simplification99.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -8e+139)
(* a b)
(if (<= (* a b) -1.3e+83)
(* z t)
(if (<= (* a b) -8.2e+17)
(* x y)
(if (<= (* a b) -9e-173)
(* c i)
(if (<= (* a b) 4.4e-308)
(* z t)
(if (<= (* a b) 1.1e-117)
(* x y)
(if (<= (* a b) 8.5e-9) (* 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) <= -8e+139) {
tmp = a * b;
} else if ((a * b) <= -1.3e+83) {
tmp = z * t;
} else if ((a * b) <= -8.2e+17) {
tmp = x * y;
} else if ((a * b) <= -9e-173) {
tmp = c * i;
} else if ((a * b) <= 4.4e-308) {
tmp = z * t;
} else if ((a * b) <= 1.1e-117) {
tmp = x * y;
} else if ((a * b) <= 8.5e-9) {
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) <= (-8d+139)) then
tmp = a * b
else if ((a * b) <= (-1.3d+83)) then
tmp = z * t
else if ((a * b) <= (-8.2d+17)) then
tmp = x * y
else if ((a * b) <= (-9d-173)) then
tmp = c * i
else if ((a * b) <= 4.4d-308) then
tmp = z * t
else if ((a * b) <= 1.1d-117) then
tmp = x * y
else if ((a * b) <= 8.5d-9) 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) <= -8e+139) {
tmp = a * b;
} else if ((a * b) <= -1.3e+83) {
tmp = z * t;
} else if ((a * b) <= -8.2e+17) {
tmp = x * y;
} else if ((a * b) <= -9e-173) {
tmp = c * i;
} else if ((a * b) <= 4.4e-308) {
tmp = z * t;
} else if ((a * b) <= 1.1e-117) {
tmp = x * y;
} else if ((a * b) <= 8.5e-9) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -8e+139: tmp = a * b elif (a * b) <= -1.3e+83: tmp = z * t elif (a * b) <= -8.2e+17: tmp = x * y elif (a * b) <= -9e-173: tmp = c * i elif (a * b) <= 4.4e-308: tmp = z * t elif (a * b) <= 1.1e-117: tmp = x * y elif (a * b) <= 8.5e-9: 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) <= -8e+139) tmp = Float64(a * b); elseif (Float64(a * b) <= -1.3e+83) tmp = Float64(z * t); elseif (Float64(a * b) <= -8.2e+17) tmp = Float64(x * y); elseif (Float64(a * b) <= -9e-173) tmp = Float64(c * i); elseif (Float64(a * b) <= 4.4e-308) tmp = Float64(z * t); elseif (Float64(a * b) <= 1.1e-117) tmp = Float64(x * y); elseif (Float64(a * b) <= 8.5e-9) 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) <= -8e+139) tmp = a * b; elseif ((a * b) <= -1.3e+83) tmp = z * t; elseif ((a * b) <= -8.2e+17) tmp = x * y; elseif ((a * b) <= -9e-173) tmp = c * i; elseif ((a * b) <= 4.4e-308) tmp = z * t; elseif ((a * b) <= 1.1e-117) tmp = x * y; elseif ((a * b) <= 8.5e-9) 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], -8e+139], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.3e+83], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -8.2e+17], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -9e-173], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.4e-308], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.1e-117], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 8.5e-9], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8 \cdot 10^{+139}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -1.3 \cdot 10^{+83}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq -8.2 \cdot 10^{+17}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -9 \cdot 10^{-173}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 4.4 \cdot 10^{-308}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.1 \cdot 10^{-117}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 8.5 \cdot 10^{-9}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -8.00000000000000026e139 or 8.5e-9 < (*.f64 a b) Initial program 89.2%
Taylor expanded in y around inf 86.5%
Taylor expanded in y around inf 78.1%
Taylor expanded in a around inf 64.7%
if -8.00000000000000026e139 < (*.f64 a b) < -1.3000000000000001e83 or -9.00000000000000037e-173 < (*.f64 a b) < 4.3999999999999999e-308Initial program 99.9%
Taylor expanded in y around inf 96.7%
Taylor expanded in y around inf 88.6%
Taylor expanded in t around inf 49.5%
if -1.3000000000000001e83 < (*.f64 a b) < -8.2e17 or 4.3999999999999999e-308 < (*.f64 a b) < 1.1000000000000001e-117Initial program 99.9%
Taylor expanded in y around inf 99.9%
Taylor expanded in y around inf 89.6%
Taylor expanded in y around inf 54.0%
if -8.2e17 < (*.f64 a b) < -9.00000000000000037e-173 or 1.1000000000000001e-117 < (*.f64 a b) < 8.5e-9Initial program 100.0%
Taylor expanded in c around inf 48.9%
Final simplification56.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* x y) (* z t))))
(if (<= (* x y) -2.1e+90)
t_2
(if (<= (* x y) -6e-64)
(+ (* c i) (* z t))
(if (<= (* x y) -4.1e-129)
t_1
(if (<= (* x y) 3e-65)
(+ (* a b) (* c i))
(if (<= (* x y) 6.4e+88) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (z * t);
double tmp;
if ((x * y) <= -2.1e+90) {
tmp = t_2;
} else if ((x * y) <= -6e-64) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= -4.1e-129) {
tmp = t_1;
} else if ((x * y) <= 3e-65) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 6.4e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (x * y) + (z * t)
if ((x * y) <= (-2.1d+90)) then
tmp = t_2
else if ((x * y) <= (-6d-64)) then
tmp = (c * i) + (z * t)
else if ((x * y) <= (-4.1d-129)) then
tmp = t_1
else if ((x * y) <= 3d-65) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 6.4d+88) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (x * y) + (z * t);
double tmp;
if ((x * y) <= -2.1e+90) {
tmp = t_2;
} else if ((x * y) <= -6e-64) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= -4.1e-129) {
tmp = t_1;
} else if ((x * y) <= 3e-65) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 6.4e+88) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (x * y) + (z * t) tmp = 0 if (x * y) <= -2.1e+90: tmp = t_2 elif (x * y) <= -6e-64: tmp = (c * i) + (z * t) elif (x * y) <= -4.1e-129: tmp = t_1 elif (x * y) <= 3e-65: tmp = (a * b) + (c * i) elif (x * y) <= 6.4e+88: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -2.1e+90) tmp = t_2; elseif (Float64(x * y) <= -6e-64) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= -4.1e-129) tmp = t_1; elseif (Float64(x * y) <= 3e-65) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 6.4e+88) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); t_2 = (x * y) + (z * t); tmp = 0.0; if ((x * y) <= -2.1e+90) tmp = t_2; elseif ((x * y) <= -6e-64) tmp = (c * i) + (z * t); elseif ((x * y) <= -4.1e-129) tmp = t_1; elseif ((x * y) <= 3e-65) tmp = (a * b) + (c * i); elseif ((x * y) <= 6.4e+88) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.1e+90], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -6e-64], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.1e-129], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3e-65], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.4e+88], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -6 \cdot 10^{-64}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -4.1 \cdot 10^{-129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 3 \cdot 10^{-65}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -2.09999999999999981e90 or 6.3999999999999997e88 < (*.f64 x y) Initial program 93.2%
Taylor expanded in a around 0 86.6%
Taylor expanded in c around 0 76.7%
if -2.09999999999999981e90 < (*.f64 x y) < -6.0000000000000001e-64Initial program 96.8%
Taylor expanded in z around inf 77.1%
if -6.0000000000000001e-64 < (*.f64 x y) < -4.1e-129 or 2.99999999999999998e-65 < (*.f64 x y) < 6.3999999999999997e88Initial program 100.0%
Taylor expanded in x around 0 92.7%
Taylor expanded in z around inf 83.3%
Taylor expanded in c around 0 73.6%
Taylor expanded in z around 0 82.9%
if -4.1e-129 < (*.f64 x y) < 2.99999999999999998e-65Initial program 95.8%
Taylor expanded in a around inf 73.7%
Final simplification76.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* x y) -1e+96)
(+ (* x y) (* z t))
(if (<= (* x y) -2e-62)
(+ (* c i) (* z t))
(if (<= (* x y) -2e-128)
t_1
(if (<= (* x y) 2e-67)
(+ (* a b) (* c i))
(if (<= (* x y) 5e+88) t_1 (+ (* x y) (* c i)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -1e+96) {
tmp = (x * y) + (z * t);
} else if ((x * y) <= -2e-62) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= -2e-128) {
tmp = t_1;
} else if ((x * y) <= 2e-67) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 5e+88) {
tmp = t_1;
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (z * t)
if ((x * y) <= (-1d+96)) then
tmp = (x * y) + (z * t)
else if ((x * y) <= (-2d-62)) then
tmp = (c * i) + (z * t)
else if ((x * y) <= (-2d-128)) then
tmp = t_1
else if ((x * y) <= 2d-67) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 5d+88) then
tmp = t_1
else
tmp = (x * y) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -1e+96) {
tmp = (x * y) + (z * t);
} else if ((x * y) <= -2e-62) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= -2e-128) {
tmp = t_1;
} else if ((x * y) <= 2e-67) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 5e+88) {
tmp = t_1;
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (x * y) <= -1e+96: tmp = (x * y) + (z * t) elif (x * y) <= -2e-62: tmp = (c * i) + (z * t) elif (x * y) <= -2e-128: tmp = t_1 elif (x * y) <= 2e-67: tmp = (a * b) + (c * i) elif (x * y) <= 5e+88: tmp = t_1 else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -1e+96) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(x * y) <= -2e-62) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= -2e-128) tmp = t_1; elseif (Float64(x * y) <= 2e-67) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 5e+88) tmp = t_1; else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); tmp = 0.0; if ((x * y) <= -1e+96) tmp = (x * y) + (z * t); elseif ((x * y) <= -2e-62) tmp = (c * i) + (z * t); elseif ((x * y) <= -2e-128) tmp = t_1; elseif ((x * y) <= 2e-67) tmp = (a * b) + (c * i); elseif ((x * y) <= 5e+88) tmp = t_1; else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+96], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-62], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2e-128], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-67], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+88], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+96}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-62}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-67}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000005e96Initial program 91.5%
Taylor expanded in a around 0 87.4%
Taylor expanded in c around 0 79.1%
if -1.00000000000000005e96 < (*.f64 x y) < -2.0000000000000001e-62Initial program 96.8%
Taylor expanded in z around inf 77.1%
if -2.0000000000000001e-62 < (*.f64 x y) < -2.00000000000000011e-128 or 1.99999999999999989e-67 < (*.f64 x y) < 4.99999999999999997e88Initial program 100.0%
Taylor expanded in x around 0 92.7%
Taylor expanded in z around inf 83.3%
Taylor expanded in c around 0 73.6%
Taylor expanded in z around 0 82.9%
if -2.00000000000000011e-128 < (*.f64 x y) < 1.99999999999999989e-67Initial program 95.8%
Taylor expanded in a around inf 73.7%
if 4.99999999999999997e88 < (*.f64 x y) Initial program 95.1%
Taylor expanded in x around inf 76.3%
Final simplification77.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* x y) -2.5e+166)
(* x y)
(if (<= (* x y) -7e+25)
t_1
(if (<= (* x y) 8.2e-58)
(+ (* a b) (* c i))
(if (<= (* x y) 1.6e+91) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -2.5e+166) {
tmp = x * y;
} else if ((x * y) <= -7e+25) {
tmp = t_1;
} else if ((x * y) <= 8.2e-58) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.6e+91) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (z * t)
if ((x * y) <= (-2.5d+166)) then
tmp = x * y
else if ((x * y) <= (-7d+25)) then
tmp = t_1
else if ((x * y) <= 8.2d-58) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 1.6d+91) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -2.5e+166) {
tmp = x * y;
} else if ((x * y) <= -7e+25) {
tmp = t_1;
} else if ((x * y) <= 8.2e-58) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 1.6e+91) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (x * y) <= -2.5e+166: tmp = x * y elif (x * y) <= -7e+25: tmp = t_1 elif (x * y) <= 8.2e-58: tmp = (a * b) + (c * i) elif (x * y) <= 1.6e+91: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -2.5e+166) tmp = Float64(x * y); elseif (Float64(x * y) <= -7e+25) tmp = t_1; elseif (Float64(x * y) <= 8.2e-58) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 1.6e+91) tmp = t_1; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); tmp = 0.0; if ((x * y) <= -2.5e+166) tmp = x * y; elseif ((x * y) <= -7e+25) tmp = t_1; elseif ((x * y) <= 8.2e-58) tmp = (a * b) + (c * i); elseif ((x * y) <= 1.6e+91) tmp = t_1; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.5e+166], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -7e+25], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 8.2e-58], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.6e+91], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -2.5 \cdot 10^{+166}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -7 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 8.2 \cdot 10^{-58}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.5000000000000001e166 or 1.59999999999999995e91 < (*.f64 x y) Initial program 93.3%
Taylor expanded in y around inf 93.3%
Taylor expanded in y around inf 96.0%
Taylor expanded in y around inf 71.5%
if -2.5000000000000001e166 < (*.f64 x y) < -6.99999999999999999e25 or 8.20000000000000056e-58 < (*.f64 x y) < 1.59999999999999995e91Initial program 98.1%
Taylor expanded in x around 0 81.3%
Taylor expanded in z around inf 74.4%
Taylor expanded in c around 0 64.2%
Taylor expanded in z around 0 71.1%
if -6.99999999999999999e25 < (*.f64 x y) < 8.20000000000000056e-58Initial program 96.0%
Taylor expanded in a around inf 72.5%
Final simplification71.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -3.5e+154)
(* x y)
(if (<= (* x y) -4e-59)
(+ (* c i) (* z t))
(if (<= (* x y) 5e-59)
(+ (* a b) (* c i))
(if (<= (* x y) 3.6e+90) (+ (* a b) (* z t)) (* 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) <= -3.5e+154) {
tmp = x * y;
} else if ((x * y) <= -4e-59) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 5e-59) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 3.6e+90) {
tmp = (a * b) + (z * t);
} 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) :: tmp
if ((x * y) <= (-3.5d+154)) then
tmp = x * y
else if ((x * y) <= (-4d-59)) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 5d-59) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 3.6d+90) then
tmp = (a * b) + (z * t)
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 tmp;
if ((x * y) <= -3.5e+154) {
tmp = x * y;
} else if ((x * y) <= -4e-59) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 5e-59) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 3.6e+90) {
tmp = (a * b) + (z * t);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -3.5e+154: tmp = x * y elif (x * y) <= -4e-59: tmp = (c * i) + (z * t) elif (x * y) <= 5e-59: tmp = (a * b) + (c * i) elif (x * y) <= 3.6e+90: tmp = (a * b) + (z * t) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -3.5e+154) tmp = Float64(x * y); elseif (Float64(x * y) <= -4e-59) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 5e-59) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 3.6e+90) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = 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) <= -3.5e+154) tmp = x * y; elseif ((x * y) <= -4e-59) tmp = (c * i) + (z * t); elseif ((x * y) <= 5e-59) tmp = (a * b) + (c * i); elseif ((x * y) <= 3.6e+90) tmp = (a * b) + (z * t); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -3.5e+154], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4e-59], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-59], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.6e+90], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.5 \cdot 10^{+154}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-59}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-59}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 3.6 \cdot 10^{+90}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.5000000000000002e154 or 3.6e90 < (*.f64 x y) Initial program 93.5%
Taylor expanded in y around inf 93.5%
Taylor expanded in y around inf 96.1%
Taylor expanded in y around inf 70.9%
if -3.5000000000000002e154 < (*.f64 x y) < -4.0000000000000001e-59Initial program 95.2%
Taylor expanded in z around inf 71.2%
if -4.0000000000000001e-59 < (*.f64 x y) < 5.0000000000000001e-59Initial program 96.3%
Taylor expanded in a around inf 74.2%
if 5.0000000000000001e-59 < (*.f64 x y) < 3.6e90Initial program 99.9%
Taylor expanded in x around 0 89.6%
Taylor expanded in z around inf 79.7%
Taylor expanded in c around 0 72.6%
Taylor expanded in z around 0 82.6%
Final simplification73.6%
(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 (* i (+ c (/ (* a b) 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 = i * (c + ((a * b) / 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 = i * (c + ((a * b) / 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 = i * (c + ((a * b) / 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(i * Float64(c + Float64(Float64(a * b) / 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 = i * (c + ((a * b) / 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[(i * N[(c + N[(N[(a * b), $MachinePrecision] / i), $MachinePrecision]), $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}:\\
\;\;\;\;i \cdot \left(c + \frac{a \cdot b}{i}\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 a around inf 64.1%
Taylor expanded in i around inf 81.8%
Final simplification99.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.9e+125)
(* a b)
(if (<= (* a b) -9.2e-171)
(* c i)
(if (<= (* a b) 1.16e-130)
(* z t)
(if (<= (* a b) 8.5e-9) (* 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) <= -2.9e+125) {
tmp = a * b;
} else if ((a * b) <= -9.2e-171) {
tmp = c * i;
} else if ((a * b) <= 1.16e-130) {
tmp = z * t;
} else if ((a * b) <= 8.5e-9) {
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) <= (-2.9d+125)) then
tmp = a * b
else if ((a * b) <= (-9.2d-171)) then
tmp = c * i
else if ((a * b) <= 1.16d-130) then
tmp = z * t
else if ((a * b) <= 8.5d-9) 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) <= -2.9e+125) {
tmp = a * b;
} else if ((a * b) <= -9.2e-171) {
tmp = c * i;
} else if ((a * b) <= 1.16e-130) {
tmp = z * t;
} else if ((a * b) <= 8.5e-9) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.9e+125: tmp = a * b elif (a * b) <= -9.2e-171: tmp = c * i elif (a * b) <= 1.16e-130: tmp = z * t elif (a * b) <= 8.5e-9: 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) <= -2.9e+125) tmp = Float64(a * b); elseif (Float64(a * b) <= -9.2e-171) tmp = Float64(c * i); elseif (Float64(a * b) <= 1.16e-130) tmp = Float64(z * t); elseif (Float64(a * b) <= 8.5e-9) 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) <= -2.9e+125) tmp = a * b; elseif ((a * b) <= -9.2e-171) tmp = c * i; elseif ((a * b) <= 1.16e-130) tmp = z * t; elseif ((a * b) <= 8.5e-9) 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], -2.9e+125], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -9.2e-171], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.16e-130], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 8.5e-9], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.9 \cdot 10^{+125}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -9.2 \cdot 10^{-171}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.16 \cdot 10^{-130}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 8.5 \cdot 10^{-9}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.89999999999999993e125 or 8.5e-9 < (*.f64 a b) Initial program 89.5%
Taylor expanded in y around inf 86.9%
Taylor expanded in y around inf 78.7%
Taylor expanded in a around inf 63.8%
if -2.89999999999999993e125 < (*.f64 a b) < -9.19999999999999911e-171 or 1.1600000000000001e-130 < (*.f64 a b) < 8.5e-9Initial program 99.9%
Taylor expanded in c around inf 42.7%
if -9.19999999999999911e-171 < (*.f64 a b) < 1.1600000000000001e-130Initial program 100.0%
Taylor expanded in y around inf 97.3%
Taylor expanded in y around inf 89.3%
Taylor expanded in t around inf 39.1%
Final simplification50.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1.15e+103)
(* x y)
(if (<= (* x y) -5.6e+32)
(* z t)
(if (<= (* x y) 1.62e+91) (+ (* a b) (* c i)) (* 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) <= -1.15e+103) {
tmp = x * y;
} else if ((x * y) <= -5.6e+32) {
tmp = z * t;
} else if ((x * y) <= 1.62e+91) {
tmp = (a * b) + (c * i);
} 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) :: tmp
if ((x * y) <= (-1.15d+103)) then
tmp = x * y
else if ((x * y) <= (-5.6d+32)) then
tmp = z * t
else if ((x * y) <= 1.62d+91) then
tmp = (a * b) + (c * i)
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 tmp;
if ((x * y) <= -1.15e+103) {
tmp = x * y;
} else if ((x * y) <= -5.6e+32) {
tmp = z * t;
} else if ((x * y) <= 1.62e+91) {
tmp = (a * b) + (c * i);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1.15e+103: tmp = x * y elif (x * y) <= -5.6e+32: tmp = z * t elif (x * y) <= 1.62e+91: tmp = (a * b) + (c * i) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1.15e+103) tmp = Float64(x * y); elseif (Float64(x * y) <= -5.6e+32) tmp = Float64(z * t); elseif (Float64(x * y) <= 1.62e+91) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = 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) <= -1.15e+103) tmp = x * y; elseif ((x * y) <= -5.6e+32) tmp = z * t; elseif ((x * y) <= 1.62e+91) tmp = (a * b) + (c * i); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1.15e+103], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5.6e+32], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.62e+91], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.15 \cdot 10^{+103}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -5.6 \cdot 10^{+32}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.62 \cdot 10^{+91}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -1.15000000000000004e103 or 1.62e91 < (*.f64 x y) Initial program 94.2%
Taylor expanded in y around inf 94.2%
Taylor expanded in y around inf 96.5%
Taylor expanded in y around inf 66.9%
if -1.15000000000000004e103 < (*.f64 x y) < -5.6e32Initial program 92.7%
Taylor expanded in y around inf 86.2%
Taylor expanded in y around inf 72.8%
Taylor expanded in t around inf 58.1%
if -5.6e32 < (*.f64 x y) < 1.62e91Initial program 96.7%
Taylor expanded in a around inf 68.6%
Final simplification67.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -4e+66) (not (<= (* x y) 5e+88))) (+ (* c i) (+ (* 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) <= -4e+66) || !((x * y) <= 5e+88)) {
tmp = (c * i) + ((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) <= (-4d+66)) .or. (.not. ((x * y) <= 5d+88))) then
tmp = (c * i) + ((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) <= -4e+66) || !((x * y) <= 5e+88)) {
tmp = (c * i) + ((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) <= -4e+66) or not ((x * y) <= 5e+88): tmp = (c * i) + ((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) <= -4e+66) || !(Float64(x * y) <= 5e+88)) tmp = Float64(Float64(c * i) + 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) <= -4e+66) || ~(((x * y) <= 5e+88))) tmp = (c * i) + ((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], -4e+66], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+88]], $MachinePrecision]], N[(N[(c * i), $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 -4 \cdot 10^{+66} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+88}\right):\\
\;\;\;\;c \cdot i + \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) < -3.99999999999999978e66 or 4.99999999999999997e88 < (*.f64 x y) Initial program 93.5%
Taylor expanded in a around 0 87.3%
if -3.99999999999999978e66 < (*.f64 x y) < 4.99999999999999997e88Initial program 96.9%
Taylor expanded in x around 0 93.9%
Final simplification91.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+96)
(+ (* x y) (* z t))
(if (<= (* x y) 5e+88)
(+ (* 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) <= -1e+96) {
tmp = (x * y) + (z * t);
} else if ((x * y) <= 5e+88) {
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) <= (-1d+96)) then
tmp = (x * y) + (z * t)
else if ((x * y) <= 5d+88) 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) <= -1e+96) {
tmp = (x * y) + (z * t);
} else if ((x * y) <= 5e+88) {
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) <= -1e+96: tmp = (x * y) + (z * t) elif (x * y) <= 5e+88: 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) <= -1e+96) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(x * y) <= 5e+88) 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) <= -1e+96) tmp = (x * y) + (z * t); elseif ((x * y) <= 5e+88) 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], -1e+96], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+88], 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 -1 \cdot 10^{+96}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+88}:\\
\;\;\;\;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) < -1.00000000000000005e96Initial program 91.5%
Taylor expanded in a around 0 87.4%
Taylor expanded in c around 0 79.1%
if -1.00000000000000005e96 < (*.f64 x y) < 4.99999999999999997e88Initial program 97.0%
Taylor expanded in x around 0 93.2%
if 4.99999999999999997e88 < (*.f64 x y) Initial program 95.1%
Taylor expanded in x around inf 76.3%
Final simplification87.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.25e+115) (not (<= (* a b) 5.5e-10))) (* 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.25e+115) || !((a * b) <= 5.5e-10)) {
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.25d+115)) .or. (.not. ((a * b) <= 5.5d-10))) 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.25e+115) || !((a * b) <= 5.5e-10)) {
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.25e+115) or not ((a * b) <= 5.5e-10): 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.25e+115) || !(Float64(a * b) <= 5.5e-10)) 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.25e+115) || ~(((a * b) <= 5.5e-10))) 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.25e+115], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5.5e-10]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.25 \cdot 10^{+115} \lor \neg \left(a \cdot b \leq 5.5 \cdot 10^{-10}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.25000000000000002e115 or 5.4999999999999996e-10 < (*.f64 a b) Initial program 89.5%
Taylor expanded in y around inf 86.9%
Taylor expanded in y around inf 78.7%
Taylor expanded in a around inf 63.8%
if -1.25000000000000002e115 < (*.f64 a b) < 5.4999999999999996e-10Initial program 99.9%
Taylor expanded in c around inf 36.9%
Final simplification47.9%
(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 y around inf 90.9%
Taylor expanded in y around inf 81.2%
Taylor expanded in a around inf 29.9%
Final simplification29.9%
herbie shell --seed 2024071
(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)))