
(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 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in a around inf
*-lowering-*.f6461.1%
Simplified61.1%
Final simplification98.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* z (+ t (/ (* c i) z)))) (t_2 (+ (* a b) (* z t))))
(if (<= (* a b) -750000000000.0)
t_2
(if (<= (* a b) -3.1e-307)
t_1
(if (<= (* a b) 1.95e-272)
(+ (* x y) (* z t))
(if (<= (* a b) 3.2e-153)
(+ (* x y) (* c i))
(if (<= (* a b) 1.15e+59) 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 = z * (t + ((c * i) / z));
double t_2 = (a * b) + (z * t);
double tmp;
if ((a * b) <= -750000000000.0) {
tmp = t_2;
} else if ((a * b) <= -3.1e-307) {
tmp = t_1;
} else if ((a * b) <= 1.95e-272) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 3.2e-153) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 1.15e+59) {
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 = z * (t + ((c * i) / z))
t_2 = (a * b) + (z * t)
if ((a * b) <= (-750000000000.0d0)) then
tmp = t_2
else if ((a * b) <= (-3.1d-307)) then
tmp = t_1
else if ((a * b) <= 1.95d-272) then
tmp = (x * y) + (z * t)
else if ((a * b) <= 3.2d-153) then
tmp = (x * y) + (c * i)
else if ((a * b) <= 1.15d+59) 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 = z * (t + ((c * i) / z));
double t_2 = (a * b) + (z * t);
double tmp;
if ((a * b) <= -750000000000.0) {
tmp = t_2;
} else if ((a * b) <= -3.1e-307) {
tmp = t_1;
} else if ((a * b) <= 1.95e-272) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 3.2e-153) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 1.15e+59) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = z * (t + ((c * i) / z)) t_2 = (a * b) + (z * t) tmp = 0 if (a * b) <= -750000000000.0: tmp = t_2 elif (a * b) <= -3.1e-307: tmp = t_1 elif (a * b) <= 1.95e-272: tmp = (x * y) + (z * t) elif (a * b) <= 3.2e-153: tmp = (x * y) + (c * i) elif (a * b) <= 1.15e+59: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(z * Float64(t + Float64(Float64(c * i) / z))) t_2 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -750000000000.0) tmp = t_2; elseif (Float64(a * b) <= -3.1e-307) tmp = t_1; elseif (Float64(a * b) <= 1.95e-272) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(a * b) <= 3.2e-153) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(a * b) <= 1.15e+59) 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 = z * (t + ((c * i) / z)); t_2 = (a * b) + (z * t); tmp = 0.0; if ((a * b) <= -750000000000.0) tmp = t_2; elseif ((a * b) <= -3.1e-307) tmp = t_1; elseif ((a * b) <= 1.95e-272) tmp = (x * y) + (z * t); elseif ((a * b) <= 3.2e-153) tmp = (x * y) + (c * i); elseif ((a * b) <= 1.15e+59) 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[(z * N[(t + N[(N[(c * i), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -750000000000.0], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -3.1e-307], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.95e-272], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.2e-153], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.15e+59], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t + \frac{c \cdot i}{z}\right)\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -750000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \cdot b \leq -3.1 \cdot 10^{-307}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 1.95 \cdot 10^{-272}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 3.2 \cdot 10^{-153}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.15 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 a b) < -7.5e11 or 1.15000000000000004e59 < (*.f64 a b) Initial program 92.3%
Taylor expanded in c around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6487.7%
Simplified87.7%
Taylor expanded in a around inf
*-lowering-*.f6475.7%
Simplified75.7%
if -7.5e11 < (*.f64 a b) < -3.0999999999999998e-307 or 3.1999999999999999e-153 < (*.f64 a b) < 1.15000000000000004e59Initial program 98.9%
Taylor expanded in z around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
Simplified96.7%
Taylor expanded in c around inf
/-lowering-/.f64N/A
*-lowering-*.f6474.2%
Simplified74.2%
if -3.0999999999999998e-307 < (*.f64 a b) < 1.9499999999999999e-272Initial program 100.0%
Taylor expanded in c around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6476.3%
Simplified76.3%
Taylor expanded in a around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6476.3%
Simplified76.3%
if 1.9499999999999999e-272 < (*.f64 a b) < 3.1999999999999999e-153Initial program 93.7%
Taylor expanded in x around inf
*-lowering-*.f6491.0%
Simplified91.0%
Final simplification76.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* a b) -170000000.0)
t_1
(if (<= (* a b) -4.6e-305)
(+ (* c i) (* z t))
(if (<= (* a b) 5.2e-282)
(+ (* x y) (* z t))
(if (<= (* a b) 1.02e+108) (+ (* x y) (* c i)) 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) + (z * t);
double tmp;
if ((a * b) <= -170000000.0) {
tmp = t_1;
} else if ((a * b) <= -4.6e-305) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 5.2e-282) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 1.02e+108) {
tmp = (x * y) + (c * i);
} 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) + (z * t)
if ((a * b) <= (-170000000.0d0)) then
tmp = t_1
else if ((a * b) <= (-4.6d-305)) then
tmp = (c * i) + (z * t)
else if ((a * b) <= 5.2d-282) then
tmp = (x * y) + (z * t)
else if ((a * b) <= 1.02d+108) then
tmp = (x * y) + (c * i)
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) + (z * t);
double tmp;
if ((a * b) <= -170000000.0) {
tmp = t_1;
} else if ((a * b) <= -4.6e-305) {
tmp = (c * i) + (z * t);
} else if ((a * b) <= 5.2e-282) {
tmp = (x * y) + (z * t);
} else if ((a * b) <= 1.02e+108) {
tmp = (x * y) + (c * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (z * t) tmp = 0 if (a * b) <= -170000000.0: tmp = t_1 elif (a * b) <= -4.6e-305: tmp = (c * i) + (z * t) elif (a * b) <= 5.2e-282: tmp = (x * y) + (z * t) elif (a * b) <= 1.02e+108: tmp = (x * y) + (c * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(a * b) <= -170000000.0) tmp = t_1; elseif (Float64(a * b) <= -4.6e-305) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(a * b) <= 5.2e-282) tmp = Float64(Float64(x * y) + Float64(z * t)); elseif (Float64(a * b) <= 1.02e+108) tmp = Float64(Float64(x * y) + Float64(c * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (z * t); tmp = 0.0; if ((a * b) <= -170000000.0) tmp = t_1; elseif ((a * b) <= -4.6e-305) tmp = (c * i) + (z * t); elseif ((a * b) <= 5.2e-282) tmp = (x * y) + (z * t); elseif ((a * b) <= 1.02e+108) tmp = (x * y) + (c * i); 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -170000000.0], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -4.6e-305], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.2e-282], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.02e+108], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -170000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq -4.6 \cdot 10^{-305}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 5.2 \cdot 10^{-282}:\\
\;\;\;\;x \cdot y + z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.02 \cdot 10^{+108}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.7e8 or 1.02e108 < (*.f64 a b) Initial program 91.7%
Taylor expanded in c around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6487.7%
Simplified87.7%
Taylor expanded in a around inf
*-lowering-*.f6477.8%
Simplified77.8%
if -1.7e8 < (*.f64 a b) < -4.5999999999999999e-305Initial program 98.0%
Taylor expanded in z around inf
*-lowering-*.f6478.0%
Simplified78.0%
if -4.5999999999999999e-305 < (*.f64 a b) < 5.20000000000000025e-282Initial program 100.0%
Taylor expanded in c around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6476.3%
Simplified76.3%
Taylor expanded in a around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6476.3%
Simplified76.3%
if 5.20000000000000025e-282 < (*.f64 a b) < 1.02e108Initial program 98.4%
Taylor expanded in x around inf
*-lowering-*.f6469.9%
Simplified69.9%
Final simplification75.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* c i))))
(if (<= (* c i) -720000000.0)
t_1
(if (<= (* c i) 850000000000.0)
(+ (* a b) (* z t))
(if (<= (* c i) 9.6e+74) t_1 (+ (* c i) (* z t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (c * i);
double tmp;
if ((c * i) <= -720000000.0) {
tmp = t_1;
} else if ((c * i) <= 850000000000.0) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 9.6e+74) {
tmp = t_1;
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (c * i)
if ((c * i) <= (-720000000.0d0)) then
tmp = t_1
else if ((c * i) <= 850000000000.0d0) then
tmp = (a * b) + (z * t)
else if ((c * i) <= 9.6d+74) then
tmp = t_1
else
tmp = (c * i) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (c * i);
double tmp;
if ((c * i) <= -720000000.0) {
tmp = t_1;
} else if ((c * i) <= 850000000000.0) {
tmp = (a * b) + (z * t);
} else if ((c * i) <= 9.6e+74) {
tmp = t_1;
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (c * i) tmp = 0 if (c * i) <= -720000000.0: tmp = t_1 elif (c * i) <= 850000000000.0: tmp = (a * b) + (z * t) elif (c * i) <= 9.6e+74: tmp = t_1 else: tmp = (c * i) + (z * t) 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) <= -720000000.0) tmp = t_1; elseif (Float64(c * i) <= 850000000000.0) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(c * i) <= 9.6e+74) tmp = t_1; else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (c * i); tmp = 0.0; if ((c * i) <= -720000000.0) tmp = t_1; elseif ((c * i) <= 850000000000.0) tmp = (a * b) + (z * t); elseif ((c * i) <= 9.6e+74) tmp = t_1; else tmp = (c * i) + (z * t); 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], -720000000.0], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 850000000000.0], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 9.6e+74], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -720000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 850000000000:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;c \cdot i \leq 9.6 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -7.2e8 or 8.5e11 < (*.f64 c i) < 9.60000000000000034e74Initial program 94.3%
Taylor expanded in x around inf
*-lowering-*.f6473.4%
Simplified73.4%
if -7.2e8 < (*.f64 c i) < 8.5e11Initial program 97.8%
Taylor expanded in c around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.3%
Simplified96.3%
Taylor expanded in a around inf
*-lowering-*.f6471.8%
Simplified71.8%
if 9.60000000000000034e74 < (*.f64 c i) Initial program 93.8%
Taylor expanded in z around inf
*-lowering-*.f6478.9%
Simplified78.9%
Final simplification73.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -2.1e+132)
(+ (* x y) (* c i))
(if (<= (* c i) 3e+81)
(+ (* z t) (+ (* x y) (* a b)))
(+ (* c i) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -2.1e+132) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 3e+81) {
tmp = (z * t) + ((x * y) + (a * b));
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-2.1d+132)) then
tmp = (x * y) + (c * i)
else if ((c * i) <= 3d+81) then
tmp = (z * t) + ((x * y) + (a * b))
else
tmp = (c * i) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -2.1e+132) {
tmp = (x * y) + (c * i);
} else if ((c * i) <= 3e+81) {
tmp = (z * t) + ((x * y) + (a * b));
} else {
tmp = (c * i) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -2.1e+132: tmp = (x * y) + (c * i) elif (c * i) <= 3e+81: tmp = (z * t) + ((x * y) + (a * b)) else: tmp = (c * i) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -2.1e+132) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(c * i) <= 3e+81) tmp = Float64(Float64(z * t) + Float64(Float64(x * y) + Float64(a * b))); else tmp = Float64(Float64(c * i) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((c * i) <= -2.1e+132) tmp = (x * y) + (c * i); elseif ((c * i) <= 3e+81) tmp = (z * t) + ((x * y) + (a * b)); else tmp = (c * i) + (z * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -2.1e+132], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3e+81], N[(N[(z * t), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.1 \cdot 10^{+132}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 3 \cdot 10^{+81}:\\
\;\;\;\;z \cdot t + \left(x \cdot y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -2.09999999999999993e132Initial program 91.8%
Taylor expanded in x around inf
*-lowering-*.f6478.8%
Simplified78.8%
if -2.09999999999999993e132 < (*.f64 c i) < 2.99999999999999997e81Initial program 97.7%
Taylor expanded in c around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6491.1%
Simplified91.1%
if 2.99999999999999997e81 < (*.f64 c i) Initial program 93.5%
Taylor expanded in z around inf
*-lowering-*.f6480.1%
Simplified80.1%
Final simplification87.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -4.8e+36)
(* a b)
(if (<= (* a b) 2.3e-284)
(* z t)
(if (<= (* a b) 3.7e+99) (* 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) <= -4.8e+36) {
tmp = a * b;
} else if ((a * b) <= 2.3e-284) {
tmp = z * t;
} else if ((a * b) <= 3.7e+99) {
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) <= (-4.8d+36)) then
tmp = a * b
else if ((a * b) <= 2.3d-284) then
tmp = z * t
else if ((a * b) <= 3.7d+99) 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) <= -4.8e+36) {
tmp = a * b;
} else if ((a * b) <= 2.3e-284) {
tmp = z * t;
} else if ((a * b) <= 3.7e+99) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -4.8e+36: tmp = a * b elif (a * b) <= 2.3e-284: tmp = z * t elif (a * b) <= 3.7e+99: 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) <= -4.8e+36) tmp = Float64(a * b); elseif (Float64(a * b) <= 2.3e-284) tmp = Float64(z * t); elseif (Float64(a * b) <= 3.7e+99) 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) <= -4.8e+36) tmp = a * b; elseif ((a * b) <= 2.3e-284) tmp = z * t; elseif ((a * b) <= 3.7e+99) 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], -4.8e+36], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.3e-284], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 3.7e+99], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4.8 \cdot 10^{+36}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 2.3 \cdot 10^{-284}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 3.7 \cdot 10^{+99}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -4.79999999999999985e36 or 3.7000000000000001e99 < (*.f64 a b) Initial program 91.5%
Taylor expanded in a around inf
*-lowering-*.f6466.8%
Simplified66.8%
if -4.79999999999999985e36 < (*.f64 a b) < 2.3e-284Initial program 99.0%
Taylor expanded in z around inf
*-lowering-*.f6443.6%
Simplified43.6%
if 2.3e-284 < (*.f64 a b) < 3.7000000000000001e99Initial program 98.3%
Taylor expanded in c around inf
*-lowering-*.f6444.0%
Simplified44.0%
Final simplification52.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* z t))))
(if (<= (* a b) -46000000000.0)
t_1
(if (<= (* a b) 1.55e+69) (+ (* 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) + (z * t);
double tmp;
if ((a * b) <= -46000000000.0) {
tmp = t_1;
} else if ((a * b) <= 1.55e+69) {
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) + (z * t)
if ((a * b) <= (-46000000000.0d0)) then
tmp = t_1
else if ((a * b) <= 1.55d+69) 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) + (z * t);
double tmp;
if ((a * b) <= -46000000000.0) {
tmp = t_1;
} else if ((a * b) <= 1.55e+69) {
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) + (z * t) tmp = 0 if (a * b) <= -46000000000.0: tmp = t_1 elif (a * b) <= 1.55e+69: 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(z * t)) tmp = 0.0 if (Float64(a * b) <= -46000000000.0) tmp = t_1; elseif (Float64(a * b) <= 1.55e+69) 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) + (z * t); tmp = 0.0; if ((a * b) <= -46000000000.0) tmp = t_1; elseif ((a * b) <= 1.55e+69) 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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -46000000000.0], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.55e+69], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -46000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 1.55 \cdot 10^{+69}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -4.6e10 or 1.5499999999999999e69 < (*.f64 a b) Initial program 92.3%
Taylor expanded in c around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6487.7%
Simplified87.7%
Taylor expanded in a around inf
*-lowering-*.f6475.7%
Simplified75.7%
if -4.6e10 < (*.f64 a b) < 1.5499999999999999e69Initial program 98.7%
Taylor expanded in z around inf
*-lowering-*.f6468.3%
Simplified68.3%
Final simplification71.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -2.25e+136) (* c i) (if (<= (* c i) 3e+217) (+ (* a b) (* 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) <= -2.25e+136) {
tmp = c * i;
} else if ((c * i) <= 3e+217) {
tmp = (a * b) + (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) <= (-2.25d+136)) then
tmp = c * i
else if ((c * i) <= 3d+217) then
tmp = (a * b) + (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) <= -2.25e+136) {
tmp = c * i;
} else if ((c * i) <= 3e+217) {
tmp = (a * b) + (z * t);
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -2.25e+136: tmp = c * i elif (c * i) <= 3e+217: tmp = (a * b) + (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) <= -2.25e+136) tmp = Float64(c * i); elseif (Float64(c * i) <= 3e+217) tmp = Float64(Float64(a * b) + 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) <= -2.25e+136) tmp = c * i; elseif ((c * i) <= 3e+217) tmp = (a * b) + (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], -2.25e+136], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3e+217], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.25 \cdot 10^{+136}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 3 \cdot 10^{+217}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -2.25e136 or 2.99999999999999976e217 < (*.f64 c i) Initial program 91.9%
Taylor expanded in c around inf
*-lowering-*.f6476.2%
Simplified76.2%
if -2.25e136 < (*.f64 c i) < 2.99999999999999976e217Initial program 97.4%
Taylor expanded in c around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6488.1%
Simplified88.1%
Taylor expanded in a around inf
*-lowering-*.f6463.1%
Simplified63.1%
Final simplification66.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -980000000000.0) (* a b) (if (<= (* a b) 1.15e+99) (* 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) <= -980000000000.0) {
tmp = a * b;
} else if ((a * b) <= 1.15e+99) {
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) <= (-980000000000.0d0)) then
tmp = a * b
else if ((a * b) <= 1.15d+99) 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) <= -980000000000.0) {
tmp = a * b;
} else if ((a * b) <= 1.15e+99) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -980000000000.0: tmp = a * b elif (a * b) <= 1.15e+99: 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) <= -980000000000.0) tmp = Float64(a * b); elseif (Float64(a * b) <= 1.15e+99) 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) <= -980000000000.0) tmp = a * b; elseif ((a * b) <= 1.15e+99) 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], -980000000000.0], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.15e+99], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -980000000000:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 1.15 \cdot 10^{+99}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -9.8e11 or 1.1500000000000001e99 < (*.f64 a b) Initial program 92.0%
Taylor expanded in a around inf
*-lowering-*.f6464.9%
Simplified64.9%
if -9.8e11 < (*.f64 a b) < 1.1500000000000001e99Initial program 98.7%
Taylor expanded in c around inf
*-lowering-*.f6436.2%
Simplified36.2%
(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.1%
Taylor expanded in a around inf
*-lowering-*.f6428.7%
Simplified28.7%
herbie shell --seed 2024158
(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)))