
(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 (<= (* c i) 5e+257) (fma c i (fma a b (fma x y (* z t)))) (fma x y (fma 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 ((c * i) <= 5e+257) {
tmp = fma(c, i, fma(a, b, fma(x, y, (z * t))));
} else {
tmp = fma(x, y, fma(a, b, (c * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= 5e+257) tmp = fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))); else tmp = fma(x, y, fma(a, b, Float64(c * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], 5e+257], N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y + N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq 5 \cdot 10^{+257}:\\
\;\;\;\;\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 c i) < 5.00000000000000028e257Initial program 98.2%
+-commutative98.2%
fma-def99.1%
+-commutative99.1%
fma-def100.0%
fma-def100.0%
Simplified100.0%
if 5.00000000000000028e257 < (*.f64 c i) Initial program 69.2%
Taylor expanded in z around 0 73.1%
associate-+r+73.1%
fma-udef84.6%
+-commutative84.6%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) 5e+257) (fma c i (+ (+ (* a b) (* x y)) (* z t))) (fma x y (fma 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 ((c * i) <= 5e+257) {
tmp = fma(c, i, (((a * b) + (x * y)) + (z * t)));
} else {
tmp = fma(x, y, fma(a, b, (c * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= 5e+257) tmp = fma(c, i, Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(z * t))); else tmp = fma(x, y, fma(a, b, Float64(c * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], 5e+257], N[(c * i + N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y + N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq 5 \cdot 10^{+257}:\\
\;\;\;\;\mathsf{fma}\left(c, i, \left(a \cdot b + x \cdot y\right) + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, y, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 c i) < 5.00000000000000028e257Initial program 98.2%
+-commutative98.2%
fma-def99.1%
+-commutative99.1%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-def100.0%
fma-udef99.1%
associate-+r+99.1%
Applied egg-rr99.1%
if 5.00000000000000028e257 < (*.f64 c i) Initial program 69.2%
Taylor expanded in z around 0 73.1%
associate-+r+73.1%
fma-udef84.6%
+-commutative84.6%
fma-def100.0%
Simplified100.0%
Final simplification99.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) 5e+307) (fma c i (+ (+ (* a b) (* x y)) (* z t))) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= 5e+307) {
tmp = fma(c, i, (((a * b) + (x * y)) + (z * t)));
} else {
tmp = c * i;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= 5e+307) tmp = fma(c, i, Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(z * t))); else tmp = Float64(c * i); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], 5e+307], N[(c * i + N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\mathsf{fma}\left(c, i, \left(a \cdot b + x \cdot y\right) + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < 5e307Initial program 98.3%
+-commutative98.3%
fma-def99.1%
+-commutative99.1%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-def100.0%
fma-udef99.1%
associate-+r+99.1%
Applied egg-rr99.1%
if 5e307 < (*.f64 c i) Initial program 61.9%
Taylor expanded in c around inf 100.0%
Final simplification99.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* c i) -1.25e+185)
(* c i)
(if (<= (* c i) -3.1e+66)
t_1
(if (<= (* c i) -8e-10)
(* x y)
(if (or (<= (* c i) 2.55e+116)
(and (not (<= (* c i) 1.18e+138)) (<= (* c i) 1.2e+193)))
t_1
(* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -1.25e+185) {
tmp = c * i;
} else if ((c * i) <= -3.1e+66) {
tmp = t_1;
} else if ((c * i) <= -8e-10) {
tmp = x * y;
} else if (((c * i) <= 2.55e+116) || (!((c * i) <= 1.18e+138) && ((c * i) <= 1.2e+193))) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (z * t)
if ((c * i) <= (-1.25d+185)) then
tmp = c * i
else if ((c * i) <= (-3.1d+66)) then
tmp = t_1
else if ((c * i) <= (-8d-10)) then
tmp = x * y
else if (((c * i) <= 2.55d+116) .or. (.not. ((c * i) <= 1.18d+138)) .and. ((c * i) <= 1.2d+193)) then
tmp = t_1
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 t_1 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -1.25e+185) {
tmp = c * i;
} else if ((c * i) <= -3.1e+66) {
tmp = t_1;
} else if ((c * i) <= -8e-10) {
tmp = x * y;
} else if (((c * i) <= 2.55e+116) || (!((c * i) <= 1.18e+138) && ((c * i) <= 1.2e+193))) {
tmp = t_1;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (c * i) <= -1.25e+185: tmp = c * i elif (c * i) <= -3.1e+66: tmp = t_1 elif (c * i) <= -8e-10: tmp = x * y elif ((c * i) <= 2.55e+116) or (not ((c * i) <= 1.18e+138) and ((c * i) <= 1.2e+193)): tmp = t_1 else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -1.25e+185) tmp = Float64(c * i); elseif (Float64(c * i) <= -3.1e+66) tmp = t_1; elseif (Float64(c * i) <= -8e-10) tmp = Float64(x * y); elseif ((Float64(c * i) <= 2.55e+116) || (!(Float64(c * i) <= 1.18e+138) && (Float64(c * i) <= 1.2e+193))) tmp = t_1; else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); tmp = 0.0; if ((c * i) <= -1.25e+185) tmp = c * i; elseif ((c * i) <= -3.1e+66) tmp = t_1; elseif ((c * i) <= -8e-10) tmp = x * y; elseif (((c * i) <= 2.55e+116) || (~(((c * i) <= 1.18e+138)) && ((c * i) <= 1.2e+193))) tmp = t_1; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.25e+185], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -3.1e+66], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -8e-10], N[(x * y), $MachinePrecision], If[Or[LessEqual[N[(c * i), $MachinePrecision], 2.55e+116], And[N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.18e+138]], $MachinePrecision], LessEqual[N[(c * i), $MachinePrecision], 1.2e+193]]], t$95$1, N[(c * i), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1.25 \cdot 10^{+185}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -3.1 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -8 \cdot 10^{-10}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 2.55 \cdot 10^{+116} \lor \neg \left(c \cdot i \leq 1.18 \cdot 10^{+138}\right) \land c \cdot i \leq 1.2 \cdot 10^{+193}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.24999999999999997e185 or 2.55e116 < (*.f64 c i) < 1.18000000000000007e138 or 1.2e193 < (*.f64 c i) Initial program 87.0%
Taylor expanded in c around inf 84.6%
if -1.24999999999999997e185 < (*.f64 c i) < -3.10000000000000019e66 or -8.00000000000000029e-10 < (*.f64 c i) < 2.55e116 or 1.18000000000000007e138 < (*.f64 c i) < 1.2e193Initial program 98.7%
Taylor expanded in x around 0 72.7%
Taylor expanded in c around 0 66.7%
if -3.10000000000000019e66 < (*.f64 c i) < -8.00000000000000029e-10Initial program 100.0%
Taylor expanded in x around inf 58.6%
Final simplification71.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -8.2e+185)
(* c i)
(if (<= (* c i) -1.1e-12)
(* x y)
(if (<= (* c i) -2.4e-135)
(* z t)
(if (<= (* c i) -2e-313)
(* a b)
(if (<= (* c i) 4.4e-274)
(* z t)
(if (<= (* c i) 1.55e+68) (* 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 ((c * i) <= -8.2e+185) {
tmp = c * i;
} else if ((c * i) <= -1.1e-12) {
tmp = x * y;
} else if ((c * i) <= -2.4e-135) {
tmp = z * t;
} else if ((c * i) <= -2e-313) {
tmp = a * b;
} else if ((c * i) <= 4.4e-274) {
tmp = z * t;
} else if ((c * i) <= 1.55e+68) {
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 ((c * i) <= (-8.2d+185)) then
tmp = c * i
else if ((c * i) <= (-1.1d-12)) then
tmp = x * y
else if ((c * i) <= (-2.4d-135)) then
tmp = z * t
else if ((c * i) <= (-2d-313)) then
tmp = a * b
else if ((c * i) <= 4.4d-274) then
tmp = z * t
else if ((c * i) <= 1.55d+68) 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 ((c * i) <= -8.2e+185) {
tmp = c * i;
} else if ((c * i) <= -1.1e-12) {
tmp = x * y;
} else if ((c * i) <= -2.4e-135) {
tmp = z * t;
} else if ((c * i) <= -2e-313) {
tmp = a * b;
} else if ((c * i) <= 4.4e-274) {
tmp = z * t;
} else if ((c * i) <= 1.55e+68) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -8.2e+185: tmp = c * i elif (c * i) <= -1.1e-12: tmp = x * y elif (c * i) <= -2.4e-135: tmp = z * t elif (c * i) <= -2e-313: tmp = a * b elif (c * i) <= 4.4e-274: tmp = z * t elif (c * i) <= 1.55e+68: tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -8.2e+185) tmp = Float64(c * i); elseif (Float64(c * i) <= -1.1e-12) tmp = Float64(x * y); elseif (Float64(c * i) <= -2.4e-135) tmp = Float64(z * t); elseif (Float64(c * i) <= -2e-313) tmp = Float64(a * b); elseif (Float64(c * i) <= 4.4e-274) tmp = Float64(z * t); elseif (Float64(c * i) <= 1.55e+68) 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 ((c * i) <= -8.2e+185) tmp = c * i; elseif ((c * i) <= -1.1e-12) tmp = x * y; elseif ((c * i) <= -2.4e-135) tmp = z * t; elseif ((c * i) <= -2e-313) tmp = a * b; elseif ((c * i) <= 4.4e-274) tmp = z * t; elseif ((c * i) <= 1.55e+68) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -8.2e+185], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.1e-12], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.4e-135], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2e-313], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.4e-274], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.55e+68], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8.2 \cdot 10^{+185}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -1.1 \cdot 10^{-12}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -2.4 \cdot 10^{-135}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-313}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 4.4 \cdot 10^{-274}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 1.55 \cdot 10^{+68}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -8.2e185 or 1.5499999999999999e68 < (*.f64 c i) Initial program 88.4%
Taylor expanded in c around inf 73.0%
if -8.2e185 < (*.f64 c i) < -1.09999999999999996e-12Initial program 97.6%
Taylor expanded in x around inf 46.9%
if -1.09999999999999996e-12 < (*.f64 c i) < -2.3999999999999999e-135 or -1.99999999998e-313 < (*.f64 c i) < 4.3999999999999999e-274Initial program 100.0%
Taylor expanded in z around inf 50.9%
if -2.3999999999999999e-135 < (*.f64 c i) < -1.99999999998e-313 or 4.3999999999999999e-274 < (*.f64 c i) < 1.5499999999999999e68Initial program 100.0%
Taylor expanded in a around inf 43.1%
Final simplification56.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -6.3e+190)
(+ (* c i) (* x y))
(if (or (<= (* c i) 1.45e+69)
(and (not (<= (* c i) 2.45e+134)) (<= (* c i) 1.3e+195)))
(+ (* a b) (+ (* x y) (* z t)))
(+ (* 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) <= -6.3e+190) {
tmp = (c * i) + (x * y);
} else if (((c * i) <= 1.45e+69) || (!((c * i) <= 2.45e+134) && ((c * i) <= 1.3e+195))) {
tmp = (a * b) + ((x * y) + (z * t));
} 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 ((c * i) <= (-6.3d+190)) then
tmp = (c * i) + (x * y)
else if (((c * i) <= 1.45d+69) .or. (.not. ((c * i) <= 2.45d+134)) .and. ((c * i) <= 1.3d+195)) then
tmp = (a * b) + ((x * y) + (z * t))
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 ((c * i) <= -6.3e+190) {
tmp = (c * i) + (x * y);
} else if (((c * i) <= 1.45e+69) || (!((c * i) <= 2.45e+134) && ((c * i) <= 1.3e+195))) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -6.3e+190: tmp = (c * i) + (x * y) elif ((c * i) <= 1.45e+69) or (not ((c * i) <= 2.45e+134) and ((c * i) <= 1.3e+195)): tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -6.3e+190) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif ((Float64(c * i) <= 1.45e+69) || (!(Float64(c * i) <= 2.45e+134) && (Float64(c * i) <= 1.3e+195))) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); 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 ((c * i) <= -6.3e+190) tmp = (c * i) + (x * y); elseif (((c * i) <= 1.45e+69) || (~(((c * i) <= 2.45e+134)) && ((c * i) <= 1.3e+195))) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -6.3e+190], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(c * i), $MachinePrecision], 1.45e+69], And[N[Not[LessEqual[N[(c * i), $MachinePrecision], 2.45e+134]], $MachinePrecision], LessEqual[N[(c * i), $MachinePrecision], 1.3e+195]]], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6.3 \cdot 10^{+190}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 1.45 \cdot 10^{+69} \lor \neg \left(c \cdot i \leq 2.45 \cdot 10^{+134}\right) \land c \cdot i \leq 1.3 \cdot 10^{+195}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -6.3000000000000002e190Initial program 94.4%
Taylor expanded in a around 0 91.7%
Taylor expanded in t around 0 88.9%
if -6.3000000000000002e190 < (*.f64 c i) < 1.4499999999999999e69 or 2.44999999999999998e134 < (*.f64 c i) < 1.30000000000000001e195Initial program 99.4%
Taylor expanded in c around 0 92.8%
if 1.4499999999999999e69 < (*.f64 c i) < 2.44999999999999998e134 or 1.30000000000000001e195 < (*.f64 c i) Initial program 81.3%
Taylor expanded in a around 0 85.6%
Taylor expanded in x around 0 90.2%
Final simplification91.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -4.5e+270)
(* x y)
(if (or (<= (* x y) -1.55e+159)
(and (not (<= (* x y) -5e+74)) (<= (* x y) 2.1e-168)))
(+ (* c i) (* z t))
(+ (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -4.5e+270) {
tmp = x * y;
} else if (((x * y) <= -1.55e+159) || (!((x * y) <= -5e+74) && ((x * y) <= 2.1e-168))) {
tmp = (c * i) + (z * t);
} 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 ((x * y) <= (-4.5d+270)) then
tmp = x * y
else if (((x * y) <= (-1.55d+159)) .or. (.not. ((x * y) <= (-5d+74))) .and. ((x * y) <= 2.1d-168)) then
tmp = (c * i) + (z * t)
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 ((x * y) <= -4.5e+270) {
tmp = x * y;
} else if (((x * y) <= -1.55e+159) || (!((x * y) <= -5e+74) && ((x * y) <= 2.1e-168))) {
tmp = (c * i) + (z * t);
} else {
tmp = (a * b) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -4.5e+270: tmp = x * y elif ((x * y) <= -1.55e+159) or (not ((x * y) <= -5e+74) and ((x * y) <= 2.1e-168)): tmp = (c * i) + (z * t) else: tmp = (a * b) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -4.5e+270) tmp = Float64(x * y); elseif ((Float64(x * y) <= -1.55e+159) || (!(Float64(x * y) <= -5e+74) && (Float64(x * y) <= 2.1e-168))) tmp = Float64(Float64(c * i) + Float64(z * t)); 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 ((x * y) <= -4.5e+270) tmp = x * y; elseif (((x * y) <= -1.55e+159) || (~(((x * y) <= -5e+74)) && ((x * y) <= 2.1e-168))) tmp = (c * i) + (z * t); else tmp = (a * b) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -4.5e+270], N[(x * y), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.55e+159], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], -5e+74]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 2.1e-168]]], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.5 \cdot 10^{+270}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.55 \cdot 10^{+159} \lor \neg \left(x \cdot y \leq -5 \cdot 10^{+74}\right) \land x \cdot y \leq 2.1 \cdot 10^{-168}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.5000000000000004e270Initial program 78.3%
Taylor expanded in x around inf 78.3%
if -4.5000000000000004e270 < (*.f64 x y) < -1.5499999999999999e159 or -4.99999999999999963e74 < (*.f64 x y) < 2.09999999999999994e-168Initial program 98.3%
Taylor expanded in a around 0 80.9%
Taylor expanded in x around 0 75.8%
if -1.5499999999999999e159 < (*.f64 x y) < -4.99999999999999963e74 or 2.09999999999999994e-168 < (*.f64 x y) Initial program 95.5%
Taylor expanded in z around 0 88.6%
associate-+r+88.6%
fma-udef90.4%
+-commutative90.4%
fma-def90.4%
Simplified90.4%
Taylor expanded in c around 0 73.0%
Final simplification74.8%
(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 (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = c * i;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = c * i;
}
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 = c * i return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(c * i), $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}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in c around inf 67.4%
Final simplification98.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= i -1.66e-9)
(* c i)
(if (<= i 3e-302)
t_1
(if (<= i 4.8e+70)
(+ (* a b) (* x y))
(if (<= i 7.6e+192) t_1 (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double tmp;
if (i <= -1.66e-9) {
tmp = c * i;
} else if (i <= 3e-302) {
tmp = t_1;
} else if (i <= 4.8e+70) {
tmp = (a * b) + (x * y);
} else if (i <= 7.6e+192) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (z * t)
if (i <= (-1.66d-9)) then
tmp = c * i
else if (i <= 3d-302) then
tmp = t_1
else if (i <= 4.8d+70) then
tmp = (a * b) + (x * y)
else if (i <= 7.6d+192) then
tmp = t_1
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 t_1 = (a * b) + (z * t);
double tmp;
if (i <= -1.66e-9) {
tmp = c * i;
} else if (i <= 3e-302) {
tmp = t_1;
} else if (i <= 4.8e+70) {
tmp = (a * b) + (x * y);
} else if (i <= 7.6e+192) {
tmp = t_1;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if i <= -1.66e-9: tmp = c * i elif i <= 3e-302: tmp = t_1 elif i <= 4.8e+70: tmp = (a * b) + (x * y) elif i <= 7.6e+192: tmp = t_1 else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (i <= -1.66e-9) tmp = Float64(c * i); elseif (i <= 3e-302) tmp = t_1; elseif (i <= 4.8e+70) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (i <= 7.6e+192) tmp = t_1; else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); tmp = 0.0; if (i <= -1.66e-9) tmp = c * i; elseif (i <= 3e-302) tmp = t_1; elseif (i <= 4.8e+70) tmp = (a * b) + (x * y); elseif (i <= 7.6e+192) tmp = t_1; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.66e-9], N[(c * i), $MachinePrecision], If[LessEqual[i, 3e-302], t$95$1, If[LessEqual[i, 4.8e+70], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.6e+192], t$95$1, N[(c * i), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;i \leq -1.66 \cdot 10^{-9}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;i \leq 3 \cdot 10^{-302}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 4.8 \cdot 10^{+70}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;i \leq 7.6 \cdot 10^{+192}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if i < -1.6600000000000001e-9 or 7.5999999999999999e192 < i Initial program 90.9%
Taylor expanded in c around inf 55.2%
if -1.6600000000000001e-9 < i < 2.99999999999999989e-302 or 4.79999999999999974e70 < i < 7.5999999999999999e192Initial program 97.7%
Taylor expanded in x around 0 76.6%
Taylor expanded in c around 0 61.3%
if 2.99999999999999989e-302 < i < 4.79999999999999974e70Initial program 97.5%
Taylor expanded in z around 0 78.0%
associate-+r+78.0%
fma-udef79.3%
+-commutative79.3%
fma-def79.3%
Simplified79.3%
Taylor expanded in c around 0 58.8%
Final simplification58.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -5.5e+186)
(+ (* c i) (* x y))
(if (<= (* c i) 1.18e+57)
(+ (* a b) (+ (* x y) (* z t)))
(+ (* c i) (+ (* a b) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -5.5e+186) {
tmp = (c * i) + (x * y);
} else if ((c * i) <= 1.18e+57) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-5.5d+186)) then
tmp = (c * i) + (x * y)
else if ((c * i) <= 1.18d+57) then
tmp = (a * b) + ((x * y) + (z * t))
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -5.5e+186) {
tmp = (c * i) + (x * y);
} else if ((c * i) <= 1.18e+57) {
tmp = (a * b) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -5.5e+186: tmp = (c * i) + (x * y) elif (c * i) <= 1.18e+57: tmp = (a * b) + ((x * y) + (z * t)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -5.5e+186) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (Float64(c * i) <= 1.18e+57) tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -5.5e+186) tmp = (c * i) + (x * y); elseif ((c * i) <= 1.18e+57) tmp = (a * b) + ((x * y) + (z * t)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -5.5e+186], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.18e+57], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5.5 \cdot 10^{+186}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 1.18 \cdot 10^{+57}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -5.4999999999999996e186Initial program 94.4%
Taylor expanded in a around 0 91.7%
Taylor expanded in t around 0 88.9%
if -5.4999999999999996e186 < (*.f64 c i) < 1.18e57Initial program 99.3%
Taylor expanded in c around 0 93.1%
if 1.18e57 < (*.f64 c i) Initial program 85.5%
Taylor expanded in x around 0 82.7%
Final simplification90.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (* a b) -1.75e-5)
(+ (* c i) (+ (* a b) (* z t)))
(if (<= (* a b) 4.1e+49) (+ (* 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) <= -1.75e-5) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((a * b) <= 4.1e+49) {
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) <= (-1.75d-5)) then
tmp = (c * i) + ((a * b) + (z * t))
else if ((a * b) <= 4.1d+49) 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) <= -1.75e-5) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((a * b) <= 4.1e+49) {
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) <= -1.75e-5: tmp = (c * i) + ((a * b) + (z * t)) elif (a * b) <= 4.1e+49: 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) <= -1.75e-5) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); elseif (Float64(a * b) <= 4.1e+49) 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) <= -1.75e-5) tmp = (c * i) + ((a * b) + (z * t)); elseif ((a * b) <= 4.1e+49) 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], -1.75e-5], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4.1e+49], 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.75 \cdot 10^{-5}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{elif}\;a \cdot b \leq 4.1 \cdot 10^{+49}:\\
\;\;\;\;c \cdot i + t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.7499999999999998e-5Initial program 91.8%
Taylor expanded in x around 0 82.9%
if -1.7499999999999998e-5 < (*.f64 a b) < 4.1e49Initial program 98.5%
Taylor expanded in a around 0 95.8%
if 4.1e49 < (*.f64 a b) Initial program 91.7%
Taylor expanded in c around 0 90.2%
Final simplification91.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -2.25e+165)
(+ (* c i) (* x y))
(if (or (<= x -7.5e+99) (not (<= x 2.25e-95)))
(+ (* 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 (x <= -2.25e+165) {
tmp = (c * i) + (x * y);
} else if ((x <= -7.5e+99) || !(x <= 2.25e-95)) {
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 (x <= (-2.25d+165)) then
tmp = (c * i) + (x * y)
else if ((x <= (-7.5d+99)) .or. (.not. (x <= 2.25d-95))) 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 (x <= -2.25e+165) {
tmp = (c * i) + (x * y);
} else if ((x <= -7.5e+99) || !(x <= 2.25e-95)) {
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 x <= -2.25e+165: tmp = (c * i) + (x * y) elif (x <= -7.5e+99) or not (x <= 2.25e-95): 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 (x <= -2.25e+165) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif ((x <= -7.5e+99) || !(x <= 2.25e-95)) 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 (x <= -2.25e+165) tmp = (c * i) + (x * y); elseif ((x <= -7.5e+99) || ~((x <= 2.25e-95))) 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[x, -2.25e+165], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -7.5e+99], N[Not[LessEqual[x, 2.25e-95]], $MachinePrecision]], 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}\;x \leq -2.25 \cdot 10^{+165}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{+99} \lor \neg \left(x \leq 2.25 \cdot 10^{-95}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if x < -2.2499999999999998e165Initial program 96.7%
Taylor expanded in a around 0 77.0%
Taylor expanded in t around 0 67.2%
if -2.2499999999999998e165 < x < -7.49999999999999963e99 or 2.25e-95 < x Initial program 91.8%
Taylor expanded in z around 0 77.2%
associate-+r+77.2%
fma-udef79.2%
+-commutative79.2%
fma-def81.2%
Simplified81.2%
Taylor expanded in c around 0 66.2%
if -7.49999999999999963e99 < x < 2.25e-95Initial program 97.6%
Taylor expanded in a around 0 73.2%
Taylor expanded in x around 0 66.0%
Final simplification66.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -8.5e+184) (not (<= (* c i) 1.9e+68))) (* c i) (* a b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -8.5e+184) || !((c * i) <= 1.9e+68)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-8.5d+184)) .or. (.not. ((c * i) <= 1.9d+68))) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -8.5e+184) || !((c * i) <= 1.9e+68)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -8.5e+184) or not ((c * i) <= 1.9e+68): tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -8.5e+184) || !(Float64(c * i) <= 1.9e+68)) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -8.5e+184) || ~(((c * i) <= 1.9e+68))) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -8.5e+184], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.9e+68]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8.5 \cdot 10^{+184} \lor \neg \left(c \cdot i \leq 1.9 \cdot 10^{+68}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 c i) < -8.50000000000000043e184 or 1.9e68 < (*.f64 c i) Initial program 88.5%
Taylor expanded in c around inf 72.3%
if -8.50000000000000043e184 < (*.f64 c i) < 1.9e68Initial program 99.4%
Taylor expanded in a around inf 35.8%
Final simplification49.5%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 95.3%
Taylor expanded in a around inf 27.5%
Final simplification27.5%
herbie shell --seed 2024017
(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)))