
(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 16 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 (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.5%
+-commutative96.5%
fma-define98.4%
associate-+l+98.4%
fma-define98.8%
fma-define99.6%
Simplified99.6%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (* b (+ a (/ (* x y) b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = b * (a + ((x * y) / b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = b * (a + ((x * y) / b));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = b * (a + ((x * y) / b)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(b * Float64(a + Float64(Float64(x * y) / b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = b * (a + ((x * y) / b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(b * N[(a + N[(N[(x * y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a + \frac{x \cdot y}{b}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
+-commutative0.0%
fma-define55.6%
associate-+l+55.6%
fma-define66.7%
fma-define88.9%
Simplified88.9%
Taylor expanded in c around 0 55.6%
Taylor expanded in t around 0 78.3%
Taylor expanded in b around inf 78.3%
Final simplification99.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -1e+141)
(+ (* x y) (+ (* a b) (* c i)))
(if (<= (* a b) 5e+124)
(+ (* c i) (+ (* x y) (* z t)))
(* b (+ a (+ (/ (* x y) b) (/ (* z t) b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -1e+141) {
tmp = (x * y) + ((a * b) + (c * i));
} else if ((a * b) <= 5e+124) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = b * (a + (((x * y) / b) + ((z * t) / 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) <= (-1d+141)) then
tmp = (x * y) + ((a * b) + (c * i))
else if ((a * b) <= 5d+124) then
tmp = (c * i) + ((x * y) + (z * t))
else
tmp = b * (a + (((x * y) / b) + ((z * t) / 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) <= -1e+141) {
tmp = (x * y) + ((a * b) + (c * i));
} else if ((a * b) <= 5e+124) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = b * (a + (((x * y) / b) + ((z * t) / b)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -1e+141: tmp = (x * y) + ((a * b) + (c * i)) elif (a * b) <= 5e+124: tmp = (c * i) + ((x * y) + (z * t)) else: tmp = b * (a + (((x * y) / b) + ((z * t) / b))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -1e+141) tmp = Float64(Float64(x * y) + Float64(Float64(a * b) + Float64(c * i))); elseif (Float64(a * b) <= 5e+124) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(b * Float64(a + Float64(Float64(Float64(x * y) / b) + Float64(Float64(z * t) / b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -1e+141) tmp = (x * y) + ((a * b) + (c * i)); elseif ((a * b) <= 5e+124) tmp = (c * i) + ((x * y) + (z * t)); else tmp = b * (a + (((x * y) / b) + ((z * t) / b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1e+141], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+124], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(a + N[(N[(N[(x * y), $MachinePrecision] / b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+141}:\\
\;\;\;\;x \cdot y + \left(a \cdot b + c \cdot i\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+124}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a + \left(\frac{x \cdot y}{b} + \frac{z \cdot t}{b}\right)\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000002e141Initial program 90.4%
associate-+l+90.4%
fma-define90.4%
Simplified90.4%
Taylor expanded in x around inf 88.2%
if -1.00000000000000002e141 < (*.f64 a b) < 4.9999999999999996e124Initial program 98.3%
+-commutative98.3%
fma-define99.4%
associate-+l+99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in a around 0 93.0%
if 4.9999999999999996e124 < (*.f64 a b) Initial program 94.7%
+-commutative94.7%
fma-define97.4%
associate-+l+97.4%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 90.4%
Taylor expanded in b around inf 90.4%
Final simplification91.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (or (<= (* a b) -1e+141) (not (<= (* a b) 5e+124)))
(+ (* a b) t_1)
(+ (* c i) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((a * b) <= -1e+141) || !((a * b) <= 5e+124)) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if (((a * b) <= (-1d+141)) .or. (.not. ((a * b) <= 5d+124))) then
tmp = (a * b) + t_1
else
tmp = (c * i) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (((a * b) <= -1e+141) || !((a * b) <= 5e+124)) {
tmp = (a * b) + t_1;
} else {
tmp = (c * i) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if ((a * b) <= -1e+141) or not ((a * b) <= 5e+124): tmp = (a * b) + t_1 else: tmp = (c * i) + t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if ((Float64(a * b) <= -1e+141) || !(Float64(a * b) <= 5e+124)) tmp = Float64(Float64(a * b) + t_1); else tmp = Float64(Float64(c * i) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if (((a * b) <= -1e+141) || ~(((a * b) <= 5e+124))) tmp = (a * b) + t_1; else tmp = (c * i) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+141], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+124]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+141} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+124}\right):\\
\;\;\;\;a \cdot b + t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000002e141 or 4.9999999999999996e124 < (*.f64 a b) Initial program 92.5%
+-commutative92.5%
fma-define96.2%
associate-+l+96.2%
fma-define97.5%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 87.0%
if -1.00000000000000002e141 < (*.f64 a b) < 4.9999999999999996e124Initial program 98.3%
+-commutative98.3%
fma-define99.4%
associate-+l+99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in a around 0 93.0%
Final simplification91.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -1e+196) (not (<= (* c i) 5e+284))) (* i (+ c (/ (* a b) i))) (+ (* a b) (+ (* 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 (((c * i) <= -1e+196) || !((c * i) <= 5e+284)) {
tmp = i * (c + ((a * b) / i));
} else {
tmp = (a * b) + ((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 (((c * i) <= (-1d+196)) .or. (.not. ((c * i) <= 5d+284))) then
tmp = i * (c + ((a * b) / i))
else
tmp = (a * b) + ((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 (((c * i) <= -1e+196) || !((c * i) <= 5e+284)) {
tmp = i * (c + ((a * b) / i));
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -1e+196) or not ((c * i) <= 5e+284): tmp = i * (c + ((a * b) / i)) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -1e+196) || !(Float64(c * i) <= 5e+284)) tmp = Float64(i * Float64(c + Float64(Float64(a * b) / i))); else tmp = Float64(Float64(a * b) + 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 (((c * i) <= -1e+196) || ~(((c * i) <= 5e+284))) tmp = i * (c + ((a * b) / i)); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1e+196], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5e+284]], $MachinePrecision]], N[(i * N[(c + N[(N[(a * b), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+196} \lor \neg \left(c \cdot i \leq 5 \cdot 10^{+284}\right):\\
\;\;\;\;i \cdot \left(c + \frac{a \cdot b}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -9.9999999999999995e195 or 4.9999999999999999e284 < (*.f64 c i) Initial program 90.9%
associate-+l+90.9%
fma-define90.9%
Simplified90.9%
Taylor expanded in x around inf 90.4%
Taylor expanded in i around inf 94.1%
Taylor expanded in x around 0 92.3%
if -9.9999999999999995e195 < (*.f64 c i) < 4.9999999999999999e284Initial program 98.0%
+-commutative98.0%
fma-define98.0%
associate-+l+98.0%
fma-define98.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in c around 0 86.4%
Final simplification87.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* a b) -1e+141)
(+ (* x y) (+ (* a b) (* c i)))
(if (<= (* a b) 5e+124) (+ (* c i) t_1) (+ (* a b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -1e+141) {
tmp = (x * y) + ((a * b) + (c * i));
} else if ((a * b) <= 5e+124) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (z * t)
if ((a * b) <= (-1d+141)) then
tmp = (x * y) + ((a * b) + (c * i))
else if ((a * b) <= 5d+124) then
tmp = (c * i) + t_1
else
tmp = (a * b) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -1e+141) {
tmp = (x * y) + ((a * b) + (c * i));
} else if ((a * b) <= 5e+124) {
tmp = (c * i) + t_1;
} else {
tmp = (a * b) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if (a * b) <= -1e+141: tmp = (x * y) + ((a * b) + (c * i)) elif (a * b) <= 5e+124: tmp = (c * i) + t_1 else: tmp = (a * b) + t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -1e+141) tmp = Float64(Float64(x * y) + Float64(Float64(a * b) + Float64(c * i))); elseif (Float64(a * b) <= 5e+124) tmp = Float64(Float64(c * i) + t_1); else tmp = Float64(Float64(a * b) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if ((a * b) <= -1e+141) tmp = (x * y) + ((a * b) + (c * i)); elseif ((a * b) <= 5e+124) tmp = (c * i) + t_1; else tmp = (a * b) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+141], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+124], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+141}:\\
\;\;\;\;x \cdot y + \left(a \cdot b + c \cdot i\right)\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+124}:\\
\;\;\;\;c \cdot i + t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000002e141Initial program 90.4%
associate-+l+90.4%
fma-define90.4%
Simplified90.4%
Taylor expanded in x around inf 88.2%
if -1.00000000000000002e141 < (*.f64 a b) < 4.9999999999999996e124Initial program 98.3%
+-commutative98.3%
fma-define99.4%
associate-+l+99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in a around 0 93.0%
if 4.9999999999999996e124 < (*.f64 a b) Initial program 94.7%
+-commutative94.7%
fma-define97.4%
associate-+l+97.4%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 90.4%
Final simplification91.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= b -3.8e-54)
(+ (* a b) (* x y))
(if (<= b 2.3e-228)
(+ (* x y) (* z t))
(if (<= b 1.95e+35) (+ (* c i) (* z t)) (* b (+ a (/ (* x y) b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (b <= -3.8e-54) {
tmp = (a * b) + (x * y);
} else if (b <= 2.3e-228) {
tmp = (x * y) + (z * t);
} else if (b <= 1.95e+35) {
tmp = (c * i) + (z * t);
} else {
tmp = b * (a + ((x * y) / 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 (b <= (-3.8d-54)) then
tmp = (a * b) + (x * y)
else if (b <= 2.3d-228) then
tmp = (x * y) + (z * t)
else if (b <= 1.95d+35) then
tmp = (c * i) + (z * t)
else
tmp = b * (a + ((x * y) / 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 (b <= -3.8e-54) {
tmp = (a * b) + (x * y);
} else if (b <= 2.3e-228) {
tmp = (x * y) + (z * t);
} else if (b <= 1.95e+35) {
tmp = (c * i) + (z * t);
} else {
tmp = b * (a + ((x * y) / b));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if b <= -3.8e-54: tmp = (a * b) + (x * y) elif b <= 2.3e-228: tmp = (x * y) + (z * t) elif b <= 1.95e+35: tmp = (c * i) + (z * t) else: tmp = b * (a + ((x * y) / b)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (b <= -3.8e-54) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (b <= 2.3e-228) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (b <= 1.95e+35) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = Float64(b * Float64(a + Float64(Float64(x * y) / b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (b <= -3.8e-54) tmp = (a * b) + (x * y); elseif (b <= 2.3e-228) tmp = (x * y) + (z * t); elseif (b <= 1.95e+35) tmp = (c * i) + (z * t); else tmp = b * (a + ((x * y) / b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[b, -3.8e-54], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e-228], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.95e+35], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(b * N[(a + N[(N[(x * y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{-54}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-228}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{+35}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a + \frac{x \cdot y}{b}\right)\\
\end{array}
\end{array}
if b < -3.8000000000000002e-54Initial program 98.5%
+-commutative98.5%
fma-define100.0%
associate-+l+100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 79.2%
Taylor expanded in t around 0 59.5%
if -3.8000000000000002e-54 < b < 2.2999999999999999e-228Initial program 98.4%
+-commutative98.4%
fma-define100.0%
associate-+l+100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 80.0%
Taylor expanded in a around 0 77.0%
if 2.2999999999999999e-228 < b < 1.95e35Initial program 98.4%
+-commutative98.4%
fma-define100.0%
associate-+l+100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 82.3%
Taylor expanded in x around 0 72.1%
if 1.95e35 < b Initial program 90.0%
+-commutative90.0%
fma-define93.3%
associate-+l+93.3%
fma-define95.0%
fma-define98.3%
Simplified98.3%
Taylor expanded in c around 0 82.7%
Taylor expanded in t around 0 73.1%
Taylor expanded in b around inf 73.1%
Final simplification70.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= b -4.4e-54)
(* a b)
(if (<= b 5.5e-189)
(* x y)
(if (<= b 1.55e+35) (* c i) (if (<= b 9.6e+112) (* x y) (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (b <= -4.4e-54) {
tmp = a * b;
} else if (b <= 5.5e-189) {
tmp = x * y;
} else if (b <= 1.55e+35) {
tmp = c * i;
} else if (b <= 9.6e+112) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (b <= (-4.4d-54)) then
tmp = a * b
else if (b <= 5.5d-189) then
tmp = x * y
else if (b <= 1.55d+35) then
tmp = c * i
else if (b <= 9.6d+112) then
tmp = x * y
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (b <= -4.4e-54) {
tmp = a * b;
} else if (b <= 5.5e-189) {
tmp = x * y;
} else if (b <= 1.55e+35) {
tmp = c * i;
} else if (b <= 9.6e+112) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if b <= -4.4e-54: tmp = a * b elif b <= 5.5e-189: tmp = x * y elif b <= 1.55e+35: tmp = c * i elif b <= 9.6e+112: tmp = x * y else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (b <= -4.4e-54) tmp = Float64(a * b); elseif (b <= 5.5e-189) tmp = Float64(x * y); elseif (b <= 1.55e+35) tmp = Float64(c * i); elseif (b <= 9.6e+112) tmp = Float64(x * y); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (b <= -4.4e-54) tmp = a * b; elseif (b <= 5.5e-189) tmp = x * y; elseif (b <= 1.55e+35) tmp = c * i; elseif (b <= 9.6e+112) tmp = x * y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[b, -4.4e-54], N[(a * b), $MachinePrecision], If[LessEqual[b, 5.5e-189], N[(x * y), $MachinePrecision], If[LessEqual[b, 1.55e+35], N[(c * i), $MachinePrecision], If[LessEqual[b, 9.6e+112], N[(x * y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{-54}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{-189}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{+35}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;b \leq 9.6 \cdot 10^{+112}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if b < -4.3999999999999999e-54 or 9.6e112 < b Initial program 95.3%
+-commutative95.3%
fma-define98.1%
associate-+l+98.1%
fma-define98.1%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around inf 45.6%
if -4.3999999999999999e-54 < b < 5.4999999999999999e-189 or 1.54999999999999993e35 < b < 9.6e112Initial program 95.5%
+-commutative95.5%
fma-define97.8%
associate-+l+97.8%
fma-define98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in c around 0 79.3%
Taylor expanded in t around 0 50.7%
Taylor expanded in a around 0 44.0%
if 5.4999999999999999e-189 < b < 1.54999999999999993e35Initial program 99.9%
+-commutative99.9%
fma-define100.0%
associate-+l+100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around inf 45.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= t -1.2e-110)
(* t (+ z (/ (* c i) t)))
(if (<= t 1.5e-155)
(+ (* a b) (* c i))
(if (<= t 1.25e+131) (+ (* a b) (* x y)) (+ (* 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.2e-110) {
tmp = t * (z + ((c * i) / t));
} else if (t <= 1.5e-155) {
tmp = (a * b) + (c * i);
} else if (t <= 1.25e+131) {
tmp = (a * b) + (x * y);
} 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 (t <= (-1.2d-110)) then
tmp = t * (z + ((c * i) / t))
else if (t <= 1.5d-155) then
tmp = (a * b) + (c * i)
else if (t <= 1.25d+131) then
tmp = (a * b) + (x * y)
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 (t <= -1.2e-110) {
tmp = t * (z + ((c * i) / t));
} else if (t <= 1.5e-155) {
tmp = (a * b) + (c * i);
} else if (t <= 1.25e+131) {
tmp = (a * b) + (x * y);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= -1.2e-110: tmp = t * (z + ((c * i) / t)) elif t <= 1.5e-155: tmp = (a * b) + (c * i) elif t <= 1.25e+131: tmp = (a * b) + (x * y) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= -1.2e-110) tmp = Float64(t * Float64(z + Float64(Float64(c * i) / t))); elseif (t <= 1.5e-155) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (t <= 1.25e+131) tmp = Float64(Float64(a * b) + Float64(x * y)); 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 (t <= -1.2e-110) tmp = t * (z + ((c * i) / t)); elseif (t <= 1.5e-155) tmp = (a * b) + (c * i); elseif (t <= 1.25e+131) tmp = (a * b) + (x * y); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, -1.2e-110], N[(t * N[(z + N[(N[(c * i), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-155], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+131], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{-110}:\\
\;\;\;\;t \cdot \left(z + \frac{c \cdot i}{t}\right)\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-155}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+131}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if t < -1.20000000000000003e-110Initial program 94.7%
+-commutative94.7%
fma-define98.7%
associate-+l+98.7%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 81.0%
Taylor expanded in t around inf 77.6%
Taylor expanded in x around 0 60.4%
if -1.20000000000000003e-110 < t < 1.49999999999999992e-155Initial program 98.7%
associate-+l+98.7%
fma-define98.7%
Simplified98.7%
Taylor expanded in x around inf 95.3%
Taylor expanded in x around 0 70.4%
if 1.49999999999999992e-155 < t < 1.24999999999999999e131Initial program 96.8%
+-commutative96.8%
fma-define98.4%
associate-+l+98.4%
fma-define98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in c around 0 82.6%
Taylor expanded in t around 0 60.8%
if 1.24999999999999999e131 < t Initial program 94.4%
+-commutative94.4%
fma-define94.4%
associate-+l+94.4%
fma-define94.4%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 89.0%
Taylor expanded in x around 0 79.8%
Final simplification66.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= b -4.4e-54)
t_1
(if (<= b 2.3e-228)
(+ (* x y) (* z t))
(if (<= b 1.5e+35) (+ (* c i) (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double tmp;
if (b <= -4.4e-54) {
tmp = t_1;
} else if (b <= 2.3e-228) {
tmp = (x * y) + (z * t);
} else if (b <= 1.5e+35) {
tmp = (c * i) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (x * y)
if (b <= (-4.4d-54)) then
tmp = t_1
else if (b <= 2.3d-228) then
tmp = (x * y) + (z * t)
else if (b <= 1.5d+35) then
tmp = (c * i) + (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double tmp;
if (b <= -4.4e-54) {
tmp = t_1;
} else if (b <= 2.3e-228) {
tmp = (x * y) + (z * t);
} else if (b <= 1.5e+35) {
tmp = (c * i) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) tmp = 0 if b <= -4.4e-54: tmp = t_1 elif b <= 2.3e-228: tmp = (x * y) + (z * t) elif b <= 1.5e+35: tmp = (c * i) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (b <= -4.4e-54) tmp = t_1; elseif (b <= 2.3e-228) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (b <= 1.5e+35) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); tmp = 0.0; if (b <= -4.4e-54) tmp = t_1; elseif (b <= 2.3e-228) tmp = (x * y) + (z * t); elseif (b <= 1.5e+35) tmp = (c * i) + (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.4e-54], t$95$1, If[LessEqual[b, 2.3e-228], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e+35], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;b \leq -4.4 \cdot 10^{-54}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-228}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+35}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.3999999999999999e-54 or 1.49999999999999995e35 < b Initial program 94.4%
+-commutative94.4%
fma-define96.8%
associate-+l+96.8%
fma-define97.6%
fma-define99.2%
Simplified99.2%
Taylor expanded in c around 0 80.9%
Taylor expanded in t around 0 66.1%
if -4.3999999999999999e-54 < b < 2.2999999999999999e-228Initial program 98.4%
+-commutative98.4%
fma-define100.0%
associate-+l+100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in c around 0 80.0%
Taylor expanded in a around 0 77.0%
if 2.2999999999999999e-228 < b < 1.49999999999999995e35Initial program 98.4%
+-commutative98.4%
fma-define100.0%
associate-+l+100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 82.3%
Taylor expanded in x around 0 72.1%
Final simplification70.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))))
(if (<= t -1.16e-110)
t_1
(if (<= t 1.8e-156)
(+ (* a b) (* c i))
(if (<= t 1.22e+131) (+ (* a b) (* x y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double tmp;
if (t <= -1.16e-110) {
tmp = t_1;
} else if (t <= 1.8e-156) {
tmp = (a * b) + (c * i);
} else if (t <= 1.22e+131) {
tmp = (a * b) + (x * y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * i) + (z * t)
if (t <= (-1.16d-110)) then
tmp = t_1
else if (t <= 1.8d-156) then
tmp = (a * b) + (c * i)
else if (t <= 1.22d+131) then
tmp = (a * b) + (x * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double tmp;
if (t <= -1.16e-110) {
tmp = t_1;
} else if (t <= 1.8e-156) {
tmp = (a * b) + (c * i);
} else if (t <= 1.22e+131) {
tmp = (a * b) + (x * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) tmp = 0 if t <= -1.16e-110: tmp = t_1 elif t <= 1.8e-156: tmp = (a * b) + (c * i) elif t <= 1.22e+131: tmp = (a * b) + (x * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (t <= -1.16e-110) tmp = t_1; elseif (t <= 1.8e-156) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (t <= 1.22e+131) tmp = Float64(Float64(a * b) + Float64(x * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); tmp = 0.0; if (t <= -1.16e-110) tmp = t_1; elseif (t <= 1.8e-156) tmp = (a * b) + (c * i); elseif (t <= 1.22e+131) tmp = (a * b) + (x * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.16e-110], t$95$1, If[LessEqual[t, 1.8e-156], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.22e+131], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
\mathbf{if}\;t \leq -1.16 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-156}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;t \leq 1.22 \cdot 10^{+131}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.16000000000000001e-110 or 1.22e131 < t Initial program 94.6%
+-commutative94.6%
fma-define97.3%
associate-+l+97.3%
fma-define98.2%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 83.6%
Taylor expanded in x around 0 67.4%
if -1.16000000000000001e-110 < t < 1.79999999999999999e-156Initial program 98.7%
associate-+l+98.7%
fma-define98.7%
Simplified98.7%
Taylor expanded in x around inf 95.2%
Taylor expanded in x around 0 70.1%
if 1.79999999999999999e-156 < t < 1.22e131Initial program 96.8%
+-commutative96.8%
fma-define98.4%
associate-+l+98.4%
fma-define98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in c around 0 81.4%
Taylor expanded in t around 0 59.9%
Final simplification66.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -7e+135) (not (<= (* c i) 4e+36))) (+ (* a b) (* 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 (((c * i) <= -7e+135) || !((c * i) <= 4e+36)) {
tmp = (a * b) + (c * i);
} else {
tmp = (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 (((c * i) <= (-7d+135)) .or. (.not. ((c * i) <= 4d+36))) then
tmp = (a * b) + (c * i)
else
tmp = (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 (((c * i) <= -7e+135) || !((c * i) <= 4e+36)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -7e+135) or not ((c * i) <= 4e+36): tmp = (a * b) + (c * i) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -7e+135) || !(Float64(c * i) <= 4e+36)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -7e+135) || ~(((c * i) <= 4e+36))) tmp = (a * b) + (c * i); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -7e+135], N[Not[LessEqual[N[(c * i), $MachinePrecision], 4e+36]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -7 \cdot 10^{+135} \lor \neg \left(c \cdot i \leq 4 \cdot 10^{+36}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 c i) < -7.0000000000000005e135 or 4.00000000000000017e36 < (*.f64 c i) Initial program 94.2%
associate-+l+94.2%
fma-define94.2%
Simplified94.2%
Taylor expanded in x around inf 79.3%
Taylor expanded in x around 0 73.8%
if -7.0000000000000005e135 < (*.f64 c i) < 4.00000000000000017e36Initial program 98.0%
+-commutative98.0%
fma-define98.0%
associate-+l+98.0%
fma-define98.7%
fma-define99.3%
Simplified99.3%
Taylor expanded in c around 0 92.3%
Taylor expanded in t around 0 65.3%
Final simplification68.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2.5e+181) (not (<= (* x y) 5.9e+211))) (* 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) <= -2.5e+181) || !((x * y) <= 5.9e+211)) {
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) <= (-2.5d+181)) .or. (.not. ((x * y) <= 5.9d+211))) 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) <= -2.5e+181) || !((x * y) <= 5.9e+211)) {
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) <= -2.5e+181) or not ((x * y) <= 5.9e+211): 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) <= -2.5e+181) || !(Float64(x * y) <= 5.9e+211)) 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) <= -2.5e+181) || ~(((x * y) <= 5.9e+211))) 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], -2.5e+181], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5.9e+211]], $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 -2.5 \cdot 10^{+181} \lor \neg \left(x \cdot y \leq 5.9 \cdot 10^{+211}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -2.5000000000000002e181 or 5.90000000000000014e211 < (*.f64 x y) Initial program 92.5%
+-commutative92.5%
fma-define96.2%
associate-+l+96.2%
fma-define98.1%
fma-define98.1%
Simplified98.1%
Taylor expanded in c around 0 93.1%
Taylor expanded in t around 0 83.9%
Taylor expanded in a around 0 81.9%
if -2.5000000000000002e181 < (*.f64 x y) < 5.90000000000000014e211Initial program 97.5%
associate-+l+97.5%
fma-define97.5%
Simplified97.5%
Taylor expanded in x around inf 72.0%
Taylor expanded in x around 0 61.6%
Final simplification65.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -3.35e+140) (not (<= (* a b) 8.5e+148))) (* 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) <= -3.35e+140) || !((a * b) <= 8.5e+148)) {
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) <= (-3.35d+140)) .or. (.not. ((a * b) <= 8.5d+148))) 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) <= -3.35e+140) || !((a * b) <= 8.5e+148)) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -3.35e+140) or not ((a * b) <= 8.5e+148): 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) <= -3.35e+140) || !(Float64(a * b) <= 8.5e+148)) 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) <= -3.35e+140) || ~(((a * b) <= 8.5e+148))) 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], -3.35e+140], N[Not[LessEqual[N[(a * b), $MachinePrecision], 8.5e+148]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -3.35 \cdot 10^{+140} \lor \neg \left(a \cdot b \leq 8.5 \cdot 10^{+148}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -3.35e140 or 8.4999999999999996e148 < (*.f64 a b) Initial program 92.3%
+-commutative92.3%
fma-define96.1%
associate-+l+96.1%
fma-define97.4%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around inf 73.2%
if -3.35e140 < (*.f64 a b) < 8.4999999999999996e148Initial program 98.3%
+-commutative98.3%
fma-define99.4%
associate-+l+99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in a around 0 93.1%
Taylor expanded in t around inf 35.1%
Final simplification46.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -4.3e+133) (not (<= (* a b) 5e+146))) (* 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.3e+133) || !((a * b) <= 5e+146)) {
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) <= (-4.3d+133)) .or. (.not. ((a * b) <= 5d+146))) 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) <= -4.3e+133) || !((a * b) <= 5e+146)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -4.3e+133) or not ((a * b) <= 5e+146): 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) <= -4.3e+133) || !(Float64(a * b) <= 5e+146)) 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) <= -4.3e+133) || ~(((a * b) <= 5e+146))) 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], -4.3e+133], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+146]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4.3 \cdot 10^{+133} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+146}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -4.29999999999999994e133 or 4.9999999999999999e146 < (*.f64 a b) Initial program 92.4%
+-commutative92.4%
fma-define96.2%
associate-+l+96.2%
fma-define97.5%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around inf 72.3%
if -4.29999999999999994e133 < (*.f64 a b) < 4.9999999999999999e146Initial program 98.3%
+-commutative98.3%
fma-define99.4%
associate-+l+99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in c around inf 33.5%
Final simplification45.5%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.5%
+-commutative96.5%
fma-define98.4%
associate-+l+98.4%
fma-define98.8%
fma-define99.6%
Simplified99.6%
Taylor expanded in a around inf 27.3%
herbie shell --seed 2024144
(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)))