
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* a b) (+ (* z t) (* x y))) INFINITY) (fma c i (+ (* z t) (+ (* 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 (((a * b) + ((z * t) + (x * y))) <= ((double) INFINITY)) {
tmp = fma(c, i, ((z * t) + ((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(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y))) <= Inf) tmp = fma(c, i, Float64(Float64(z * t) + Float64(Float64(a * b) + Float64(x * y)))); else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(N[(z * t), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b + \left(z \cdot t + x \cdot y\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t + \left(a \cdot b + x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 98.7%
+-commutative98.7%
fma-def99.6%
associate-+l+99.6%
fma-def99.6%
fma-def99.6%
Simplified99.6%
fma-udef99.6%
fma-udef99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
Applied egg-rr99.6%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
Taylor expanded in a around 0 42.9%
Taylor expanded in y around 0 71.5%
Final simplification98.8%
(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 96.0%
+-commutative96.0%
fma-def96.8%
associate-+l+96.8%
fma-def98.0%
fma-def98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* z t) (* x y))) (* c i)))) (if (<= t_1 INFINITY) t_1 (fma 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) + ((z * t) + (x * y))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(c, i, (z * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(c, i, Float64(z * t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right) + c \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\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%
+-commutative0.0%
fma-def20.0%
associate-+l+20.0%
fma-def50.0%
fma-def50.0%
Simplified50.0%
fma-udef20.0%
fma-udef20.0%
associate-+l+20.0%
+-commutative20.0%
associate-+r+20.0%
Applied egg-rr20.0%
Taylor expanded in z around inf 70.0%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))) (t_2 (+ (* a b) (* z t))))
(if (<= (* c i) -1.05e+149)
t_1
(if (<= (* c i) -7.2e+114)
(* x y)
(if (<= (* c i) -5.3e+70)
t_1
(if (<= (* c i) 1.9e-292)
t_2
(if (<= (* c i) 6.5e-253)
(* x y)
(if (<= (* c i) 3.4e+74) 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 = (a * b) + (c * i);
double t_2 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -1.05e+149) {
tmp = t_1;
} else if ((c * i) <= -7.2e+114) {
tmp = x * y;
} else if ((c * i) <= -5.3e+70) {
tmp = t_1;
} else if ((c * i) <= 1.9e-292) {
tmp = t_2;
} else if ((c * i) <= 6.5e-253) {
tmp = x * y;
} else if ((c * i) <= 3.4e+74) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (a * b) + (c * i)
t_2 = (a * b) + (z * t)
if ((c * i) <= (-1.05d+149)) then
tmp = t_1
else if ((c * i) <= (-7.2d+114)) then
tmp = x * y
else if ((c * i) <= (-5.3d+70)) then
tmp = t_1
else if ((c * i) <= 1.9d-292) then
tmp = t_2
else if ((c * i) <= 6.5d-253) then
tmp = x * y
else if ((c * i) <= 3.4d+74) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double t_2 = (a * b) + (z * t);
double tmp;
if ((c * i) <= -1.05e+149) {
tmp = t_1;
} else if ((c * i) <= -7.2e+114) {
tmp = x * y;
} else if ((c * i) <= -5.3e+70) {
tmp = t_1;
} else if ((c * i) <= 1.9e-292) {
tmp = t_2;
} else if ((c * i) <= 6.5e-253) {
tmp = x * y;
} else if ((c * i) <= 3.4e+74) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) t_2 = (a * b) + (z * t) tmp = 0 if (c * i) <= -1.05e+149: tmp = t_1 elif (c * i) <= -7.2e+114: tmp = x * y elif (c * i) <= -5.3e+70: tmp = t_1 elif (c * i) <= 1.9e-292: tmp = t_2 elif (c * i) <= 6.5e-253: tmp = x * y elif (c * i) <= 3.4e+74: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) t_2 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -1.05e+149) tmp = t_1; elseif (Float64(c * i) <= -7.2e+114) tmp = Float64(x * y); elseif (Float64(c * i) <= -5.3e+70) tmp = t_1; elseif (Float64(c * i) <= 1.9e-292) tmp = t_2; elseif (Float64(c * i) <= 6.5e-253) tmp = Float64(x * y); elseif (Float64(c * i) <= 3.4e+74) 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 = (a * b) + (c * i); t_2 = (a * b) + (z * t); tmp = 0.0; if ((c * i) <= -1.05e+149) tmp = t_1; elseif ((c * i) <= -7.2e+114) tmp = x * y; elseif ((c * i) <= -5.3e+70) tmp = t_1; elseif ((c * i) <= 1.9e-292) tmp = t_2; elseif ((c * i) <= 6.5e-253) tmp = x * y; elseif ((c * i) <= 3.4e+74) 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[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.05e+149], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -7.2e+114], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5.3e+70], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.9e-292], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 6.5e-253], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.4e+74], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1.05 \cdot 10^{+149}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq -7.2 \cdot 10^{+114}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -5.3 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 1.9 \cdot 10^{-292}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq 6.5 \cdot 10^{-253}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 3.4 \cdot 10^{+74}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 c i) < -1.0500000000000001e149 or -7.2000000000000001e114 < (*.f64 c i) < -5.3e70 or 3.3999999999999999e74 < (*.f64 c i) Initial program 94.7%
Taylor expanded in a around inf 73.9%
if -1.0500000000000001e149 < (*.f64 c i) < -7.2000000000000001e114 or 1.9000000000000001e-292 < (*.f64 c i) < 6.4999999999999998e-253Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in t around 0 88.0%
Taylor expanded in c around 0 81.9%
if -5.3e70 < (*.f64 c i) < 1.9000000000000001e-292 or 6.4999999999999998e-253 < (*.f64 c i) < 3.3999999999999999e74Initial program 96.3%
Taylor expanded in x around 0 77.2%
associate-+r+77.2%
+-commutative77.2%
fma-def77.2%
*-commutative77.2%
+-commutative77.2%
fma-def77.3%
Simplified77.3%
fma-def77.3%
fma-udef77.2%
+-commutative77.2%
associate-+r+77.2%
Applied egg-rr77.2%
Taylor expanded in c around 0 73.6%
Final simplification74.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* c i) (* z t))))
(if (<= (* c i) -1.05e+149)
t_2
(if (<= (* c i) -6.4e+114)
(* x y)
(if (<= (* c i) -4.9e+73)
(+ (* a b) (* c i))
(if (<= (* c i) 1.9e-292)
t_1
(if (<= (* c i) 7.5e-253)
(* x y)
(if (<= (* c i) 750000000.0) 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) + (z * t);
double t_2 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -1.05e+149) {
tmp = t_2;
} else if ((c * i) <= -6.4e+114) {
tmp = x * y;
} else if ((c * i) <= -4.9e+73) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= 1.9e-292) {
tmp = t_1;
} else if ((c * i) <= 7.5e-253) {
tmp = x * y;
} else if ((c * i) <= 750000000.0) {
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) + (z * t)
t_2 = (c * i) + (z * t)
if ((c * i) <= (-1.05d+149)) then
tmp = t_2
else if ((c * i) <= (-6.4d+114)) then
tmp = x * y
else if ((c * i) <= (-4.9d+73)) then
tmp = (a * b) + (c * i)
else if ((c * i) <= 1.9d-292) then
tmp = t_1
else if ((c * i) <= 7.5d-253) then
tmp = x * y
else if ((c * i) <= 750000000.0d0) 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) + (z * t);
double t_2 = (c * i) + (z * t);
double tmp;
if ((c * i) <= -1.05e+149) {
tmp = t_2;
} else if ((c * i) <= -6.4e+114) {
tmp = x * y;
} else if ((c * i) <= -4.9e+73) {
tmp = (a * b) + (c * i);
} else if ((c * i) <= 1.9e-292) {
tmp = t_1;
} else if ((c * i) <= 7.5e-253) {
tmp = x * y;
} else if ((c * i) <= 750000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (c * i) + (z * t) tmp = 0 if (c * i) <= -1.05e+149: tmp = t_2 elif (c * i) <= -6.4e+114: tmp = x * y elif (c * i) <= -4.9e+73: tmp = (a * b) + (c * i) elif (c * i) <= 1.9e-292: tmp = t_1 elif (c * i) <= 7.5e-253: tmp = x * y elif (c * i) <= 750000000.0: 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(z * t)) t_2 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(c * i) <= -1.05e+149) tmp = t_2; elseif (Float64(c * i) <= -6.4e+114) tmp = Float64(x * y); elseif (Float64(c * i) <= -4.9e+73) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(c * i) <= 1.9e-292) tmp = t_1; elseif (Float64(c * i) <= 7.5e-253) tmp = Float64(x * y); elseif (Float64(c * i) <= 750000000.0) 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) + (z * t); t_2 = (c * i) + (z * t); tmp = 0.0; if ((c * i) <= -1.05e+149) tmp = t_2; elseif ((c * i) <= -6.4e+114) tmp = x * y; elseif ((c * i) <= -4.9e+73) tmp = (a * b) + (c * i); elseif ((c * i) <= 1.9e-292) tmp = t_1; elseif ((c * i) <= 7.5e-253) tmp = x * y; elseif ((c * i) <= 750000000.0) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.05e+149], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -6.4e+114], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -4.9e+73], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.9e-292], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 7.5e-253], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 750000000.0], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1.05 \cdot 10^{+149}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \cdot i \leq -6.4 \cdot 10^{+114}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -4.9 \cdot 10^{+73}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 1.9 \cdot 10^{-292}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \cdot i \leq 7.5 \cdot 10^{-253}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq 750000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 c i) < -1.0500000000000001e149 or 7.5e8 < (*.f64 c i) Initial program 93.9%
Taylor expanded in a around 0 86.6%
Taylor expanded in y around 0 72.3%
if -1.0500000000000001e149 < (*.f64 c i) < -6.4e114 or 1.9000000000000001e-292 < (*.f64 c i) < 7.49999999999999987e-253Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in t around 0 88.0%
Taylor expanded in c around 0 81.9%
if -6.4e114 < (*.f64 c i) < -4.8999999999999999e73Initial program 100.0%
Taylor expanded in a around inf 88.1%
if -4.8999999999999999e73 < (*.f64 c i) < 1.9000000000000001e-292 or 7.49999999999999987e-253 < (*.f64 c i) < 7.5e8Initial program 96.6%
Taylor expanded in x around 0 77.0%
associate-+r+77.0%
+-commutative77.0%
fma-def77.0%
*-commutative77.0%
+-commutative77.0%
fma-def77.1%
Simplified77.1%
fma-def77.1%
fma-udef77.0%
+-commutative77.0%
associate-+r+77.0%
Applied egg-rr77.0%
Taylor expanded in c around 0 74.4%
Final simplification74.6%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* z t) (* x y))) (* c i)))) (if (<= t_1 INFINITY) t_1 (* 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) + ((z * t) + (x * y))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * t;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((z * t) + (x * y))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + ((z * t) + (x * y))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + ((z * t) + (x * y))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right) + c \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in x around 0 40.0%
associate-+r+40.0%
+-commutative40.0%
fma-def40.0%
*-commutative40.0%
+-commutative40.0%
fma-def40.0%
Simplified40.0%
fma-def40.0%
fma-udef40.0%
+-commutative40.0%
associate-+r+40.0%
Applied egg-rr40.0%
Taylor expanded in z around inf 60.2%
Final simplification98.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -6.8e+69)
(* c i)
(if (<= (* c i) -7.2e-130)
(* z t)
(if (<= (* c i) -8.4e-284)
(* a b)
(if (<= (* c i) 1e-237)
(* z t)
(if (<= (* c i) 1.22e-73)
(* a b)
(if (<= (* c i) 3.3e+74) (* 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) <= -6.8e+69) {
tmp = c * i;
} else if ((c * i) <= -7.2e-130) {
tmp = z * t;
} else if ((c * i) <= -8.4e-284) {
tmp = a * b;
} else if ((c * i) <= 1e-237) {
tmp = z * t;
} else if ((c * i) <= 1.22e-73) {
tmp = a * b;
} else if ((c * i) <= 3.3e+74) {
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) <= (-6.8d+69)) then
tmp = c * i
else if ((c * i) <= (-7.2d-130)) then
tmp = z * t
else if ((c * i) <= (-8.4d-284)) then
tmp = a * b
else if ((c * i) <= 1d-237) then
tmp = z * t
else if ((c * i) <= 1.22d-73) then
tmp = a * b
else if ((c * i) <= 3.3d+74) 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) <= -6.8e+69) {
tmp = c * i;
} else if ((c * i) <= -7.2e-130) {
tmp = z * t;
} else if ((c * i) <= -8.4e-284) {
tmp = a * b;
} else if ((c * i) <= 1e-237) {
tmp = z * t;
} else if ((c * i) <= 1.22e-73) {
tmp = a * b;
} else if ((c * i) <= 3.3e+74) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -6.8e+69: tmp = c * i elif (c * i) <= -7.2e-130: tmp = z * t elif (c * i) <= -8.4e-284: tmp = a * b elif (c * i) <= 1e-237: tmp = z * t elif (c * i) <= 1.22e-73: tmp = a * b elif (c * i) <= 3.3e+74: 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) <= -6.8e+69) tmp = Float64(c * i); elseif (Float64(c * i) <= -7.2e-130) tmp = Float64(z * t); elseif (Float64(c * i) <= -8.4e-284) tmp = Float64(a * b); elseif (Float64(c * i) <= 1e-237) tmp = Float64(z * t); elseif (Float64(c * i) <= 1.22e-73) tmp = Float64(a * b); elseif (Float64(c * i) <= 3.3e+74) 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) <= -6.8e+69) tmp = c * i; elseif ((c * i) <= -7.2e-130) tmp = z * t; elseif ((c * i) <= -8.4e-284) tmp = a * b; elseif ((c * i) <= 1e-237) tmp = z * t; elseif ((c * i) <= 1.22e-73) tmp = a * b; elseif ((c * i) <= 3.3e+74) 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], -6.8e+69], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -7.2e-130], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -8.4e-284], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e-237], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.22e-73], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.3e+74], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6.8 \cdot 10^{+69}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -7.2 \cdot 10^{-130}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq -8.4 \cdot 10^{-284}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 10^{-237}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 1.22 \cdot 10^{-73}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 3.3 \cdot 10^{+74}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -6.79999999999999973e69 or 3.3000000000000002e74 < (*.f64 c i) Initial program 95.1%
Taylor expanded in c around inf 56.4%
if -6.79999999999999973e69 < (*.f64 c i) < -7.2000000000000003e-130 or -8.39999999999999965e-284 < (*.f64 c i) < 9.9999999999999999e-238 or 1.22e-73 < (*.f64 c i) < 3.3000000000000002e74Initial program 95.6%
Taylor expanded in x around 0 69.9%
associate-+r+69.9%
+-commutative69.9%
fma-def69.9%
*-commutative69.9%
+-commutative69.9%
fma-def69.9%
Simplified69.9%
fma-def69.9%
fma-udef69.9%
+-commutative69.9%
associate-+r+69.9%
Applied egg-rr69.9%
Taylor expanded in z around inf 50.0%
if -7.2000000000000003e-130 < (*.f64 c i) < -8.39999999999999965e-284 or 9.9999999999999999e-238 < (*.f64 c i) < 1.22e-73Initial program 98.3%
Taylor expanded in x around 0 83.4%
associate-+r+83.4%
+-commutative83.4%
fma-def83.4%
*-commutative83.4%
+-commutative83.4%
fma-def83.4%
Simplified83.4%
fma-def83.4%
fma-udef83.4%
+-commutative83.4%
associate-+r+83.4%
Applied egg-rr83.4%
Taylor expanded in a around inf 66.6%
Final simplification55.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (+ (* z t) (* x y)))) (t_2 (+ (* a b) (* z t))))
(if (<= (* a b) -2.7e+128)
t_2
(if (<= (* a b) 4e+28)
t_1
(if (<= (* a b) 3.8e+103)
(+ (* a b) (* c i))
(if (<= (* a b) 3e+139) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((z * t) + (x * y));
double t_2 = (a * b) + (z * t);
double tmp;
if ((a * b) <= -2.7e+128) {
tmp = t_2;
} else if ((a * b) <= 4e+28) {
tmp = t_1;
} else if ((a * b) <= 3.8e+103) {
tmp = (a * b) + (c * i);
} else if ((a * b) <= 3e+139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (c * i) + ((z * t) + (x * y))
t_2 = (a * b) + (z * t)
if ((a * b) <= (-2.7d+128)) then
tmp = t_2
else if ((a * b) <= 4d+28) then
tmp = t_1
else if ((a * b) <= 3.8d+103) then
tmp = (a * b) + (c * i)
else if ((a * b) <= 3d+139) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((z * t) + (x * y));
double t_2 = (a * b) + (z * t);
double tmp;
if ((a * b) <= -2.7e+128) {
tmp = t_2;
} else if ((a * b) <= 4e+28) {
tmp = t_1;
} else if ((a * b) <= 3.8e+103) {
tmp = (a * b) + (c * i);
} else if ((a * b) <= 3e+139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((z * t) + (x * y)) t_2 = (a * b) + (z * t) tmp = 0 if (a * b) <= -2.7e+128: tmp = t_2 elif (a * b) <= 4e+28: tmp = t_1 elif (a * b) <= 3.8e+103: tmp = (a * b) + (c * i) elif (a * b) <= 3e+139: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(z * t) + Float64(x * y))) t_2 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -2.7e+128) tmp = t_2; elseif (Float64(a * b) <= 4e+28) tmp = t_1; elseif (Float64(a * b) <= 3.8e+103) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(a * b) <= 3e+139) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((z * t) + (x * y)); t_2 = (a * b) + (z * t); tmp = 0.0; if ((a * b) <= -2.7e+128) tmp = t_2; elseif ((a * b) <= 4e+28) tmp = t_1; elseif ((a * b) <= 3.8e+103) tmp = (a * b) + (c * i); elseif ((a * b) <= 3e+139) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2.7e+128], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 4e+28], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 3.8e+103], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3e+139], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(z \cdot t + x \cdot y\right)\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -2.7 \cdot 10^{+128}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{+103}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 3 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2.70000000000000001e128 or 3e139 < (*.f64 a b) Initial program 92.0%
Taylor expanded in x around 0 82.0%
associate-+r+82.0%
+-commutative82.0%
fma-def82.0%
*-commutative82.0%
+-commutative82.0%
fma-def82.0%
Simplified82.0%
fma-def82.0%
fma-udef82.0%
+-commutative82.0%
associate-+r+82.0%
Applied egg-rr82.0%
Taylor expanded in c around 0 79.6%
if -2.70000000000000001e128 < (*.f64 a b) < 3.99999999999999983e28 or 3.7999999999999997e103 < (*.f64 a b) < 3e139Initial program 98.1%
Taylor expanded in a around 0 89.3%
if 3.99999999999999983e28 < (*.f64 a b) < 3.7999999999999997e103Initial program 94.7%
Taylor expanded in a around inf 80.0%
Final simplification85.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* z t) -2e+91) (not (<= (* z t) 1e+43))) (+ (* c i) (+ (* z t) (* x y))) (+ (* 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) <= -2e+91) || !((z * t) <= 1e+43)) {
tmp = (c * i) + ((z * t) + (x * y));
} 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) <= (-2d+91)) .or. (.not. ((z * t) <= 1d+43))) then
tmp = (c * i) + ((z * t) + (x * y))
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) <= -2e+91) || !((z * t) <= 1e+43)) {
tmp = (c * i) + ((z * t) + (x * y));
} 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) <= -2e+91) or not ((z * t) <= 1e+43): tmp = (c * i) + ((z * t) + (x * y)) 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) <= -2e+91) || !(Float64(z * t) <= 1e+43)) tmp = Float64(Float64(c * i) + Float64(Float64(z * t) + Float64(x * y))); 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) <= -2e+91) || ~(((z * t) <= 1e+43))) tmp = (c * i) + ((z * t) + (x * y)); 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], -2e+91], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1e+43]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $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 -2 \cdot 10^{+91} \lor \neg \left(z \cdot t \leq 10^{+43}\right):\\
\;\;\;\;c \cdot i + \left(z \cdot t + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -2.00000000000000016e91 or 1.00000000000000001e43 < (*.f64 z t) Initial program 92.3%
Taylor expanded in a around 0 87.9%
if -2.00000000000000016e91 < (*.f64 z t) < 1.00000000000000001e43Initial program 98.6%
Taylor expanded in x around inf 94.3%
Final simplification91.7%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -8.8e+88) (not (<= x 3.1e-127))) (+ (* c i) (+ (* z t) (* x y))) (+ (* 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 ((x <= -8.8e+88) || !(x <= 3.1e-127)) {
tmp = (c * i) + ((z * t) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-8.8d+88)) .or. (.not. (x <= 3.1d-127))) then
tmp = (c * i) + ((z * t) + (x * y))
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -8.8e+88) || !(x <= 3.1e-127)) {
tmp = (c * i) + ((z * t) + (x * y));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -8.8e+88) or not (x <= 3.1e-127): tmp = (c * i) + ((z * t) + (x * y)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -8.8e+88) || !(x <= 3.1e-127)) tmp = Float64(Float64(c * i) + Float64(Float64(z * t) + Float64(x * y))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -8.8e+88) || ~((x <= 3.1e-127))) tmp = (c * i) + ((z * t) + (x * y)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -8.8e+88], N[Not[LessEqual[x, 3.1e-127]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+88} \lor \neg \left(x \leq 3.1 \cdot 10^{-127}\right):\\
\;\;\;\;c \cdot i + \left(z \cdot t + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if x < -8.80000000000000035e88 or 3.1e-127 < x Initial program 93.6%
Taylor expanded in a around 0 78.6%
if -8.80000000000000035e88 < x < 3.1e-127Initial program 98.4%
Taylor expanded in x around 0 88.1%
Final simplification83.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* x y))))
(if (<= x -4.5e+84)
t_1
(if (<= x 1.95e-303)
(+ (* a b) (* z t))
(if (<= x 4.2e-82) (+ (* c i) (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (x * y);
double tmp;
if (x <= -4.5e+84) {
tmp = t_1;
} else if (x <= 1.95e-303) {
tmp = (a * b) + (z * t);
} else if (x <= 4.2e-82) {
tmp = (c * i) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (c * i) + (x * y)
if (x <= (-4.5d+84)) then
tmp = t_1
else if (x <= 1.95d-303) then
tmp = (a * b) + (z * t)
else if (x <= 4.2d-82) then
tmp = (c * i) + (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (x * y);
double tmp;
if (x <= -4.5e+84) {
tmp = t_1;
} else if (x <= 1.95e-303) {
tmp = (a * b) + (z * t);
} else if (x <= 4.2e-82) {
tmp = (c * i) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (x * y) tmp = 0 if x <= -4.5e+84: tmp = t_1 elif x <= 1.95e-303: tmp = (a * b) + (z * t) elif x <= 4.2e-82: tmp = (c * i) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(x * y)) tmp = 0.0 if (x <= -4.5e+84) tmp = t_1; elseif (x <= 1.95e-303) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (x <= 4.2e-82) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (x * y); tmp = 0.0; if (x <= -4.5e+84) tmp = t_1; elseif (x <= 1.95e-303) tmp = (a * b) + (z * t); elseif (x <= 4.2e-82) tmp = (c * i) + (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.5e+84], t$95$1, If[LessEqual[x, 1.95e-303], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-82], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + x \cdot y\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-303}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-82}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -4.4999999999999997e84 or 4.2000000000000001e-82 < x Initial program 92.9%
Taylor expanded in a around 0 80.6%
Taylor expanded in t around 0 63.4%
if -4.4999999999999997e84 < x < 1.95e-303Initial program 97.8%
Taylor expanded in x around 0 86.1%
associate-+r+86.1%
+-commutative86.1%
fma-def86.1%
*-commutative86.1%
+-commutative86.1%
fma-def86.1%
Simplified86.1%
fma-def86.1%
fma-udef86.1%
+-commutative86.1%
associate-+r+86.1%
Applied egg-rr86.1%
Taylor expanded in c around 0 68.7%
if 1.95e-303 < x < 4.2000000000000001e-82Initial program 99.8%
Taylor expanded in a around 0 61.9%
Taylor expanded in y around 0 54.7%
Final simplification63.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -2.5e+133) (not (<= z 5.8e-73))) (* z t) (+ (* a b) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -2.5e+133) || !(z <= 5.8e-73)) {
tmp = z * t;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((z <= (-2.5d+133)) .or. (.not. (z <= 5.8d-73))) then
tmp = z * t
else
tmp = (a * b) + (c * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -2.5e+133) || !(z <= 5.8e-73)) {
tmp = z * t;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -2.5e+133) or not (z <= 5.8e-73): tmp = z * t else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -2.5e+133) || !(z <= 5.8e-73)) tmp = Float64(z * t); else tmp = Float64(Float64(a * b) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((z <= -2.5e+133) || ~((z <= 5.8e-73))) tmp = z * t; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -2.5e+133], N[Not[LessEqual[z, 5.8e-73]], $MachinePrecision]], N[(z * t), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+133} \lor \neg \left(z \leq 5.8 \cdot 10^{-73}\right):\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if z < -2.4999999999999998e133 or 5.8e-73 < z Initial program 93.2%
Taylor expanded in x around 0 76.8%
associate-+r+76.8%
+-commutative76.8%
fma-def76.8%
*-commutative76.8%
+-commutative76.8%
fma-def76.9%
Simplified76.9%
fma-def76.9%
fma-udef76.8%
+-commutative76.8%
associate-+r+76.8%
Applied egg-rr76.8%
Taylor expanded in z around inf 46.2%
if -2.4999999999999998e133 < z < 5.8e-73Initial program 98.5%
Taylor expanded in a around inf 59.3%
Final simplification53.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -6.5e+118) (* c i) (if (<= (* c i) 550000000.0) (* 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) <= -6.5e+118) {
tmp = c * i;
} else if ((c * i) <= 550000000.0) {
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) <= (-6.5d+118)) then
tmp = c * i
else if ((c * i) <= 550000000.0d0) 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) <= -6.5e+118) {
tmp = c * i;
} else if ((c * i) <= 550000000.0) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -6.5e+118: tmp = c * i elif (c * i) <= 550000000.0: 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) <= -6.5e+118) tmp = Float64(c * i); elseif (Float64(c * i) <= 550000000.0) 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) <= -6.5e+118) tmp = c * i; elseif ((c * i) <= 550000000.0) 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], -6.5e+118], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 550000000.0], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6.5 \cdot 10^{+118}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 550000000:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -6.5e118 or 5.5e8 < (*.f64 c i) Initial program 94.2%
Taylor expanded in c around inf 53.1%
if -6.5e118 < (*.f64 c i) < 5.5e8Initial program 97.0%
Taylor expanded in x around 0 74.5%
associate-+r+74.5%
+-commutative74.5%
fma-def74.5%
*-commutative74.5%
+-commutative74.5%
fma-def74.5%
Simplified74.5%
fma-def74.5%
fma-udef74.5%
+-commutative74.5%
associate-+r+74.5%
Applied egg-rr74.5%
Taylor expanded in a around inf 37.3%
Final simplification42.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= t -5.5e-68) (* z t) (if (<= t 3.7e-63) (* a b) (if (<= t 3.5e+134) (* 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 (t <= -5.5e-68) {
tmp = z * t;
} else if (t <= 3.7e-63) {
tmp = a * b;
} else if (t <= 3.5e+134) {
tmp = x * y;
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (t <= (-5.5d-68)) then
tmp = z * t
else if (t <= 3.7d-63) then
tmp = a * b
else if (t <= 3.5d+134) then
tmp = x * y
else
tmp = z * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (t <= -5.5e-68) {
tmp = z * t;
} else if (t <= 3.7e-63) {
tmp = a * b;
} else if (t <= 3.5e+134) {
tmp = x * y;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= -5.5e-68: tmp = z * t elif t <= 3.7e-63: tmp = a * b elif t <= 3.5e+134: tmp = x * y else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= -5.5e-68) tmp = Float64(z * t); elseif (t <= 3.7e-63) tmp = Float64(a * b); elseif (t <= 3.5e+134) tmp = Float64(x * y); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (t <= -5.5e-68) tmp = z * t; elseif (t <= 3.7e-63) tmp = a * b; elseif (t <= 3.5e+134) tmp = x * y; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, -5.5e-68], N[(z * t), $MachinePrecision], If[LessEqual[t, 3.7e-63], N[(a * b), $MachinePrecision], If[LessEqual[t, 3.5e+134], N[(x * y), $MachinePrecision], N[(z * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-68}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-63}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+134}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if t < -5.5000000000000003e-68 or 3.50000000000000003e134 < t Initial program 93.1%
Taylor expanded in x around 0 80.0%
associate-+r+80.0%
+-commutative80.0%
fma-def80.0%
*-commutative80.0%
+-commutative80.0%
fma-def80.0%
Simplified80.0%
fma-def80.0%
fma-udef80.0%
+-commutative80.0%
associate-+r+80.0%
Applied egg-rr80.0%
Taylor expanded in z around inf 48.1%
if -5.5000000000000003e-68 < t < 3.70000000000000012e-63Initial program 98.1%
Taylor expanded in x around 0 70.8%
associate-+r+70.8%
+-commutative70.8%
fma-def70.8%
*-commutative70.8%
+-commutative70.8%
fma-def70.9%
Simplified70.9%
fma-def70.9%
fma-udef70.8%
+-commutative70.8%
associate-+r+70.8%
Applied egg-rr70.8%
Taylor expanded in a around inf 41.0%
if 3.70000000000000012e-63 < t < 3.50000000000000003e134Initial program 99.8%
Taylor expanded in a around 0 79.6%
Taylor expanded in t around 0 44.4%
Taylor expanded in c around 0 29.4%
Final simplification42.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 96.0%
Taylor expanded in x around 0 75.4%
associate-+r+75.4%
+-commutative75.4%
fma-def75.4%
*-commutative75.4%
+-commutative75.4%
fma-def75.4%
Simplified75.4%
fma-def75.4%
fma-udef75.4%
+-commutative75.4%
associate-+r+75.4%
Applied egg-rr75.4%
Taylor expanded in a around inf 28.8%
Final simplification28.8%
herbie shell --seed 2023242
(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)))