
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (fma c i (fma a b (fma x y (* z t)))) (* z (+ t (* 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))) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(c, i, fma(a, b, fma(x, y, (z * t))));
} else {
tmp = z * (t + (c * (i / z)));
}
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 = fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))); else tmp = Float64(z * Float64(t + Float64(c * Float64(i / z)))); 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[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t + N[(c * N[(i / z), $MachinePrecision]), $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(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + c \cdot \frac{i}{z}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.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 z around inf 61.6%
Taylor expanded in z around inf 61.6%
associate-/l*77.0%
Simplified77.0%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* c i))))
(if (<= (* a b) -5e+23)
(+ (* a b) (* c i))
(if (<= (* a b) -1e-33)
t_1
(if (<= (* a b) 1e-157)
(+ (* c i) (* z t))
(if (<= (* a b) 5e-15) 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 = (x * y) + (c * i);
double tmp;
if ((a * b) <= -5e+23) {
tmp = (a * b) + (c * i);
} else if ((a * b) <= -1e-33) {
tmp = t_1;
} else if ((a * b) <= 1e-157) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 5e-15) {
tmp = t_1;
} else {
tmp = i * (c + ((a * b) / 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 = (x * y) + (c * i)
if ((a * b) <= (-5d+23)) then
tmp = (a * b) + (c * i)
else if ((a * b) <= (-1d-33)) then
tmp = t_1
else if ((a * b) <= 1d-157) then
tmp = (c * i) + (z * t)
else if ((a * b) <= 5d-15) then
tmp = t_1
else
tmp = i * (c + ((a * b) / 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 = (x * y) + (c * i);
double tmp;
if ((a * b) <= -5e+23) {
tmp = (a * b) + (c * i);
} else if ((a * b) <= -1e-33) {
tmp = t_1;
} else if ((a * b) <= 1e-157) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 5e-15) {
tmp = t_1;
} else {
tmp = i * (c + ((a * b) / i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (c * i) tmp = 0 if (a * b) <= -5e+23: tmp = (a * b) + (c * i) elif (a * b) <= -1e-33: tmp = t_1 elif (a * b) <= 1e-157: tmp = (c * i) + (z * t) elif (a * b) <= 5e-15: 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(x * y) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -5e+23) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(a * b) <= -1e-33) tmp = t_1; elseif (Float64(a * b) <= 1e-157) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(a * b) <= 5e-15) 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 = (x * y) + (c * i); tmp = 0.0; if ((a * b) <= -5e+23) tmp = (a * b) + (c * i); elseif ((a * b) <= -1e-33) tmp = t_1; elseif ((a * b) <= 1e-157) tmp = (c * i) + (z * t); elseif ((a * b) <= 5e-15) 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[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+23], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1e-33], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e-157], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e-15], t$95$1, N[(i * N[(c + N[(N[(a * b), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+23}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 10^{-157}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(c + \frac{a \cdot b}{i}\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e23Initial program 90.6%
Taylor expanded in a around inf 77.4%
if -4.9999999999999999e23 < (*.f64 a b) < -1.0000000000000001e-33 or 9.99999999999999943e-158 < (*.f64 a b) < 4.99999999999999999e-15Initial program 100.0%
Taylor expanded in x around inf 73.9%
if -1.0000000000000001e-33 < (*.f64 a b) < 9.99999999999999943e-158Initial program 96.4%
Taylor expanded in z around inf 64.9%
if 4.99999999999999999e-15 < (*.f64 a b) Initial program 94.1%
Taylor expanded in a around inf 64.9%
Taylor expanded in i around inf 62.8%
Final simplification68.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))) (t_2 (* x (+ y (/ (* a b) x)))))
(if (<= (* x y) -4e-23)
t_2
(if (<= (* x y) -1e-294)
t_1
(if (<= (* x y) 5e-297)
(+ (* c i) (* z t))
(if (<= (* x y) 2e+112) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double t_2 = x * (y + ((a * b) / x));
double tmp;
if ((x * y) <= -4e-23) {
tmp = t_2;
} else if ((x * y) <= -1e-294) {
tmp = t_1;
} else if ((x * y) <= 5e-297) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 2e+112) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (c * i)
t_2 = x * (y + ((a * b) / x))
if ((x * y) <= (-4d-23)) then
tmp = t_2
else if ((x * y) <= (-1d-294)) then
tmp = t_1
else if ((x * y) <= 5d-297) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 2d+112) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double t_2 = x * (y + ((a * b) / x));
double tmp;
if ((x * y) <= -4e-23) {
tmp = t_2;
} else if ((x * y) <= -1e-294) {
tmp = t_1;
} else if ((x * y) <= 5e-297) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 2e+112) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) t_2 = x * (y + ((a * b) / x)) tmp = 0 if (x * y) <= -4e-23: tmp = t_2 elif (x * y) <= -1e-294: tmp = t_1 elif (x * y) <= 5e-297: tmp = (c * i) + (z * t) elif (x * y) <= 2e+112: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) t_2 = Float64(x * Float64(y + Float64(Float64(a * b) / x))) tmp = 0.0 if (Float64(x * y) <= -4e-23) tmp = t_2; elseif (Float64(x * y) <= -1e-294) tmp = t_1; elseif (Float64(x * y) <= 5e-297) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 2e+112) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); t_2 = x * (y + ((a * b) / x)); tmp = 0.0; if ((x * y) <= -4e-23) tmp = t_2; elseif ((x * y) <= -1e-294) tmp = t_1; elseif ((x * y) <= 5e-297) tmp = (c * i) + (z * t); elseif ((x * y) <= 2e+112) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y + N[(N[(a * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4e-23], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1e-294], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-297], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+112], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
t_2 := x \cdot \left(y + \frac{a \cdot b}{x}\right)\\
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-294}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-297}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 x y) < -3.99999999999999984e-23 or 1.9999999999999999e112 < (*.f64 x y) Initial program 94.2%
Taylor expanded in x around inf 92.3%
Taylor expanded in t around 0 80.3%
Taylor expanded in c around 0 75.4%
if -3.99999999999999984e-23 < (*.f64 x y) < -1.00000000000000002e-294 or 5e-297 < (*.f64 x y) < 1.9999999999999999e112Initial program 96.5%
Taylor expanded in a around inf 70.1%
if -1.00000000000000002e-294 < (*.f64 x y) < 5e-297Initial program 92.3%
Taylor expanded in z around inf 70.4%
Final simplification72.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -4e-23)
(* x (+ y (/ (* a b) x)))
(if (<= (* x y) -1e-294)
t_1
(if (<= (* x y) 5e-297)
(+ (* c i) (* z t))
(if (<= (* x y) 5e+108) t_1 (* z (+ t (/ (* 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) + (c * i);
double tmp;
if ((x * y) <= -4e-23) {
tmp = x * (y + ((a * b) / x));
} else if ((x * y) <= -1e-294) {
tmp = t_1;
} else if ((x * y) <= 5e-297) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 5e+108) {
tmp = t_1;
} else {
tmp = z * (t + ((x * y) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((x * y) <= (-4d-23)) then
tmp = x * (y + ((a * b) / x))
else if ((x * y) <= (-1d-294)) then
tmp = t_1
else if ((x * y) <= 5d-297) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 5d+108) then
tmp = t_1
else
tmp = z * (t + ((x * y) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -4e-23) {
tmp = x * (y + ((a * b) / x));
} else if ((x * y) <= -1e-294) {
tmp = t_1;
} else if ((x * y) <= 5e-297) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 5e+108) {
tmp = t_1;
} else {
tmp = z * (t + ((x * y) / z));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (x * y) <= -4e-23: tmp = x * (y + ((a * b) / x)) elif (x * y) <= -1e-294: tmp = t_1 elif (x * y) <= 5e-297: tmp = (c * i) + (z * t) elif (x * y) <= 5e+108: tmp = t_1 else: tmp = z * (t + ((x * y) / z)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -4e-23) tmp = Float64(x * Float64(y + Float64(Float64(a * b) / x))); elseif (Float64(x * y) <= -1e-294) tmp = t_1; elseif (Float64(x * y) <= 5e-297) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 5e+108) tmp = t_1; else tmp = Float64(z * Float64(t + Float64(Float64(x * y) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); tmp = 0.0; if ((x * y) <= -4e-23) tmp = x * (y + ((a * b) / x)); elseif ((x * y) <= -1e-294) tmp = t_1; elseif ((x * y) <= 5e-297) tmp = (c * i) + (z * t); elseif ((x * y) <= 5e+108) tmp = t_1; else tmp = z * (t + ((x * y) / 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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4e-23], N[(x * N[(y + N[(N[(a * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-294], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-297], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+108], t$95$1, N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-23}:\\
\;\;\;\;x \cdot \left(y + \frac{a \cdot b}{x}\right)\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-294}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-297}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \frac{x \cdot y}{z}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -3.99999999999999984e-23Initial program 93.2%
Taylor expanded in x around inf 89.9%
Taylor expanded in t around 0 80.2%
Taylor expanded in c around 0 73.4%
if -3.99999999999999984e-23 < (*.f64 x y) < -1.00000000000000002e-294 or 5e-297 < (*.f64 x y) < 4.99999999999999991e108Initial program 96.4%
Taylor expanded in a around inf 70.7%
if -1.00000000000000002e-294 < (*.f64 x y) < 5e-297Initial program 92.3%
Taylor expanded in z around inf 70.4%
if 4.99999999999999991e108 < (*.f64 x y) Initial program 95.6%
Taylor expanded in z around inf 85.0%
Taylor expanded in a around 0 80.5%
Taylor expanded in c around 0 80.5%
Final simplification73.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* c i))) (t_2 (+ (* a b) (* c i))))
(if (<= (* a b) -5e+23)
t_2
(if (<= (* a b) -1e-33)
t_1
(if (<= (* a b) 1e-157)
(+ (* c i) (* z t))
(if (<= (* a b) 5e-15) 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 = (x * y) + (c * i);
double t_2 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -5e+23) {
tmp = t_2;
} else if ((a * b) <= -1e-33) {
tmp = t_1;
} else if ((a * b) <= 1e-157) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 5e-15) {
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 = (x * y) + (c * i)
t_2 = (a * b) + (c * i)
if ((a * b) <= (-5d+23)) then
tmp = t_2
else if ((a * b) <= (-1d-33)) then
tmp = t_1
else if ((a * b) <= 1d-157) then
tmp = (c * i) + (z * t)
else if ((a * b) <= 5d-15) 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 = (x * y) + (c * i);
double t_2 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -5e+23) {
tmp = t_2;
} else if ((a * b) <= -1e-33) {
tmp = t_1;
} else if ((a * b) <= 1e-157) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 5e-15) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (c * i) t_2 = (a * b) + (c * i) tmp = 0 if (a * b) <= -5e+23: tmp = t_2 elif (a * b) <= -1e-33: tmp = t_1 elif (a * b) <= 1e-157: tmp = (c * i) + (z * t) elif (a * b) <= 5e-15: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(c * i)) t_2 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -5e+23) tmp = t_2; elseif (Float64(a * b) <= -1e-33) tmp = t_1; elseif (Float64(a * b) <= 1e-157) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(a * b) <= 5e-15) 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 = (x * y) + (c * i); t_2 = (a * b) + (c * i); tmp = 0.0; if ((a * b) <= -5e+23) tmp = t_2; elseif ((a * b) <= -1e-33) tmp = t_1; elseif ((a * b) <= 1e-157) tmp = (c * i) + (z * t); elseif ((a * b) <= 5e-15) 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[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+23], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1e-33], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e-157], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e-15], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + c \cdot i\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 10^{-157}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -4.9999999999999999e23 or 4.99999999999999999e-15 < (*.f64 a b) Initial program 92.4%
Taylor expanded in a around inf 70.9%
if -4.9999999999999999e23 < (*.f64 a b) < -1.0000000000000001e-33 or 9.99999999999999943e-158 < (*.f64 a b) < 4.99999999999999999e-15Initial program 100.0%
Taylor expanded in x around inf 73.9%
if -1.0000000000000001e-33 < (*.f64 a b) < 9.99999999999999943e-158Initial program 96.4%
Taylor expanded in z around inf 64.9%
Final simplification69.4%
(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)))))))
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)));
}
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)));
}
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))) 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(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))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (t + (c * (i / 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[(c * N[(i / z), $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 + c \cdot \frac{i}{z}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in z around inf 61.6%
Taylor expanded in z around inf 61.6%
associate-/l*77.0%
Simplified77.0%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5e+119) (not (<= (* x y) 1e+173))) (* x (+ y (/ (* a b) x))) (+ (* 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) <= -5e+119) || !((x * y) <= 1e+173)) {
tmp = x * (y + ((a * b) / x));
} 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) <= (-5d+119)) .or. (.not. ((x * y) <= 1d+173))) then
tmp = x * (y + ((a * b) / x))
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) <= -5e+119) || !((x * y) <= 1e+173)) {
tmp = x * (y + ((a * b) / x));
} 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) <= -5e+119) or not ((x * y) <= 1e+173): tmp = x * (y + ((a * b) / x)) 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) <= -5e+119) || !(Float64(x * y) <= 1e+173)) tmp = Float64(x * Float64(y + Float64(Float64(a * b) / x))); 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) <= -5e+119) || ~(((x * y) <= 1e+173))) tmp = x * (y + ((a * b) / x)); 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], -5e+119], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+173]], $MachinePrecision]], N[(x * N[(y + N[(N[(a * b), $MachinePrecision] / x), $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 -5 \cdot 10^{+119} \lor \neg \left(x \cdot y \leq 10^{+173}\right):\\
\;\;\;\;x \cdot \left(y + \frac{a \cdot b}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999999e119 or 1e173 < (*.f64 x y) Initial program 93.1%
Taylor expanded in x around inf 94.6%
Taylor expanded in t around 0 89.2%
Taylor expanded in c around 0 86.5%
if -4.9999999999999999e119 < (*.f64 x y) < 1e173Initial program 95.6%
Taylor expanded in x around 0 88.6%
Final simplification88.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5e+119)
(+ (* c i) (+ (* x y) (* a b)))
(if (<= (* x y) 1e+173)
(+ (* c i) (+ (* a b) (* z t)))
(* x (+ y (/ (* a b) x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+119) {
tmp = (c * i) + ((x * y) + (a * b));
} else if ((x * y) <= 1e+173) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = x * (y + ((a * b) / x));
}
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+119)) then
tmp = (c * i) + ((x * y) + (a * b))
else if ((x * y) <= 1d+173) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = x * (y + ((a * b) / x))
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+119) {
tmp = (c * i) + ((x * y) + (a * b));
} else if ((x * y) <= 1e+173) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = x * (y + ((a * b) / x));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -5e+119: tmp = (c * i) + ((x * y) + (a * b)) elif (x * y) <= 1e+173: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = x * (y + ((a * b) / x)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5e+119) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(a * b))); elseif (Float64(x * y) <= 1e+173) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(x * Float64(y + Float64(Float64(a * b) / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -5e+119) tmp = (c * i) + ((x * y) + (a * b)); elseif ((x * y) <= 1e+173) tmp = (c * i) + ((a * b) + (z * t)); else tmp = x * (y + ((a * b) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+119], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+173], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + N[(N[(a * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+119}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + a \cdot b\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+173}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + \frac{a \cdot b}{x}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999999e119Initial program 91.8%
Taylor expanded in z around 0 89.3%
if -4.9999999999999999e119 < (*.f64 x y) < 1e173Initial program 95.6%
Taylor expanded in x around 0 88.6%
if 1e173 < (*.f64 x y) Initial program 94.4%
Taylor expanded in x around inf 94.7%
Taylor expanded in t around 0 86.4%
Taylor expanded in c around 0 83.8%
Final simplification88.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5e+119)
(+ (* c i) (+ (* x y) (* a b)))
(if (<= (* x y) 5e+108)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* c i) (+ (* x y) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+119) {
tmp = (c * i) + ((x * y) + (a * b));
} else if ((x * y) <= 5e+108) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-5d+119)) then
tmp = (c * i) + ((x * y) + (a * b))
else if ((x * y) <= 5d+108) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+119) {
tmp = (c * i) + ((x * y) + (a * b));
} else if ((x * y) <= 5e+108) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -5e+119: tmp = (c * i) + ((x * y) + (a * b)) elif (x * y) <= 5e+108: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5e+119) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(a * b))); elseif (Float64(x * y) <= 5e+108) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -5e+119) tmp = (c * i) + ((x * y) + (a * b)); elseif ((x * y) <= 5e+108) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+119], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+108], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+119}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + a \cdot b\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+108}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999999e119Initial program 91.8%
Taylor expanded in z around 0 89.3%
if -4.9999999999999999e119 < (*.f64 x y) < 4.99999999999999991e108Initial program 95.4%
Taylor expanded in x around 0 89.9%
if 4.99999999999999991e108 < (*.f64 x y) Initial program 95.6%
Taylor expanded in a around 0 88.9%
Final simplification89.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -5e+119)
(+ (* c i) (* x (+ y (/ (* a b) x))))
(if (<= (* x y) 5e+108)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* c i) (+ (* x y) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+119) {
tmp = (c * i) + (x * (y + ((a * b) / x)));
} else if ((x * y) <= 5e+108) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-5d+119)) then
tmp = (c * i) + (x * (y + ((a * b) / x)))
else if ((x * y) <= 5d+108) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+119) {
tmp = (c * i) + (x * (y + ((a * b) / x)));
} else if ((x * y) <= 5e+108) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -5e+119: tmp = (c * i) + (x * (y + ((a * b) / x))) elif (x * y) <= 5e+108: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5e+119) tmp = Float64(Float64(c * i) + Float64(x * Float64(y + Float64(Float64(a * b) / x)))); elseif (Float64(x * y) <= 5e+108) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -5e+119) tmp = (c * i) + (x * (y + ((a * b) / x))); elseif ((x * y) <= 5e+108) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+119], N[(N[(c * i), $MachinePrecision] + N[(x * N[(y + N[(N[(a * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+108], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+119}:\\
\;\;\;\;c \cdot i + x \cdot \left(y + \frac{a \cdot b}{x}\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+108}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999999e119Initial program 91.8%
Taylor expanded in x around inf 94.5%
Taylor expanded in t around 0 92.0%
if -4.9999999999999999e119 < (*.f64 x y) < 4.99999999999999991e108Initial program 95.4%
Taylor expanded in x around 0 89.9%
if 4.99999999999999991e108 < (*.f64 x y) Initial program 95.6%
Taylor expanded in a around 0 88.9%
Final simplification90.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -36000000.0) (not (<= (* a b) 5.6e+36))) (+ (* a b) (* c i)) (+ (* c i) (* 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) <= -36000000.0) || !((a * b) <= 5.6e+36)) {
tmp = (a * b) + (c * i);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-36000000.0d0)) .or. (.not. ((a * b) <= 5.6d+36))) then
tmp = (a * b) + (c * i)
else
tmp = (c * i) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -36000000.0) || !((a * b) <= 5.6e+36)) {
tmp = (a * b) + (c * i);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -36000000.0) or not ((a * b) <= 5.6e+36): tmp = (a * b) + (c * i) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -36000000.0) || !(Float64(a * b) <= 5.6e+36)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -36000000.0) || ~(((a * b) <= 5.6e+36))) tmp = (a * b) + (c * i); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -36000000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5.6e+36]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -36000000 \lor \neg \left(a \cdot b \leq 5.6 \cdot 10^{+36}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -3.6e7 or 5.6000000000000001e36 < (*.f64 a b) Initial program 91.8%
Taylor expanded in a around inf 73.3%
if -3.6e7 < (*.f64 a b) < 5.6000000000000001e36Initial program 97.7%
Taylor expanded in z around inf 58.8%
Final simplification65.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -3.9e+248) (not (<= (* c i) 1.76e+146))) (* c i) (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -3.9e+248) || !((c * i) <= 1.76e+146)) {
tmp = c * i;
} 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 (((c * i) <= (-3.9d+248)) .or. (.not. ((c * i) <= 1.76d+146))) then
tmp = c * i
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 (((c * i) <= -3.9e+248) || !((c * i) <= 1.76e+146)) {
tmp = c * i;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -3.9e+248) or not ((c * i) <= 1.76e+146): tmp = c * i else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -3.9e+248) || !(Float64(c * i) <= 1.76e+146)) tmp = Float64(c * i); 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 (((c * i) <= -3.9e+248) || ~(((c * i) <= 1.76e+146))) tmp = c * i; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -3.9e+248], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.76e+146]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.9 \cdot 10^{+248} \lor \neg \left(c \cdot i \leq 1.76 \cdot 10^{+146}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -3.8999999999999999e248 or 1.76000000000000007e146 < (*.f64 c i) Initial program 87.1%
Taylor expanded in c around inf 77.2%
if -3.8999999999999999e248 < (*.f64 c i) < 1.76000000000000007e146Initial program 97.4%
Taylor expanded in z around inf 36.9%
Taylor expanded in z around inf 35.9%
associate-/l*36.4%
Simplified36.4%
clear-num36.3%
un-div-inv35.8%
Applied egg-rr35.8%
Taylor expanded in z around inf 31.9%
Final simplification42.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= t 1.45e+236) (+ (* a b) (* c i)) (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (t <= 1.45e+236) {
tmp = (a * b) + (c * i);
} 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 (t <= 1.45d+236) then
tmp = (a * b) + (c * i)
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 (t <= 1.45e+236) {
tmp = (a * b) + (c * i);
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= 1.45e+236: tmp = (a * b) + (c * i) else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= 1.45e+236) tmp = Float64(Float64(a * b) + Float64(c * i)); 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 (t <= 1.45e+236) tmp = (a * b) + (c * i); else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, 1.45e+236], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.45 \cdot 10^{+236}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if t < 1.45e236Initial program 95.0%
Taylor expanded in a around inf 53.2%
if 1.45e236 < t Initial program 93.3%
Taylor expanded in z around inf 75.3%
Taylor expanded in z around inf 68.9%
associate-/l*68.9%
Simplified68.9%
clear-num68.9%
un-div-inv68.9%
Applied egg-rr68.9%
Taylor expanded in z around inf 62.6%
Final simplification53.7%
(FPCore (x y z t a b c i) :precision binary64 (* c i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 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 = 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 c * i;
}
def code(x, y, z, t, a, b, c, i): return c * i
function code(x, y, z, t, a, b, c, i) return Float64(c * i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = c * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i), $MachinePrecision]
\begin{array}{l}
\\
c \cdot i
\end{array}
Initial program 94.9%
Taylor expanded in c around inf 24.2%
Final simplification24.2%
herbie shell --seed 2024095
(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)))