
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* a b) (+ (* x y) (* z t))) INFINITY) (fma x y (fma z t (fma a b (* c i)))) (fma z t (fma 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 (((a * b) + ((x * y) + (z * t))) <= ((double) INFINITY)) {
tmp = fma(x, y, fma(z, t, fma(a, b, (c * i))));
} else {
tmp = fma(z, t, fma(x, y, (c * i)));
}
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(x, y, fma(z, t, fma(a, b, Float64(c * i)))); else tmp = fma(z, t, fma(x, y, Float64(c * i))); 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[(x * y + N[(z * t + N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(x * y + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b + \left(x \cdot y + z \cdot t\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, c \cdot i\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 96.7%
associate-+l+96.7%
associate-+l+96.7%
fma-def97.1%
fma-def97.5%
fma-def98.4%
Simplified98.4%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
Taylor expanded in a around 0 50.0%
associate-+l+50.0%
*-commutative50.0%
fma-def66.7%
fma-def75.0%
Applied egg-rr75.0%
Final simplification97.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (fma x y (fma z t (+ (* a b) (* c i)))) (fma z t (fma 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 ((((a * b) + ((x * y) + (z * t))) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(x, y, fma(z, t, ((a * b) + (c * i))));
} else {
tmp = fma(z, t, fma(x, y, (c * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) <= Inf) tmp = fma(x, y, fma(z, t, Float64(Float64(a * b) + Float64(c * i)))); else tmp = fma(z, t, fma(x, y, Float64(c * i))); 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[(x * y + N[(z * t + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(x * y + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b + c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, c \cdot i\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
associate-+l+100.0%
associate-+l+100.0%
fma-def100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.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 a around 0 40.0%
associate-+l+40.0%
*-commutative40.0%
fma-def55.0%
fma-def65.0%
Applied egg-rr65.0%
Final simplification97.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (fma c i (+ (+ (* x y) (* a b)) (* z t))) (fma z t (fma 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 ((((a * b) + ((x * y) + (z * t))) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(c, i, (((x * y) + (a * b)) + (z * t)));
} else {
tmp = fma(z, t, fma(x, y, (c * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) <= Inf) tmp = fma(c, i, Float64(Float64(Float64(x * y) + Float64(a * b)) + Float64(z * t))); else tmp = fma(z, t, fma(x, y, Float64(c * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(x * y + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, \left(x \cdot y + a \cdot b\right) + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, c \cdot i\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
+-commutative100.0%
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 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around 0 40.0%
associate-+l+40.0%
*-commutative40.0%
fma-def55.0%
fma-def65.0%
Applied egg-rr65.0%
Final simplification97.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* a b) (+ (* x y) (* z t))) INFINITY) (fma c i (+ (+ (* x y) (* a b)) (* z t))) (fma t z (* 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, (((x * y) + (a * b)) + (z * t)));
} else {
tmp = fma(t, z, (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(Float64(x * y) + Float64(a * b)) + Float64(z * t))); else tmp = fma(t, z, 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[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b + \left(x \cdot y + z \cdot t\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, \left(x \cdot y + a \cdot b\right) + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, z, x \cdot y\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 96.7%
+-commutative96.7%
fma-def98.3%
associate-+l+98.3%
fma-def98.3%
fma-def98.3%
Simplified98.3%
fma-udef98.3%
fma-udef98.3%
associate-+l+98.3%
+-commutative98.3%
associate-+r+98.3%
Applied egg-rr98.3%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
Taylor expanded in a around 0 50.0%
Taylor expanded in c around 0 50.0%
fma-def66.7%
Simplified66.7%
Final simplification96.9%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (fma t z (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(t, z, (x * y));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(t, z, Float64(x * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, z, 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%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around 0 40.0%
Taylor expanded in c around 0 40.5%
fma-def50.5%
Simplified50.5%
Final simplification96.1%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (fma z t (* 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) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(z, t, (c * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(z, t, Float64(c * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * t + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, c \cdot i\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around 0 40.0%
associate-+l+40.0%
*-commutative40.0%
fma-def55.0%
fma-def65.0%
Applied egg-rr65.0%
Taylor expanded in x around 0 50.2%
+-commutative50.2%
*-commutative50.2%
fma-def55.2%
Simplified55.2%
Final simplification96.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* c i)))
(t_2 (+ (* x y) (* z t)))
(t_3 (+ (* a b) (* c i))))
(if (<= (* a b) -6.4e+72)
t_3
(if (<= (* a b) -6.2e-145)
t_1
(if (<= (* a b) -2.4e-250)
t_2
(if (<= (* a b) -5e-310)
t_1
(if (<= (* a b) 9.6e-293)
t_2
(if (<= (* a b) 1.2e+156) (+ (* c i) (* z t)) t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (c * i);
double t_2 = (x * y) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -6.4e+72) {
tmp = t_3;
} else if ((a * b) <= -6.2e-145) {
tmp = t_1;
} else if ((a * b) <= -2.4e-250) {
tmp = t_2;
} else if ((a * b) <= -5e-310) {
tmp = t_1;
} else if ((a * b) <= 9.6e-293) {
tmp = t_2;
} else if ((a * b) <= 1.2e+156) {
tmp = (c * i) + (z * t);
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = (x * y) + (c * i)
t_2 = (x * y) + (z * t)
t_3 = (a * b) + (c * i)
if ((a * b) <= (-6.4d+72)) then
tmp = t_3
else if ((a * b) <= (-6.2d-145)) then
tmp = t_1
else if ((a * b) <= (-2.4d-250)) then
tmp = t_2
else if ((a * b) <= (-5d-310)) then
tmp = t_1
else if ((a * b) <= 9.6d-293) then
tmp = t_2
else if ((a * b) <= 1.2d+156) then
tmp = (c * i) + (z * t)
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (c * i);
double t_2 = (x * y) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -6.4e+72) {
tmp = t_3;
} else if ((a * b) <= -6.2e-145) {
tmp = t_1;
} else if ((a * b) <= -2.4e-250) {
tmp = t_2;
} else if ((a * b) <= -5e-310) {
tmp = t_1;
} else if ((a * b) <= 9.6e-293) {
tmp = t_2;
} else if ((a * b) <= 1.2e+156) {
tmp = (c * i) + (z * t);
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (c * i) t_2 = (x * y) + (z * t) t_3 = (a * b) + (c * i) tmp = 0 if (a * b) <= -6.4e+72: tmp = t_3 elif (a * b) <= -6.2e-145: tmp = t_1 elif (a * b) <= -2.4e-250: tmp = t_2 elif (a * b) <= -5e-310: tmp = t_1 elif (a * b) <= 9.6e-293: tmp = t_2 elif (a * b) <= 1.2e+156: tmp = (c * i) + (z * t) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(c * i)) t_2 = Float64(Float64(x * y) + Float64(z * t)) t_3 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -6.4e+72) tmp = t_3; elseif (Float64(a * b) <= -6.2e-145) tmp = t_1; elseif (Float64(a * b) <= -2.4e-250) tmp = t_2; elseif (Float64(a * b) <= -5e-310) tmp = t_1; elseif (Float64(a * b) <= 9.6e-293) tmp = t_2; elseif (Float64(a * b) <= 1.2e+156) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (c * i); t_2 = (x * y) + (z * t); t_3 = (a * b) + (c * i); tmp = 0.0; if ((a * b) <= -6.4e+72) tmp = t_3; elseif ((a * b) <= -6.2e-145) tmp = t_1; elseif ((a * b) <= -2.4e-250) tmp = t_2; elseif ((a * b) <= -5e-310) tmp = t_1; elseif ((a * b) <= 9.6e-293) tmp = t_2; elseif ((a * b) <= 1.2e+156) tmp = (c * i) + (z * t); else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -6.4e+72], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], -6.2e-145], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2.4e-250], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -5e-310], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 9.6e-293], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 1.2e+156], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + c \cdot i\\
t_2 := x \cdot y + z \cdot t\\
t_3 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -6.4 \cdot 10^{+72}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq -6.2 \cdot 10^{-145}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -2.4 \cdot 10^{-250}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 9.6 \cdot 10^{-293}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 1.2 \cdot 10^{+156}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 a b) < -6.4000000000000003e72 or 1.2000000000000001e156 < (*.f64 a b) Initial program 86.3%
Taylor expanded in z around 0 81.4%
Taylor expanded in x around 0 77.5%
if -6.4000000000000003e72 < (*.f64 a b) < -6.20000000000000001e-145 or -2.3999999999999999e-250 < (*.f64 a b) < -4.999999999999985e-310Initial program 92.3%
Taylor expanded in a around 0 86.8%
Taylor expanded in t around 0 74.7%
if -6.20000000000000001e-145 < (*.f64 a b) < -2.3999999999999999e-250 or -4.999999999999985e-310 < (*.f64 a b) < 9.5999999999999996e-293Initial program 97.7%
Taylor expanded in a around 0 97.7%
Taylor expanded in c around 0 87.8%
if 9.5999999999999996e-293 < (*.f64 a b) < 1.2000000000000001e156Initial program 96.9%
Taylor expanded in a around 0 88.3%
associate-+l+88.3%
*-commutative88.3%
fma-def88.3%
fma-def89.9%
Applied egg-rr89.9%
Taylor expanded in x around 0 71.4%
Final simplification77.2%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (+ (* c i) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around 0 40.0%
associate-+l+40.0%
*-commutative40.0%
fma-def55.0%
fma-def65.0%
Applied egg-rr65.0%
Taylor expanded in x around 0 50.2%
Final simplification96.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (+ (* a b) (* z t)))))
(if (<= (* x y) -8.5e+255)
(* x y)
(if (<= (* x y) -1.45e+136)
t_1
(if (<= (* x y) -2.05e+95)
(+ (* x y) (* c i))
(if (<= (* x y) 3.4e+97) t_1 (+ (* x y) (* 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) + (z * t));
double tmp;
if ((x * y) <= -8.5e+255) {
tmp = x * y;
} else if ((x * y) <= -1.45e+136) {
tmp = t_1;
} else if ((x * y) <= -2.05e+95) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= 3.4e+97) {
tmp = t_1;
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * i) + ((a * b) + (z * t))
if ((x * y) <= (-8.5d+255)) then
tmp = x * y
else if ((x * y) <= (-1.45d+136)) then
tmp = t_1
else if ((x * y) <= (-2.05d+95)) then
tmp = (x * y) + (c * i)
else if ((x * y) <= 3.4d+97) then
tmp = t_1
else
tmp = (x * y) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + (z * t));
double tmp;
if ((x * y) <= -8.5e+255) {
tmp = x * y;
} else if ((x * y) <= -1.45e+136) {
tmp = t_1;
} else if ((x * y) <= -2.05e+95) {
tmp = (x * y) + (c * i);
} else if ((x * y) <= 3.4e+97) {
tmp = t_1;
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + (z * t)) tmp = 0 if (x * y) <= -8.5e+255: tmp = x * y elif (x * y) <= -1.45e+136: tmp = t_1 elif (x * y) <= -2.05e+95: tmp = (x * y) + (c * i) elif (x * y) <= 3.4e+97: tmp = t_1 else: tmp = (x * y) + (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(z * t))) tmp = 0.0 if (Float64(x * y) <= -8.5e+255) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.45e+136) tmp = t_1; elseif (Float64(x * y) <= -2.05e+95) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(x * y) <= 3.4e+97) tmp = t_1; else tmp = Float64(Float64(x * y) + 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) + (z * t)); tmp = 0.0; if ((x * y) <= -8.5e+255) tmp = x * y; elseif ((x * y) <= -1.45e+136) tmp = t_1; elseif ((x * y) <= -2.05e+95) tmp = (x * y) + (c * i); elseif ((x * y) <= 3.4e+97) tmp = t_1; else tmp = (x * y) + (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[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+255], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.45e+136], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.05e+95], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.4e+97], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+255}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.45 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -2.05 \cdot 10^{+95}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 3.4 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -8.49999999999999959e255Initial program 80.0%
Taylor expanded in x around inf 84.3%
if -8.49999999999999959e255 < (*.f64 x y) < -1.44999999999999987e136 or -2.04999999999999993e95 < (*.f64 x y) < 3.4000000000000001e97Initial program 96.2%
Taylor expanded in x around 0 88.3%
if -1.44999999999999987e136 < (*.f64 x y) < -2.04999999999999993e95Initial program 99.8%
Taylor expanded in a around 0 89.9%
Taylor expanded in t around 0 80.1%
if 3.4000000000000001e97 < (*.f64 x y) Initial program 78.3%
Taylor expanded in a around 0 76.0%
Taylor expanded in c around 0 70.6%
Final simplification85.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* a b) (* c i))))
(if (<= (* a b) -3.3e+70)
t_2
(if (<= (* a b) -1950000000000.0)
t_1
(if (<= (* a b) -9.6e-82)
(* x y)
(if (<= (* a b) 1.05e+156) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -3.3e+70) {
tmp = t_2;
} else if ((a * b) <= -1950000000000.0) {
tmp = t_1;
} else if ((a * b) <= -9.6e-82) {
tmp = x * y;
} else if ((a * b) <= 1.05e+156) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (c * i) + (z * t)
t_2 = (a * b) + (c * i)
if ((a * b) <= (-3.3d+70)) then
tmp = t_2
else if ((a * b) <= (-1950000000000.0d0)) then
tmp = t_1
else if ((a * b) <= (-9.6d-82)) then
tmp = x * y
else if ((a * b) <= 1.05d+156) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -3.3e+70) {
tmp = t_2;
} else if ((a * b) <= -1950000000000.0) {
tmp = t_1;
} else if ((a * b) <= -9.6e-82) {
tmp = x * y;
} else if ((a * b) <= 1.05e+156) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = (a * b) + (c * i) tmp = 0 if (a * b) <= -3.3e+70: tmp = t_2 elif (a * b) <= -1950000000000.0: tmp = t_1 elif (a * b) <= -9.6e-82: tmp = x * y elif (a * b) <= 1.05e+156: tmp = t_1 else: tmp = t_2 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(c * i)) tmp = 0.0 if (Float64(a * b) <= -3.3e+70) tmp = t_2; elseif (Float64(a * b) <= -1950000000000.0) tmp = t_1; elseif (Float64(a * b) <= -9.6e-82) tmp = Float64(x * y); elseif (Float64(a * b) <= 1.05e+156) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); t_2 = (a * b) + (c * i); tmp = 0.0; if ((a * b) <= -3.3e+70) tmp = t_2; elseif ((a * b) <= -1950000000000.0) tmp = t_1; elseif ((a * b) <= -9.6e-82) tmp = x * y; elseif ((a * b) <= 1.05e+156) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -3.3e+70], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1950000000000.0], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -9.6e-82], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.05e+156], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -3.3 \cdot 10^{+70}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -1950000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -9.6 \cdot 10^{-82}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.05 \cdot 10^{+156}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -3.30000000000000016e70 or 1.04999999999999991e156 < (*.f64 a b) Initial program 86.5%
Taylor expanded in z around 0 81.6%
Taylor expanded in x around 0 76.7%
if -3.30000000000000016e70 < (*.f64 a b) < -1.95e12 or -9.60000000000000033e-82 < (*.f64 a b) < 1.04999999999999991e156Initial program 97.2%
Taylor expanded in a around 0 92.1%
associate-+l+92.1%
*-commutative92.1%
fma-def92.1%
fma-def93.5%
Applied egg-rr93.5%
Taylor expanded in x around 0 67.0%
if -1.95e12 < (*.f64 a b) < -9.60000000000000033e-82Initial program 81.3%
Taylor expanded in x around inf 63.0%
Final simplification70.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* a b) -1.8e+72)
t_1
(if (<= (* a b) -7e-309)
(+ (* x y) (* c i))
(if (<= (* a b) 1.05e+156) (+ (* c i) (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -1.8e+72) {
tmp = t_1;
} else if ((a * b) <= -7e-309) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 1.05e+156) {
tmp = (c * i) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((a * b) <= (-1.8d+72)) then
tmp = t_1
else if ((a * b) <= (-7d-309)) then
tmp = (x * y) + (c * i)
else if ((a * b) <= 1.05d+156) then
tmp = (c * i) + (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -1.8e+72) {
tmp = t_1;
} else if ((a * b) <= -7e-309) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 1.05e+156) {
tmp = (c * i) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (a * b) <= -1.8e+72: tmp = t_1 elif (a * b) <= -7e-309: tmp = (x * y) + (c * i) elif (a * b) <= 1.05e+156: tmp = (c * i) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -1.8e+72) tmp = t_1; elseif (Float64(a * b) <= -7e-309) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(a * b) <= 1.05e+156) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); tmp = 0.0; if ((a * b) <= -1.8e+72) tmp = t_1; elseif ((a * b) <= -7e-309) tmp = (x * y) + (c * i); elseif ((a * b) <= 1.05e+156) tmp = (c * i) + (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.8e+72], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -7e-309], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.05e+156], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -1.8 \cdot 10^{+72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -7 \cdot 10^{-309}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.05 \cdot 10^{+156}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.80000000000000017e72 or 1.04999999999999991e156 < (*.f64 a b) Initial program 86.3%
Taylor expanded in z around 0 81.4%
Taylor expanded in x around 0 77.5%
if -1.80000000000000017e72 < (*.f64 a b) < -6.9999999999999984e-309Initial program 94.3%
Taylor expanded in a around 0 90.3%
Taylor expanded in t around 0 68.0%
if -6.9999999999999984e-309 < (*.f64 a b) < 1.04999999999999991e156Initial program 96.7%
Taylor expanded in a around 0 90.6%
associate-+l+90.6%
*-commutative90.6%
fma-def90.6%
fma-def91.7%
Applied egg-rr91.7%
Taylor expanded in x around 0 68.9%
Final simplification71.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -4.2e+72)
(+ (* c i) (+ (* x y) (* a b)))
(if (<= (* a b) 1.85e-30)
(+ (* c i) (+ (* x y) (* z t)))
(+ (* c i) (+ (* a b) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4.2e+72) {
tmp = (c * i) + ((x * y) + (a * b));
} else if ((a * b) <= 1.85e-30) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-4.2d+72)) then
tmp = (c * i) + ((x * y) + (a * b))
else if ((a * b) <= 1.85d-30) then
tmp = (c * i) + ((x * y) + (z * t))
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4.2e+72) {
tmp = (c * i) + ((x * y) + (a * b));
} else if ((a * b) <= 1.85e-30) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -4.2e+72: tmp = (c * i) + ((x * y) + (a * b)) elif (a * b) <= 1.85e-30: tmp = (c * i) + ((x * y) + (z * t)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -4.2e+72) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(a * b))); elseif (Float64(a * b) <= 1.85e-30) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -4.2e+72) tmp = (c * i) + ((x * y) + (a * b)); elseif ((a * b) <= 1.85e-30) tmp = (c * i) + ((x * y) + (z * t)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -4.2e+72], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.85e-30], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4.2 \cdot 10^{+72}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + a \cdot b\right)\\
\mathbf{elif}\;a \cdot b \leq 1.85 \cdot 10^{-30}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -4.2000000000000003e72Initial program 84.9%
Taylor expanded in z around 0 84.9%
if -4.2000000000000003e72 < (*.f64 a b) < 1.8500000000000002e-30Initial program 96.2%
Taylor expanded in a around 0 93.6%
if 1.8500000000000002e-30 < (*.f64 a b) Initial program 89.9%
Taylor expanded in x around 0 88.4%
Final simplification90.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -2.2e+139) (* c i) (if (<= (* c i) 2e+61) (* z t) (if (<= (* c i) 3e+165) (* 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 ((c * i) <= -2.2e+139) {
tmp = c * i;
} else if ((c * i) <= 2e+61) {
tmp = z * t;
} else if ((c * i) <= 3e+165) {
tmp = x * y;
} 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) <= (-2.2d+139)) then
tmp = c * i
else if ((c * i) <= 2d+61) then
tmp = z * t
else if ((c * i) <= 3d+165) then
tmp = x * y
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) <= -2.2e+139) {
tmp = c * i;
} else if ((c * i) <= 2e+61) {
tmp = z * t;
} else if ((c * i) <= 3e+165) {
tmp = x * y;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -2.2e+139: tmp = c * i elif (c * i) <= 2e+61: tmp = z * t elif (c * i) <= 3e+165: tmp = x * y else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -2.2e+139) tmp = Float64(c * i); elseif (Float64(c * i) <= 2e+61) tmp = Float64(z * t); elseif (Float64(c * i) <= 3e+165) tmp = Float64(x * y); 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) <= -2.2e+139) tmp = c * i; elseif ((c * i) <= 2e+61) tmp = z * t; elseif ((c * i) <= 3e+165) tmp = x * y; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -2.2e+139], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2e+61], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3e+165], N[(x * y), $MachinePrecision], N[(c * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.2 \cdot 10^{+139}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+61}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 3 \cdot 10^{+165}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.1999999999999999e139 or 2.9999999999999999e165 < (*.f64 c i) Initial program 88.2%
Taylor expanded in c around inf 69.8%
if -2.1999999999999999e139 < (*.f64 c i) < 1.9999999999999999e61Initial program 94.8%
Taylor expanded in z around inf 37.2%
if 1.9999999999999999e61 < (*.f64 c i) < 2.9999999999999999e165Initial program 88.9%
Taylor expanded in x around inf 51.2%
Final simplification49.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= t -1.25e-30)
(+ (* c i) (* z t))
(if (<= t 3.8e+128)
(+ (* c i) (+ (* x y) (* a b)))
(+ (* 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 (t <= -1.25e-30) {
tmp = (c * i) + (z * t);
} else if (t <= 3.8e+128) {
tmp = (c * i) + ((x * y) + (a * b));
} 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 (t <= (-1.25d-30)) then
tmp = (c * i) + (z * t)
else if (t <= 3.8d+128) then
tmp = (c * i) + ((x * y) + (a * b))
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 (t <= -1.25e-30) {
tmp = (c * i) + (z * t);
} else if (t <= 3.8e+128) {
tmp = (c * i) + ((x * y) + (a * b));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= -1.25e-30: tmp = (c * i) + (z * t) elif t <= 3.8e+128: tmp = (c * i) + ((x * y) + (a * b)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= -1.25e-30) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (t <= 3.8e+128) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(a * b))); 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 (t <= -1.25e-30) tmp = (c * i) + (z * t); elseif (t <= 3.8e+128) tmp = (c * i) + ((x * y) + (a * b)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, -1.25e-30], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+128], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $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}\;t \leq -1.25 \cdot 10^{-30}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+128}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if t < -1.24999999999999993e-30Initial program 91.5%
Taylor expanded in a around 0 82.6%
associate-+l+82.6%
*-commutative82.6%
fma-def84.0%
fma-def84.0%
Applied egg-rr84.0%
Taylor expanded in x around 0 60.6%
if -1.24999999999999993e-30 < t < 3.7999999999999999e128Initial program 96.5%
Taylor expanded in z around 0 85.3%
if 3.7999999999999999e128 < t Initial program 78.0%
Taylor expanded in x around 0 85.4%
Final simplification78.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -1.2e+143) (* c i) (if (<= (* c i) 1.45e+166) (* 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) <= -1.2e+143) {
tmp = c * i;
} else if ((c * i) <= 1.45e+166) {
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) <= (-1.2d+143)) then
tmp = c * i
else if ((c * i) <= 1.45d+166) 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) <= -1.2e+143) {
tmp = c * i;
} else if ((c * i) <= 1.45e+166) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.2e+143: tmp = c * i elif (c * i) <= 1.45e+166: 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) <= -1.2e+143) tmp = Float64(c * i); elseif (Float64(c * i) <= 1.45e+166) 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) <= -1.2e+143) tmp = c * i; elseif ((c * i) <= 1.45e+166) 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], -1.2e+143], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.45e+166], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.2 \cdot 10^{+143}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 1.45 \cdot 10^{+166}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.1999999999999999e143 or 1.4500000000000001e166 < (*.f64 c i) Initial program 88.1%
Taylor expanded in c around inf 70.6%
if -1.1999999999999999e143 < (*.f64 c i) < 1.4500000000000001e166Initial program 94.2%
Taylor expanded in a around inf 34.7%
Final simplification46.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -2.1e+141) (* c i) (if (<= (* c i) 1.7e+165) (* 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) <= -2.1e+141) {
tmp = c * i;
} else if ((c * i) <= 1.7e+165) {
tmp = z * t;
} 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) <= (-2.1d+141)) then
tmp = c * i
else if ((c * i) <= 1.7d+165) then
tmp = z * t
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) <= -2.1e+141) {
tmp = c * i;
} else if ((c * i) <= 1.7e+165) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -2.1e+141: tmp = c * i elif (c * i) <= 1.7e+165: tmp = 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) <= -2.1e+141) tmp = Float64(c * i); elseif (Float64(c * i) <= 1.7e+165) tmp = Float64(z * t); 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) <= -2.1e+141) tmp = c * i; elseif ((c * i) <= 1.7e+165) tmp = z * t; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -2.1e+141], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.7e+165], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.1 \cdot 10^{+141}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 1.7 \cdot 10^{+165}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.0999999999999998e141 or 1.70000000000000005e165 < (*.f64 c i) Initial program 88.2%
Taylor expanded in c around inf 69.8%
if -2.0999999999999998e141 < (*.f64 c i) < 1.70000000000000005e165Initial program 94.1%
Taylor expanded in z around inf 35.3%
Final simplification46.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -5.8e+127) (* z t) (if (<= z 4.4e+44) (+ (* a b) (* c i)) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -5.8e+127) {
tmp = z * t;
} else if (z <= 4.4e+44) {
tmp = (a * b) + (c * i);
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-5.8d+127)) then
tmp = z * t
else if (z <= 4.4d+44) then
tmp = (a * b) + (c * i)
else
tmp = z * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -5.8e+127) {
tmp = z * t;
} else if (z <= 4.4e+44) {
tmp = (a * b) + (c * i);
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -5.8e+127: tmp = z * t elif z <= 4.4e+44: tmp = (a * b) + (c * i) else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -5.8e+127) tmp = Float64(z * t); elseif (z <= 4.4e+44) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -5.8e+127) tmp = z * t; elseif (z <= 4.4e+44) tmp = (a * b) + (c * i); else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -5.8e+127], N[(z * t), $MachinePrecision], If[LessEqual[z, 4.4e+44], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(z * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+127}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+44}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if z < -5.8000000000000004e127 or 4.39999999999999991e44 < z Initial program 90.8%
Taylor expanded in z around inf 52.6%
if -5.8000000000000004e127 < z < 4.39999999999999991e44Initial program 93.0%
Taylor expanded in z around 0 83.8%
Taylor expanded in x around 0 60.7%
Final simplification57.6%
(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 92.2%
Taylor expanded in a around inf 28.7%
Final simplification28.7%
herbie shell --seed 2023271
(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)))