
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))) INFINITY) (+ (+ (* x y) (* c i)) (fma z t (* a b))) (fma y x (fma a b (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = ((x * y) + (c * i)) + fma(z, t, (a * b));
} else {
tmp = fma(y, x, fma(a, b, (z * t)));
}
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(x * y) + Float64(z * t)))) <= Inf) tmp = Float64(Float64(Float64(x * y) + Float64(c * i)) + fma(z, t, Float64(a * b))); else tmp = fma(y, x, fma(a, b, Float64(z * t))); 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(a * b + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) \leq \infty:\\
\;\;\;\;\left(x \cdot y + c \cdot i\right) + \mathsf{fma}\left(z, t, a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \mathsf{fma}\left(a, b, z \cdot t\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%
+-commutative100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
fma-udef100.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 c around 0 23.1%
+-commutative23.1%
+-commutative23.1%
associate-+r+23.1%
*-commutative23.1%
*-commutative23.1%
fma-def38.5%
+-commutative38.5%
*-commutative38.5%
fma-def53.8%
*-commutative53.8%
Applied egg-rr53.8%
Final simplification97.6%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 94.9%
+-commutative94.9%
fma-def96.1%
+-commutative96.1%
fma-def97.2%
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 (+ (* a b) (* z t)))))
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, ((a * b) + (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, Float64(Float64(a * b) + Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, a \cdot b + z \cdot t\right)\right)
\end{array}
Initial program 94.9%
+-commutative94.9%
fma-def96.1%
associate-+l+96.1%
fma-def96.9%
fma-def96.9%
Simplified96.9%
fma-udef96.9%
Applied egg-rr96.9%
Final simplification96.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))) INFINITY) (+ (+ (* x y) (* c i)) (fma z t (* a b))) (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) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
tmp = ((x * y) + (c * i)) + fma(z, t, (a * b));
} 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(x * y) + Float64(z * t)))) <= Inf) tmp = Float64(Float64(Float64(x * y) + Float64(c * i)) + fma(z, t, Float64(a * b))); 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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(z * t + N[(a * b), $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(x \cdot y + z \cdot t\right)\right) \leq \infty:\\
\;\;\;\;\left(x \cdot y + c \cdot i\right) + \mathsf{fma}\left(z, t, a \cdot b\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%
+-commutative100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
fma-udef100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
fma-udef100.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 c around 0 23.1%
+-commutative23.1%
*-commutative23.1%
fma-def23.1%
*-commutative23.1%
Applied egg-rr23.1%
Taylor expanded in z around 0 31.2%
+-commutative31.2%
*-commutative31.2%
fma-def46.6%
Applied egg-rr46.6%
Final simplification97.3%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (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) + ((x * y) + (z * t)));
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(x * y) + Float64(z * t)))) 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[(x * y), $MachinePrecision] + N[(z * t), $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(x \cdot y + z \cdot t\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%
Taylor expanded in c around 0 23.1%
+-commutative23.1%
*-commutative23.1%
fma-def23.1%
*-commutative23.1%
Applied egg-rr23.1%
Taylor expanded in z around 0 31.2%
+-commutative31.2%
*-commutative31.2%
fma-def46.6%
Applied egg-rr46.6%
Final simplification97.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y)))
(t_2 (+ (* a b) (* z t)))
(t_3 (+ (* a b) (* c i))))
(if (<= (* c i) -3.05e+103)
t_3
(if (<= (* c i) -7.5e-78)
t_1
(if (<= (* c i) -4.2e-291)
t_2
(if (<= (* c i) 1.55e-209)
t_1
(if (<= (* c i) 15500000000.0) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double t_2 = (a * b) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -3.05e+103) {
tmp = t_3;
} else if ((c * i) <= -7.5e-78) {
tmp = t_1;
} else if ((c * i) <= -4.2e-291) {
tmp = t_2;
} else if ((c * i) <= 1.55e-209) {
tmp = t_1;
} else if ((c * i) <= 15500000000.0) {
tmp = t_2;
} 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 = (a * b) + (x * y)
t_2 = (a * b) + (z * t)
t_3 = (a * b) + (c * i)
if ((c * i) <= (-3.05d+103)) then
tmp = t_3
else if ((c * i) <= (-7.5d-78)) then
tmp = t_1
else if ((c * i) <= (-4.2d-291)) then
tmp = t_2
else if ((c * i) <= 1.55d-209) then
tmp = t_1
else if ((c * i) <= 15500000000.0d0) then
tmp = t_2
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 = (a * b) + (x * y);
double t_2 = (a * b) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -3.05e+103) {
tmp = t_3;
} else if ((c * i) <= -7.5e-78) {
tmp = t_1;
} else if ((c * i) <= -4.2e-291) {
tmp = t_2;
} else if ((c * i) <= 1.55e-209) {
tmp = t_1;
} else if ((c * i) <= 15500000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) t_2 = (a * b) + (z * t) t_3 = (a * b) + (c * i) tmp = 0 if (c * i) <= -3.05e+103: tmp = t_3 elif (c * i) <= -7.5e-78: tmp = t_1 elif (c * i) <= -4.2e-291: tmp = t_2 elif (c * i) <= 1.55e-209: tmp = t_1 elif (c * i) <= 15500000000.0: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) t_2 = Float64(Float64(a * b) + Float64(z * t)) t_3 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -3.05e+103) tmp = t_3; elseif (Float64(c * i) <= -7.5e-78) tmp = t_1; elseif (Float64(c * i) <= -4.2e-291) tmp = t_2; elseif (Float64(c * i) <= 1.55e-209) tmp = t_1; elseif (Float64(c * i) <= 15500000000.0) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); t_2 = (a * b) + (z * t); t_3 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -3.05e+103) tmp = t_3; elseif ((c * i) <= -7.5e-78) tmp = t_1; elseif ((c * i) <= -4.2e-291) tmp = t_2; elseif ((c * i) <= 1.55e-209) tmp = t_1; elseif ((c * i) <= 15500000000.0) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -3.05e+103], t$95$3, If[LessEqual[N[(c * i), $MachinePrecision], -7.5e-78], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -4.2e-291], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 1.55e-209], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 15500000000.0], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := a \cdot b + z \cdot t\\
t_3 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -3.05 \cdot 10^{+103}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;c \cdot i \leq -7.5 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -4.2 \cdot 10^{-291}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq 1.55 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 15500000000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 c i) < -3.0500000000000001e103 or 1.55e10 < (*.f64 c i) Initial program 91.6%
Taylor expanded in x around 0 82.8%
Taylor expanded in t around 0 73.1%
if -3.0500000000000001e103 < (*.f64 c i) < -7.50000000000000041e-78 or -4.1999999999999999e-291 < (*.f64 c i) < 1.55e-209Initial program 98.7%
Taylor expanded in c around 0 93.7%
+-commutative93.7%
*-commutative93.7%
fma-def93.7%
*-commutative93.7%
Applied egg-rr93.7%
Taylor expanded in z around 0 82.1%
if -7.50000000000000041e-78 < (*.f64 c i) < -4.1999999999999999e-291 or 1.55e-209 < (*.f64 c i) < 1.55e10Initial program 96.6%
Taylor expanded in x around 0 81.0%
Taylor expanded in c around 0 77.7%
Final simplification76.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))) (t_2 (+ (* a b) (* z t))))
(if (<= (* c i) -2.45e+103)
(+ (* a b) (* c i))
(if (<= (* c i) -2.8e-78)
t_1
(if (<= (* c i) -3.8e-291)
t_2
(if (<= (* c i) 4.5e-210)
t_1
(if (<= (* c i) 2.4e+68) t_2 (+ (* 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);
double t_2 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -2.45e+103) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= -2.8e-78) {
tmp = t_1;
} else if ((c * i) <= -3.8e-291) {
tmp = t_2;
} else if ((c * i) <= 4.5e-210) {
tmp = t_1;
} else if ((c * i) <= 2.4e+68) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (x * y)
t_2 = (a * b) + (z * t)
if ((c * i) <= (-2.45d+103)) then
tmp = (a * b) + (c * i)
else if ((c * i) <= (-2.8d-78)) then
tmp = t_1
else if ((c * i) <= (-3.8d-291)) then
tmp = t_2
else if ((c * i) <= 4.5d-210) then
tmp = t_1
else if ((c * i) <= 2.4d+68) then
tmp = t_2
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 t_1 = (a * b) + (x * y);
double t_2 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -2.45e+103) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= -2.8e-78) {
tmp = t_1;
} else if ((c * i) <= -3.8e-291) {
tmp = t_2;
} else if ((c * i) <= 4.5e-210) {
tmp = t_1;
} else if ((c * i) <= 2.4e+68) {
tmp = t_2;
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) t_2 = (a * b) + (z * t) tmp = 0 if (c * i) <= -2.45e+103: tmp = (a * b) + (c * i) elif (c * i) <= -2.8e-78: tmp = t_1 elif (c * i) <= -3.8e-291: tmp = t_2 elif (c * i) <= 4.5e-210: tmp = t_1 elif (c * i) <= 2.4e+68: tmp = t_2 else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(x * y)) t_2 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -2.45e+103) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(c * i) <= -2.8e-78) tmp = t_1; elseif (Float64(c * i) <= -3.8e-291) tmp = t_2; elseif (Float64(c * i) <= 4.5e-210) tmp = t_1; elseif (Float64(c * i) <= 2.4e+68) tmp = t_2; 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); t_2 = (a * b) + (z * t); tmp = 0.0; if ((c * i) <= -2.45e+103) tmp = (a * b) + (c * i); elseif ((c * i) <= -2.8e-78) tmp = t_1; elseif ((c * i) <= -3.8e-291) tmp = t_2; elseif ((c * i) <= 4.5e-210) tmp = t_1; elseif ((c * i) <= 2.4e+68) tmp = t_2; 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[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2.45e+103], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.8e-78], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -3.8e-291], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 4.5e-210], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 2.4e+68], t$95$2, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -2.45 \cdot 10^{+103}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -2.8 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -3.8 \cdot 10^{-291}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq 4.5 \cdot 10^{-210}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 2.4 \cdot 10^{+68}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -2.4499999999999999e103Initial program 93.3%
Taylor expanded in x around 0 86.9%
Taylor expanded in t around 0 82.6%
if -2.4499999999999999e103 < (*.f64 c i) < -2.80000000000000024e-78 or -3.7999999999999998e-291 < (*.f64 c i) < 4.5000000000000002e-210Initial program 98.7%
Taylor expanded in c around 0 93.7%
+-commutative93.7%
*-commutative93.7%
fma-def93.7%
*-commutative93.7%
Applied egg-rr93.7%
Taylor expanded in z around 0 82.1%
if -2.80000000000000024e-78 < (*.f64 c i) < -3.7999999999999998e-291 or 4.5000000000000002e-210 < (*.f64 c i) < 2.40000000000000008e68Initial program 96.9%
Taylor expanded in x around 0 78.7%
Taylor expanded in c around 0 74.2%
if 2.40000000000000008e68 < (*.f64 c i) Initial program 89.6%
Taylor expanded in x around 0 82.5%
Taylor expanded in a around 0 74.8%
Final simplification78.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* x y))))
(if (<= (* c i) -7.6e+102)
(+ (* a b) (* c i))
(if (<= (* c i) -3.4e-78)
t_1
(if (<= (* c i) -5.7e-291)
(+ (* a b) (* z t))
(if (<= (* c i) 5e-237)
t_1
(if (<= (* c i) 3.2e+68)
(+ (* x y) (* z t))
(+ (* c i) (* z t)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double tmp;
if ((c * i) <= -7.6e+102) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= -3.4e-78) {
tmp = t_1;
} else if ((c * i) <= -5.7e-291) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 5e-237) {
tmp = t_1;
} else if ((c * i) <= 3.2e+68) {
tmp = (x * y) + (z * t);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (x * y)
if ((c * i) <= (-7.6d+102)) then
tmp = (a * b) + (c * i)
else if ((c * i) <= (-3.4d-78)) then
tmp = t_1
else if ((c * i) <= (-5.7d-291)) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 5d-237) then
tmp = t_1
else if ((c * i) <= 3.2d+68) then
tmp = (x * y) + (z * t)
else
tmp = (c * i) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (x * y);
double tmp;
if ((c * i) <= -7.6e+102) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= -3.4e-78) {
tmp = t_1;
} else if ((c * i) <= -5.7e-291) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 5e-237) {
tmp = t_1;
} else if ((c * i) <= 3.2e+68) {
tmp = (x * y) + (z * t);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (x * y) tmp = 0 if (c * i) <= -7.6e+102: tmp = (a * b) + (c * i) elif (c * i) <= -3.4e-78: tmp = t_1 elif (c * i) <= -5.7e-291: tmp = (a * b) + (z * t) elif (c * i) <= 5e-237: tmp = t_1 elif (c * i) <= 3.2e+68: tmp = (x * y) + (z * t) else: tmp = (c * i) + (z * t) 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(c * i) <= -7.6e+102) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(c * i) <= -3.4e-78) tmp = t_1; elseif (Float64(c * i) <= -5.7e-291) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 5e-237) tmp = t_1; elseif (Float64(c * i) <= 3.2e+68) tmp = Float64(Float64(x * y) + Float64(z * t)); else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (x * y); tmp = 0.0; if ((c * i) <= -7.6e+102) tmp = (a * b) + (c * i); elseif ((c * i) <= -3.4e-78) tmp = t_1; elseif ((c * i) <= -5.7e-291) tmp = (a * b) + (z * t); elseif ((c * i) <= 5e-237) tmp = t_1; elseif ((c * i) <= 3.2e+68) tmp = (x * y) + (z * t); 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[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -7.6e+102], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -3.4e-78], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -5.7e-291], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e-237], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 3.2e+68], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
\mathbf{if}\;c \cdot i \leq -7.6 \cdot 10^{+102}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -3.4 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -5.7 \cdot 10^{-291}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{-237}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 3.2 \cdot 10^{+68}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -7.59999999999999958e102Initial program 93.3%
Taylor expanded in x around 0 86.9%
Taylor expanded in t around 0 82.6%
if -7.59999999999999958e102 < (*.f64 c i) < -3.40000000000000012e-78 or -5.70000000000000034e-291 < (*.f64 c i) < 5.0000000000000002e-237Initial program 98.6%
Taylor expanded in c around 0 93.4%
+-commutative93.4%
*-commutative93.4%
fma-def93.4%
*-commutative93.4%
Applied egg-rr93.4%
Taylor expanded in z around 0 82.5%
if -3.40000000000000012e-78 < (*.f64 c i) < -5.70000000000000034e-291Initial program 96.7%
Taylor expanded in x around 0 84.1%
Taylor expanded in c around 0 84.0%
if 5.0000000000000002e-237 < (*.f64 c i) < 3.19999999999999994e68Initial program 97.4%
Taylor expanded in c around 0 90.1%
+-commutative90.1%
*-commutative90.1%
fma-def90.1%
*-commutative90.1%
Applied egg-rr90.1%
Taylor expanded in a around 0 69.6%
if 3.19999999999999994e68 < (*.f64 c i) Initial program 89.6%
Taylor expanded in x around 0 82.5%
Taylor expanded in a around 0 74.8%
Final simplification78.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (+ (* x y) (* z t)))) (t_2 (+ (* a b) (* c i))))
(if (<= (* c i) -1.5e+122)
t_2
(if (<= (* c i) 2.8e+68)
t_1
(if (<= (* c i) 1e+182)
(+ (* c i) (* z t))
(if (<= (* c i) 3.5e+226) 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 = (a * b) + ((x * y) + (z * t));
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.5e+122) {
tmp = t_2;
} else if ((c * i) <= 2.8e+68) {
tmp = t_1;
} else if ((c * i) <= 1e+182) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 3.5e+226) {
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 = (a * b) + ((x * y) + (z * t))
t_2 = (a * b) + (c * i)
if ((c * i) <= (-1.5d+122)) then
tmp = t_2
else if ((c * i) <= 2.8d+68) then
tmp = t_1
else if ((c * i) <= 1d+182) then
tmp = (c * i) + (z * t)
else if ((c * i) <= 3.5d+226) 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 = (a * b) + ((x * y) + (z * t));
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.5e+122) {
tmp = t_2;
} else if ((c * i) <= 2.8e+68) {
tmp = t_1;
} else if ((c * i) <= 1e+182) {
tmp = (c * i) + (z * t);
} else if ((c * i) <= 3.5e+226) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + ((x * y) + (z * t)) t_2 = (a * b) + (c * i) tmp = 0 if (c * i) <= -1.5e+122: tmp = t_2 elif (c * i) <= 2.8e+68: tmp = t_1 elif (c * i) <= 1e+182: tmp = (c * i) + (z * t) elif (c * i) <= 3.5e+226: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) t_2 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -1.5e+122) tmp = t_2; elseif (Float64(c * i) <= 2.8e+68) tmp = t_1; elseif (Float64(c * i) <= 1e+182) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(c * i) <= 3.5e+226) 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 = (a * b) + ((x * y) + (z * t)); t_2 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -1.5e+122) tmp = t_2; elseif ((c * i) <= 2.8e+68) tmp = t_1; elseif ((c * i) <= 1e+182) tmp = (c * i) + (z * t); elseif ((c * i) <= 3.5e+226) 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[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.5e+122], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 2.8e+68], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1e+182], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.5e+226], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + \left(x \cdot y + z \cdot t\right)\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -1.5 \cdot 10^{+122}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq 2.8 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 10^{+182}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 3.5 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 c i) < -1.49999999999999993e122 or 3.4999999999999998e226 < (*.f64 c i) Initial program 88.3%
Taylor expanded in x around 0 86.0%
Taylor expanded in t around 0 84.8%
if -1.49999999999999993e122 < (*.f64 c i) < 2.8e68 or 1.0000000000000001e182 < (*.f64 c i) < 3.4999999999999998e226Initial program 98.0%
Taylor expanded in c around 0 92.7%
if 2.8e68 < (*.f64 c i) < 1.0000000000000001e182Initial program 95.7%
Taylor expanded in x around 0 87.0%
Taylor expanded in a around 0 74.2%
Final simplification88.7%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ (* c i) (+ (* a b) t_1)))) (if (<= t_2 INFINITY) t_2 t_1)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = (c * i) + ((a * b) + t_1);
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = (c * i) + ((a * b) + t_1);
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = (c * i) + ((a * b) + t_1) tmp = 0 if t_2 <= math.inf: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(Float64(c * i) + Float64(Float64(a * b) + t_1)) tmp = 0.0 if (t_2 <= Inf) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); t_2 = (c * i) + ((a * b) + t_1); tmp = 0.0; if (t_2 <= Inf) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], t$95$2, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := c \cdot i + \left(a \cdot b + t\_1\right)\\
\mathbf{if}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in c around 0 23.1%
+-commutative23.1%
*-commutative23.1%
fma-def23.1%
*-commutative23.1%
Applied egg-rr23.1%
Taylor expanded in a around 0 46.2%
Final simplification97.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -6.1e+221)
(+ (* a b) (* x y))
(if (<= (* x y) 1.3e+74)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* a b) (+ (* x y) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -6.1e+221) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 1.3e+74) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-6.1d+221)) then
tmp = (a * b) + (x * y)
else if ((x * y) <= 1.3d+74) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (a * b) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -6.1e+221) {
tmp = (a * b) + (x * y);
} else if ((x * y) <= 1.3e+74) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -6.1e+221: tmp = (a * b) + (x * y) elif (x * y) <= 1.3e+74: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -6.1e+221) tmp = Float64(Float64(a * b) + Float64(x * y)); elseif (Float64(x * y) <= 1.3e+74) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -6.1e+221) tmp = (a * b) + (x * y); elseif ((x * y) <= 1.3e+74) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -6.1e+221], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.3e+74], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.1 \cdot 10^{+221}:\\
\;\;\;\;a \cdot b + x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{+74}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -6.0999999999999998e221Initial program 70.8%
Taylor expanded in c around 0 71.1%
+-commutative71.1%
*-commutative71.1%
fma-def71.1%
*-commutative71.1%
Applied egg-rr71.1%
Taylor expanded in z around 0 79.5%
if -6.0999999999999998e221 < (*.f64 x y) < 1.3e74Initial program 98.3%
Taylor expanded in x around 0 92.6%
if 1.3e74 < (*.f64 x y) Initial program 94.2%
Taylor expanded in c around 0 83.0%
Final simplification89.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -8.6e+67)
(* c i)
(if (<= (* c i) 1.7e-237)
(* a b)
(if (<= (* c i) 1.05e+89) (* 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) <= -8.6e+67) {
tmp = c * i;
} else if ((c * i) <= 1.7e-237) {
tmp = a * b;
} else if ((c * i) <= 1.05e+89) {
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) <= (-8.6d+67)) then
tmp = c * i
else if ((c * i) <= 1.7d-237) then
tmp = a * b
else if ((c * i) <= 1.05d+89) 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) <= -8.6e+67) {
tmp = c * i;
} else if ((c * i) <= 1.7e-237) {
tmp = a * b;
} else if ((c * i) <= 1.05e+89) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -8.6e+67: tmp = c * i elif (c * i) <= 1.7e-237: tmp = a * b elif (c * i) <= 1.05e+89: 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) <= -8.6e+67) tmp = Float64(c * i); elseif (Float64(c * i) <= 1.7e-237) tmp = Float64(a * b); elseif (Float64(c * i) <= 1.05e+89) 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) <= -8.6e+67) tmp = c * i; elseif ((c * i) <= 1.7e-237) tmp = a * b; elseif ((c * i) <= 1.05e+89) 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], -8.6e+67], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.7e-237], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.05e+89], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8.6 \cdot 10^{+67}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 1.7 \cdot 10^{-237}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 1.05 \cdot 10^{+89}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -8.6000000000000002e67 or 1.04999999999999993e89 < (*.f64 c i) Initial program 92.3%
Taylor expanded in c around inf 60.7%
if -8.6000000000000002e67 < (*.f64 c i) < 1.7000000000000001e-237Initial program 97.9%
Taylor expanded in a around inf 48.5%
if 1.7000000000000001e-237 < (*.f64 c i) < 1.04999999999999993e89Initial program 95.5%
Taylor expanded in z around inf 44.8%
Final simplification53.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.75e+219) (not (<= (* x y) 3.5e+242))) (* x y) (+ (* a b) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.75e+219) || !((x * y) <= 3.5e+242)) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1.75d+219)) .or. (.not. ((x * y) <= 3.5d+242))) then
tmp = x * y
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.75e+219) || !((x * y) <= 3.5e+242)) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1.75e+219) or not ((x * y) <= 3.5e+242): tmp = x * y else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1.75e+219) || !(Float64(x * y) <= 3.5e+242)) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1.75e+219) || ~(((x * y) <= 3.5e+242))) tmp = x * y; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.75e+219], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.5e+242]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.75 \cdot 10^{+219} \lor \neg \left(x \cdot y \leq 3.5 \cdot 10^{+242}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.7500000000000001e219 or 3.4999999999999999e242 < (*.f64 x y) Initial program 81.2%
Taylor expanded in x around inf 83.4%
if -1.7500000000000001e219 < (*.f64 x y) < 3.4999999999999999e242Initial program 98.1%
Taylor expanded in x around 0 87.9%
Taylor expanded in t around 0 66.7%
Final simplification69.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -3.8e+74) (not (<= (* c i) 13500000000.0))) (+ (* 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 (((c * i) <= -3.8e+74) || !((c * i) <= 13500000000.0)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-3.8d+74)) .or. (.not. ((c * i) <= 13500000000.0d0))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -3.8e+74) || !((c * i) <= 13500000000.0)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -3.8e+74) or not ((c * i) <= 13500000000.0): tmp = (a * b) + (c * i) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -3.8e+74) || !(Float64(c * i) <= 13500000000.0)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -3.8e+74) || ~(((c * i) <= 13500000000.0))) tmp = (a * b) + (c * i); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -3.8e+74], N[Not[LessEqual[N[(c * i), $MachinePrecision], 13500000000.0]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+74} \lor \neg \left(c \cdot i \leq 13500000000\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -3.7999999999999998e74 or 1.35e10 < (*.f64 c i) Initial program 92.2%
Taylor expanded in x around 0 81.1%
Taylor expanded in t around 0 70.7%
if -3.7999999999999998e74 < (*.f64 c i) < 1.35e10Initial program 97.6%
Taylor expanded in x around 0 70.0%
Taylor expanded in c around 0 67.7%
Final simplification69.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -5.8e+81) (not (<= (* a b) 1.7e+43))) (* a b) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -5.8e+81) || !((a * b) <= 1.7e+43)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-5.8d+81)) .or. (.not. ((a * b) <= 1.7d+43))) then
tmp = a * b
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -5.8e+81) || !((a * b) <= 1.7e+43)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -5.8e+81) or not ((a * b) <= 1.7e+43): tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -5.8e+81) || !(Float64(a * b) <= 1.7e+43)) tmp = Float64(a * b); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -5.8e+81) || ~(((a * b) <= 1.7e+43))) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5.8e+81], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.7e+43]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5.8 \cdot 10^{+81} \lor \neg \left(a \cdot b \leq 1.7 \cdot 10^{+43}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -5.7999999999999999e81 or 1.70000000000000006e43 < (*.f64 a b) Initial program 91.7%
Taylor expanded in a around inf 60.1%
if -5.7999999999999999e81 < (*.f64 a b) < 1.70000000000000006e43Initial program 97.3%
Taylor expanded in c around inf 43.8%
Final simplification50.7%
(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 94.9%
Taylor expanded in a around inf 29.7%
Final simplification29.7%
herbie shell --seed 2024041
(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)))