
(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 10 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 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))) (if (<= t_1 INFINITY) t_1 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((x * y) + (z * t)) + (a * b)) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * t;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((x * y) + (z * t)) + (a * b)) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (((x * y) + (z * t)) + (a * b)) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (((x * y) + (z * t)) + (a * b)) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in z around inf
*-lowering-*.f6454.7%
Simplified54.7%
Final simplification98.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2.05e+169)
(* x y)
(if (<= (* x y) -2.45e+76)
(* c i)
(if (<= (* x y) 2.2e-294)
(* z t)
(if (<= (* x y) 1.15e-122)
(* a b)
(if (<= (* x y) 4.5e+192) (* 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) <= -2.05e+169) {
tmp = x * y;
} else if ((x * y) <= -2.45e+76) {
tmp = c * i;
} else if ((x * y) <= 2.2e-294) {
tmp = z * t;
} else if ((x * y) <= 1.15e-122) {
tmp = a * b;
} else if ((x * y) <= 4.5e+192) {
tmp = 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) <= (-2.05d+169)) then
tmp = x * y
else if ((x * y) <= (-2.45d+76)) then
tmp = c * i
else if ((x * y) <= 2.2d-294) then
tmp = z * t
else if ((x * y) <= 1.15d-122) then
tmp = a * b
else if ((x * y) <= 4.5d+192) then
tmp = 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) <= -2.05e+169) {
tmp = x * y;
} else if ((x * y) <= -2.45e+76) {
tmp = c * i;
} else if ((x * y) <= 2.2e-294) {
tmp = z * t;
} else if ((x * y) <= 1.15e-122) {
tmp = a * b;
} else if ((x * y) <= 4.5e+192) {
tmp = c * i;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2.05e+169: tmp = x * y elif (x * y) <= -2.45e+76: tmp = c * i elif (x * y) <= 2.2e-294: tmp = z * t elif (x * y) <= 1.15e-122: tmp = a * b elif (x * y) <= 4.5e+192: tmp = 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) <= -2.05e+169) tmp = Float64(x * y); elseif (Float64(x * y) <= -2.45e+76) tmp = Float64(c * i); elseif (Float64(x * y) <= 2.2e-294) tmp = Float64(z * t); elseif (Float64(x * y) <= 1.15e-122) tmp = Float64(a * b); elseif (Float64(x * y) <= 4.5e+192) tmp = 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) <= -2.05e+169) tmp = x * y; elseif ((x * y) <= -2.45e+76) tmp = c * i; elseif ((x * y) <= 2.2e-294) tmp = z * t; elseif ((x * y) <= 1.15e-122) tmp = a * b; elseif ((x * y) <= 4.5e+192) tmp = 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], -2.05e+169], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.45e+76], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-294], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.15e-122], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.5e+192], N[(c * i), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.05 \cdot 10^{+169}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -2.45 \cdot 10^{+76}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-294}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{-122}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+192}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -2.0500000000000002e169 or 4.5e192 < (*.f64 x y) Initial program 90.6%
Taylor expanded in x around inf
*-lowering-*.f6480.8%
Simplified80.8%
if -2.0500000000000002e169 < (*.f64 x y) < -2.45000000000000013e76 or 1.15000000000000003e-122 < (*.f64 x y) < 4.5e192Initial program 96.0%
Taylor expanded in c around inf
*-lowering-*.f6446.7%
Simplified46.7%
if -2.45000000000000013e76 < (*.f64 x y) < 2.2e-294Initial program 97.8%
Taylor expanded in z around inf
*-lowering-*.f6445.0%
Simplified45.0%
if 2.2e-294 < (*.f64 x y) < 1.15000000000000003e-122Initial program 100.0%
Taylor expanded in a around inf
*-lowering-*.f6457.2%
Simplified57.2%
Final simplification55.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* a b))) (t_2 (+ (* a b) (* c i))))
(if (<= (* c i) -1.25e+123)
t_2
(if (<= (* c i) -2.35e-7)
t_1
(if (<= (* c i) 1.35e-75)
(+ (* a b) (* z t))
(if (<= (* c i) 8.6e+140) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (a * b);
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.25e+123) {
tmp = t_2;
} else if ((c * i) <= -2.35e-7) {
tmp = t_1;
} else if ((c * i) <= 1.35e-75) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 8.6e+140) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * y) + (a * b)
t_2 = (a * b) + (c * i)
if ((c * i) <= (-1.25d+123)) then
tmp = t_2
else if ((c * i) <= (-2.35d-7)) then
tmp = t_1
else if ((c * i) <= 1.35d-75) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 8.6d+140) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (a * b);
double t_2 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -1.25e+123) {
tmp = t_2;
} else if ((c * i) <= -2.35e-7) {
tmp = t_1;
} else if ((c * i) <= 1.35e-75) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 8.6e+140) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (a * b) t_2 = (a * b) + (c * i) tmp = 0 if (c * i) <= -1.25e+123: tmp = t_2 elif (c * i) <= -2.35e-7: tmp = t_1 elif (c * i) <= 1.35e-75: tmp = (a * b) + (z * t) elif (c * i) <= 8.6e+140: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(a * b)) t_2 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -1.25e+123) tmp = t_2; elseif (Float64(c * i) <= -2.35e-7) tmp = t_1; elseif (Float64(c * i) <= 1.35e-75) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 8.6e+140) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (a * b); t_2 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -1.25e+123) tmp = t_2; elseif ((c * i) <= -2.35e-7) tmp = t_1; elseif ((c * i) <= 1.35e-75) tmp = (a * b) + (z * t); elseif ((c * i) <= 8.6e+140) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.25e+123], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -2.35e-7], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.35e-75], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 8.6e+140], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
t_2 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -1.25 \cdot 10^{+123}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq -2.35 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 1.35 \cdot 10^{-75}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 8.6 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 c i) < -1.24999999999999994e123 or 8.60000000000000004e140 < (*.f64 c i) Initial program 88.3%
Taylor expanded in a around inf
*-lowering-*.f6478.5%
Simplified78.5%
if -1.24999999999999994e123 < (*.f64 c i) < -2.35e-7 or 1.3499999999999999e-75 < (*.f64 c i) < 8.60000000000000004e140Initial program 100.0%
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-*.f6487.3%
Simplified87.3%
Taylor expanded in a around inf
*-lowering-*.f6473.1%
Simplified73.1%
if -2.35e-7 < (*.f64 c i) < 1.3499999999999999e-75Initial program 98.3%
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-*.f6496.6%
Simplified96.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6474.0%
Simplified74.0%
Final simplification75.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -1.6e+107)
(* c i)
(if (<= (* c i) -3.2e-234)
(* a b)
(if (<= (* c i) 8e-300)
(* z t)
(if (<= (* c i) 1e+79) (* 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) <= -1.6e+107) {
tmp = c * i;
} else if ((c * i) <= -3.2e-234) {
tmp = a * b;
} else if ((c * i) <= 8e-300) {
tmp = z * t;
} else if ((c * i) <= 1e+79) {
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) <= (-1.6d+107)) then
tmp = c * i
else if ((c * i) <= (-3.2d-234)) then
tmp = a * b
else if ((c * i) <= 8d-300) then
tmp = z * t
else if ((c * i) <= 1d+79) 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) <= -1.6e+107) {
tmp = c * i;
} else if ((c * i) <= -3.2e-234) {
tmp = a * b;
} else if ((c * i) <= 8e-300) {
tmp = z * t;
} else if ((c * i) <= 1e+79) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.6e+107: tmp = c * i elif (c * i) <= -3.2e-234: tmp = a * b elif (c * i) <= 8e-300: tmp = z * t elif (c * i) <= 1e+79: 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) <= -1.6e+107) tmp = Float64(c * i); elseif (Float64(c * i) <= -3.2e-234) tmp = Float64(a * b); elseif (Float64(c * i) <= 8e-300) tmp = Float64(z * t); elseif (Float64(c * i) <= 1e+79) 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) <= -1.6e+107) tmp = c * i; elseif ((c * i) <= -3.2e-234) tmp = a * b; elseif ((c * i) <= 8e-300) tmp = z * t; elseif ((c * i) <= 1e+79) 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], -1.6e+107], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -3.2e-234], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 8e-300], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1e+79], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.6 \cdot 10^{+107}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq -3.2 \cdot 10^{-234}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 8 \cdot 10^{-300}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 10^{+79}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.60000000000000015e107 or 9.99999999999999967e78 < (*.f64 c i) Initial program 90.0%
Taylor expanded in c around inf
*-lowering-*.f6468.9%
Simplified68.9%
if -1.60000000000000015e107 < (*.f64 c i) < -3.1999999999999999e-234 or 8.0000000000000002e-300 < (*.f64 c i) < 9.99999999999999967e78Initial program 99.1%
Taylor expanded in a around inf
*-lowering-*.f6439.5%
Simplified39.5%
if -3.1999999999999999e-234 < (*.f64 c i) < 8.0000000000000002e-300Initial program 98.1%
Taylor expanded in z around inf
*-lowering-*.f6446.0%
Simplified46.0%
Final simplification51.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* c i))))
(if (<= (* c i) -2.7e+111)
t_1
(if (<= (* c i) -0.32)
(+ (* x y) (* a b))
(if (<= (* c i) 8.2e-51) (+ (* 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) + (c * i);
double tmp;
if ((c * i) <= -2.7e+111) {
tmp = t_1;
} else if ((c * i) <= -0.32) {
tmp = (x * y) + (a * b);
} else if ((c * i) <= 8.2e-51) {
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) + (c * i)
if ((c * i) <= (-2.7d+111)) then
tmp = t_1
else if ((c * i) <= (-0.32d0)) then
tmp = (x * y) + (a * b)
else if ((c * i) <= 8.2d-51) 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) + (c * i);
double tmp;
if ((c * i) <= -2.7e+111) {
tmp = t_1;
} else if ((c * i) <= -0.32) {
tmp = (x * y) + (a * b);
} else if ((c * i) <= 8.2e-51) {
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) + (c * i) tmp = 0 if (c * i) <= -2.7e+111: tmp = t_1 elif (c * i) <= -0.32: tmp = (x * y) + (a * b) elif (c * i) <= 8.2e-51: 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(c * i)) tmp = 0.0 if (Float64(c * i) <= -2.7e+111) tmp = t_1; elseif (Float64(c * i) <= -0.32) tmp = Float64(Float64(x * y) + Float64(a * b)); elseif (Float64(c * i) <= 8.2e-51) 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) + (c * i); tmp = 0.0; if ((c * i) <= -2.7e+111) tmp = t_1; elseif ((c * i) <= -0.32) tmp = (x * y) + (a * b); elseif ((c * i) <= 8.2e-51) 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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2.7e+111], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -0.32], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 8.2e-51], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -2.7 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq -0.32:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{elif}\;c \cdot i \leq 8.2 \cdot 10^{-51}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -2.6999999999999999e111 or 8.19999999999999947e-51 < (*.f64 c i) Initial program 92.0%
Taylor expanded in x around inf
*-lowering-*.f6478.3%
Simplified78.3%
if -2.6999999999999999e111 < (*.f64 c i) < -0.320000000000000007Initial program 100.0%
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-*.f6493.7%
Simplified93.7%
Taylor expanded in a around inf
*-lowering-*.f6481.0%
Simplified81.0%
if -0.320000000000000007 < (*.f64 c i) < 8.19999999999999947e-51Initial program 98.3%
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-*.f6496.8%
Simplified96.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6474.2%
Simplified74.2%
Final simplification76.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* c i))))
(if (<= (* c i) -2.8e+131)
t_1
(if (<= (* c i) 5.6e+108) (+ (* 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 = (x * y) + (c * i);
double tmp;
if ((c * i) <= -2.8e+131) {
tmp = t_1;
} else if ((c * i) <= 5.6e+108) {
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 = (x * y) + (c * i)
if ((c * i) <= (-2.8d+131)) then
tmp = t_1
else if ((c * i) <= 5.6d+108) 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 = (x * y) + (c * i);
double tmp;
if ((c * i) <= -2.8e+131) {
tmp = t_1;
} else if ((c * i) <= 5.6e+108) {
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 = (x * y) + (c * i) tmp = 0 if (c * i) <= -2.8e+131: tmp = t_1 elif (c * i) <= 5.6e+108: 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(x * y) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -2.8e+131) tmp = t_1; elseif (Float64(c * i) <= 5.6e+108) 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 = (x * y) + (c * i); tmp = 0.0; if ((c * i) <= -2.8e+131) tmp = t_1; elseif ((c * i) <= 5.6e+108) 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[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2.8e+131], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 5.6e+108], 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 := x \cdot y + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -2.8 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 5.6 \cdot 10^{+108}:\\
\;\;\;\;x \cdot y + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -2.8000000000000001e131 or 5.5999999999999996e108 < (*.f64 c i) Initial program 88.8%
Taylor expanded in x around inf
*-lowering-*.f6485.6%
Simplified85.6%
if -2.8000000000000001e131 < (*.f64 c i) < 5.5999999999999996e108Initial program 98.9%
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-*.f6493.7%
Simplified93.7%
Final simplification91.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* c i) -6e+92)
t_1
(if (<= (* c i) 4.5e+29) (+ (* 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 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -6e+92) {
tmp = t_1;
} else if ((c * i) <= 4.5e+29) {
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 = (a * b) + (c * i)
if ((c * i) <= (-6d+92)) then
tmp = t_1
else if ((c * i) <= 4.5d+29) 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 = (a * b) + (c * i);
double tmp;
if ((c * i) <= -6e+92) {
tmp = t_1;
} else if ((c * i) <= 4.5e+29) {
tmp = (a * b) + (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 (c * i) <= -6e+92: tmp = t_1 elif (c * i) <= 4.5e+29: 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(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(c * i) <= -6e+92) tmp = t_1; elseif (Float64(c * i) <= 4.5e+29) 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 = (a * b) + (c * i); tmp = 0.0; if ((c * i) <= -6e+92) tmp = t_1; elseif ((c * i) <= 4.5e+29) 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[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -6e+92], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 4.5e+29], N[(N[(a * b), $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}\;c \cdot i \leq -6 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 4.5 \cdot 10^{+29}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -6.00000000000000026e92 or 4.5000000000000002e29 < (*.f64 c i) Initial program 91.0%
Taylor expanded in a around inf
*-lowering-*.f6470.8%
Simplified70.8%
if -6.00000000000000026e92 < (*.f64 c i) < 4.5000000000000002e29Initial program 98.7%
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-*.f6495.4%
Simplified95.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6469.1%
Simplified69.1%
Final simplification69.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* x y) -6.4e+177) (* x y) (if (<= (* x y) 2.1e+193) (+ (* 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) <= -6.4e+177) {
tmp = x * y;
} else if ((x * y) <= 2.1e+193) {
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) <= (-6.4d+177)) then
tmp = x * y
else if ((x * y) <= 2.1d+193) 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) <= -6.4e+177) {
tmp = x * y;
} else if ((x * y) <= 2.1e+193) {
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) <= -6.4e+177: tmp = x * y elif (x * y) <= 2.1e+193: 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) <= -6.4e+177) tmp = Float64(x * y); elseif (Float64(x * y) <= 2.1e+193) 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) <= -6.4e+177) tmp = x * y; elseif ((x * y) <= 2.1e+193) 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], -6.4e+177], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.1e+193], 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 -6.4 \cdot 10^{+177}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+193}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -6.4e177 or 2.1e193 < (*.f64 x y) Initial program 90.6%
Taylor expanded in x around inf
*-lowering-*.f6480.8%
Simplified80.8%
if -6.4e177 < (*.f64 x y) < 2.1e193Initial program 97.4%
Taylor expanded in a around inf
*-lowering-*.f6463.1%
Simplified63.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -3.7e+108) (* c i) (if (<= (* c i) 2e+80) (* 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) <= -3.7e+108) {
tmp = c * i;
} else if ((c * i) <= 2e+80) {
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) <= (-3.7d+108)) then
tmp = c * i
else if ((c * i) <= 2d+80) 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) <= -3.7e+108) {
tmp = c * i;
} else if ((c * i) <= 2e+80) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -3.7e+108: tmp = c * i elif (c * i) <= 2e+80: 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) <= -3.7e+108) tmp = Float64(c * i); elseif (Float64(c * i) <= 2e+80) 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) <= -3.7e+108) tmp = c * i; elseif ((c * i) <= 2e+80) 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], -3.7e+108], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2e+80], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.7 \cdot 10^{+108}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+80}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -3.6999999999999998e108 or 2e80 < (*.f64 c i) Initial program 90.0%
Taylor expanded in c around inf
*-lowering-*.f6468.9%
Simplified68.9%
if -3.6999999999999998e108 < (*.f64 c i) < 2e80Initial program 98.8%
Taylor expanded in a around inf
*-lowering-*.f6436.4%
Simplified36.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.7%
Taylor expanded in a around inf
*-lowering-*.f6427.0%
Simplified27.0%
herbie shell --seed 2024191
(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)))