
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* a b) (+ (* x y) (* z t))) INFINITY) (fma c i (fma x y (fma 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 (((a * b) + ((x * y) + (z * t))) <= ((double) INFINITY)) {
tmp = fma(c, i, fma(x, y, fma(z, t, (a * b))));
} else {
tmp = x * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) <= Inf) tmp = fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))); else tmp = Float64(x * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b + \left(x \cdot y + z \cdot t\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 98.4%
+-commutative98.4%
fma-def100.0%
associate-+l+100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
associate-+l+0.0%
fma-def0.0%
Simplified0.0%
fma-def0.0%
+-commutative0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 80.0%
Final simplification99.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (+ (fma x y (* z t)) (+ (* a b) (* c i))) (fma 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 ((((a * b) + ((x * y) + (z * t))) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(x, y, (z * t)) + ((a * b) + (c * i));
} else {
tmp = fma(a, b, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) <= Inf) tmp = Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))); else tmp = fma(a, b, Float64(x * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * b + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b, x \cdot y\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
associate-+l+100.0%
fma-def100.0%
Simplified100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in z around 0 11.1%
Taylor expanded in c around 0 45.0%
fma-def78.3%
Simplified78.3%
Final simplification99.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* a b) (+ (* x y) (* z t))) INFINITY) (fma c i (+ (* z t) (+ (* a b) (* x y)))) (* x y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) + ((x * y) + (z * t))) <= ((double) INFINITY)) {
tmp = fma(c, i, ((z * t) + ((a * b) + (x * y))));
} else {
tmp = x * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) <= Inf) tmp = fma(c, i, Float64(Float64(z * t) + Float64(Float64(a * b) + Float64(x * y)))); else tmp = Float64(x * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(N[(z * t), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b + \left(x \cdot y + z \cdot t\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t + \left(a \cdot b + x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 98.4%
+-commutative98.4%
fma-def100.0%
associate-+l+100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
Applied egg-rr100.0%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
associate-+l+0.0%
fma-def0.0%
Simplified0.0%
fma-def0.0%
+-commutative0.0%
Applied egg-rr0.0%
Taylor expanded in x around inf 80.0%
Final simplification99.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (+ (+ (* a b) t_1) (* c i)) INFINITY)
(+ (+ (* a b) (* c i)) t_1)
(fma a b (* x y)))))
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) + t_1) + (c * i)) <= ((double) INFINITY)) {
tmp = ((a * b) + (c * i)) + t_1;
} else {
tmp = fma(a, b, (x * y));
}
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(Float64(Float64(a * b) + t_1) + Float64(c * i)) <= Inf) tmp = Float64(Float64(Float64(a * b) + Float64(c * i)) + t_1); else tmp = fma(a, b, Float64(x * y)); end return 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[(N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(a * b + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;\left(a \cdot b + t_1\right) + c \cdot i \leq \infty:\\
\;\;\;\;\left(a \cdot b + c \cdot i\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b, x \cdot y\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
associate-+l+100.0%
fma-def100.0%
Simplified100.0%
fma-def100.0%
+-commutative100.0%
Applied egg-rr100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in z around 0 11.1%
Taylor expanded in c around 0 45.0%
fma-def78.3%
Simplified78.3%
Final simplification99.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= (+ (+ (* a b) t_1) (* c i)) INFINITY)
(+ (+ (* a b) (* c i)) t_1)
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) + t_1) + (c * i)) <= ((double) INFINITY)) {
tmp = ((a * b) + (c * i)) + t_1;
} else {
tmp = t_1;
}
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 = (x * y) + (z * t);
double tmp;
if ((((a * b) + t_1) + (c * i)) <= Double.POSITIVE_INFINITY) {
tmp = ((a * b) + (c * i)) + t_1;
} else {
tmp = 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) + t_1) + (c * i)) <= math.inf: tmp = ((a * b) + (c * i)) + t_1 else: tmp = 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(Float64(Float64(a * b) + t_1) + Float64(c * i)) <= Inf) tmp = Float64(Float64(Float64(a * b) + Float64(c * i)) + t_1); else tmp = 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) + t_1) + (c * i)) <= Inf) tmp = ((a * b) + (c * i)) + t_1; else tmp = 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[(N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;\left(a \cdot b + t_1\right) + c \cdot i \leq \infty:\\
\;\;\;\;\left(a \cdot b + c \cdot i\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
associate-+l+100.0%
fma-def100.0%
Simplified100.0%
fma-def100.0%
+-commutative100.0%
Applied egg-rr100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
associate-+l+0.0%
associate-+l+0.0%
fma-def0.0%
fma-def0.0%
fma-def11.1%
Simplified11.1%
Taylor expanded in a around 0 44.4%
Taylor expanded in c around 0 77.8%
Final simplification99.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* a b) (* x y))))
(if (<= (* a b) -1e+151)
t_2
(if (<= (* a b) -3.2e+104)
t_1
(if (<= (* a b) -1.5e+47)
t_2
(if (<= (* a b) 9.4e+38) t_1 (+ (* a b) (* 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) + (z * t);
double t_2 = (a * b) + (x * y);
double tmp;
if ((a * b) <= -1e+151) {
tmp = t_2;
} else if ((a * b) <= -3.2e+104) {
tmp = t_1;
} else if ((a * b) <= -1.5e+47) {
tmp = t_2;
} else if ((a * b) <= 9.4e+38) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (c * i) + (z * t)
t_2 = (a * b) + (x * y)
if ((a * b) <= (-1d+151)) then
tmp = t_2
else if ((a * b) <= (-3.2d+104)) then
tmp = t_1
else if ((a * b) <= (-1.5d+47)) then
tmp = t_2
else if ((a * b) <= 9.4d+38) then
tmp = t_1
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 t_1 = (c * i) + (z * t);
double t_2 = (a * b) + (x * y);
double tmp;
if ((a * b) <= -1e+151) {
tmp = t_2;
} else if ((a * b) <= -3.2e+104) {
tmp = t_1;
} else if ((a * b) <= -1.5e+47) {
tmp = t_2;
} else if ((a * b) <= 9.4e+38) {
tmp = t_1;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = (a * b) + (x * y) tmp = 0 if (a * b) <= -1e+151: tmp = t_2 elif (a * b) <= -3.2e+104: tmp = t_1 elif (a * b) <= -1.5e+47: tmp = t_2 elif (a * b) <= 9.4e+38: tmp = t_1 else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) t_2 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(a * b) <= -1e+151) tmp = t_2; elseif (Float64(a * b) <= -3.2e+104) tmp = t_1; elseif (Float64(a * b) <= -1.5e+47) tmp = t_2; elseif (Float64(a * b) <= 9.4e+38) tmp = t_1; 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) t_1 = (c * i) + (z * t); t_2 = (a * b) + (x * y); tmp = 0.0; if ((a * b) <= -1e+151) tmp = t_2; elseif ((a * b) <= -3.2e+104) tmp = t_1; elseif ((a * b) <= -1.5e+47) tmp = t_2; elseif ((a * b) <= 9.4e+38) tmp = t_1; else tmp = (a * b) + (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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+151], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -3.2e+104], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1.5e+47], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 9.4e+38], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := a \cdot b + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+151}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -3.2 \cdot 10^{+104}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -1.5 \cdot 10^{+47}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 9.4 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000002e151 or -3.2e104 < (*.f64 a b) < -1.5000000000000001e47Initial program 98.1%
Taylor expanded in z around 0 87.4%
Taylor expanded in c around 0 78.2%
if -1.00000000000000002e151 < (*.f64 a b) < -3.2e104 or -1.5000000000000001e47 < (*.f64 a b) < 9.3999999999999998e38Initial program 97.3%
Taylor expanded in z around inf 67.1%
if 9.3999999999999998e38 < (*.f64 a b) Initial program 92.6%
Taylor expanded in a around inf 75.3%
Final simplification71.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -4.9e+73)
(+ (* x y) (* c i))
(if (<= (* c i) -1.46e-25)
(+ (* c i) (* z t))
(if (<= (* c i) -6.2e-105)
(+ (* a b) (* x y))
(if (<= (* c i) 1.05e+29) (+ (* x y) (* z t)) (+ (* a b) (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -4.9e+73) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= -1.46e-25) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= -6.2e-105) {
tmp = (a * b) + (x * y);
} else if ((c * i) <= 1.05e+29) {
tmp = (x * y) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-4.9d+73)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= (-1.46d-25)) then
tmp = (c * i) + (z * t)
else if ((c * i) <= (-6.2d-105)) then
tmp = (a * b) + (x * y)
else if ((c * i) <= 1.05d+29) then
tmp = (x * y) + (z * t)
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -4.9e+73) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= -1.46e-25) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= -6.2e-105) {
tmp = (a * b) + (x * y);
} else if ((c * i) <= 1.05e+29) {
tmp = (x * y) + (z * t);
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -4.9e+73: tmp = (x * y) + (c * i) elif (c * i) <= -1.46e-25: tmp = (c * i) + (z * t) elif (c * i) <= -6.2e-105: tmp = (a * b) + (x * y) elif (c * i) <= 1.05e+29: tmp = (x * y) + (z * t) else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -4.9e+73) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= -1.46e-25) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(c * i) <= -6.2e-105) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(c * i) <= 1.05e+29) tmp = Float64(Float64(x * y) + Float64(z * t)); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -4.9e+73) tmp = (x * y) + (c * i); elseif ((c * i) <= -1.46e-25) tmp = (c * i) + (z * t); elseif ((c * i) <= -6.2e-105) tmp = (a * b) + (x * y); elseif ((c * i) <= 1.05e+29) tmp = (x * y) + (z * t); else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -4.9e+73], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.46e-25], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -6.2e-105], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.05e+29], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4.9 \cdot 10^{+73}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -1.46 \cdot 10^{-25}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq -6.2 \cdot 10^{-105}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 1.05 \cdot 10^{+29}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -4.8999999999999999e73Initial program 93.3%
Taylor expanded in x around inf 82.9%
if -4.8999999999999999e73 < (*.f64 c i) < -1.46e-25Initial program 100.0%
Taylor expanded in z around inf 67.4%
if -1.46e-25 < (*.f64 c i) < -6.20000000000000029e-105Initial program 100.0%
Taylor expanded in z around 0 80.8%
Taylor expanded in c around 0 75.0%
if -6.20000000000000029e-105 < (*.f64 c i) < 1.0500000000000001e29Initial program 97.5%
associate-+l+97.5%
associate-+l+97.5%
fma-def97.5%
fma-def97.5%
fma-def97.5%
Simplified97.5%
Taylor expanded in a around 0 72.4%
Taylor expanded in c around 0 69.0%
if 1.0500000000000001e29 < (*.f64 c i) Initial program 94.9%
Taylor expanded in a around inf 75.5%
Final simplification73.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))) (t_2 (+ (* c i) (* z t))))
(if (<= a -6e+128)
(+ (* a b) (* c i))
(if (<= a -2.3e+65)
t_1
(if (<= a -0.065)
t_2
(if (<= a -1.26e-19)
t_1
(if (<= a -2e-151)
t_2
(if (<= a 6e-34) (+ (* x y) (* c i)) (* a b)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double t_2 = (c * i) + (z * t);
double tmp;
if (a <= -6e+128) {
tmp = (a * b) + (c * i);
} else if (a <= -2.3e+65) {
tmp = t_1;
} else if (a <= -0.065) {
tmp = t_2;
} else if (a <= -1.26e-19) {
tmp = t_1;
} else if (a <= -2e-151) {
tmp = t_2;
} else if (a <= 6e-34) {
tmp = (x * y) + (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (x * y)
t_2 = (c * i) + (z * t)
if (a <= (-6d+128)) then
tmp = (a * b) + (c * i)
else if (a <= (-2.3d+65)) then
tmp = t_1
else if (a <= (-0.065d0)) then
tmp = t_2
else if (a <= (-1.26d-19)) then
tmp = t_1
else if (a <= (-2d-151)) then
tmp = t_2
else if (a <= 6d-34) then
tmp = (x * y) + (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 t_1 = (a * b) + (x * y);
double t_2 = (c * i) + (z * t);
double tmp;
if (a <= -6e+128) {
tmp = (a * b) + (c * i);
} else if (a <= -2.3e+65) {
tmp = t_1;
} else if (a <= -0.065) {
tmp = t_2;
} else if (a <= -1.26e-19) {
tmp = t_1;
} else if (a <= -2e-151) {
tmp = t_2;
} else if (a <= 6e-34) {
tmp = (x * y) + (c * i);
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) t_2 = (c * i) + (z * t) tmp = 0 if a <= -6e+128: tmp = (a * b) + (c * i) elif a <= -2.3e+65: tmp = t_1 elif a <= -0.065: tmp = t_2 elif a <= -1.26e-19: tmp = t_1 elif a <= -2e-151: tmp = t_2 elif a <= 6e-34: tmp = (x * y) + (c * i) else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) t_2 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (a <= -6e+128) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (a <= -2.3e+65) tmp = t_1; elseif (a <= -0.065) tmp = t_2; elseif (a <= -1.26e-19) tmp = t_1; elseif (a <= -2e-151) tmp = t_2; elseif (a <= 6e-34) tmp = Float64(Float64(x * y) + Float64(c * i)); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); t_2 = (c * i) + (z * t); tmp = 0.0; if (a <= -6e+128) tmp = (a * b) + (c * i); elseif (a <= -2.3e+65) tmp = t_1; elseif (a <= -0.065) tmp = t_2; elseif (a <= -1.26e-19) tmp = t_1; elseif (a <= -2e-151) tmp = t_2; elseif (a <= 6e-34) tmp = (x * y) + (c * i); else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6e+128], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.3e+65], t$95$1, If[LessEqual[a, -0.065], t$95$2, If[LessEqual[a, -1.26e-19], t$95$1, If[LessEqual[a, -2e-151], t$95$2, If[LessEqual[a, 6e-34], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := c \cdot i + z \cdot t\\
\mathbf{if}\;a \leq -6 \cdot 10^{+128}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;a \leq -2.3 \cdot 10^{+65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -0.065:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -1.26 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2 \cdot 10^{-151}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-34}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if a < -5.9999999999999997e128Initial program 93.9%
Taylor expanded in a around inf 81.0%
if -5.9999999999999997e128 < a < -2.3e65 or -0.065000000000000002 < a < -1.2599999999999999e-19Initial program 92.9%
Taylor expanded in z around 0 65.8%
Taylor expanded in c around 0 72.7%
if -2.3e65 < a < -0.065000000000000002 or -1.2599999999999999e-19 < a < -1.9999999999999999e-151Initial program 97.4%
Taylor expanded in z around inf 64.3%
if -1.9999999999999999e-151 < a < 6e-34Initial program 99.0%
Taylor expanded in x around inf 66.7%
if 6e-34 < a Initial program 93.7%
associate-+l+93.7%
fma-def93.7%
Simplified93.7%
fma-def93.7%
+-commutative93.7%
Applied egg-rr93.7%
Taylor expanded in a around inf 42.3%
Final simplification62.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (+ (* a b) (* x y)))))
(if (<= x -7e+231)
t_1
(if (<= x -1.75e+185)
(+ (* x y) (* z t))
(if (or (<= x -5e+76) (not (<= x 5.8e-94)))
t_1
(+ (* 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 t_1 = (c * i) + ((a * b) + (x * y));
double tmp;
if (x <= -7e+231) {
tmp = t_1;
} else if (x <= -1.75e+185) {
tmp = (x * y) + (z * t);
} else if ((x <= -5e+76) || !(x <= 5.8e-94)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (c * i) + ((a * b) + (x * y))
if (x <= (-7d+231)) then
tmp = t_1
else if (x <= (-1.75d+185)) then
tmp = (x * y) + (z * t)
else if ((x <= (-5d+76)) .or. (.not. (x <= 5.8d-94))) then
tmp = t_1
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 t_1 = (c * i) + ((a * b) + (x * y));
double tmp;
if (x <= -7e+231) {
tmp = t_1;
} else if (x <= -1.75e+185) {
tmp = (x * y) + (z * t);
} else if ((x <= -5e+76) || !(x <= 5.8e-94)) {
tmp = t_1;
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + (x * y)) tmp = 0 if x <= -7e+231: tmp = t_1 elif x <= -1.75e+185: tmp = (x * y) + (z * t) elif (x <= -5e+76) or not (x <= 5.8e-94): tmp = t_1 else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))) tmp = 0.0 if (x <= -7e+231) tmp = t_1; elseif (x <= -1.75e+185) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif ((x <= -5e+76) || !(x <= 5.8e-94)) tmp = t_1; 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) t_1 = (c * i) + ((a * b) + (x * y)); tmp = 0.0; if (x <= -7e+231) tmp = t_1; elseif (x <= -1.75e+185) tmp = (x * y) + (z * t); elseif ((x <= -5e+76) || ~((x <= 5.8e-94))) tmp = t_1; else tmp = (c * i) + ((a * b) + (z * t)); 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[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7e+231], t$95$1, If[LessEqual[x, -1.75e+185], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -5e+76], N[Not[LessEqual[x, 5.8e-94]], $MachinePrecision]], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{if}\;x \leq -7 \cdot 10^{+231}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{+185}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;x \leq -5 \cdot 10^{+76} \lor \neg \left(x \leq 5.8 \cdot 10^{-94}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if x < -6.9999999999999997e231 or -1.75000000000000012e185 < x < -4.99999999999999991e76 or 5.79999999999999991e-94 < x Initial program 95.2%
Taylor expanded in z around 0 82.0%
if -6.9999999999999997e231 < x < -1.75000000000000012e185Initial program 72.7%
associate-+l+72.7%
associate-+l+72.7%
fma-def72.7%
fma-def72.7%
fma-def72.7%
Simplified72.7%
Taylor expanded in a around 0 65.0%
Taylor expanded in c around 0 82.7%
if -4.99999999999999991e76 < x < 5.79999999999999991e-94Initial program 100.0%
Taylor expanded in x around 0 91.7%
Final simplification86.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -8.2e+64)
(+ (* c i) (+ (* a b) (* z t)))
(if (<= (* a b) 1e+38)
(+ (* c i) (+ (* x y) (* z t)))
(+ (* c i) (+ (* a b) (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -8.2e+64) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((a * b) <= 1e+38) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-8.2d+64)) then
tmp = (c * i) + ((a * b) + (z * t))
else if ((a * b) <= 1d+38) then
tmp = (c * i) + ((x * y) + (z * t))
else
tmp = (c * i) + ((a * b) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -8.2e+64) {
tmp = (c * i) + ((a * b) + (z * t));
} else if ((a * b) <= 1e+38) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -8.2e+64: tmp = (c * i) + ((a * b) + (z * t)) elif (a * b) <= 1e+38: tmp = (c * i) + ((x * y) + (z * t)) else: tmp = (c * i) + ((a * b) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -8.2e+64) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); elseif (Float64(a * b) <= 1e+38) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -8.2e+64) tmp = (c * i) + ((a * b) + (z * t)); elseif ((a * b) <= 1e+38) tmp = (c * i) + ((x * y) + (z * t)); else tmp = (c * i) + ((a * b) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -8.2e+64], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+38], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8.2 \cdot 10^{+64}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+38}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -8.19999999999999956e64Initial program 96.3%
Taylor expanded in x around 0 82.7%
if -8.19999999999999956e64 < (*.f64 a b) < 9.99999999999999977e37Initial program 97.9%
Taylor expanded in a around 0 95.7%
if 9.99999999999999977e37 < (*.f64 a b) Initial program 92.6%
Taylor expanded in z around 0 85.0%
Final simplification90.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -3.1e+97)
(* x y)
(if (<= x -1.42e+38)
(* a b)
(if (<= x -2.9e-75)
(* z t)
(if (<= x -2e-241)
(* c i)
(if (<= x -1.9e-304)
(* a b)
(if (<= x 1.35e-155) (* c i) (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -3.1e+97) {
tmp = x * y;
} else if (x <= -1.42e+38) {
tmp = a * b;
} else if (x <= -2.9e-75) {
tmp = z * t;
} else if (x <= -2e-241) {
tmp = c * i;
} else if (x <= -1.9e-304) {
tmp = a * b;
} else if (x <= 1.35e-155) {
tmp = c * i;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (x <= (-3.1d+97)) then
tmp = x * y
else if (x <= (-1.42d+38)) then
tmp = a * b
else if (x <= (-2.9d-75)) then
tmp = z * t
else if (x <= (-2d-241)) then
tmp = c * i
else if (x <= (-1.9d-304)) then
tmp = a * b
else if (x <= 1.35d-155) then
tmp = c * i
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -3.1e+97) {
tmp = x * y;
} else if (x <= -1.42e+38) {
tmp = a * b;
} else if (x <= -2.9e-75) {
tmp = z * t;
} else if (x <= -2e-241) {
tmp = c * i;
} else if (x <= -1.9e-304) {
tmp = a * b;
} else if (x <= 1.35e-155) {
tmp = c * i;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= -3.1e+97: tmp = x * y elif x <= -1.42e+38: tmp = a * b elif x <= -2.9e-75: tmp = z * t elif x <= -2e-241: tmp = c * i elif x <= -1.9e-304: tmp = a * b elif x <= 1.35e-155: tmp = c * i else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -3.1e+97) tmp = Float64(x * y); elseif (x <= -1.42e+38) tmp = Float64(a * b); elseif (x <= -2.9e-75) tmp = Float64(z * t); elseif (x <= -2e-241) tmp = Float64(c * i); elseif (x <= -1.9e-304) tmp = Float64(a * b); elseif (x <= 1.35e-155) tmp = Float64(c * i); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= -3.1e+97) tmp = x * y; elseif (x <= -1.42e+38) tmp = a * b; elseif (x <= -2.9e-75) tmp = z * t; elseif (x <= -2e-241) tmp = c * i; elseif (x <= -1.9e-304) tmp = a * b; elseif (x <= 1.35e-155) tmp = c * i; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -3.1e+97], N[(x * y), $MachinePrecision], If[LessEqual[x, -1.42e+38], N[(a * b), $MachinePrecision], If[LessEqual[x, -2.9e-75], N[(z * t), $MachinePrecision], If[LessEqual[x, -2e-241], N[(c * i), $MachinePrecision], If[LessEqual[x, -1.9e-304], N[(a * b), $MachinePrecision], If[LessEqual[x, 1.35e-155], N[(c * i), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+97}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq -1.42 \cdot 10^{+38}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-75}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-241}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-304}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-155}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -3.09999999999999981e97 or 1.34999999999999991e-155 < x Initial program 93.9%
associate-+l+93.9%
fma-def93.9%
Simplified93.9%
fma-def93.9%
+-commutative93.9%
Applied egg-rr93.9%
Taylor expanded in x around inf 41.4%
if -3.09999999999999981e97 < x < -1.4200000000000001e38 or -1.9999999999999999e-241 < x < -1.8999999999999998e-304Initial program 99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
fma-def99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in a around inf 33.9%
if -1.4200000000000001e38 < x < -2.9000000000000002e-75Initial program 100.0%
associate-+l+100.0%
fma-def100.0%
Simplified100.0%
fma-def100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 41.9%
if -2.9000000000000002e-75 < x < -1.9999999999999999e-241 or -1.8999999999999998e-304 < x < 1.34999999999999991e-155Initial program 100.0%
Taylor expanded in c around inf 38.9%
Final simplification40.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -1.75e-25) (not (<= (* c i) 4.4e+22))) (+ (* 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) <= -1.75e-25) || !((c * i) <= 4.4e+22)) {
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) <= (-1.75d-25)) .or. (.not. ((c * i) <= 4.4d+22))) 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) <= -1.75e-25) || !((c * i) <= 4.4e+22)) {
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) <= -1.75e-25) or not ((c * i) <= 4.4e+22): 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) <= -1.75e-25) || !(Float64(c * i) <= 4.4e+22)) 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) <= -1.75e-25) || ~(((c * i) <= 4.4e+22))) 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], -1.75e-25], N[Not[LessEqual[N[(c * i), $MachinePrecision], 4.4e+22]], $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 -1.75 \cdot 10^{-25} \lor \neg \left(c \cdot i \leq 4.4 \cdot 10^{+22}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\end{array}
\end{array}
if (*.f64 c i) < -1.7500000000000001e-25 or 4.4e22 < (*.f64 c i) Initial program 95.0%
Taylor expanded in a around inf 70.1%
if -1.7500000000000001e-25 < (*.f64 c i) < 4.4e22Initial program 97.8%
Taylor expanded in z around 0 65.2%
Taylor expanded in c around 0 61.8%
Final simplification65.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -64000000.0) (+ (* x y) (* z t)) (if (<= y 7.5e+190) (+ (* c i) (+ (* a b) (* z t))) (+ (* x y) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -64000000.0) {
tmp = (x * y) + (z * t);
} else if (y <= 7.5e+190) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (y <= (-64000000.0d0)) then
tmp = (x * y) + (z * t)
else if (y <= 7.5d+190) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (x * y) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -64000000.0) {
tmp = (x * y) + (z * t);
} else if (y <= 7.5e+190) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -64000000.0: tmp = (x * y) + (z * t) elif y <= 7.5e+190: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -64000000.0) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (y <= 7.5e+190) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= -64000000.0) tmp = (x * y) + (z * t); elseif (y <= 7.5e+190) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -64000000.0], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+190], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -64000000:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+190}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if y < -6.4e7Initial program 96.4%
associate-+l+96.4%
associate-+l+96.4%
fma-def96.4%
fma-def96.4%
fma-def96.4%
Simplified96.4%
Taylor expanded in a around 0 80.6%
Taylor expanded in c around 0 71.8%
if -6.4e7 < y < 7.4999999999999994e190Initial program 98.8%
Taylor expanded in x around 0 89.5%
if 7.4999999999999994e190 < y Initial program 86.1%
Taylor expanded in x around inf 78.3%
Final simplification84.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -4.7e+145) (* a b) (if (<= (* a b) 5e+187) (* c i) (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4.7e+145) {
tmp = a * b;
} else if ((a * b) <= 5e+187) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-4.7d+145)) then
tmp = a * b
else if ((a * b) <= 5d+187) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4.7e+145) {
tmp = a * b;
} else if ((a * b) <= 5e+187) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -4.7e+145: tmp = a * b elif (a * b) <= 5e+187: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -4.7e+145) tmp = Float64(a * b); elseif (Float64(a * b) <= 5e+187) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -4.7e+145) tmp = a * b; elseif ((a * b) <= 5e+187) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -4.7e+145], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+187], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4.7 \cdot 10^{+145}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+187}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -4.7000000000000002e145 or 5.0000000000000001e187 < (*.f64 a b) Initial program 90.9%
associate-+l+90.9%
fma-def90.9%
Simplified90.9%
fma-def90.9%
+-commutative90.9%
Applied egg-rr90.9%
Taylor expanded in a around inf 71.5%
if -4.7000000000000002e145 < (*.f64 a b) < 5.0000000000000001e187Initial program 98.4%
Taylor expanded in c around inf 34.8%
Final simplification44.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -82000000.0) (* x y) (if (<= y 5.2e+174) (+ (* a b) (* c i)) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -82000000.0) {
tmp = x * y;
} else if (y <= 5.2e+174) {
tmp = (a * b) + (c * i);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (y <= (-82000000.0d0)) then
tmp = x * y
else if (y <= 5.2d+174) then
tmp = (a * b) + (c * i)
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -82000000.0) {
tmp = x * y;
} else if (y <= 5.2e+174) {
tmp = (a * b) + (c * i);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -82000000.0: tmp = x * y elif y <= 5.2e+174: tmp = (a * b) + (c * i) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -82000000.0) tmp = Float64(x * y); elseif (y <= 5.2e+174) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= -82000000.0) tmp = x * y; elseif (y <= 5.2e+174) tmp = (a * b) + (c * i); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -82000000.0], N[(x * y), $MachinePrecision], If[LessEqual[y, 5.2e+174], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -82000000:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+174}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -8.2e7 or 5.1999999999999997e174 < y Initial program 92.6%
associate-+l+92.6%
fma-def92.6%
Simplified92.6%
fma-def92.6%
+-commutative92.6%
Applied egg-rr92.6%
Taylor expanded in x around inf 61.0%
if -8.2e7 < y < 5.1999999999999997e174Initial program 98.7%
Taylor expanded in a around inf 61.5%
Final simplification61.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a -1.02e+123) (* a b) (if (<= a -4.9e-176) (* z t) (if (<= a 1.35e-36) (* c i) (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -1.02e+123) {
tmp = a * b;
} else if (a <= -4.9e-176) {
tmp = z * t;
} else if (a <= 1.35e-36) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (a <= (-1.02d+123)) then
tmp = a * b
else if (a <= (-4.9d-176)) then
tmp = z * t
else if (a <= 1.35d-36) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= -1.02e+123) {
tmp = a * b;
} else if (a <= -4.9e-176) {
tmp = z * t;
} else if (a <= 1.35e-36) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= -1.02e+123: tmp = a * b elif a <= -4.9e-176: tmp = z * t elif a <= 1.35e-36: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= -1.02e+123) tmp = Float64(a * b); elseif (a <= -4.9e-176) tmp = Float64(z * t); elseif (a <= 1.35e-36) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (a <= -1.02e+123) tmp = a * b; elseif (a <= -4.9e-176) tmp = z * t; elseif (a <= 1.35e-36) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, -1.02e+123], N[(a * b), $MachinePrecision], If[LessEqual[a, -4.9e-176], N[(z * t), $MachinePrecision], If[LessEqual[a, 1.35e-36], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{+123}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \leq -4.9 \cdot 10^{-176}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-36}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if a < -1.02e123 or 1.35000000000000004e-36 < a Initial program 93.9%
associate-+l+93.9%
fma-def93.9%
Simplified93.9%
fma-def93.9%
+-commutative93.9%
Applied egg-rr93.9%
Taylor expanded in a around inf 47.4%
if -1.02e123 < a < -4.8999999999999997e-176Initial program 96.6%
associate-+l+96.6%
fma-def96.6%
Simplified96.6%
fma-def96.6%
+-commutative96.6%
Applied egg-rr96.6%
Taylor expanded in z around inf 36.5%
if -4.8999999999999997e-176 < a < 1.35000000000000004e-36Initial program 99.0%
Taylor expanded in c around inf 34.5%
Final simplification39.9%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.5%
associate-+l+96.5%
fma-def96.5%
Simplified96.5%
fma-def96.5%
+-commutative96.5%
Applied egg-rr96.5%
Taylor expanded in a around inf 25.9%
Final simplification25.9%
herbie shell --seed 2023240
(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)))