
(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 (fma x y (fma z t (fma a b (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(x, y, fma(z, t, fma(a, b, (c * i))));
}
function code(x, y, z, t, a, b, c, i) return fma(x, y, fma(z, t, fma(a, b, Float64(c * i)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(x * y + N[(z * t + N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\right)
\end{array}
Initial program 93.3%
associate-+l+93.3%
associate-+l+93.3%
fma-def94.9%
fma-def96.1%
fma-def97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 93.3%
+-commutative93.3%
fma-def94.5%
associate-+l+94.5%
fma-def96.1%
fma-def97.2%
Simplified97.2%
Final simplification97.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))) INFINITY) (+ (* z t) (+ (fma a b (* c i)) (* x y))) (fma y x (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) + ((a * b) + ((z * t) + (x * y)))) <= ((double) INFINITY)) {
tmp = (z * t) + (fma(a, b, (c * i)) + (x * y));
} else {
tmp = fma(y, x, (a * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) <= Inf) tmp = Float64(Float64(z * t) + Float64(fma(a, b, Float64(c * i)) + Float64(x * y))); else tmp = fma(y, x, Float64(a * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * t), $MachinePrecision] + N[(N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right) \leq \infty:\\
\;\;\;\;z \cdot t + \left(\mathsf{fma}\left(a, b, c \cdot i\right) + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
fma-udef100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
fma-def100.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-def23.5%
fma-def41.2%
fma-def58.8%
Simplified58.8%
Taylor expanded in z around 0 41.2%
Taylor expanded in c around 0 41.2%
+-commutative41.2%
fma-def58.9%
Applied egg-rr58.9%
Final simplification97.2%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))))) (if (<= t_1 INFINITY) t_1 (fma 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) + ((a * b) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(a, b, (c * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(a, b, Float64(c * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b, 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 x around 0 23.5%
fma-def35.3%
Simplified35.3%
Taylor expanded in t around 0 35.5%
+-commutative35.5%
fma-def53.2%
Simplified53.2%
Final simplification96.9%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))))) (if (<= t_1 INFINITY) t_1 (fma y x (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(y, x, (a * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(y, x, Float64(a * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(y * x + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
associate-+l+0.0%
associate-+l+0.0%
fma-def23.5%
fma-def41.2%
fma-def58.8%
Simplified58.8%
Taylor expanded in z around 0 41.2%
Taylor expanded in c around 0 41.2%
+-commutative41.2%
fma-def58.9%
Applied egg-rr58.9%
Final simplification97.2%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))))) (if (<= t_1 INFINITY) t_1 (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((z * t) + (x * y)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((z * t) + (x * y))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((z * t) + (x * y))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\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%
associate-+l+0.0%
associate-+l+0.0%
fma-def23.5%
fma-def41.2%
fma-def58.8%
Simplified58.8%
Taylor expanded in z around 0 41.2%
Taylor expanded in a around inf 41.7%
Final simplification96.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -2.9e+90)
(+ (* c i) (* a b))
(if (or (<= (* c i) 3.1e+16)
(and (not (<= (* c i) 2.4e+69)) (<= (* c i) 6e+179)))
(+ (* a b) (* x y))
(+ (* c i) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -2.9e+90) {
tmp = (c * i) + (a * b);
} else if (((c * i) <= 3.1e+16) || (!((c * i) <= 2.4e+69) && ((c * i) <= 6e+179))) {
tmp = (a * b) + (x * y);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-2.9d+90)) then
tmp = (c * i) + (a * b)
else if (((c * i) <= 3.1d+16) .or. (.not. ((c * i) <= 2.4d+69)) .and. ((c * i) <= 6d+179)) then
tmp = (a * b) + (x * y)
else
tmp = (c * i) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -2.9e+90) {
tmp = (c * i) + (a * b);
} else if (((c * i) <= 3.1e+16) || (!((c * i) <= 2.4e+69) && ((c * i) <= 6e+179))) {
tmp = (a * b) + (x * y);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -2.9e+90: tmp = (c * i) + (a * b) elif ((c * i) <= 3.1e+16) or (not ((c * i) <= 2.4e+69) and ((c * i) <= 6e+179)): tmp = (a * b) + (x * y) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -2.9e+90) tmp = Float64(Float64(c * i) + Float64(a * b)); elseif ((Float64(c * i) <= 3.1e+16) || (!(Float64(c * i) <= 2.4e+69) && (Float64(c * i) <= 6e+179))) tmp = Float64(Float64(a * b) + Float64(x * y)); else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -2.9e+90) tmp = (c * i) + (a * b); elseif (((c * i) <= 3.1e+16) || (~(((c * i) <= 2.4e+69)) && ((c * i) <= 6e+179))) tmp = (a * b) + (x * y); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -2.9e+90], N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(c * i), $MachinePrecision], 3.1e+16], And[N[Not[LessEqual[N[(c * i), $MachinePrecision], 2.4e+69]], $MachinePrecision], LessEqual[N[(c * i), $MachinePrecision], 6e+179]]], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.9 \cdot 10^{+90}:\\
\;\;\;\;c \cdot i + a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 3.1 \cdot 10^{+16} \lor \neg \left(c \cdot i \leq 2.4 \cdot 10^{+69}\right) \land c \cdot i \leq 6 \cdot 10^{+179}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -2.9000000000000001e90Initial program 88.6%
Taylor expanded in a around inf 79.4%
if -2.9000000000000001e90 < (*.f64 c i) < 3.1e16 or 2.4000000000000002e69 < (*.f64 c i) < 5.9999999999999996e179Initial program 95.9%
associate-+l+95.9%
associate-+l+95.9%
fma-def97.6%
fma-def98.8%
fma-def98.8%
Simplified98.8%
Taylor expanded in z around 0 79.4%
Taylor expanded in c around 0 70.8%
if 3.1e16 < (*.f64 c i) < 2.4000000000000002e69 or 5.9999999999999996e179 < (*.f64 c i) Initial program 87.5%
Taylor expanded in z around inf 76.4%
Final simplification73.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= (* a b) -7.5e-15)
t_1
(if (<= (* a b) 8.8e-79)
(+ (* c i) (* x y))
(if (<= (* a b) 1.1e-8)
(+ (* c i) (* z t))
(if (<= (* a b) 6.6e+90) t_1 (+ (* 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 tmp;
if ((a * b) <= -7.5e-15) {
tmp = t_1;
} else if ((a * b) <= 8.8e-79) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 1.1e-8) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 6.6e+90) {
tmp = t_1;
} else {
tmp = (c * i) + (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) :: tmp
t_1 = (a * b) + (x * y)
if ((a * b) <= (-7.5d-15)) then
tmp = t_1
else if ((a * b) <= 8.8d-79) then
tmp = (c * i) + (x * y)
else if ((a * b) <= 1.1d-8) then
tmp = (c * i) + (z * t)
else if ((a * b) <= 6.6d+90) then
tmp = t_1
else
tmp = (c * i) + (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 tmp;
if ((a * b) <= -7.5e-15) {
tmp = t_1;
} else if ((a * b) <= 8.8e-79) {
tmp = (c * i) + (x * y);
} else if ((a * b) <= 1.1e-8) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 6.6e+90) {
tmp = t_1;
} else {
tmp = (c * i) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) tmp = 0 if (a * b) <= -7.5e-15: tmp = t_1 elif (a * b) <= 8.8e-79: tmp = (c * i) + (x * y) elif (a * b) <= 1.1e-8: tmp = (c * i) + (z * t) elif (a * b) <= 6.6e+90: tmp = t_1 else: tmp = (c * i) + (a * b) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (Float64(a * b) <= -7.5e-15) tmp = t_1; elseif (Float64(a * b) <= 8.8e-79) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (Float64(a * b) <= 1.1e-8) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(a * b) <= 6.6e+90) tmp = t_1; else tmp = Float64(Float64(c * i) + 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); tmp = 0.0; if ((a * b) <= -7.5e-15) tmp = t_1; elseif ((a * b) <= 8.8e-79) tmp = (c * i) + (x * y); elseif ((a * b) <= 1.1e-8) tmp = (c * i) + (z * t); elseif ((a * b) <= 6.6e+90) tmp = t_1; else tmp = (c * i) + (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]}, If[LessEqual[N[(a * b), $MachinePrecision], -7.5e-15], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 8.8e-79], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.1e-8], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 6.6e+90], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;a \cdot b \leq -7.5 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 8.8 \cdot 10^{-79}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.1 \cdot 10^{-8}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 6.6 \cdot 10^{+90}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -7.4999999999999996e-15 or 1.0999999999999999e-8 < (*.f64 a b) < 6.60000000000000016e90Initial program 93.4%
associate-+l+93.4%
associate-+l+93.4%
fma-def94.5%
fma-def95.6%
fma-def97.8%
Simplified97.8%
Taylor expanded in z around 0 84.2%
Taylor expanded in c around 0 72.3%
if -7.4999999999999996e-15 < (*.f64 a b) < 8.7999999999999995e-79Initial program 95.5%
Taylor expanded in x around inf 74.6%
if 8.7999999999999995e-79 < (*.f64 a b) < 1.0999999999999999e-8Initial program 100.0%
Taylor expanded in z around inf 82.8%
if 6.60000000000000016e90 < (*.f64 a b) Initial program 85.7%
Taylor expanded in a around inf 82.9%
Final simplification75.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -2.75e+94)
(* c i)
(if (<= (* c i) 2.8e-213)
(* a b)
(if (<= (* c i) 2.1e-91)
(* z t)
(if (<= (* c i) 4.7e+140) (* 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) <= -2.75e+94) {
tmp = c * i;
} else if ((c * i) <= 2.8e-213) {
tmp = a * b;
} else if ((c * i) <= 2.1e-91) {
tmp = z * t;
} else if ((c * i) <= 4.7e+140) {
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) <= (-2.75d+94)) then
tmp = c * i
else if ((c * i) <= 2.8d-213) then
tmp = a * b
else if ((c * i) <= 2.1d-91) then
tmp = z * t
else if ((c * i) <= 4.7d+140) 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) <= -2.75e+94) {
tmp = c * i;
} else if ((c * i) <= 2.8e-213) {
tmp = a * b;
} else if ((c * i) <= 2.1e-91) {
tmp = z * t;
} else if ((c * i) <= 4.7e+140) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -2.75e+94: tmp = c * i elif (c * i) <= 2.8e-213: tmp = a * b elif (c * i) <= 2.1e-91: tmp = z * t elif (c * i) <= 4.7e+140: 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) <= -2.75e+94) tmp = Float64(c * i); elseif (Float64(c * i) <= 2.8e-213) tmp = Float64(a * b); elseif (Float64(c * i) <= 2.1e-91) tmp = Float64(z * t); elseif (Float64(c * i) <= 4.7e+140) 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) <= -2.75e+94) tmp = c * i; elseif ((c * i) <= 2.8e-213) tmp = a * b; elseif ((c * i) <= 2.1e-91) tmp = z * t; elseif ((c * i) <= 4.7e+140) 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], -2.75e+94], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.8e-213], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.1e-91], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.7e+140], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.75 \cdot 10^{+94}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 2.8 \cdot 10^{-213}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 2.1 \cdot 10^{-91}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 4.7 \cdot 10^{+140}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.7499999999999999e94 or 4.7000000000000003e140 < (*.f64 c i) Initial program 87.3%
Taylor expanded in c around inf 69.7%
if -2.7499999999999999e94 < (*.f64 c i) < 2.8e-213 or 2.0999999999999999e-91 < (*.f64 c i) < 4.7000000000000003e140Initial program 95.6%
associate-+l+95.6%
associate-+l+95.6%
fma-def97.5%
fma-def98.7%
fma-def98.7%
Simplified98.7%
Taylor expanded in z around 0 79.6%
Taylor expanded in a around inf 40.1%
if 2.8e-213 < (*.f64 c i) < 2.0999999999999999e-91Initial program 100.0%
Taylor expanded in x around 0 54.7%
fma-def54.7%
Simplified54.7%
fma-udef54.7%
*-commutative54.7%
+-commutative54.7%
Applied egg-rr54.7%
Taylor expanded in z around inf 47.7%
Final simplification49.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* a b))))
(if (<= (* c i) -8.5e-9)
t_1
(if (<= (* c i) 4.6e-79)
(+ (* a b) (* z t))
(if (<= (* c i) 1.05e-34) (* x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (a * b);
double tmp;
if ((c * i) <= -8.5e-9) {
tmp = t_1;
} else if ((c * i) <= 4.6e-79) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 1.05e-34) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * i) + (a * b)
if ((c * i) <= (-8.5d-9)) then
tmp = t_1
else if ((c * i) <= 4.6d-79) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 1.05d-34) then
tmp = x * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (a * b);
double tmp;
if ((c * i) <= -8.5e-9) {
tmp = t_1;
} else if ((c * i) <= 4.6e-79) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 1.05e-34) {
tmp = x * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (a * b) tmp = 0 if (c * i) <= -8.5e-9: tmp = t_1 elif (c * i) <= 4.6e-79: tmp = (a * b) + (z * t) elif (c * i) <= 1.05e-34: tmp = x * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(a * b)) tmp = 0.0 if (Float64(c * i) <= -8.5e-9) tmp = t_1; elseif (Float64(c * i) <= 4.6e-79) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 1.05e-34) tmp = Float64(x * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (a * b); tmp = 0.0; if ((c * i) <= -8.5e-9) tmp = t_1; elseif ((c * i) <= 4.6e-79) tmp = (a * b) + (z * t); elseif ((c * i) <= 1.05e-34) tmp = x * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -8.5e-9], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 4.6e-79], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.05e-34], N[(x * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + a \cdot b\\
\mathbf{if}\;c \cdot i \leq -8.5 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 4.6 \cdot 10^{-79}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 1.05 \cdot 10^{-34}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 c i) < -8.5e-9 or 1.05e-34 < (*.f64 c i) Initial program 92.0%
Taylor expanded in a around inf 65.9%
if -8.5e-9 < (*.f64 c i) < 4.60000000000000023e-79Initial program 96.1%
Taylor expanded in x around 0 66.4%
fma-def67.3%
Simplified67.3%
fma-udef66.4%
*-commutative66.4%
+-commutative66.4%
Applied egg-rr66.4%
Taylor expanded in c around 0 64.3%
if 4.60000000000000023e-79 < (*.f64 c i) < 1.05e-34Initial program 85.7%
associate-+l+85.7%
associate-+l+85.7%
fma-def92.9%
fma-def92.9%
fma-def92.9%
Simplified92.9%
Taylor expanded in z around 0 93.6%
Taylor expanded in x around inf 79.6%
Final simplification66.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -1e+135) (not (<= (* z t) 1.0))) (+ (* c i) (+ (* a b) (* 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 (((z * t) <= -1e+135) || !((z * t) <= 1.0)) {
tmp = (c * i) + ((a * b) + (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 (((z * t) <= (-1d+135)) .or. (.not. ((z * t) <= 1.0d0))) then
tmp = (c * i) + ((a * b) + (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 (((z * t) <= -1e+135) || !((z * t) <= 1.0)) {
tmp = (c * i) + ((a * b) + (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 ((z * t) <= -1e+135) or not ((z * t) <= 1.0): tmp = (c * i) + ((a * b) + (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(z * t) <= -1e+135) || !(Float64(z * t) <= 1.0)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + 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 (((z * t) <= -1e+135) || ~(((z * t) <= 1.0))) tmp = (c * i) + ((a * b) + (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[Or[LessEqual[N[(z * t), $MachinePrecision], -1e+135], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1.0]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $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}\;z \cdot t \leq -1 \cdot 10^{+135} \lor \neg \left(z \cdot t \leq 1\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -9.99999999999999962e134 or 1 < (*.f64 z t) Initial program 86.0%
Taylor expanded in x around 0 80.3%
if -9.99999999999999962e134 < (*.f64 z t) < 1Initial program 97.0%
Taylor expanded in z around 0 95.3%
Final simplification90.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -6.5e+92) (+ (* c i) (* a b)) (if (<= (* c i) 3.6e+185) (+ (* a b) (* 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) <= -6.5e+92) {
tmp = (c * i) + (a * b);
} else if ((c * i) <= 3.6e+185) {
tmp = (a * b) + (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) <= (-6.5d+92)) then
tmp = (c * i) + (a * b)
else if ((c * i) <= 3.6d+185) then
tmp = (a * b) + (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) <= -6.5e+92) {
tmp = (c * i) + (a * b);
} else if ((c * i) <= 3.6e+185) {
tmp = (a * b) + (x * y);
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -6.5e+92: tmp = (c * i) + (a * b) elif (c * i) <= 3.6e+185: tmp = (a * b) + (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) <= -6.5e+92) tmp = Float64(Float64(c * i) + Float64(a * b)); elseif (Float64(c * i) <= 3.6e+185) tmp = Float64(Float64(a * b) + 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) <= -6.5e+92) tmp = (c * i) + (a * b); elseif ((c * i) <= 3.6e+185) tmp = (a * b) + (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], -6.5e+92], N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.6e+185], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6.5 \cdot 10^{+92}:\\
\;\;\;\;c \cdot i + a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 3.6 \cdot 10^{+185}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -6.49999999999999999e92Initial program 88.6%
Taylor expanded in a around inf 79.4%
if -6.49999999999999999e92 < (*.f64 c i) < 3.60000000000000029e185Initial program 96.2%
associate-+l+96.2%
associate-+l+96.2%
fma-def97.8%
fma-def98.9%
fma-def98.9%
Simplified98.9%
Taylor expanded in z around 0 77.5%
Taylor expanded in c around 0 67.3%
if 3.60000000000000029e185 < (*.f64 c i) Initial program 80.8%
Taylor expanded in c around inf 77.4%
Final simplification70.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= y -3850.0)
t_1
(if (<= y 1.3e+94)
(+ (* c i) (+ (* a b) (* z t)))
(if (<= y 4.2e+224) t_1 (+ (* c i) (* 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);
double tmp;
if (y <= -3850.0) {
tmp = t_1;
} else if (y <= 1.3e+94) {
tmp = (c * i) + ((a * b) + (z * t));
} else if (y <= 4.2e+224) {
tmp = t_1;
} else {
tmp = (c * i) + (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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (x * y)
if (y <= (-3850.0d0)) then
tmp = t_1
else if (y <= 1.3d+94) then
tmp = (c * i) + ((a * b) + (z * t))
else if (y <= 4.2d+224) then
tmp = t_1
else
tmp = (c * i) + (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 t_1 = (a * b) + (x * y);
double tmp;
if (y <= -3850.0) {
tmp = t_1;
} else if (y <= 1.3e+94) {
tmp = (c * i) + ((a * b) + (z * t));
} else if (y <= 4.2e+224) {
tmp = t_1;
} else {
tmp = (c * i) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) tmp = 0 if y <= -3850.0: tmp = t_1 elif y <= 1.3e+94: tmp = (c * i) + ((a * b) + (z * t)) elif y <= 4.2e+224: tmp = t_1 else: tmp = (c * i) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) tmp = 0.0 if (y <= -3850.0) tmp = t_1; elseif (y <= 1.3e+94) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); elseif (y <= 4.2e+224) tmp = t_1; else tmp = Float64(Float64(c * i) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); tmp = 0.0; if (y <= -3850.0) tmp = t_1; elseif (y <= 1.3e+94) tmp = (c * i) + ((a * b) + (z * t)); elseif (y <= 4.2e+224) tmp = t_1; else tmp = (c * i) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3850.0], t$95$1, If[LessEqual[y, 1.3e+94], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+224], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;y \leq -3850:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+94}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+224}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\end{array}
\end{array}
if y < -3850 or 1.3e94 < y < 4.2000000000000003e224Initial program 90.4%
associate-+l+90.4%
associate-+l+90.4%
fma-def91.6%
fma-def94.0%
fma-def95.2%
Simplified95.2%
Taylor expanded in z around 0 83.5%
Taylor expanded in c around 0 75.4%
if -3850 < y < 1.3e94Initial program 97.4%
Taylor expanded in x around 0 83.3%
if 4.2000000000000003e224 < y Initial program 72.2%
Taylor expanded in x around inf 72.2%
Final simplification79.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= y -1.25)
(* x y)
(if (<= y -2.2e-279)
(* a b)
(if (<= y 2.9e-265)
(* c i)
(if (<= y 4e-104) (* a b) (if (<= y 1.5e+94) (* 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 <= -1.25) {
tmp = x * y;
} else if (y <= -2.2e-279) {
tmp = a * b;
} else if (y <= 2.9e-265) {
tmp = c * i;
} else if (y <= 4e-104) {
tmp = a * b;
} else if (y <= 1.5e+94) {
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 (y <= (-1.25d0)) then
tmp = x * y
else if (y <= (-2.2d-279)) then
tmp = a * b
else if (y <= 2.9d-265) then
tmp = c * i
else if (y <= 4d-104) then
tmp = a * b
else if (y <= 1.5d+94) 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 (y <= -1.25) {
tmp = x * y;
} else if (y <= -2.2e-279) {
tmp = a * b;
} else if (y <= 2.9e-265) {
tmp = c * i;
} else if (y <= 4e-104) {
tmp = a * b;
} else if (y <= 1.5e+94) {
tmp = c * i;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -1.25: tmp = x * y elif y <= -2.2e-279: tmp = a * b elif y <= 2.9e-265: tmp = c * i elif y <= 4e-104: tmp = a * b elif y <= 1.5e+94: tmp = c * i else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -1.25) tmp = Float64(x * y); elseif (y <= -2.2e-279) tmp = Float64(a * b); elseif (y <= 2.9e-265) tmp = Float64(c * i); elseif (y <= 4e-104) tmp = Float64(a * b); elseif (y <= 1.5e+94) 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 (y <= -1.25) tmp = x * y; elseif (y <= -2.2e-279) tmp = a * b; elseif (y <= 2.9e-265) tmp = c * i; elseif (y <= 4e-104) tmp = a * b; elseif (y <= 1.5e+94) tmp = c * i; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -1.25], N[(x * y), $MachinePrecision], If[LessEqual[y, -2.2e-279], N[(a * b), $MachinePrecision], If[LessEqual[y, 2.9e-265], N[(c * i), $MachinePrecision], If[LessEqual[y, 4e-104], N[(a * b), $MachinePrecision], If[LessEqual[y, 1.5e+94], N[(c * i), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-279}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-265}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-104}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+94}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -1.25 or 1.5e94 < y Initial program 87.1%
associate-+l+87.1%
associate-+l+87.1%
fma-def91.1%
fma-def93.1%
fma-def94.1%
Simplified94.1%
Taylor expanded in z around 0 83.5%
Taylor expanded in x around inf 52.0%
if -1.25 < y < -2.2e-279 or 2.89999999999999975e-265 < y < 3.99999999999999971e-104Initial program 99.1%
associate-+l+99.1%
associate-+l+99.1%
fma-def99.1%
fma-def99.1%
fma-def100.0%
Simplified100.0%
Taylor expanded in z around 0 76.0%
Taylor expanded in a around inf 36.6%
if -2.2e-279 < y < 2.89999999999999975e-265 or 3.99999999999999971e-104 < y < 1.5e94Initial program 93.1%
Taylor expanded in c around inf 44.0%
Final simplification43.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -4.6e+89) (* c i) (if (<= (* c i) 3e+144) (* 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.6e+89) {
tmp = c * i;
} else if ((c * i) <= 3e+144) {
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) <= (-4.6d+89)) then
tmp = c * i
else if ((c * i) <= 3d+144) 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) <= -4.6e+89) {
tmp = c * i;
} else if ((c * i) <= 3e+144) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -4.6e+89: tmp = c * i elif (c * i) <= 3e+144: 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) <= -4.6e+89) tmp = Float64(c * i); elseif (Float64(c * i) <= 3e+144) 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) <= -4.6e+89) tmp = c * i; elseif ((c * i) <= 3e+144) 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], -4.6e+89], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3e+144], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4.6 \cdot 10^{+89}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 3 \cdot 10^{+144}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -4.5999999999999998e89 or 2.9999999999999999e144 < (*.f64 c i) Initial program 87.3%
Taylor expanded in c around inf 69.7%
if -4.5999999999999998e89 < (*.f64 c i) < 2.9999999999999999e144Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
fma-def97.7%
fma-def98.8%
fma-def98.9%
Simplified98.9%
Taylor expanded in z around 0 77.5%
Taylor expanded in a around inf 37.5%
Final simplification47.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -3900.0) (* x y) (if (<= y 6.6e+122) (+ (* 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 (y <= -3900.0) {
tmp = x * y;
} else if (y <= 6.6e+122) {
tmp = (c * i) + (a * b);
} 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 <= (-3900.0d0)) then
tmp = x * y
else if (y <= 6.6d+122) then
tmp = (c * i) + (a * b)
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 <= -3900.0) {
tmp = x * y;
} else if (y <= 6.6e+122) {
tmp = (c * i) + (a * b);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -3900.0: tmp = x * y elif y <= 6.6e+122: tmp = (c * i) + (a * b) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -3900.0) tmp = Float64(x * y); elseif (y <= 6.6e+122) tmp = Float64(Float64(c * i) + Float64(a * b)); 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 <= -3900.0) tmp = x * y; elseif (y <= 6.6e+122) tmp = (c * i) + (a * b); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -3900.0], N[(x * y), $MachinePrecision], If[LessEqual[y, 6.6e+122], N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3900:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+122}:\\
\;\;\;\;c \cdot i + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -3900 or 6.5999999999999998e122 < y Initial program 87.5%
associate-+l+87.5%
associate-+l+87.5%
fma-def91.7%
fma-def92.7%
fma-def93.8%
Simplified93.8%
Taylor expanded in z around 0 82.6%
Taylor expanded in x around inf 52.5%
if -3900 < y < 6.5999999999999998e122Initial program 96.8%
Taylor expanded in a around inf 63.6%
Final simplification59.4%
(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 93.3%
associate-+l+93.3%
associate-+l+93.3%
fma-def94.9%
fma-def96.1%
fma-def97.3%
Simplified97.3%
Taylor expanded in z around 0 80.1%
Taylor expanded in a around inf 30.4%
Final simplification30.4%
herbie shell --seed 2023200
(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)))