
(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 13 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 a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -4.8e+94)
(* x y)
(if (<= (* x y) -4.2e-84)
(* z t)
(if (<= (* x y) -9.5e-252)
(* a b)
(if (<= (* x y) 4.3e-308)
(* z t)
(if (<= (* x y) 2.8e-122)
(* a b)
(if (<= (* x y) 2.4e+33)
(* c i)
(if (<= (* x y) 1.85e+143) (* 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 ((x * y) <= -4.8e+94) {
tmp = x * y;
} else if ((x * y) <= -4.2e-84) {
tmp = z * t;
} else if ((x * y) <= -9.5e-252) {
tmp = a * b;
} else if ((x * y) <= 4.3e-308) {
tmp = z * t;
} else if ((x * y) <= 2.8e-122) {
tmp = a * b;
} else if ((x * y) <= 2.4e+33) {
tmp = c * i;
} else if ((x * y) <= 1.85e+143) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-4.8d+94)) then
tmp = x * y
else if ((x * y) <= (-4.2d-84)) then
tmp = z * t
else if ((x * y) <= (-9.5d-252)) then
tmp = a * b
else if ((x * y) <= 4.3d-308) then
tmp = z * t
else if ((x * y) <= 2.8d-122) then
tmp = a * b
else if ((x * y) <= 2.4d+33) then
tmp = c * i
else if ((x * y) <= 1.85d+143) then
tmp = a * b
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -4.8e+94) {
tmp = x * y;
} else if ((x * y) <= -4.2e-84) {
tmp = z * t;
} else if ((x * y) <= -9.5e-252) {
tmp = a * b;
} else if ((x * y) <= 4.3e-308) {
tmp = z * t;
} else if ((x * y) <= 2.8e-122) {
tmp = a * b;
} else if ((x * y) <= 2.4e+33) {
tmp = c * i;
} else if ((x * y) <= 1.85e+143) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -4.8e+94: tmp = x * y elif (x * y) <= -4.2e-84: tmp = z * t elif (x * y) <= -9.5e-252: tmp = a * b elif (x * y) <= 4.3e-308: tmp = z * t elif (x * y) <= 2.8e-122: tmp = a * b elif (x * y) <= 2.4e+33: tmp = c * i elif (x * y) <= 1.85e+143: tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -4.8e+94) tmp = Float64(x * y); elseif (Float64(x * y) <= -4.2e-84) tmp = Float64(z * t); elseif (Float64(x * y) <= -9.5e-252) tmp = Float64(a * b); elseif (Float64(x * y) <= 4.3e-308) tmp = Float64(z * t); elseif (Float64(x * y) <= 2.8e-122) tmp = Float64(a * b); elseif (Float64(x * y) <= 2.4e+33) tmp = Float64(c * i); elseif (Float64(x * y) <= 1.85e+143) tmp = Float64(a * b); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -4.8e+94) tmp = x * y; elseif ((x * y) <= -4.2e-84) tmp = z * t; elseif ((x * y) <= -9.5e-252) tmp = a * b; elseif ((x * y) <= 4.3e-308) tmp = z * t; elseif ((x * y) <= 2.8e-122) tmp = a * b; elseif ((x * y) <= 2.4e+33) tmp = c * i; elseif ((x * y) <= 1.85e+143) tmp = a * b; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -4.8e+94], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.2e-84], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -9.5e-252], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.3e-308], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.8e-122], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.4e+33], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.85e+143], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.8 \cdot 10^{+94}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4.2 \cdot 10^{-84}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq -9.5 \cdot 10^{-252}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 4.3 \cdot 10^{-308}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{-122}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 2.4 \cdot 10^{+33}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 1.85 \cdot 10^{+143}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t)))))) (if (<= t_1 INFINITY) t_1 (+ (* a b) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (a * b) + (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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + ((a * b) + ((x * y) + (z * t))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* a b) (* c i))))
(if (<= (* x y) -4.7e+169)
(* x y)
(if (<= (* x y) -4.8e-44)
t_1
(if (<= (* x y) -1.65e-248)
t_2
(if (<= (* x y) 1.9e-140)
t_1
(if (<= (* x y) 1.7e+197) t_2 (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -4.7e+169) {
tmp = x * y;
} else if ((x * y) <= -4.8e-44) {
tmp = t_1;
} else if ((x * y) <= -1.65e-248) {
tmp = t_2;
} else if ((x * y) <= 1.9e-140) {
tmp = t_1;
} else if ((x * y) <= 1.7e+197) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a * b) + (z * t)
t_2 = (a * b) + (c * i)
if ((x * y) <= (-4.7d+169)) then
tmp = x * y
else if ((x * y) <= (-4.8d-44)) then
tmp = t_1
else if ((x * y) <= (-1.65d-248)) then
tmp = t_2
else if ((x * y) <= 1.9d-140) then
tmp = t_1
else if ((x * y) <= 1.7d+197) then
tmp = t_2
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 t_1 = (a * b) + (z * t);
double t_2 = (a * b) + (c * i);
double tmp;
if ((x * y) <= -4.7e+169) {
tmp = x * y;
} else if ((x * y) <= -4.8e-44) {
tmp = t_1;
} else if ((x * y) <= -1.65e-248) {
tmp = t_2;
} else if ((x * y) <= 1.9e-140) {
tmp = t_1;
} else if ((x * y) <= 1.7e+197) {
tmp = t_2;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) t_2 = (a * b) + (c * i) tmp = 0 if (x * y) <= -4.7e+169: tmp = x * y elif (x * y) <= -4.8e-44: tmp = t_1 elif (x * y) <= -1.65e-248: tmp = t_2 elif (x * y) <= 1.9e-140: tmp = t_1 elif (x * y) <= 1.7e+197: tmp = t_2 else: tmp = x * y 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(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -4.7e+169) tmp = Float64(x * y); elseif (Float64(x * y) <= -4.8e-44) tmp = t_1; elseif (Float64(x * y) <= -1.65e-248) tmp = t_2; elseif (Float64(x * y) <= 1.9e-140) tmp = t_1; elseif (Float64(x * y) <= 1.7e+197) tmp = t_2; else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); t_2 = (a * b) + (c * i); tmp = 0.0; if ((x * y) <= -4.7e+169) tmp = x * y; elseif ((x * y) <= -4.8e-44) tmp = t_1; elseif ((x * y) <= -1.65e-248) tmp = t_2; elseif ((x * y) <= 1.9e-140) tmp = t_1; elseif ((x * y) <= 1.7e+197) tmp = t_2; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.7e+169], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.8e-44], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.65e-248], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.9e-140], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.7e+197], t$95$2, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -4.7 \cdot 10^{+169}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4.8 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq -1.65 \cdot 10^{-248}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 1.9 \cdot 10^{-140}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.7 \cdot 10^{+197}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1.35e+95)
(* x y)
(if (<= (* x y) -4.5e-41)
(* z t)
(if (<= (* x y) 1.35e+196) (+ (* 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) <= -1.35e+95) {
tmp = x * y;
} else if ((x * y) <= -4.5e-41) {
tmp = z * t;
} else if ((x * y) <= 1.35e+196) {
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) <= (-1.35d+95)) then
tmp = x * y
else if ((x * y) <= (-4.5d-41)) then
tmp = z * t
else if ((x * y) <= 1.35d+196) 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) <= -1.35e+95) {
tmp = x * y;
} else if ((x * y) <= -4.5e-41) {
tmp = z * t;
} else if ((x * y) <= 1.35e+196) {
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) <= -1.35e+95: tmp = x * y elif (x * y) <= -4.5e-41: tmp = z * t elif (x * y) <= 1.35e+196: 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) <= -1.35e+95) tmp = Float64(x * y); elseif (Float64(x * y) <= -4.5e-41) tmp = Float64(z * t); elseif (Float64(x * y) <= 1.35e+196) 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) <= -1.35e+95) tmp = x * y; elseif ((x * y) <= -4.5e-41) tmp = z * t; elseif ((x * y) <= 1.35e+196) 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], -1.35e+95], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.5e-41], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.35e+196], 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 -1.35 \cdot 10^{+95}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-41}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.35 \cdot 10^{+196}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -5.1e+218) (not (<= (* c i) 1.35e+200))) (+ (* a b) (* c i)) (+ (* a b) (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -5.1e+218) || !((c * i) <= 1.35e+200)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-5.1d+218)) .or. (.not. ((c * i) <= 1.35d+200))) then
tmp = (a * b) + (c * i)
else
tmp = (a * b) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -5.1e+218) || !((c * i) <= 1.35e+200)) {
tmp = (a * b) + (c * i);
} else {
tmp = (a * b) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -5.1e+218) or not ((c * i) <= 1.35e+200): tmp = (a * b) + (c * i) else: tmp = (a * b) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -5.1e+218) || !(Float64(c * i) <= 1.35e+200)) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -5.1e+218) || ~(((c * i) <= 1.35e+200))) tmp = (a * b) + (c * i); else tmp = (a * b) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -5.1e+218], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.35e+200]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5.1 \cdot 10^{+218} \lor \neg \left(c \cdot i \leq 1.35 \cdot 10^{+200}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.7e-10) (not (<= (* x y) 3.3e+33))) (+ (* a b) (+ (* 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 (((x * y) <= -1.7e-10) || !((x * y) <= 3.3e+33)) {
tmp = (a * b) + ((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 (((x * y) <= (-1.7d-10)) .or. (.not. ((x * y) <= 3.3d+33))) then
tmp = (a * b) + ((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 (((x * y) <= -1.7e-10) || !((x * y) <= 3.3e+33)) {
tmp = (a * b) + ((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 ((x * y) <= -1.7e-10) or not ((x * y) <= 3.3e+33): tmp = (a * b) + ((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(x * y) <= -1.7e-10) || !(Float64(x * y) <= 3.3e+33)) tmp = Float64(Float64(a * b) + 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 (((x * y) <= -1.7e-10) || ~(((x * y) <= 3.3e+33))) tmp = (a * b) + ((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[Or[LessEqual[N[(x * y), $MachinePrecision], -1.7e-10], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.3e+33]], $MachinePrecision]], N[(N[(a * b), $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}\;x \cdot y \leq -1.7 \cdot 10^{-10} \lor \neg \left(x \cdot y \leq 3.3 \cdot 10^{+33}\right):\\
\;\;\;\;a \cdot b + \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}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* a b))))
(if (<= y -5.8e+43)
t_1
(if (<= y -4.3e-165)
(+ (* c i) (* z t))
(if (<= y 22500000000000.0) (+ (* 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 = (x * y) + (a * b);
double tmp;
if (y <= -5.8e+43) {
tmp = t_1;
} else if (y <= -4.3e-165) {
tmp = (c * i) + (z * t);
} else if (y <= 22500000000000.0) {
tmp = (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 = (x * y) + (a * b)
if (y <= (-5.8d+43)) then
tmp = t_1
else if (y <= (-4.3d-165)) then
tmp = (c * i) + (z * t)
else if (y <= 22500000000000.0d0) then
tmp = (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 = (x * y) + (a * b);
double tmp;
if (y <= -5.8e+43) {
tmp = t_1;
} else if (y <= -4.3e-165) {
tmp = (c * i) + (z * t);
} else if (y <= 22500000000000.0) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (a * b) tmp = 0 if y <= -5.8e+43: tmp = t_1 elif y <= -4.3e-165: tmp = (c * i) + (z * t) elif y <= 22500000000000.0: tmp = (a * b) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (y <= -5.8e+43) tmp = t_1; elseif (y <= -4.3e-165) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (y <= 22500000000000.0) tmp = 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 = (x * y) + (a * b); tmp = 0.0; if (y <= -5.8e+43) tmp = t_1; elseif (y <= -4.3e-165) tmp = (c * i) + (z * t); elseif (y <= 22500000000000.0) tmp = (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[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e+43], t$95$1, If[LessEqual[y, -4.3e-165], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 22500000000000.0], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.3 \cdot 10^{-165}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;y \leq 22500000000000:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t))))
(if (<= y -2.7e-135)
t_1
(if (<= y 2.7e+14)
(+ (* a b) (* z t))
(if (<= y 1.45e+163) (+ (* x y) (* a b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (z * t);
double tmp;
if (y <= -2.7e-135) {
tmp = t_1;
} else if (y <= 2.7e+14) {
tmp = (a * b) + (z * t);
} else if (y <= 1.45e+163) {
tmp = (x * y) + (a * b);
} 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 = (x * y) + (z * t)
if (y <= (-2.7d-135)) then
tmp = t_1
else if (y <= 2.7d+14) then
tmp = (a * b) + (z * t)
else if (y <= 1.45d+163) then
tmp = (x * y) + (a * b)
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 = (x * y) + (z * t);
double tmp;
if (y <= -2.7e-135) {
tmp = t_1;
} else if (y <= 2.7e+14) {
tmp = (a * b) + (z * t);
} else if (y <= 1.45e+163) {
tmp = (x * y) + (a * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (z * t) tmp = 0 if y <= -2.7e-135: tmp = t_1 elif y <= 2.7e+14: tmp = (a * b) + (z * t) elif y <= 1.45e+163: tmp = (x * y) + (a * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (y <= -2.7e-135) tmp = t_1; elseif (y <= 2.7e+14) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (y <= 1.45e+163) tmp = Float64(Float64(x * y) + Float64(a * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (z * t); tmp = 0.0; if (y <= -2.7e-135) tmp = t_1; elseif (y <= 2.7e+14) tmp = (a * b) + (z * t); elseif (y <= 1.45e+163) tmp = (x * y) + (a * b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e-135], t$95$1, If[LessEqual[y, 2.7e+14], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+163], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-135}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+14}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+163}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -5.1e+35) (not (<= (* c i) 4.2e+175))) (* 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 (((c * i) <= -5.1e+35) || !((c * i) <= 4.2e+175)) {
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 (((c * i) <= (-5.1d+35)) .or. (.not. ((c * i) <= 4.2d+175))) 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 (((c * i) <= -5.1e+35) || !((c * i) <= 4.2e+175)) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -5.1e+35) or not ((c * i) <= 4.2e+175): tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -5.1e+35) || !(Float64(c * i) <= 4.2e+175)) 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 (((c * i) <= -5.1e+35) || ~(((c * i) <= 4.2e+175))) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -5.1e+35], N[Not[LessEqual[N[(c * i), $MachinePrecision], 4.2e+175]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5.1 \cdot 10^{+35} \lor \neg \left(c \cdot i \leq 4.2 \cdot 10^{+175}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -2.5e-51) (not (<= y 2.56e+14))) (+ (* x y) (* a b)) (+ (* 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 ((y <= -2.5e-51) || !(y <= 2.56e+14)) {
tmp = (x * y) + (a * b);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((y <= (-2.5d-51)) .or. (.not. (y <= 2.56d+14))) then
tmp = (x * y) + (a * b)
else
tmp = (a * b) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -2.5e-51) || !(y <= 2.56e+14)) {
tmp = (x * y) + (a * b);
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -2.5e-51) or not (y <= 2.56e+14): tmp = (x * y) + (a * b) else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -2.5e-51) || !(y <= 2.56e+14)) tmp = Float64(Float64(x * y) + Float64(a * b)); else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((y <= -2.5e-51) || ~((y <= 2.56e+14))) tmp = (x * y) + (a * b); else tmp = (a * b) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -2.5e-51], N[Not[LessEqual[y, 2.56e+14]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-51} \lor \neg \left(y \leq 2.56 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= a -1.45e+90) (not (<= a 3.3e-157))) (* 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 <= -1.45e+90) || !(a <= 3.3e-157)) {
tmp = a * b;
} 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 ((a <= (-1.45d+90)) .or. (.not. (a <= 3.3d-157))) then
tmp = a * b
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 ((a <= -1.45e+90) || !(a <= 3.3e-157)) {
tmp = a * b;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a <= -1.45e+90) or not (a <= 3.3e-157): tmp = a * b else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((a <= -1.45e+90) || !(a <= 3.3e-157)) tmp = Float64(a * b); 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 ((a <= -1.45e+90) || ~((a <= 3.3e-157))) tmp = a * b; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[a, -1.45e+90], N[Not[LessEqual[a, 3.3e-157]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45 \cdot 10^{+90} \lor \neg \left(a \leq 3.3 \cdot 10^{-157}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
(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}
herbie shell --seed 2024008
(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)))