
(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 17 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 x y (* z t)) (+ (* a b) (* c i))) (* z (+ t (+ (* a (/ b z)) (+ (/ (* x y) z) (* c (/ i z))))))))
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(x, y, (z * t)) + ((a * b) + (c * i));
} else {
tmp = z * (t + ((a * (b / z)) + (((x * y) / z) + (c * (i / z)))));
}
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 = Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))); else tmp = Float64(z * Float64(t + Float64(Float64(a * Float64(b / z)) + Float64(Float64(Float64(x * y) / z) + Float64(c * Float64(i / z)))))); 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[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t + N[(N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision] + N[(c * N[(i / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \left(a \cdot \frac{b}{z} + \left(\frac{x \cdot y}{z} + c \cdot \frac{i}{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 99.6%
associate-+l+99.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 z around inf 44.4%
associate-/l*66.7%
+-commutative66.7%
associate-/l*77.8%
Simplified77.8%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 96.1%
+-commutative96.1%
fma-define96.1%
associate-+l+96.1%
fma-define96.9%
fma-define98.0%
Simplified98.0%
Final simplification98.0%
(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 96.1%
+-commutative96.1%
fma-define96.1%
+-commutative96.1%
fma-define96.9%
fma-define97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (+ (* a b) (* z t)))))
(if (<= (* x y) -5e+163)
(* x (+ y (/ (* z t) x)))
(if (<= (* x y) 1e+63)
t_1
(if (<= (* x y) 2e+149)
(+ (* a b) (* x y))
(if (<= (* x y) 1e+205) 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 = (c * i) + ((a * b) + (z * t));
double tmp;
if ((x * y) <= -5e+163) {
tmp = x * (y + ((z * t) / x));
} else if ((x * y) <= 1e+63) {
tmp = t_1;
} else if ((x * y) <= 2e+149) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 1e+205) {
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 = (c * i) + ((a * b) + (z * t))
if ((x * y) <= (-5d+163)) then
tmp = x * (y + ((z * t) / x))
else if ((x * y) <= 1d+63) then
tmp = t_1
else if ((x * y) <= 2d+149) then
tmp = (a * b) + (x * y)
else if ((x * y) <= 1d+205) 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 = (c * i) + ((a * b) + (z * t));
double tmp;
if ((x * y) <= -5e+163) {
tmp = x * (y + ((z * t) / x));
} else if ((x * y) <= 1e+63) {
tmp = t_1;
} else if ((x * y) <= 2e+149) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 1e+205) {
tmp = t_1;
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + (z * t)) tmp = 0 if (x * y) <= -5e+163: tmp = x * (y + ((z * t) / x)) elif (x * y) <= 1e+63: tmp = t_1 elif (x * y) <= 2e+149: tmp = (a * b) + (x * y) elif (x * y) <= 1e+205: 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(c * i) + Float64(Float64(a * b) + Float64(z * t))) tmp = 0.0 if (Float64(x * y) <= -5e+163) tmp = Float64(x * Float64(y + Float64(Float64(z * t) / x))); elseif (Float64(x * y) <= 1e+63) tmp = t_1; elseif (Float64(x * y) <= 2e+149) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(x * y) <= 1e+205) 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 = (c * i) + ((a * b) + (z * t)); tmp = 0.0; if ((x * y) <= -5e+163) tmp = x * (y + ((z * t) / x)); elseif ((x * y) <= 1e+63) tmp = t_1; elseif ((x * y) <= 2e+149) tmp = (a * b) + (x * y); elseif ((x * y) <= 1e+205) 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[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+163], N[(x * N[(y + N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+63], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e+149], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+205], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+163}:\\
\;\;\;\;x \cdot \left(y + \frac{z \cdot t}{x}\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+149}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 10^{+205}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -5e163Initial program 93.8%
Taylor expanded in x around inf 96.8%
Taylor expanded in a around 0 92.6%
Taylor expanded in c around 0 83.6%
if -5e163 < (*.f64 x y) < 1.00000000000000006e63 or 2.0000000000000001e149 < (*.f64 x y) < 1.00000000000000002e205Initial program 98.3%
Taylor expanded in x around 0 89.3%
if 1.00000000000000006e63 < (*.f64 x y) < 2.0000000000000001e149Initial program 92.9%
Taylor expanded in x around inf 92.9%
Taylor expanded in x around inf 86.4%
Taylor expanded in c around 0 79.6%
if 1.00000000000000002e205 < (*.f64 x y) Initial program 88.2%
Taylor expanded in x around inf 85.7%
Final simplification87.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (+ (* x y) (* z t)))))
(if (<= t_1 INFINITY)
(+ t_1 (* c i))
(* z (+ t (+ (* a (/ b z)) (+ (/ (* x y) z) (* c (/ i z)))))))))
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 tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1 + (c * i);
} else {
tmp = z * (t + ((a * (b / z)) + (((x * y) / z) + (c * (i / z)))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + ((x * y) + (z * t));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1 + (c * i);
} else {
tmp = z * (t + ((a * (b / z)) + (((x * y) / z) + (c * (i / z)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + ((x * y) + (z * t)) tmp = 0 if t_1 <= math.inf: tmp = t_1 + (c * i) else: tmp = z * (t + ((a * (b / z)) + (((x * y) / z) + (c * (i / z))))) 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))) tmp = 0.0 if (t_1 <= Inf) tmp = Float64(t_1 + Float64(c * i)); else tmp = Float64(z * Float64(t + Float64(Float64(a * Float64(b / z)) + Float64(Float64(Float64(x * y) / z) + Float64(c * Float64(i / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + ((x * y) + (z * t)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1 + (c * i); else tmp = z * (t + ((a * (b / z)) + (((x * y) / z) + (c * (i / z))))); 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]}, If[LessEqual[t$95$1, Infinity], N[(t$95$1 + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(z * N[(t + N[(N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision] + N[(c * N[(i / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1 + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \left(a \cdot \frac{b}{z} + \left(\frac{x \cdot y}{z} + c \cdot \frac{i}{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 99.6%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
Taylor expanded in z around inf 44.4%
associate-/l*66.7%
+-commutative66.7%
associate-/l*77.8%
Simplified77.8%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))) (t_2 (+ (* a b) (* c i))))
(if (<= (* c i) -5.2e+99)
t_2
(if (<= (* c i) 7.2e-110)
t_1
(if (<= (* c i) 8200000000.0)
(* z t)
(if (<= (* c i) 2.9e+222) 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) + (x * y);
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -5.2e+99) {
tmp = t_2;
} else if ((c * i) <= 7.2e-110) {
tmp = t_1;
} else if ((c * i) <= 8200000000.0) {
tmp = z * t;
} else if ((c * i) <= 2.9e+222) {
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) + (x * y)
t_2 = (a * b) + (c * i)
if ((c * i) <= (-5.2d+99)) then
tmp = t_2
else if ((c * i) <= 7.2d-110) then
tmp = t_1
else if ((c * i) <= 8200000000.0d0) then
tmp = z * t
else if ((c * i) <= 2.9d+222) 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) + (x * y);
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -5.2e+99) {
tmp = t_2;
} else if ((c * i) <= 7.2e-110) {
tmp = t_1;
} else if ((c * i) <= 8200000000.0) {
tmp = z * t;
} else if ((c * i) <= 2.9e+222) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) t_2 = (a * b) + (c * i) tmp = 0 if (c * i) <= -5.2e+99: tmp = t_2 elif (c * i) <= 7.2e-110: tmp = t_1 elif (c * i) <= 8200000000.0: tmp = z * t elif (c * i) <= 2.9e+222: 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(x * y)) t_2 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -5.2e+99) tmp = t_2; elseif (Float64(c * i) <= 7.2e-110) tmp = t_1; elseif (Float64(c * i) <= 8200000000.0) tmp = Float64(z * t); elseif (Float64(c * i) <= 2.9e+222) 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) + (x * y); t_2 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -5.2e+99) tmp = t_2; elseif ((c * i) <= 7.2e-110) tmp = t_1; elseif ((c * i) <= 8200000000.0) tmp = z * t; elseif ((c * i) <= 2.9e+222) 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[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -5.2e+99], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 7.2e-110], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 8200000000.0], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.9e+222], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -5.2 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq 7.2 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 8200000000:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 2.9 \cdot 10^{+222}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 c i) < -5.1999999999999999e99 or 2.89999999999999981e222 < (*.f64 c i) Initial program 95.1%
Taylor expanded in a around inf 79.3%
if -5.1999999999999999e99 < (*.f64 c i) < 7.1999999999999999e-110 or 8.2e9 < (*.f64 c i) < 2.89999999999999981e222Initial program 97.0%
Taylor expanded in x around inf 90.3%
Taylor expanded in x around inf 72.3%
Taylor expanded in c around 0 66.9%
if 7.1999999999999999e-110 < (*.f64 c i) < 8.2e9Initial program 92.5%
Taylor expanded in z around inf 70.1%
Taylor expanded in i around inf 56.3%
associate-/l*56.2%
Simplified56.2%
Taylor expanded in i around 0 65.0%
Final simplification69.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1.1e-48)
(+ (* a b) (* x y))
(if (<= (* a b) -4.4e-197)
(+ (* c i) (* z t))
(if (<= (* a b) 3.7e-289)
(+ (* x y) (* c i))
(if (<= (* a b) 1.05e+93) (+ (* x y) (* z t)) (+ (* a b) (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.1e-48) {
tmp = (a * b) + (x * y);
} else if ((a * b) <= -4.4e-197) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 3.7e-289) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 1.05e+93) {
tmp = (x * y) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-1.1d-48)) then
tmp = (a * b) + (x * y)
else if ((a * b) <= (-4.4d-197)) then
tmp = (c * i) + (z * t)
else if ((a * b) <= 3.7d-289) then
tmp = (x * y) + (c * i)
else if ((a * b) <= 1.05d+93) then
tmp = (x * y) + (z * t)
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1.1e-48) {
tmp = (a * b) + (x * y);
} else if ((a * b) <= -4.4e-197) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 3.7e-289) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 1.05e+93) {
tmp = (x * y) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1.1e-48: tmp = (a * b) + (x * y) elif (a * b) <= -4.4e-197: tmp = (c * i) + (z * t) elif (a * b) <= 3.7e-289: tmp = (x * y) + (c * i) elif (a * b) <= 1.05e+93: tmp = (x * y) + (z * t) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1.1e-48) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(a * b) <= -4.4e-197) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(a * b) <= 3.7e-289) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(a * b) <= 1.05e+93) tmp = Float64(Float64(x * y) + Float64(z * t)); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1.1e-48) tmp = (a * b) + (x * y); elseif ((a * b) <= -4.4e-197) tmp = (c * i) + (z * t); elseif ((a * b) <= 3.7e-289) tmp = (x * y) + (c * i); elseif ((a * b) <= 1.05e+93) tmp = (x * y) + (z * t); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1.1e-48], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -4.4e-197], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.7e-289], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.05e+93], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.1 \cdot 10^{-48}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq -4.4 \cdot 10^{-197}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 3.7 \cdot 10^{-289}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.05 \cdot 10^{+93}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.10000000000000006e-48Initial program 96.7%
Taylor expanded in x around inf 87.7%
Taylor expanded in x around inf 83.8%
Taylor expanded in c around 0 74.7%
if -1.10000000000000006e-48 < (*.f64 a b) < -4.4000000000000001e-197Initial program 93.9%
Taylor expanded in z around inf 71.4%
if -4.4000000000000001e-197 < (*.f64 a b) < 3.69999999999999989e-289Initial program 98.2%
Taylor expanded in x around inf 72.3%
if 3.69999999999999989e-289 < (*.f64 a b) < 1.0499999999999999e93Initial program 100.0%
Taylor expanded in x around inf 88.0%
Taylor expanded in a around 0 84.5%
Taylor expanded in c around 0 66.6%
Taylor expanded in x around 0 75.0%
if 1.0499999999999999e93 < (*.f64 a b) Initial program 89.8%
Taylor expanded in a around inf 73.8%
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 (* z (+ t (+ (* c (/ i z)) (* x (/ y z))))))))
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 = z * (t + ((c * (i / z)) + (x * (y / z))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (t + ((c * (i / z)) + (x * (y / z))));
}
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 = z * (t + ((c * (i / z)) + (x * (y / z)))) 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(z * Float64(t + Float64(Float64(c * Float64(i / z)) + Float64(x * Float64(y / z))))); 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 = z * (t + ((c * (i / z)) + (x * (y / z)))); 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[(z * N[(t + N[(N[(c * N[(i / z), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $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}:\\
\;\;\;\;z \cdot \left(t + \left(c \cdot \frac{i}{z} + x \cdot \frac{y}{z}\right)\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 0 30.0%
Taylor expanded in z around inf 50.0%
+-commutative50.0%
associate-/l*50.0%
associate-/l*60.0%
Simplified60.0%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5e+163)
(* x (+ y (/ (* z t) x)))
(if (<= (* x y) 200000.0)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* c i) (+ (* a b) (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+163) {
tmp = x * (y + ((z * t) / x));
} else if ((x * y) <= 200000.0) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-5d+163)) then
tmp = x * (y + ((z * t) / x))
else if ((x * y) <= 200000.0d0) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((a * b) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+163) {
tmp = x * (y + ((z * t) / x));
} else if ((x * y) <= 200000.0) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -5e+163: tmp = x * (y + ((z * t) / x)) elif (x * y) <= 200000.0: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((a * b) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5e+163) tmp = Float64(x * Float64(y + Float64(Float64(z * t) / x))); elseif (Float64(x * y) <= 200000.0) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -5e+163) tmp = x * (y + ((z * t) / x)); elseif ((x * y) <= 200000.0) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((a * b) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+163], N[(x * N[(y + N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 200000.0], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+163}:\\
\;\;\;\;x \cdot \left(y + \frac{z \cdot t}{x}\right)\\
\mathbf{elif}\;x \cdot y \leq 200000:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -5e163Initial program 93.8%
Taylor expanded in x around inf 96.8%
Taylor expanded in a around 0 92.6%
Taylor expanded in c around 0 83.6%
if -5e163 < (*.f64 x y) < 2e5Initial program 99.3%
Taylor expanded in x around 0 92.9%
if 2e5 < (*.f64 x y) Initial program 90.5%
Taylor expanded in z around 0 81.5%
Final simplification88.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -4.4e+39)
(+ (* c i) (+ (* a b) (* x y)))
(if (<= (* a b) 1.06e+87)
(+ (* 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 ((a * b) <= -4.4e+39) {
tmp = (c * i) + ((a * b) + (x * y));
} else if ((a * b) <= 1.06e+87) {
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 ((a * b) <= (-4.4d+39)) then
tmp = (c * i) + ((a * b) + (x * y))
else if ((a * b) <= 1.06d+87) 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 ((a * b) <= -4.4e+39) {
tmp = (c * i) + ((a * b) + (x * y));
} else if ((a * b) <= 1.06e+87) {
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 (a * b) <= -4.4e+39: tmp = (c * i) + ((a * b) + (x * y)) elif (a * b) <= 1.06e+87: 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(a * b) <= -4.4e+39) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); elseif (Float64(a * b) <= 1.06e+87) 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 ((a * b) <= -4.4e+39) tmp = (c * i) + ((a * b) + (x * y)); elseif ((a * b) <= 1.06e+87) 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[LessEqual[N[(a * b), $MachinePrecision], -4.4e+39], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.06e+87], 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}\;a \cdot b \leq -4.4 \cdot 10^{+39}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{elif}\;a \cdot b \leq 1.06 \cdot 10^{+87}:\\
\;\;\;\;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 a b) < -4.4000000000000003e39Initial program 95.9%
Taylor expanded in z around 0 85.5%
if -4.4000000000000003e39 < (*.f64 a b) < 1.0600000000000001e87Initial program 98.1%
Taylor expanded in a around 0 95.7%
if 1.0600000000000001e87 < (*.f64 a b) Initial program 90.0%
Taylor expanded in x around 0 82.4%
Final simplification91.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -4.6e+39)
(* a b)
(if (<= (* a b) 3.2e-259)
(* x y)
(if (<= (* a b) 4.7e+67) (* 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) <= -4.6e+39) {
tmp = a * b;
} else if ((a * b) <= 3.2e-259) {
tmp = x * y;
} else if ((a * b) <= 4.7e+67) {
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) <= (-4.6d+39)) then
tmp = a * b
else if ((a * b) <= 3.2d-259) then
tmp = x * y
else if ((a * b) <= 4.7d+67) 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) <= -4.6e+39) {
tmp = a * b;
} else if ((a * b) <= 3.2e-259) {
tmp = x * y;
} else if ((a * b) <= 4.7e+67) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -4.6e+39: tmp = a * b elif (a * b) <= 3.2e-259: tmp = x * y elif (a * b) <= 4.7e+67: 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) <= -4.6e+39) tmp = Float64(a * b); elseif (Float64(a * b) <= 3.2e-259) tmp = Float64(x * y); elseif (Float64(a * b) <= 4.7e+67) 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) <= -4.6e+39) tmp = a * b; elseif ((a * b) <= 3.2e-259) tmp = x * y; elseif ((a * b) <= 4.7e+67) 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], -4.6e+39], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.2e-259], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.7e+67], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4.6 \cdot 10^{+39}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 3.2 \cdot 10^{-259}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 4.7 \cdot 10^{+67}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -4.60000000000000024e39 or 4.70000000000000017e67 < (*.f64 a b) Initial program 93.2%
Taylor expanded in x around inf 84.9%
Taylor expanded in x around inf 83.3%
Taylor expanded in a around inf 61.9%
if -4.60000000000000024e39 < (*.f64 a b) < 3.19999999999999988e-259Initial program 97.2%
Taylor expanded in x around inf 95.4%
Taylor expanded in x around inf 68.1%
Taylor expanded in x around inf 39.3%
if 3.19999999999999988e-259 < (*.f64 a b) < 4.70000000000000017e67Initial program 100.0%
Taylor expanded in z around inf 75.7%
Taylor expanded in i around inf 63.4%
associate-/l*59.2%
Simplified59.2%
Taylor expanded in i around 0 50.2%
Final simplification50.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -6.6e+159) (not (<= (* x y) 4.5e+70))) (* 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) <= -6.6e+159) || !((x * y) <= 4.5e+70)) {
tmp = 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) <= (-6.6d+159)) .or. (.not. ((x * y) <= 4.5d+70))) then
tmp = 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) <= -6.6e+159) || !((x * y) <= 4.5e+70)) {
tmp = 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) <= -6.6e+159) or not ((x * y) <= 4.5e+70): tmp = 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) <= -6.6e+159) || !(Float64(x * y) <= 4.5e+70)) tmp = 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) <= -6.6e+159) || ~(((x * y) <= 4.5e+70))) tmp = 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], -6.6e+159], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4.5e+70]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.6 \cdot 10^{+159} \lor \neg \left(x \cdot y \leq 4.5 \cdot 10^{+70}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -6.5999999999999998e159 or 4.4999999999999999e70 < (*.f64 x y) Initial program 92.2%
Taylor expanded in x around inf 93.3%
Taylor expanded in x around inf 81.4%
Taylor expanded in x around inf 62.8%
if -6.5999999999999998e159 < (*.f64 x y) < 4.4999999999999999e70Initial program 98.2%
Taylor expanded in a around inf 58.3%
Final simplification59.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -6.5e-49) (+ (* a b) (* x y)) (if (<= (* a b) 6.5e+67) (+ (* c i) (* z t)) (+ (* a b) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -6.5e-49) {
tmp = (a * b) + (x * y);
} else if ((a * b) <= 6.5e+67) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-6.5d-49)) then
tmp = (a * b) + (x * y)
else if ((a * b) <= 6.5d+67) then
tmp = (c * i) + (z * t)
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -6.5e-49) {
tmp = (a * b) + (x * y);
} else if ((a * b) <= 6.5e+67) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -6.5e-49: tmp = (a * b) + (x * y) elif (a * b) <= 6.5e+67: tmp = (c * i) + (z * t) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -6.5e-49) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(a * b) <= 6.5e+67) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -6.5e-49) tmp = (a * b) + (x * y); elseif ((a * b) <= 6.5e+67) tmp = (c * i) + (z * t); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -6.5e-49], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 6.5e+67], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -6.5 \cdot 10^{-49}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 6.5 \cdot 10^{+67}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -6.49999999999999968e-49Initial program 96.7%
Taylor expanded in x around inf 87.7%
Taylor expanded in x around inf 83.8%
Taylor expanded in c around 0 74.7%
if -6.49999999999999968e-49 < (*.f64 a b) < 6.4999999999999995e67Initial program 97.8%
Taylor expanded in z around inf 67.8%
if 6.4999999999999995e67 < (*.f64 a b) Initial program 90.7%
Taylor expanded in a around inf 69.1%
Final simplification69.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -4.6e+39) (+ (* a b) (* x y)) (if (<= (* a b) 5e+90) (+ (* x y) (* z t)) (+ (* a b) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4.6e+39) {
tmp = (a * b) + (x * y);
} else if ((a * b) <= 5e+90) {
tmp = (x * y) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-4.6d+39)) then
tmp = (a * b) + (x * y)
else if ((a * b) <= 5d+90) then
tmp = (x * y) + (z * t)
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4.6e+39) {
tmp = (a * b) + (x * y);
} else if ((a * b) <= 5e+90) {
tmp = (x * y) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -4.6e+39: tmp = (a * b) + (x * y) elif (a * b) <= 5e+90: tmp = (x * y) + (z * t) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -4.6e+39) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(a * b) <= 5e+90) tmp = Float64(Float64(x * y) + Float64(z * t)); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -4.6e+39) tmp = (a * b) + (x * y); elseif ((a * b) <= 5e+90) tmp = (x * y) + (z * t); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -4.6e+39], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+90], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4.6 \cdot 10^{+39}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+90}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -4.60000000000000024e39Initial program 95.9%
Taylor expanded in x around inf 84.4%
Taylor expanded in x around inf 85.5%
Taylor expanded in c around 0 78.0%
if -4.60000000000000024e39 < (*.f64 a b) < 5.0000000000000004e90Initial program 98.1%
Taylor expanded in x around inf 92.7%
Taylor expanded in a around 0 90.3%
Taylor expanded in c around 0 66.1%
Taylor expanded in x around 0 69.6%
if 5.0000000000000004e90 < (*.f64 a b) Initial program 89.8%
Taylor expanded in a around inf 73.8%
Final simplification72.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -2.5e+47) (not (<= (* a b) 7.2e+57))) (* a b) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -2.5e+47) || !((a * b) <= 7.2e+57)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-2.5d+47)) .or. (.not. ((a * b) <= 7.2d+57))) then
tmp = a * b
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -2.5e+47) || !((a * b) <= 7.2e+57)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -2.5e+47) or not ((a * b) <= 7.2e+57): tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -2.5e+47) || !(Float64(a * b) <= 7.2e+57)) tmp = Float64(a * b); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -2.5e+47) || ~(((a * b) <= 7.2e+57))) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -2.5e+47], N[Not[LessEqual[N[(a * b), $MachinePrecision], 7.2e+57]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.5 \cdot 10^{+47} \lor \neg \left(a \cdot b \leq 7.2 \cdot 10^{+57}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -2.50000000000000011e47 or 7.2000000000000005e57 < (*.f64 a b) Initial program 93.1%
Taylor expanded in x around inf 84.8%
Taylor expanded in x around inf 82.2%
Taylor expanded in a around inf 61.6%
if -2.50000000000000011e47 < (*.f64 a b) < 7.2000000000000005e57Initial program 98.0%
Taylor expanded in c around inf 30.2%
Final simplification42.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -2.9e+39) (not (<= (* a b) 5.2e+67))) (* 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) <= -2.9e+39) || !((a * b) <= 5.2e+67)) {
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) <= (-2.9d+39)) .or. (.not. ((a * b) <= 5.2d+67))) 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) <= -2.9e+39) || !((a * b) <= 5.2e+67)) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -2.9e+39) or not ((a * b) <= 5.2e+67): 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) <= -2.9e+39) || !(Float64(a * b) <= 5.2e+67)) 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) <= -2.9e+39) || ~(((a * b) <= 5.2e+67))) tmp = a * b; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -2.9e+39], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5.2e+67]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.9 \cdot 10^{+39} \lor \neg \left(a \cdot b \leq 5.2 \cdot 10^{+67}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -2.90000000000000029e39 or 5.2000000000000001e67 < (*.f64 a b) Initial program 93.2%
Taylor expanded in x around inf 84.9%
Taylor expanded in x around inf 83.3%
Taylor expanded in a around inf 61.9%
if -2.90000000000000029e39 < (*.f64 a b) < 5.2000000000000001e67Initial program 98.0%
Taylor expanded in z around inf 65.6%
Taylor expanded in i around inf 58.8%
associate-/l*56.2%
Simplified56.2%
Taylor expanded in i around 0 38.3%
Final simplification47.8%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.1%
Taylor expanded in x around inf 89.8%
Taylor expanded in x around inf 71.2%
Taylor expanded in a around inf 27.4%
Final simplification27.4%
herbie shell --seed 2024075
(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)))