
(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 11 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 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (* z (+ t (/ (* c i) z))))))
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 = z * (t + ((c * i) / z));
}
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 = z * (t + ((c * i) / z));
}
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 = z * (t + ((c * i) / z)) 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(z * Float64(t + Float64(Float64(c * i) / z))); 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 = z * (t + ((c * i) / z)); 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[(z * N[(t + N[(N[(c * i), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \frac{c \cdot i}{z}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in z around inf
*-lowering-*.f6477.9%
Simplified77.9%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6477.9%
Simplified77.9%
Final simplification99.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* x y) (* z t))))
(if (<= (* a b) -1e+153)
(* b (+ a (/ (* c i) b)))
(if (<= (* a b) -1e-26)
t_2
(if (<= (* a b) -1e-96)
t_1
(if (<= (* a b) 2e-321)
t_2
(if (<= (* a b) 4e+129) t_1 (+ (* x y) (* a b)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -1e+153) {
tmp = b * (a + ((c * i) / b));
} else if ((a * b) <= -1e-26) {
tmp = t_2;
} else if ((a * b) <= -1e-96) {
tmp = t_1;
} else if ((a * b) <= 2e-321) {
tmp = t_2;
} else if ((a * b) <= 4e+129) {
tmp = t_1;
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (c * i) + (z * t)
t_2 = (x * y) + (z * t)
if ((a * b) <= (-1d+153)) then
tmp = b * (a + ((c * i) / b))
else if ((a * b) <= (-1d-26)) then
tmp = t_2
else if ((a * b) <= (-1d-96)) then
tmp = t_1
else if ((a * b) <= 2d-321) then
tmp = t_2
else if ((a * b) <= 4d+129) then
tmp = t_1
else
tmp = (x * y) + (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (z * t);
double t_2 = (x * y) + (z * t);
double tmp;
if ((a * b) <= -1e+153) {
tmp = b * (a + ((c * i) / b));
} else if ((a * b) <= -1e-26) {
tmp = t_2;
} else if ((a * b) <= -1e-96) {
tmp = t_1;
} else if ((a * b) <= 2e-321) {
tmp = t_2;
} else if ((a * b) <= 4e+129) {
tmp = t_1;
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = (x * y) + (z * t) tmp = 0 if (a * b) <= -1e+153: tmp = b * (a + ((c * i) / b)) elif (a * b) <= -1e-26: tmp = t_2 elif (a * b) <= -1e-96: tmp = t_1 elif (a * b) <= 2e-321: tmp = t_2 elif (a * b) <= 4e+129: tmp = t_1 else: tmp = (x * y) + (a * b) 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)) tmp = 0.0 if (Float64(a * b) <= -1e+153) tmp = Float64(b * Float64(a + Float64(Float64(c * i) / b))); elseif (Float64(a * b) <= -1e-26) tmp = t_2; elseif (Float64(a * b) <= -1e-96) tmp = t_1; elseif (Float64(a * b) <= 2e-321) tmp = t_2; elseif (Float64(a * b) <= 4e+129) tmp = t_1; else tmp = Float64(Float64(x * y) + Float64(a * b)); 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); tmp = 0.0; if ((a * b) <= -1e+153) tmp = b * (a + ((c * i) / b)); elseif ((a * b) <= -1e-26) tmp = t_2; elseif ((a * b) <= -1e-96) tmp = t_1; elseif ((a * b) <= 2e-321) tmp = t_2; elseif ((a * b) <= 4e+129) tmp = t_1; else tmp = (x * y) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+153], N[(b * N[(a + N[(N[(c * i), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1e-26], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1e-96], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e-321], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 4e+129], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+153}:\\
\;\;\;\;b \cdot \left(a + \frac{c \cdot i}{b}\right)\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-26}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-321}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -1e153Initial program 93.9%
Taylor expanded in a around inf
*-lowering-*.f6485.4%
Simplified85.4%
Taylor expanded in b around inf
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6485.4%
Simplified85.4%
if -1e153 < (*.f64 a b) < -1e-26 or -9.9999999999999991e-97 < (*.f64 a b) < 2.00097e-321Initial program 97.9%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+l+N/A
Applied egg-rr97.8%
Taylor expanded in a around 0
*-lowering-*.f6492.7%
Simplified92.7%
Taylor expanded in c around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.2%
Simplified73.2%
if -1e-26 < (*.f64 a b) < -9.9999999999999991e-97 or 2.00097e-321 < (*.f64 a b) < 4e129Initial program 98.8%
Taylor expanded in z around inf
*-lowering-*.f6482.6%
Simplified82.6%
if 4e129 < (*.f64 a b) Initial program 90.5%
Taylor expanded in c around 0
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.6%
Simplified83.6%
Taylor expanded in a around inf
*-lowering-*.f6483.6%
Simplified83.6%
Final simplification79.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))) (t_2 (+ (* c i) (* z t))))
(if (<= (* a b) -2.4e+147)
(+ (* a b) (* c i))
(if (<= (* a b) -1.16e-28)
t_1
(if (<= (* a b) -1.45e-97)
t_2
(if (<= (* a b) 2e-321)
t_1
(if (<= (* a b) 1.3e+132) t_2 (+ (* x y) (* a b)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = (c * i) + (z * t);
double tmp;
if ((a * b) <= -2.4e+147) {
tmp = (a * b) + (c * i);
} else if ((a * b) <= -1.16e-28) {
tmp = t_1;
} else if ((a * b) <= -1.45e-97) {
tmp = t_2;
} else if ((a * b) <= 2e-321) {
tmp = t_1;
} else if ((a * b) <= 1.3e+132) {
tmp = t_2;
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) + (z * t)
t_2 = (c * i) + (z * t)
if ((a * b) <= (-2.4d+147)) then
tmp = (a * b) + (c * i)
else if ((a * b) <= (-1.16d-28)) then
tmp = t_1
else if ((a * b) <= (-1.45d-97)) then
tmp = t_2
else if ((a * b) <= 2d-321) then
tmp = t_1
else if ((a * b) <= 1.3d+132) then
tmp = t_2
else
tmp = (x * y) + (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double t_2 = (c * i) + (z * t);
double tmp;
if ((a * b) <= -2.4e+147) {
tmp = (a * b) + (c * i);
} else if ((a * b) <= -1.16e-28) {
tmp = t_1;
} else if ((a * b) <= -1.45e-97) {
tmp = t_2;
} else if ((a * b) <= 2e-321) {
tmp = t_1;
} else if ((a * b) <= 1.3e+132) {
tmp = t_2;
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = (c * i) + (z * t) tmp = 0 if (a * b) <= -2.4e+147: tmp = (a * b) + (c * i) elif (a * b) <= -1.16e-28: tmp = t_1 elif (a * b) <= -1.45e-97: tmp = t_2 elif (a * b) <= 2e-321: tmp = t_1 elif (a * b) <= 1.3e+132: tmp = t_2 else: tmp = (x * y) + (a * b) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -2.4e+147) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(a * b) <= -1.16e-28) tmp = t_1; elseif (Float64(a * b) <= -1.45e-97) tmp = t_2; elseif (Float64(a * b) <= 2e-321) tmp = t_1; elseif (Float64(a * b) <= 1.3e+132) tmp = t_2; else tmp = Float64(Float64(x * y) + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); t_2 = (c * i) + (z * t); tmp = 0.0; if ((a * b) <= -2.4e+147) tmp = (a * b) + (c * i); elseif ((a * b) <= -1.16e-28) tmp = t_1; elseif ((a * b) <= -1.45e-97) tmp = t_2; elseif ((a * b) <= 2e-321) tmp = t_1; elseif ((a * b) <= 1.3e+132) tmp = t_2; else tmp = (x * y) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2.4e+147], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -1.16e-28], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1.45e-97], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 2e-321], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.3e+132], t$95$2, N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := c \cdot i + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -2.4 \cdot 10^{+147}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -1.16 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -1.45 \cdot 10^{-97}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-321}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 1.3 \cdot 10^{+132}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -2.40000000000000002e147Initial program 93.9%
Taylor expanded in a around inf
*-lowering-*.f6485.4%
Simplified85.4%
if -2.40000000000000002e147 < (*.f64 a b) < -1.1600000000000001e-28 or -1.45e-97 < (*.f64 a b) < 2.00097e-321Initial program 97.9%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+l+N/A
Applied egg-rr97.8%
Taylor expanded in a around 0
*-lowering-*.f6492.7%
Simplified92.7%
Taylor expanded in c around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.2%
Simplified73.2%
if -1.1600000000000001e-28 < (*.f64 a b) < -1.45e-97 or 2.00097e-321 < (*.f64 a b) < 1.3e132Initial program 98.8%
Taylor expanded in z around inf
*-lowering-*.f6482.6%
Simplified82.6%
if 1.3e132 < (*.f64 a b) Initial program 90.5%
Taylor expanded in c around 0
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6483.6%
Simplified83.6%
Taylor expanded in a around inf
*-lowering-*.f6483.6%
Simplified83.6%
Final simplification79.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t)))
(t_2 (+ (* a b) (* c i)))
(t_3 (+ (* c i) (* z t))))
(if (<= (* a b) -9.6e+151)
t_2
(if (<= (* a b) -3.4e-27)
t_1
(if (<= (* a b) -6.5e-97)
t_3
(if (<= (* a b) 2e-321) t_1 (if (<= (* a b) 1.55e+128) 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 = (x * y) + (z * t);
double t_2 = (a * b) + (c * i);
double t_3 = (c * i) + (z * t);
double tmp;
if ((a * b) <= -9.6e+151) {
tmp = t_2;
} else if ((a * b) <= -3.4e-27) {
tmp = t_1;
} else if ((a * b) <= -6.5e-97) {
tmp = t_3;
} else if ((a * b) <= 2e-321) {
tmp = t_1;
} else if ((a * b) <= 1.55e+128) {
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 = (x * y) + (z * t)
t_2 = (a * b) + (c * i)
t_3 = (c * i) + (z * t)
if ((a * b) <= (-9.6d+151)) then
tmp = t_2
else if ((a * b) <= (-3.4d-27)) then
tmp = t_1
else if ((a * b) <= (-6.5d-97)) then
tmp = t_3
else if ((a * b) <= 2d-321) then
tmp = t_1
else if ((a * b) <= 1.55d+128) 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 = (x * y) + (z * t);
double t_2 = (a * b) + (c * i);
double t_3 = (c * i) + (z * t);
double tmp;
if ((a * b) <= -9.6e+151) {
tmp = t_2;
} else if ((a * b) <= -3.4e-27) {
tmp = t_1;
} else if ((a * b) <= -6.5e-97) {
tmp = t_3;
} else if ((a * b) <= 2e-321) {
tmp = t_1;
} else if ((a * b) <= 1.55e+128) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) t_2 = (a * b) + (c * i) t_3 = (c * i) + (z * t) tmp = 0 if (a * b) <= -9.6e+151: tmp = t_2 elif (a * b) <= -3.4e-27: tmp = t_1 elif (a * b) <= -6.5e-97: tmp = t_3 elif (a * b) <= 2e-321: tmp = t_1 elif (a * b) <= 1.55e+128: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(Float64(a * b) + Float64(c * i)) t_3 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -9.6e+151) tmp = t_2; elseif (Float64(a * b) <= -3.4e-27) tmp = t_1; elseif (Float64(a * b) <= -6.5e-97) tmp = t_3; elseif (Float64(a * b) <= 2e-321) tmp = t_1; elseif (Float64(a * b) <= 1.55e+128) 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 = (x * y) + (z * t); t_2 = (a * b) + (c * i); t_3 = (c * i) + (z * t); tmp = 0.0; if ((a * b) <= -9.6e+151) tmp = t_2; elseif ((a * b) <= -3.4e-27) tmp = t_1; elseif ((a * b) <= -6.5e-97) tmp = t_3; elseif ((a * b) <= 2e-321) tmp = t_1; elseif ((a * b) <= 1.55e+128) 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[(x * y), $MachinePrecision] + N[(z * t), $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], -9.6e+151], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -3.4e-27], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -6.5e-97], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 2e-321], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.55e+128], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
t_3 := c \cdot i + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -9.6 \cdot 10^{+151}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -3.4 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -6.5 \cdot 10^{-97}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-321}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 1.55 \cdot 10^{+128}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -9.6000000000000004e151 or 1.55000000000000002e128 < (*.f64 a b) Initial program 92.1%
Taylor expanded in a around inf
*-lowering-*.f6480.4%
Simplified80.4%
if -9.6000000000000004e151 < (*.f64 a b) < -3.3999999999999997e-27 or -6.5000000000000004e-97 < (*.f64 a b) < 2.00097e-321Initial program 97.9%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
/-lowering-/.f64N/A
associate-+l+N/A
Applied egg-rr97.8%
Taylor expanded in a around 0
*-lowering-*.f6492.7%
Simplified92.7%
Taylor expanded in c around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.2%
Simplified73.2%
if -3.3999999999999997e-27 < (*.f64 a b) < -6.5000000000000004e-97 or 2.00097e-321 < (*.f64 a b) < 1.55000000000000002e128Initial program 98.8%
Taylor expanded in z around inf
*-lowering-*.f6482.4%
Simplified82.4%
Final simplification78.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.18e+107)
(* c i)
(if (<= (* c i) -5e+40)
(* x y)
(if (<= (* c i) -7e-226)
(* z t)
(if (<= (* c i) 2.35e-228)
(* a b)
(if (<= (* c i) 3.25e+149) (* x y) (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.18e+107) {
tmp = c * i;
} else if ((c * i) <= -5e+40) {
tmp = x * y;
} else if ((c * i) <= -7e-226) {
tmp = z * t;
} else if ((c * i) <= 2.35e-228) {
tmp = a * b;
} else if ((c * i) <= 3.25e+149) {
tmp = x * y;
} else {
tmp = c * i;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-1.18d+107)) then
tmp = c * i
else if ((c * i) <= (-5d+40)) then
tmp = x * y
else if ((c * i) <= (-7d-226)) then
tmp = z * t
else if ((c * i) <= 2.35d-228) then
tmp = a * b
else if ((c * i) <= 3.25d+149) then
tmp = x * y
else
tmp = c * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.18e+107) {
tmp = c * i;
} else if ((c * i) <= -5e+40) {
tmp = x * y;
} else if ((c * i) <= -7e-226) {
tmp = z * t;
} else if ((c * i) <= 2.35e-228) {
tmp = a * b;
} else if ((c * i) <= 3.25e+149) {
tmp = x * y;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.18e+107: tmp = c * i elif (c * i) <= -5e+40: tmp = x * y elif (c * i) <= -7e-226: tmp = z * t elif (c * i) <= 2.35e-228: tmp = a * b elif (c * i) <= 3.25e+149: tmp = x * y else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1.18e+107) tmp = Float64(c * i); elseif (Float64(c * i) <= -5e+40) tmp = Float64(x * y); elseif (Float64(c * i) <= -7e-226) tmp = Float64(z * t); elseif (Float64(c * i) <= 2.35e-228) tmp = Float64(a * b); elseif (Float64(c * i) <= 3.25e+149) tmp = Float64(x * y); else tmp = Float64(c * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -1.18e+107) tmp = c * i; elseif ((c * i) <= -5e+40) tmp = x * y; elseif ((c * i) <= -7e-226) tmp = z * t; elseif ((c * i) <= 2.35e-228) tmp = a * b; elseif ((c * i) <= 3.25e+149) tmp = x * y; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1.18e+107], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5e+40], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -7e-226], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.35e-228], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.25e+149], N[(x * y), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.18 \cdot 10^{+107}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{+40}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;c \cdot i \leq -7 \cdot 10^{-226}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 2.35 \cdot 10^{-228}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 3.25 \cdot 10^{+149}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.18000000000000005e107 or 3.25000000000000007e149 < (*.f64 c i) Initial program 94.0%
Taylor expanded in c around inf
*-lowering-*.f6471.7%
Simplified71.7%
if -1.18000000000000005e107 < (*.f64 c i) < -5.00000000000000003e40 or 2.3500000000000001e-228 < (*.f64 c i) < 3.25000000000000007e149Initial program 97.5%
Taylor expanded in x around inf
*-lowering-*.f6440.9%
Simplified40.9%
if -5.00000000000000003e40 < (*.f64 c i) < -7e-226Initial program 97.4%
Taylor expanded in z around inf
*-lowering-*.f6451.8%
Simplified51.8%
if -7e-226 < (*.f64 c i) < 2.3500000000000001e-228Initial program 98.1%
Taylor expanded in a around inf
*-lowering-*.f6449.5%
Simplified49.5%
Final simplification54.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -4e+98)
(* c i)
(if (<= (* c i) -1.46e-210)
(* z t)
(if (<= (* c i) 2.9e-114)
(* a b)
(if (<= (* c i) 2.7e+137) (* 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) <= -4e+98) {
tmp = c * i;
} else if ((c * i) <= -1.46e-210) {
tmp = z * t;
} else if ((c * i) <= 2.9e-114) {
tmp = a * b;
} else if ((c * i) <= 2.7e+137) {
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) <= (-4d+98)) then
tmp = c * i
else if ((c * i) <= (-1.46d-210)) then
tmp = z * t
else if ((c * i) <= 2.9d-114) then
tmp = a * b
else if ((c * i) <= 2.7d+137) 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) <= -4e+98) {
tmp = c * i;
} else if ((c * i) <= -1.46e-210) {
tmp = z * t;
} else if ((c * i) <= 2.9e-114) {
tmp = a * b;
} else if ((c * i) <= 2.7e+137) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -4e+98: tmp = c * i elif (c * i) <= -1.46e-210: tmp = z * t elif (c * i) <= 2.9e-114: tmp = a * b elif (c * i) <= 2.7e+137: 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) <= -4e+98) tmp = Float64(c * i); elseif (Float64(c * i) <= -1.46e-210) tmp = Float64(z * t); elseif (Float64(c * i) <= 2.9e-114) tmp = Float64(a * b); elseif (Float64(c * i) <= 2.7e+137) 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) <= -4e+98) tmp = c * i; elseif ((c * i) <= -1.46e-210) tmp = z * t; elseif ((c * i) <= 2.9e-114) tmp = a * b; elseif ((c * i) <= 2.7e+137) 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], -4e+98], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.46e-210], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.9e-114], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.7e+137], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4 \cdot 10^{+98}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -1.46 \cdot 10^{-210}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 2.9 \cdot 10^{-114}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 2.7 \cdot 10^{+137}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -3.99999999999999999e98 or 2.70000000000000017e137 < (*.f64 c i) Initial program 94.3%
Taylor expanded in c around inf
*-lowering-*.f6468.2%
Simplified68.2%
if -3.99999999999999999e98 < (*.f64 c i) < -1.45999999999999994e-210 or 2.89999999999999997e-114 < (*.f64 c i) < 2.70000000000000017e137Initial program 96.9%
Taylor expanded in z around inf
*-lowering-*.f6441.1%
Simplified41.1%
if -1.45999999999999994e-210 < (*.f64 c i) < 2.89999999999999997e-114Initial program 98.6%
Taylor expanded in a around inf
*-lowering-*.f6445.0%
Simplified45.0%
Final simplification51.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))))
(if (<= (* c i) -3.4e+176)
t_1
(if (<= (* c i) 7.4e+149) (+ (* x y) (+ (* a b) (* 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) + (z * t);
double tmp;
if ((c * i) <= -3.4e+176) {
tmp = t_1;
} else if ((c * i) <= 7.4e+149) {
tmp = (x * y) + ((a * b) + (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) + (z * t)
if ((c * i) <= (-3.4d+176)) then
tmp = t_1
else if ((c * i) <= 7.4d+149) then
tmp = (x * y) + ((a * b) + (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) + (z * t);
double tmp;
if ((c * i) <= -3.4e+176) {
tmp = t_1;
} else if ((c * i) <= 7.4e+149) {
tmp = (x * y) + ((a * b) + (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) tmp = 0 if (c * i) <= -3.4e+176: tmp = t_1 elif (c * i) <= 7.4e+149: tmp = (x * y) + ((a * b) + (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(z * t)) tmp = 0.0 if (Float64(c * i) <= -3.4e+176) tmp = t_1; elseif (Float64(c * i) <= 7.4e+149) tmp = Float64(Float64(x * y) + Float64(Float64(a * b) + 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) + (z * t); tmp = 0.0; if ((c * i) <= -3.4e+176) tmp = t_1; elseif ((c * i) <= 7.4e+149) tmp = (x * y) + ((a * b) + (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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -3.4e+176], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 7.4e+149], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -3.4 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 7.4 \cdot 10^{+149}:\\
\;\;\;\;x \cdot y + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -3.40000000000000014e176 or 7.39999999999999957e149 < (*.f64 c i) Initial program 93.4%
Taylor expanded in z around inf
*-lowering-*.f6485.4%
Simplified85.4%
if -3.40000000000000014e176 < (*.f64 c i) < 7.39999999999999957e149Initial program 97.8%
Taylor expanded in c around 0
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.3%
Simplified90.3%
Final simplification88.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* a b) -3.6e+95)
t_1
(if (<= (* a b) 9.2e+126) (+ (* c i) (* z t)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -3.6e+95) {
tmp = t_1;
} else if ((a * b) <= 9.2e+126) {
tmp = (c * i) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((a * b) <= (-3.6d+95)) then
tmp = t_1
else if ((a * b) <= 9.2d+126) then
tmp = (c * i) + (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -3.6e+95) {
tmp = t_1;
} else if ((a * b) <= 9.2e+126) {
tmp = (c * i) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (a * b) <= -3.6e+95: tmp = t_1 elif (a * b) <= 9.2e+126: tmp = (c * i) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -3.6e+95) tmp = t_1; elseif (Float64(a * b) <= 9.2e+126) tmp = Float64(Float64(c * i) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); tmp = 0.0; if ((a * b) <= -3.6e+95) tmp = t_1; elseif ((a * b) <= 9.2e+126) tmp = (c * i) + (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -3.6e+95], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 9.2e+126], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -3.6 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 9.2 \cdot 10^{+126}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -3.59999999999999978e95 or 9.2000000000000002e126 < (*.f64 a b) Initial program 92.8%
Taylor expanded in a around inf
*-lowering-*.f6477.4%
Simplified77.4%
if -3.59999999999999978e95 < (*.f64 a b) < 9.2000000000000002e126Initial program 98.2%
Taylor expanded in z around inf
*-lowering-*.f6470.2%
Simplified70.2%
Final simplification72.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* x y) -5e+142) (* x y) (if (<= (* x y) 4e+247) (+ (* a b) (* c i)) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+142) {
tmp = x * y;
} else if ((x * y) <= 4e+247) {
tmp = (a * b) + (c * i);
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-5d+142)) then
tmp = x * y
else if ((x * y) <= 4d+247) then
tmp = (a * b) + (c * i)
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5e+142) {
tmp = x * y;
} else if ((x * y) <= 4e+247) {
tmp = (a * b) + (c * i);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -5e+142: tmp = x * y elif (x * y) <= 4e+247: tmp = (a * b) + (c * i) else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5e+142) tmp = Float64(x * y); elseif (Float64(x * y) <= 4e+247) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -5e+142) tmp = x * y; elseif ((x * y) <= 4e+247) tmp = (a * b) + (c * i); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+142], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+247], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+142}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+247}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -5.0000000000000001e142 or 3.99999999999999981e247 < (*.f64 x y) Initial program 88.2%
Taylor expanded in x around inf
*-lowering-*.f6476.1%
Simplified76.1%
if -5.0000000000000001e142 < (*.f64 x y) < 3.99999999999999981e247Initial program 99.4%
Taylor expanded in a around inf
*-lowering-*.f6461.3%
Simplified61.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -9.4e+54) (* a b) (if (<= (* a b) 3.4e+130) (* 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) <= -9.4e+54) {
tmp = a * b;
} else if ((a * b) <= 3.4e+130) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-9.4d+54)) then
tmp = a * b
else if ((a * b) <= 3.4d+130) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -9.4e+54) {
tmp = a * b;
} else if ((a * b) <= 3.4e+130) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -9.4e+54: tmp = a * b elif (a * b) <= 3.4e+130: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -9.4e+54) tmp = Float64(a * b); elseif (Float64(a * b) <= 3.4e+130) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -9.4e+54) tmp = a * b; elseif ((a * b) <= 3.4e+130) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -9.4e+54], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.4e+130], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -9.4 \cdot 10^{+54}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 3.4 \cdot 10^{+130}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -9.39999999999999985e54 or 3.4000000000000001e130 < (*.f64 a b) Initial program 93.2%
Taylor expanded in a around inf
*-lowering-*.f6463.4%
Simplified63.4%
if -9.39999999999999985e54 < (*.f64 a b) < 3.4000000000000001e130Initial program 98.2%
Taylor expanded in c around inf
*-lowering-*.f6436.6%
Simplified36.6%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
\\
a \cdot b
\end{array}
Initial program 96.5%
Taylor expanded in a around inf
*-lowering-*.f6425.4%
Simplified25.4%
herbie shell --seed 2024192
(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)))