
(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 (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 95.3%
+-commutative95.3%
fma-def96.1%
associate-+l+96.1%
fma-def97.6%
fma-def98.4%
Simplified98.4%
Final simplification98.4%
(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 95.3%
+-commutative95.3%
fma-def96.1%
associate-+l+96.1%
fma-def97.6%
fma-def98.4%
Simplified98.4%
fma-udef97.6%
Applied egg-rr97.6%
Final simplification97.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (+ (fma x y (* z t)) (+ (* a b) (* c i))) (* a b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((a * b) + ((x * y) + (z * t))) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(x, y, (z * t)) + ((a * b) + (c * i));
} else {
tmp = a * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) <= Inf) tmp = Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))); else tmp = Float64(a * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
associate-+l+100.0%
fma-def100.0%
Simplified100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
+-commutative0.0%
fma-def16.7%
associate-+l+16.7%
fma-def50.0%
fma-def66.7%
Simplified66.7%
fma-udef50.0%
Applied egg-rr50.0%
Taylor expanded in a around inf 50.1%
Final simplification97.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (+ (* a b) (+ (* x y) (* z t))) INFINITY) (fma c i (+ (+ (* a b) (* x y)) (* z t))) (fma c i (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) + ((x * y) + (z * t))) <= ((double) INFINITY)) {
tmp = fma(c, i, (((a * b) + (x * y)) + (z * t)));
} else {
tmp = fma(c, i, (a * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) <= Inf) tmp = fma(c, i, Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(z * t))); else tmp = fma(c, i, Float64(a * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * i + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b + \left(x \cdot y + z \cdot t\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, i, \left(a \cdot b + x \cdot y\right) + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) < +inf.0Initial program 98.3%
+-commutative98.3%
fma-def99.2%
associate-+l+99.2%
fma-def99.2%
fma-def99.2%
Simplified99.2%
fma-udef99.2%
fma-udef99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r+99.2%
Applied egg-rr99.2%
if +inf.0 < (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) Initial program 0.0%
Taylor expanded in x around 0 37.5%
Taylor expanded in t around 0 50.1%
fma-def62.6%
Simplified62.6%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.7e+18)
(* c i)
(if (<= (* c i) -8.6e-45)
(* x y)
(if (<= (* c i) -1e-314)
(* z t)
(if (<= (* c i) 1.15e-129)
(* a b)
(if (<= (* c i) 3.3e-82)
(* z t)
(if (<= (* c i) 9.5e+101)
(* a b)
(if (<= (* c i) 4.8e+234) (* 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) <= -1.7e+18) {
tmp = c * i;
} else if ((c * i) <= -8.6e-45) {
tmp = x * y;
} else if ((c * i) <= -1e-314) {
tmp = z * t;
} else if ((c * i) <= 1.15e-129) {
tmp = a * b;
} else if ((c * i) <= 3.3e-82) {
tmp = z * t;
} else if ((c * i) <= 9.5e+101) {
tmp = a * b;
} else if ((c * i) <= 4.8e+234) {
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) <= (-1.7d+18)) then
tmp = c * i
else if ((c * i) <= (-8.6d-45)) then
tmp = x * y
else if ((c * i) <= (-1d-314)) then
tmp = z * t
else if ((c * i) <= 1.15d-129) then
tmp = a * b
else if ((c * i) <= 3.3d-82) then
tmp = z * t
else if ((c * i) <= 9.5d+101) then
tmp = a * b
else if ((c * i) <= 4.8d+234) 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) <= -1.7e+18) {
tmp = c * i;
} else if ((c * i) <= -8.6e-45) {
tmp = x * y;
} else if ((c * i) <= -1e-314) {
tmp = z * t;
} else if ((c * i) <= 1.15e-129) {
tmp = a * b;
} else if ((c * i) <= 3.3e-82) {
tmp = z * t;
} else if ((c * i) <= 9.5e+101) {
tmp = a * b;
} else if ((c * i) <= 4.8e+234) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.7e+18: tmp = c * i elif (c * i) <= -8.6e-45: tmp = x * y elif (c * i) <= -1e-314: tmp = z * t elif (c * i) <= 1.15e-129: tmp = a * b elif (c * i) <= 3.3e-82: tmp = z * t elif (c * i) <= 9.5e+101: tmp = a * b elif (c * i) <= 4.8e+234: 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) <= -1.7e+18) tmp = Float64(c * i); elseif (Float64(c * i) <= -8.6e-45) tmp = Float64(x * y); elseif (Float64(c * i) <= -1e-314) tmp = Float64(z * t); elseif (Float64(c * i) <= 1.15e-129) tmp = Float64(a * b); elseif (Float64(c * i) <= 3.3e-82) tmp = Float64(z * t); elseif (Float64(c * i) <= 9.5e+101) tmp = Float64(a * b); elseif (Float64(c * i) <= 4.8e+234) 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) <= -1.7e+18) tmp = c * i; elseif ((c * i) <= -8.6e-45) tmp = x * y; elseif ((c * i) <= -1e-314) tmp = z * t; elseif ((c * i) <= 1.15e-129) tmp = a * b; elseif ((c * i) <= 3.3e-82) tmp = z * t; elseif ((c * i) <= 9.5e+101) tmp = a * b; elseif ((c * i) <= 4.8e+234) 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], -1.7e+18], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -8.6e-45], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1e-314], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.15e-129], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.3e-82], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 9.5e+101], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.8e+234], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.7 \cdot 10^{+18}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -8.6 \cdot 10^{-45}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{-314}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 1.15 \cdot 10^{-129}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 3.3 \cdot 10^{-82}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 9.5 \cdot 10^{+101}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 4.8 \cdot 10^{+234}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.7e18 or 4.80000000000000023e234 < (*.f64 c i) Initial program 91.8%
Taylor expanded in c around inf 66.0%
if -1.7e18 < (*.f64 c i) < -8.5999999999999998e-45Initial program 99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 47.2%
if -8.5999999999999998e-45 < (*.f64 c i) < -9.9999999996e-315 or 1.15e-129 < (*.f64 c i) < 3.30000000000000022e-82 or 9.49999999999999947e101 < (*.f64 c i) < 4.80000000000000023e234Initial program 96.9%
+-commutative96.9%
fma-def96.9%
associate-+l+96.9%
fma-def96.9%
fma-def96.9%
Simplified96.9%
fma-udef96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 56.8%
if -9.9999999996e-315 < (*.f64 c i) < 1.15e-129 or 3.30000000000000022e-82 < (*.f64 c i) < 9.49999999999999947e101Initial program 96.6%
+-commutative96.6%
fma-def96.6%
associate-+l+96.6%
fma-def97.7%
fma-def100.0%
Simplified100.0%
fma-udef97.7%
Applied egg-rr97.7%
Taylor expanded in a around inf 49.6%
Final simplification56.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* x y)))
(t_2 (+ (* a b) (* c i)))
(t_3 (+ (* c i) (* z t))))
(if (<= (* a b) -1.38e+104)
t_2
(if (<= (* a b) -2.8e+38)
t_1
(if (<= (* a b) -40000000000.0)
t_2
(if (<= (* a b) 7e-118)
t_3
(if (<= (* a b) 4.2e-66)
t_1
(if (<= (* a b) 5.7e+76) t_3 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) + (x * y);
double t_2 = (a * b) + (c * i);
double t_3 = (c * i) + (z * t);
double tmp;
if ((a * b) <= -1.38e+104) {
tmp = t_2;
} else if ((a * b) <= -2.8e+38) {
tmp = t_1;
} else if ((a * b) <= -40000000000.0) {
tmp = t_2;
} else if ((a * b) <= 7e-118) {
tmp = t_3;
} else if ((a * b) <= 4.2e-66) {
tmp = t_1;
} else if ((a * b) <= 5.7e+76) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = (c * i) + (x * y)
t_2 = (a * b) + (c * i)
t_3 = (c * i) + (z * t)
if ((a * b) <= (-1.38d+104)) then
tmp = t_2
else if ((a * b) <= (-2.8d+38)) then
tmp = t_1
else if ((a * b) <= (-40000000000.0d0)) then
tmp = t_2
else if ((a * b) <= 7d-118) then
tmp = t_3
else if ((a * b) <= 4.2d-66) then
tmp = t_1
else if ((a * b) <= 5.7d+76) then
tmp = t_3
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) + (x * y);
double t_2 = (a * b) + (c * i);
double t_3 = (c * i) + (z * t);
double tmp;
if ((a * b) <= -1.38e+104) {
tmp = t_2;
} else if ((a * b) <= -2.8e+38) {
tmp = t_1;
} else if ((a * b) <= -40000000000.0) {
tmp = t_2;
} else if ((a * b) <= 7e-118) {
tmp = t_3;
} else if ((a * b) <= 4.2e-66) {
tmp = t_1;
} else if ((a * b) <= 5.7e+76) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (x * y) t_2 = (a * b) + (c * i) t_3 = (c * i) + (z * t) tmp = 0 if (a * b) <= -1.38e+104: tmp = t_2 elif (a * b) <= -2.8e+38: tmp = t_1 elif (a * b) <= -40000000000.0: tmp = t_2 elif (a * b) <= 7e-118: tmp = t_3 elif (a * b) <= 4.2e-66: tmp = t_1 elif (a * b) <= 5.7e+76: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(x * y)) t_2 = Float64(Float64(a * b) + Float64(c * i)) t_3 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -1.38e+104) tmp = t_2; elseif (Float64(a * b) <= -2.8e+38) tmp = t_1; elseif (Float64(a * b) <= -40000000000.0) tmp = t_2; elseif (Float64(a * b) <= 7e-118) tmp = t_3; elseif (Float64(a * b) <= 4.2e-66) tmp = t_1; elseif (Float64(a * b) <= 5.7e+76) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (x * y); t_2 = (a * b) + (c * i); t_3 = (c * i) + (z * t); tmp = 0.0; if ((a * b) <= -1.38e+104) tmp = t_2; elseif ((a * b) <= -2.8e+38) tmp = t_1; elseif ((a * b) <= -40000000000.0) tmp = t_2; elseif ((a * b) <= 7e-118) tmp = t_3; elseif ((a * b) <= 4.2e-66) tmp = t_1; elseif ((a * b) <= 5.7e+76) tmp = t_3; 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[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.38e+104], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -2.8e+38], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -40000000000.0], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 7e-118], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 4.2e-66], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 5.7e+76], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + x \cdot y\\
t_2 := a \cdot b + c \cdot i\\
t_3 := c \cdot i + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -1.38 \cdot 10^{+104}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -2.8 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq -40000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 7 \cdot 10^{-118}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 4.2 \cdot 10^{-66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 5.7 \cdot 10^{+76}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -1.38e104 or -2.8e38 < (*.f64 a b) < -4e10 or 5.70000000000000004e76 < (*.f64 a b) Initial program 89.2%
Taylor expanded in a around inf 79.8%
if -1.38e104 < (*.f64 a b) < -2.8e38 or 7e-118 < (*.f64 a b) < 4.2000000000000001e-66Initial program 99.9%
Taylor expanded in x around inf 74.1%
if -4e10 < (*.f64 a b) < 7e-118 or 4.2000000000000001e-66 < (*.f64 a b) < 5.70000000000000004e76Initial program 99.1%
Taylor expanded in z around inf 74.7%
Final simplification76.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t)))
(t_2 (+ (* x y) (* z t)))
(t_3 (+ (* a b) (* c i))))
(if (<= (* a b) -1.15e+104)
t_3
(if (<= (* a b) -1e+39)
t_2
(if (<= (* a b) -60000000000.0)
t_3
(if (<= (* a b) 6.4e-131)
t_1
(if (<= (* a b) 2.4e-73)
t_2
(if (<= (* a b) 3.7e+79) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = (x * y) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -1.15e+104) {
tmp = t_3;
} else if ((a * b) <= -1e+39) {
tmp = t_2;
} else if ((a * b) <= -60000000000.0) {
tmp = t_3;
} else if ((a * b) <= 6.4e-131) {
tmp = t_1;
} else if ((a * b) <= 2.4e-73) {
tmp = t_2;
} else if ((a * b) <= 3.7e+79) {
tmp = t_1;
} 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 = (c * i) + (z * t)
t_2 = (x * y) + (z * t)
t_3 = (a * b) + (c * i)
if ((a * b) <= (-1.15d+104)) then
tmp = t_3
else if ((a * b) <= (-1d+39)) then
tmp = t_2
else if ((a * b) <= (-60000000000.0d0)) then
tmp = t_3
else if ((a * b) <= 6.4d-131) then
tmp = t_1
else if ((a * b) <= 2.4d-73) then
tmp = t_2
else if ((a * b) <= 3.7d+79) then
tmp = t_1
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 = (c * i) + (z * t);
double t_2 = (x * y) + (z * t);
double t_3 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -1.15e+104) {
tmp = t_3;
} else if ((a * b) <= -1e+39) {
tmp = t_2;
} else if ((a * b) <= -60000000000.0) {
tmp = t_3;
} else if ((a * b) <= 6.4e-131) {
tmp = t_1;
} else if ((a * b) <= 2.4e-73) {
tmp = t_2;
} else if ((a * b) <= 3.7e+79) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = (x * y) + (z * t) t_3 = (a * b) + (c * i) tmp = 0 if (a * b) <= -1.15e+104: tmp = t_3 elif (a * b) <= -1e+39: tmp = t_2 elif (a * b) <= -60000000000.0: tmp = t_3 elif (a * b) <= 6.4e-131: tmp = t_1 elif (a * b) <= 2.4e-73: tmp = t_2 elif (a * b) <= 3.7e+79: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) t_2 = Float64(Float64(x * y) + Float64(z * t)) t_3 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -1.15e+104) tmp = t_3; elseif (Float64(a * b) <= -1e+39) tmp = t_2; elseif (Float64(a * b) <= -60000000000.0) tmp = t_3; elseif (Float64(a * b) <= 6.4e-131) tmp = t_1; elseif (Float64(a * b) <= 2.4e-73) tmp = t_2; elseif (Float64(a * b) <= 3.7e+79) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (z * t); t_2 = (x * y) + (z * t); t_3 = (a * b) + (c * i); tmp = 0.0; if ((a * b) <= -1.15e+104) tmp = t_3; elseif ((a * b) <= -1e+39) tmp = t_2; elseif ((a * b) <= -60000000000.0) tmp = t_3; elseif ((a * b) <= 6.4e-131) tmp = t_1; elseif ((a * b) <= 2.4e-73) tmp = t_2; elseif ((a * b) <= 3.7e+79) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.15e+104], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], -1e+39], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -60000000000.0], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 6.4e-131], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2.4e-73], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 3.7e+79], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := x \cdot y + z \cdot t\\
t_3 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -1.15 \cdot 10^{+104}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{+39}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -60000000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \cdot b \leq 6.4 \cdot 10^{-131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 2.4 \cdot 10^{-73}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq 3.7 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 a b) < -1.14999999999999992e104 or -9.9999999999999994e38 < (*.f64 a b) < -6e10 or 3.70000000000000009e79 < (*.f64 a b) Initial program 89.4%
Taylor expanded in a around inf 79.4%
if -1.14999999999999992e104 < (*.f64 a b) < -9.9999999999999994e38 or 6.3999999999999999e-131 < (*.f64 a b) < 2.40000000000000006e-73Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
fma-def100.0%
fma-def100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in a around 0 96.5%
Taylor expanded in c around 0 78.5%
if -6e10 < (*.f64 a b) < 6.3999999999999999e-131 or 2.40000000000000006e-73 < (*.f64 a b) < 3.70000000000000009e79Initial program 99.1%
Taylor expanded in z around inf 74.3%
Final simplification76.8%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
+-commutative0.0%
fma-def16.7%
associate-+l+16.7%
fma-def50.0%
fma-def66.7%
Simplified66.7%
fma-udef50.0%
Applied egg-rr50.0%
Taylor expanded in a around inf 50.1%
Final simplification97.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.05e-28)
(* c i)
(if (<= (* c i) -1e-314)
(* z t)
(if (<= (* c i) 4e-127)
(* a b)
(if (<= (* c i) 1.25e-73)
(* z t)
(if (<= (* c i) 1.4e+102)
(* a b)
(if (<= (* c i) 7.2e+235) (* 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) <= -1.05e-28) {
tmp = c * i;
} else if ((c * i) <= -1e-314) {
tmp = z * t;
} else if ((c * i) <= 4e-127) {
tmp = a * b;
} else if ((c * i) <= 1.25e-73) {
tmp = z * t;
} else if ((c * i) <= 1.4e+102) {
tmp = a * b;
} else if ((c * i) <= 7.2e+235) {
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) <= (-1.05d-28)) then
tmp = c * i
else if ((c * i) <= (-1d-314)) then
tmp = z * t
else if ((c * i) <= 4d-127) then
tmp = a * b
else if ((c * i) <= 1.25d-73) then
tmp = z * t
else if ((c * i) <= 1.4d+102) then
tmp = a * b
else if ((c * i) <= 7.2d+235) 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) <= -1.05e-28) {
tmp = c * i;
} else if ((c * i) <= -1e-314) {
tmp = z * t;
} else if ((c * i) <= 4e-127) {
tmp = a * b;
} else if ((c * i) <= 1.25e-73) {
tmp = z * t;
} else if ((c * i) <= 1.4e+102) {
tmp = a * b;
} else if ((c * i) <= 7.2e+235) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.05e-28: tmp = c * i elif (c * i) <= -1e-314: tmp = z * t elif (c * i) <= 4e-127: tmp = a * b elif (c * i) <= 1.25e-73: tmp = z * t elif (c * i) <= 1.4e+102: tmp = a * b elif (c * i) <= 7.2e+235: 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) <= -1.05e-28) tmp = Float64(c * i); elseif (Float64(c * i) <= -1e-314) tmp = Float64(z * t); elseif (Float64(c * i) <= 4e-127) tmp = Float64(a * b); elseif (Float64(c * i) <= 1.25e-73) tmp = Float64(z * t); elseif (Float64(c * i) <= 1.4e+102) tmp = Float64(a * b); elseif (Float64(c * i) <= 7.2e+235) 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) <= -1.05e-28) tmp = c * i; elseif ((c * i) <= -1e-314) tmp = z * t; elseif ((c * i) <= 4e-127) tmp = a * b; elseif ((c * i) <= 1.25e-73) tmp = z * t; elseif ((c * i) <= 1.4e+102) tmp = a * b; elseif ((c * i) <= 7.2e+235) 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], -1.05e-28], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1e-314], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4e-127], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.25e-73], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.4e+102], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 7.2e+235], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.05 \cdot 10^{-28}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{-314}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 4 \cdot 10^{-127}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 1.25 \cdot 10^{-73}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 1.4 \cdot 10^{+102}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 7.2 \cdot 10^{+235}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.05000000000000003e-28 or 7.19999999999999971e235 < (*.f64 c i) Initial program 92.8%
Taylor expanded in c around inf 60.3%
if -1.05000000000000003e-28 < (*.f64 c i) < -9.9999999996e-315 or 4.0000000000000001e-127 < (*.f64 c i) < 1.25e-73 or 1.40000000000000009e102 < (*.f64 c i) < 7.19999999999999971e235Initial program 97.1%
+-commutative97.1%
fma-def97.1%
associate-+l+97.1%
fma-def97.1%
fma-def97.1%
Simplified97.1%
fma-udef97.1%
Applied egg-rr97.1%
Taylor expanded in z around inf 55.0%
if -9.9999999996e-315 < (*.f64 c i) < 4.0000000000000001e-127 or 1.25e-73 < (*.f64 c i) < 1.40000000000000009e102Initial program 96.6%
+-commutative96.6%
fma-def96.6%
associate-+l+96.6%
fma-def97.7%
fma-def100.0%
Simplified100.0%
fma-udef97.7%
Applied egg-rr97.7%
Taylor expanded in a around inf 49.6%
Final simplification55.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -5e+21)
(+ (* c i) (+ (* a b) (* x y)))
(if (<= (* a b) 2.9e+16)
(+ (* c i) (+ (* x y) (* z t)))
(+ (* c i) (+ (* a b) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -5e+21) {
tmp = (c * i) + ((a * b) + (x * y));
} else if ((a * b) <= 2.9e+16) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-5d+21)) then
tmp = (c * i) + ((a * b) + (x * y))
else if ((a * b) <= 2.9d+16) then
tmp = (c * i) + ((x * y) + (z * t))
else
tmp = (c * i) + ((a * b) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -5e+21) {
tmp = (c * i) + ((a * b) + (x * y));
} else if ((a * b) <= 2.9e+16) {
tmp = (c * i) + ((x * y) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -5e+21: tmp = (c * i) + ((a * b) + (x * y)) elif (a * b) <= 2.9e+16: tmp = (c * i) + ((x * y) + (z * t)) else: tmp = (c * i) + ((a * b) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -5e+21) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); elseif (Float64(a * b) <= 2.9e+16) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -5e+21) tmp = (c * i) + ((a * b) + (x * y)); elseif ((a * b) <= 2.9e+16) tmp = (c * i) + ((x * y) + (z * t)); else tmp = (c * i) + ((a * b) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -5e+21], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.9e+16], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+21}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{elif}\;a \cdot b \leq 2.9 \cdot 10^{+16}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -5e21Initial program 96.4%
Taylor expanded in z around 0 89.6%
if -5e21 < (*.f64 a b) < 2.9e16Initial program 99.2%
Taylor expanded in a around 0 94.4%
if 2.9e16 < (*.f64 a b) Initial program 86.1%
Taylor expanded in x around 0 83.3%
Final simplification90.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -57000000000.0) (not (<= (* a b) 7.5e+76))) (+ (* a b) (* c i)) (+ (* 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) <= -57000000000.0) || !((a * b) <= 7.5e+76)) {
tmp = (a * b) + (c * i);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((a * b) <= (-57000000000.0d0)) .or. (.not. ((a * b) <= 7.5d+76))) then
tmp = (a * b) + (c * i)
else
tmp = (c * i) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((a * b) <= -57000000000.0) || !((a * b) <= 7.5e+76)) {
tmp = (a * b) + (c * i);
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -57000000000.0) or not ((a * b) <= 7.5e+76): tmp = (a * b) + (c * i) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -57000000000.0) || !(Float64(a * b) <= 7.5e+76)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((a * b) <= -57000000000.0) || ~(((a * b) <= 7.5e+76))) tmp = (a * b) + (c * i); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -57000000000.0], N[Not[LessEqual[N[(a * b), $MachinePrecision], 7.5e+76]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -57000000000 \lor \neg \left(a \cdot b \leq 7.5 \cdot 10^{+76}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -5.7e10 or 7.4999999999999995e76 < (*.f64 a b) Initial program 90.4%
Taylor expanded in a around inf 74.6%
if -5.7e10 < (*.f64 a b) < 7.4999999999999995e76Initial program 99.2%
Taylor expanded in z around inf 71.5%
Final simplification72.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= t -1.15e-63) (not (<= t 1.95e+121))) (+ (* c i) (+ (* a b) (* z t))) (+ (* c i) (+ (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -1.15e-63) || !(t <= 1.95e+121)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((t <= (-1.15d-63)) .or. (.not. (t <= 1.95d+121))) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((a * b) + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((t <= -1.15e-63) || !(t <= 1.95e+121)) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((a * b) + (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (t <= -1.15e-63) or not (t <= 1.95e+121): tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((a * b) + (x * y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((t <= -1.15e-63) || !(t <= 1.95e+121)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((t <= -1.15e-63) || ~((t <= 1.95e+121))) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((a * b) + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -1.15e-63], N[Not[LessEqual[t, 1.95e+121]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{-63} \lor \neg \left(t \leq 1.95 \cdot 10^{+121}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\end{array}
\end{array}
if t < -1.15e-63 or 1.94999999999999992e121 < t Initial program 93.3%
Taylor expanded in x around 0 85.0%
if -1.15e-63 < t < 1.94999999999999992e121Initial program 97.0%
Taylor expanded in z around 0 89.7%
Final simplification87.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x -4.1e+205) (+ (* c i) (* x y)) (if (<= x 1.15e+62) (+ (* c i) (+ (* a b) (* z t))) (+ (* 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 <= -4.1e+205) {
tmp = (c * i) + (x * y);
} else if (x <= 1.15e+62) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (x <= (-4.1d+205)) then
tmp = (c * i) + (x * y)
else if (x <= 1.15d+62) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (x * y) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -4.1e+205) {
tmp = (c * i) + (x * y);
} else if (x <= 1.15e+62) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= -4.1e+205: tmp = (c * i) + (x * y) elif x <= 1.15e+62: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (x * y) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -4.1e+205) tmp = Float64(Float64(c * i) + Float64(x * y)); elseif (x <= 1.15e+62) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= -4.1e+205) tmp = (c * i) + (x * y); elseif (x <= 1.15e+62) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (x * y) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -4.1e+205], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e+62], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{+205}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+62}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\end{array}
\end{array}
if x < -4.1000000000000003e205Initial program 95.7%
Taylor expanded in x around inf 70.2%
if -4.1000000000000003e205 < x < 1.14999999999999992e62Initial program 96.7%
Taylor expanded in x around 0 86.7%
if 1.14999999999999992e62 < x Initial program 89.6%
associate-+l+89.6%
associate-+l+89.6%
fma-def95.8%
fma-def97.9%
fma-def97.9%
Simplified97.9%
Taylor expanded in a around 0 75.4%
Taylor expanded in c around 0 61.0%
Final simplification80.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -4e+20) (* c i) (if (<= (* c i) 2.1e+115) (* 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) <= -4e+20) {
tmp = c * i;
} else if ((c * i) <= 2.1e+115) {
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) <= (-4d+20)) then
tmp = c * i
else if ((c * i) <= 2.1d+115) 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) <= -4e+20) {
tmp = c * i;
} else if ((c * i) <= 2.1e+115) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -4e+20: tmp = c * i elif (c * i) <= 2.1e+115: 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) <= -4e+20) tmp = Float64(c * i); elseif (Float64(c * i) <= 2.1e+115) 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) <= -4e+20) tmp = c * i; elseif ((c * i) <= 2.1e+115) 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], -4e+20], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.1e+115], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4 \cdot 10^{+20}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 2.1 \cdot 10^{+115}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -4e20 or 2.10000000000000003e115 < (*.f64 c i) Initial program 93.1%
Taylor expanded in c around inf 58.4%
if -4e20 < (*.f64 c i) < 2.10000000000000003e115Initial program 96.7%
+-commutative96.7%
fma-def96.7%
associate-+l+96.7%
fma-def97.4%
fma-def98.7%
Simplified98.7%
fma-udef97.4%
Applied egg-rr97.4%
Taylor expanded in a around inf 41.6%
Final simplification48.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= t -1.05e+69) (* z t) (if (<= t 9e+133) (+ (* a b) (* c i)) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (t <= -1.05e+69) {
tmp = z * t;
} else if (t <= 9e+133) {
tmp = (a * b) + (c * i);
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (t <= (-1.05d+69)) then
tmp = z * t
else if (t <= 9d+133) then
tmp = (a * b) + (c * i)
else
tmp = z * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (t <= -1.05e+69) {
tmp = z * t;
} else if (t <= 9e+133) {
tmp = (a * b) + (c * i);
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if t <= -1.05e+69: tmp = z * t elif t <= 9e+133: tmp = (a * b) + (c * i) else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (t <= -1.05e+69) tmp = Float64(z * t); elseif (t <= 9e+133) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (t <= -1.05e+69) tmp = z * t; elseif (t <= 9e+133) tmp = (a * b) + (c * i); else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[t, -1.05e+69], N[(z * t), $MachinePrecision], If[LessEqual[t, 9e+133], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(z * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+69}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+133}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if t < -1.05000000000000008e69 or 8.9999999999999997e133 < t Initial program 93.7%
+-commutative93.7%
fma-def94.7%
associate-+l+94.7%
fma-def96.8%
fma-def98.9%
Simplified98.9%
fma-udef96.8%
Applied egg-rr96.8%
Taylor expanded in z around inf 59.8%
if -1.05000000000000008e69 < t < 8.9999999999999997e133Initial program 96.2%
Taylor expanded in a around inf 63.9%
Final simplification62.4%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 95.3%
+-commutative95.3%
fma-def96.1%
associate-+l+96.1%
fma-def97.6%
fma-def98.4%
Simplified98.4%
fma-udef97.6%
Applied egg-rr97.6%
Taylor expanded in a around inf 30.6%
Final simplification30.6%
herbie shell --seed 2023185
(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)))