
(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 (let* ((t_1 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))) (if (<= t_1 INFINITY) t_1 (fma a b (* c i)))))
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 = fma(a, b, (c * i));
}
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 = fma(a, b, Float64(c * i)); end return 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[(a * b + N[(c * i), $MachinePrecision]), $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}:\\
\;\;\;\;\mathsf{fma}\left(a, b, c \cdot i\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in z around 0 25.0%
Taylor expanded in x around 0 62.5%
fma-def87.5%
Simplified87.5%
Final simplification99.6%
(FPCore (x y z t a b c i) :precision binary64 (fma a b (fma x y (fma c i (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(a, b, fma(x, y, fma(c, i, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(a, b, fma(x, y, fma(c, i, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b + N[(x * y + N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, z \cdot t\right)\right)\right)
\end{array}
Initial program 96.9%
+-commutative96.9%
associate-+l+96.9%
fma-def97.7%
associate-+l+97.7%
fma-def98.4%
+-commutative98.4%
fma-def98.4%
Simplified98.4%
Final simplification98.4%
(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 (* c i))))
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 = c * i;
}
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 = c * i;
}
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 = c * i 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(c * i); 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 = c * i; 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[(c * i), $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}:\\
\;\;\;\;c \cdot i\\
\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 c around inf 62.7%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))) (t_2 (+ (* a b) (* z t))))
(if (<= (* x y) -8.5e+293)
(* x y)
(if (<= (* x y) -3.2e-100)
t_1
(if (<= (* x y) 1.55e-246)
t_2
(if (<= (* x y) 3.5e-21)
t_1
(if (<= (* x y) 3.1e+156) 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) + (c * i);
double t_2 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -8.5e+293) {
tmp = x * y;
} else if ((x * y) <= -3.2e-100) {
tmp = t_1;
} else if ((x * y) <= 1.55e-246) {
tmp = t_2;
} else if ((x * y) <= 3.5e-21) {
tmp = t_1;
} else if ((x * y) <= 3.1e+156) {
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) + (c * i)
t_2 = (a * b) + (z * t)
if ((x * y) <= (-8.5d+293)) then
tmp = x * y
else if ((x * y) <= (-3.2d-100)) then
tmp = t_1
else if ((x * y) <= 1.55d-246) then
tmp = t_2
else if ((x * y) <= 3.5d-21) then
tmp = t_1
else if ((x * y) <= 3.1d+156) 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) + (c * i);
double t_2 = (a * b) + (z * t);
double tmp;
if ((x * y) <= -8.5e+293) {
tmp = x * y;
} else if ((x * y) <= -3.2e-100) {
tmp = t_1;
} else if ((x * y) <= 1.55e-246) {
tmp = t_2;
} else if ((x * y) <= 3.5e-21) {
tmp = t_1;
} else if ((x * y) <= 3.1e+156) {
tmp = t_2;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) t_2 = (a * b) + (z * t) tmp = 0 if (x * y) <= -8.5e+293: tmp = x * y elif (x * y) <= -3.2e-100: tmp = t_1 elif (x * y) <= 1.55e-246: tmp = t_2 elif (x * y) <= 3.5e-21: tmp = t_1 elif (x * y) <= 3.1e+156: 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(c * i)) t_2 = Float64(Float64(a * b) + Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -8.5e+293) tmp = Float64(x * y); elseif (Float64(x * y) <= -3.2e-100) tmp = t_1; elseif (Float64(x * y) <= 1.55e-246) tmp = t_2; elseif (Float64(x * y) <= 3.5e-21) tmp = t_1; elseif (Float64(x * y) <= 3.1e+156) 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) + (c * i); t_2 = (a * b) + (z * t); tmp = 0.0; if ((x * y) <= -8.5e+293) tmp = x * y; elseif ((x * y) <= -3.2e-100) tmp = t_1; elseif ((x * y) <= 1.55e-246) tmp = t_2; elseif ((x * y) <= 3.5e-21) tmp = t_1; elseif ((x * y) <= 3.1e+156) 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[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+293], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.2e-100], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.55e-246], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 3.5e-21], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.1e+156], t$95$2, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+293}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -3.2 \cdot 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{-246}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{-21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 3.1 \cdot 10^{+156}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.5000000000000001e293 or 3.1000000000000002e156 < (*.f64 x y) Initial program 93.4%
Taylor expanded in x around inf 77.6%
if -8.5000000000000001e293 < (*.f64 x y) < -3.20000000000000017e-100 or 1.55e-246 < (*.f64 x y) < 3.5000000000000003e-21Initial program 97.9%
Taylor expanded in z around 0 83.7%
Taylor expanded in x around 0 71.2%
if -3.20000000000000017e-100 < (*.f64 x y) < 1.55e-246 or 3.5000000000000003e-21 < (*.f64 x y) < 3.1000000000000002e156Initial program 98.0%
Taylor expanded in x around 0 90.6%
fma-def91.6%
fma-def91.6%
Simplified91.6%
Taylor expanded in c around 0 72.0%
Final simplification73.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i)))
(t_2 (+ (* a b) (* z t)))
(t_3 (+ (* x y) (* a b))))
(if (<= (* x y) -2.3e+84)
t_3
(if (<= (* x y) -3.05e-100)
t_1
(if (<= (* x y) 1e-246)
t_2
(if (<= (* x y) 3.9e-22) t_1 (if (<= (* x y) 4.1e+36) t_2 t_3)))))))
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 t_2 = (a * b) + (z * t);
double t_3 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -2.3e+84) {
tmp = t_3;
} else if ((x * y) <= -3.05e-100) {
tmp = t_1;
} else if ((x * y) <= 1e-246) {
tmp = t_2;
} else if ((x * y) <= 3.9e-22) {
tmp = t_1;
} else if ((x * y) <= 4.1e+36) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (a * b) + (c * i)
t_2 = (a * b) + (z * t)
t_3 = (x * y) + (a * b)
if ((x * y) <= (-2.3d+84)) then
tmp = t_3
else if ((x * y) <= (-3.05d-100)) then
tmp = t_1
else if ((x * y) <= 1d-246) then
tmp = t_2
else if ((x * y) <= 3.9d-22) then
tmp = t_1
else if ((x * y) <= 4.1d+36) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double t_2 = (a * b) + (z * t);
double t_3 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -2.3e+84) {
tmp = t_3;
} else if ((x * y) <= -3.05e-100) {
tmp = t_1;
} else if ((x * y) <= 1e-246) {
tmp = t_2;
} else if ((x * y) <= 3.9e-22) {
tmp = t_1;
} else if ((x * y) <= 4.1e+36) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) t_2 = (a * b) + (z * t) t_3 = (x * y) + (a * b) tmp = 0 if (x * y) <= -2.3e+84: tmp = t_3 elif (x * y) <= -3.05e-100: tmp = t_1 elif (x * y) <= 1e-246: tmp = t_2 elif (x * y) <= 3.9e-22: tmp = t_1 elif (x * y) <= 4.1e+36: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) t_2 = Float64(Float64(a * b) + Float64(z * t)) t_3 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(x * y) <= -2.3e+84) tmp = t_3; elseif (Float64(x * y) <= -3.05e-100) tmp = t_1; elseif (Float64(x * y) <= 1e-246) tmp = t_2; elseif (Float64(x * y) <= 3.9e-22) tmp = t_1; elseif (Float64(x * y) <= 4.1e+36) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); t_2 = (a * b) + (z * t); t_3 = (x * y) + (a * b); tmp = 0.0; if ((x * y) <= -2.3e+84) tmp = t_3; elseif ((x * y) <= -3.05e-100) tmp = t_1; elseif ((x * y) <= 1e-246) tmp = t_2; elseif ((x * y) <= 3.9e-22) tmp = t_1; elseif ((x * y) <= 4.1e+36) tmp = t_2; else tmp = t_3; 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]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.3e+84], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -3.05e-100], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-246], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 3.9e-22], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.1e+36], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
t_2 := a \cdot b + z \cdot t\\
t_3 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -2.3 \cdot 10^{+84}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \cdot y \leq -3.05 \cdot 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-246}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot y \leq 3.9 \cdot 10^{-22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{+36}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 x y) < -2.2999999999999999e84 or 4.10000000000000013e36 < (*.f64 x y) Initial program 96.3%
Taylor expanded in z around 0 84.6%
Taylor expanded in c around 0 74.4%
if -2.2999999999999999e84 < (*.f64 x y) < -3.05e-100 or 9.99999999999999956e-247 < (*.f64 x y) < 3.89999999999999998e-22Initial program 96.9%
Taylor expanded in z around 0 83.2%
Taylor expanded in x around 0 80.3%
if -3.05e-100 < (*.f64 x y) < 9.99999999999999956e-247 or 3.89999999999999998e-22 < (*.f64 x y) < 4.10000000000000013e36Initial program 97.6%
Taylor expanded in x around 0 95.3%
fma-def96.5%
fma-def96.5%
Simplified96.5%
Taylor expanded in c around 0 75.2%
Final simplification76.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* x y) -9e+293)
(* x y)
(if (<= (* x y) 2.7e-24)
t_1
(if (<= (* x y) 450000000.0)
(* z t)
(if (<= (* x y) 4.6e+150) t_1 (* 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) + (c * i);
double tmp;
if ((x * y) <= -9e+293) {
tmp = x * y;
} else if ((x * y) <= 2.7e-24) {
tmp = t_1;
} else if ((x * y) <= 450000000.0) {
tmp = z * t;
} else if ((x * y) <= 4.6e+150) {
tmp = t_1;
} 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) :: tmp
t_1 = (a * b) + (c * i)
if ((x * y) <= (-9d+293)) then
tmp = x * y
else if ((x * y) <= 2.7d-24) then
tmp = t_1
else if ((x * y) <= 450000000.0d0) then
tmp = z * t
else if ((x * y) <= 4.6d+150) then
tmp = t_1
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) + (c * i);
double tmp;
if ((x * y) <= -9e+293) {
tmp = x * y;
} else if ((x * y) <= 2.7e-24) {
tmp = t_1;
} else if ((x * y) <= 450000000.0) {
tmp = z * t;
} else if ((x * y) <= 4.6e+150) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (x * y) <= -9e+293: tmp = x * y elif (x * y) <= 2.7e-24: tmp = t_1 elif (x * y) <= 450000000.0: tmp = z * t elif (x * y) <= 4.6e+150: tmp = t_1 else: tmp = x * y 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(x * y) <= -9e+293) tmp = Float64(x * y); elseif (Float64(x * y) <= 2.7e-24) tmp = t_1; elseif (Float64(x * y) <= 450000000.0) tmp = Float64(z * t); elseif (Float64(x * y) <= 4.6e+150) tmp = t_1; 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) + (c * i); tmp = 0.0; if ((x * y) <= -9e+293) tmp = x * y; elseif ((x * y) <= 2.7e-24) tmp = t_1; elseif ((x * y) <= 450000000.0) tmp = z * t; elseif ((x * y) <= 4.6e+150) tmp = t_1; 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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -9e+293], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.7e-24], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 450000000.0], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.6e+150], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -9 \cdot 10^{+293}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 2.7 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot y \leq 450000000:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 4.6 \cdot 10^{+150}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -8.99999999999999932e293 or 4.60000000000000002e150 < (*.f64 x y) Initial program 93.4%
Taylor expanded in x around inf 77.6%
if -8.99999999999999932e293 < (*.f64 x y) < 2.70000000000000007e-24 or 4.5e8 < (*.f64 x y) < 4.60000000000000002e150Initial program 98.4%
Taylor expanded in z around 0 76.3%
Taylor expanded in x around 0 66.6%
if 2.70000000000000007e-24 < (*.f64 x y) < 4.5e8Initial program 87.5%
Taylor expanded in z around inf 63.8%
Final simplification69.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* x y) (* a b))))
(if (<= (* a b) -2.1e-7)
t_2
(if (<= (* a b) -9e-297)
t_1
(if (<= (* a b) 6.2e-118)
(+ (* x y) (* c i))
(if (<= (* a b) 1.5e+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 = (c * i) + (z * t);
double t_2 = (x * y) + (a * b);
double tmp;
if ((a * b) <= -2.1e-7) {
tmp = t_2;
} else if ((a * b) <= -9e-297) {
tmp = t_1;
} else if ((a * b) <= 6.2e-118) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 1.5e+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 = (c * i) + (z * t)
t_2 = (x * y) + (a * b)
if ((a * b) <= (-2.1d-7)) then
tmp = t_2
else if ((a * b) <= (-9d-297)) then
tmp = t_1
else if ((a * b) <= 6.2d-118) then
tmp = (x * y) + (c * i)
else if ((a * b) <= 1.5d+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 = (c * i) + (z * t);
double t_2 = (x * y) + (a * b);
double tmp;
if ((a * b) <= -2.1e-7) {
tmp = t_2;
} else if ((a * b) <= -9e-297) {
tmp = t_1;
} else if ((a * b) <= 6.2e-118) {
tmp = (x * y) + (c * i);
} else if ((a * b) <= 1.5e+140) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) t_2 = (x * y) + (a * b) tmp = 0 if (a * b) <= -2.1e-7: tmp = t_2 elif (a * b) <= -9e-297: tmp = t_1 elif (a * b) <= 6.2e-118: tmp = (x * y) + (c * i) elif (a * b) <= 1.5e+140: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) t_2 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(a * b) <= -2.1e-7) tmp = t_2; elseif (Float64(a * b) <= -9e-297) tmp = t_1; elseif (Float64(a * b) <= 6.2e-118) tmp = Float64(Float64(x * y) + Float64(c * i)); elseif (Float64(a * b) <= 1.5e+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 = (c * i) + (z * t); t_2 = (x * y) + (a * b); tmp = 0.0; if ((a * b) <= -2.1e-7) tmp = t_2; elseif ((a * b) <= -9e-297) tmp = t_1; elseif ((a * b) <= 6.2e-118) tmp = (x * y) + (c * i); elseif ((a * b) <= 1.5e+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[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2.1e-7], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -9e-297], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 6.2e-118], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.5e+140], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := x \cdot y + a \cdot b\\
\mathbf{if}\;a \cdot b \leq -2.1 \cdot 10^{-7}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \cdot b \leq -9 \cdot 10^{-297}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \cdot b \leq 6.2 \cdot 10^{-118}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.5 \cdot 10^{+140}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 a b) < -2.1e-7 or 1.49999999999999998e140 < (*.f64 a b) Initial program 93.3%
Taylor expanded in z around 0 87.9%
Taylor expanded in c around 0 81.9%
if -2.1e-7 < (*.f64 a b) < -8.99999999999999951e-297 or 6.2000000000000002e-118 < (*.f64 a b) < 1.49999999999999998e140Initial program 98.9%
Taylor expanded in x around 0 84.9%
fma-def85.0%
fma-def85.0%
Simplified85.0%
Taylor expanded in a around 0 74.2%
if -8.99999999999999951e-297 < (*.f64 a b) < 6.2000000000000002e-118Initial program 100.0%
Taylor expanded in z around 0 73.7%
Taylor expanded in a around 0 72.1%
Final simplification76.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -9.8e+68)
(* a b)
(if (<= (* a b) -8e-8)
(* x y)
(if (<= (* a b) 1.8e-218)
(* z t)
(if (<= (* a b) 1.18e+148) (* c i) (* a b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -9.8e+68) {
tmp = a * b;
} else if ((a * b) <= -8e-8) {
tmp = x * y;
} else if ((a * b) <= 1.8e-218) {
tmp = z * t;
} else if ((a * b) <= 1.18e+148) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-9.8d+68)) then
tmp = a * b
else if ((a * b) <= (-8d-8)) then
tmp = x * y
else if ((a * b) <= 1.8d-218) then
tmp = z * t
else if ((a * b) <= 1.18d+148) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -9.8e+68) {
tmp = a * b;
} else if ((a * b) <= -8e-8) {
tmp = x * y;
} else if ((a * b) <= 1.8e-218) {
tmp = z * t;
} else if ((a * b) <= 1.18e+148) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -9.8e+68: tmp = a * b elif (a * b) <= -8e-8: tmp = x * y elif (a * b) <= 1.8e-218: tmp = z * t elif (a * b) <= 1.18e+148: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -9.8e+68) tmp = Float64(a * b); elseif (Float64(a * b) <= -8e-8) tmp = Float64(x * y); elseif (Float64(a * b) <= 1.8e-218) tmp = Float64(z * t); elseif (Float64(a * b) <= 1.18e+148) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -9.8e+68) tmp = a * b; elseif ((a * b) <= -8e-8) tmp = x * y; elseif ((a * b) <= 1.8e-218) tmp = z * t; elseif ((a * b) <= 1.18e+148) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -9.8e+68], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -8e-8], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.8e-218], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.18e+148], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -9.8 \cdot 10^{+68}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -8 \cdot 10^{-8}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;a \cdot b \leq 1.8 \cdot 10^{-218}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.18 \cdot 10^{+148}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -9.79999999999999956e68 or 1.18e148 < (*.f64 a b) Initial program 92.2%
Taylor expanded in a around inf 69.8%
if -9.79999999999999956e68 < (*.f64 a b) < -8.0000000000000002e-8Initial program 100.0%
Taylor expanded in x around inf 77.4%
if -8.0000000000000002e-8 < (*.f64 a b) < 1.80000000000000006e-218Initial program 100.0%
Taylor expanded in z around inf 41.8%
if 1.80000000000000006e-218 < (*.f64 a b) < 1.18e148Initial program 98.5%
Taylor expanded in c around inf 39.8%
Final simplification52.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.15e+90) (not (<= (* x y) 1.75e+36))) (+ (* c i) (+ (* x y) (* a b))) (+ (* 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.15e+90) || !((x * y) <= 1.75e+36)) {
tmp = (c * i) + ((x * y) + (a * b));
} 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.15d+90)) .or. (.not. ((x * y) <= 1.75d+36))) then
tmp = (c * i) + ((x * y) + (a * b))
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.15e+90) || !((x * y) <= 1.75e+36)) {
tmp = (c * i) + ((x * y) + (a * b));
} 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.15e+90) or not ((x * y) <= 1.75e+36): tmp = (c * i) + ((x * y) + (a * b)) 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.15e+90) || !(Float64(x * y) <= 1.75e+36)) tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(a * b))); 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.15e+90) || ~(((x * y) <= 1.75e+36))) tmp = (c * i) + ((x * y) + (a * b)); 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.15e+90], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.75e+36]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(a * b), $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.15 \cdot 10^{+90} \lor \neg \left(x \cdot y \leq 1.75 \cdot 10^{+36}\right):\\
\;\;\;\;c \cdot i + \left(x \cdot y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.15e90 or 1.7499999999999999e36 < (*.f64 x y) Initial program 96.2%
Taylor expanded in z around 0 85.4%
if -1.15e90 < (*.f64 x y) < 1.7499999999999999e36Initial program 97.3%
Taylor expanded in x around 0 94.8%
Final simplification90.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -3.2e+285)
(+ (* x y) (* a b))
(if (<= (* x y) 4.2e+143)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* x y) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -3.2e+285) {
tmp = (x * y) + (a * b);
} else if ((x * y) <= 4.2e+143) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (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 ((x * y) <= (-3.2d+285)) then
tmp = (x * y) + (a * b)
else if ((x * y) <= 4.2d+143) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (x * y) + (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 ((x * y) <= -3.2e+285) {
tmp = (x * y) + (a * b);
} else if ((x * y) <= 4.2e+143) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -3.2e+285: tmp = (x * y) + (a * b) elif (x * y) <= 4.2e+143: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (x * y) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -3.2e+285) tmp = Float64(Float64(x * y) + Float64(a * b)); elseif (Float64(x * y) <= 4.2e+143) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(x * y) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -3.2e+285) tmp = (x * y) + (a * b); elseif ((x * y) <= 4.2e+143) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (x * y) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -3.2e+285], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.2e+143], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.2 \cdot 10^{+285}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{elif}\;x \cdot y \leq 4.2 \cdot 10^{+143}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -3.20000000000000025e285Initial program 90.0%
Taylor expanded in z around 0 90.0%
Taylor expanded in c around 0 90.0%
if -3.20000000000000025e285 < (*.f64 x y) < 4.19999999999999975e143Initial program 97.9%
Taylor expanded in x around 0 88.6%
if 4.19999999999999975e143 < (*.f64 x y) Initial program 95.6%
Taylor expanded in z around 0 82.8%
Taylor expanded in a around 0 80.7%
Final simplification87.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -1.6e-7) (not (<= (* a b) 1.15e+140))) (+ (* 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 (((a * b) <= -1.6e-7) || !((a * b) <= 1.15e+140)) {
tmp = (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 (((a * b) <= (-1.6d-7)) .or. (.not. ((a * b) <= 1.15d+140))) then
tmp = (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 (((a * b) <= -1.6e-7) || !((a * b) <= 1.15e+140)) {
tmp = (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 ((a * b) <= -1.6e-7) or not ((a * b) <= 1.15e+140): tmp = (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(a * b) <= -1.6e-7) || !(Float64(a * b) <= 1.15e+140)) tmp = 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 (((a * b) <= -1.6e-7) || ~(((a * b) <= 1.15e+140))) tmp = (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[Or[LessEqual[N[(a * b), $MachinePrecision], -1.6e-7], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.15e+140]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.6 \cdot 10^{-7} \lor \neg \left(a \cdot b \leq 1.15 \cdot 10^{+140}\right):\\
\;\;\;\;x \cdot y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\end{array}
\end{array}
if (*.f64 a b) < -1.6e-7 or 1.14999999999999995e140 < (*.f64 a b) Initial program 93.3%
Taylor expanded in z around 0 87.9%
Taylor expanded in c around 0 81.9%
if -1.6e-7 < (*.f64 a b) < 1.14999999999999995e140Initial program 99.3%
Taylor expanded in x around 0 76.5%
fma-def76.5%
fma-def76.5%
Simplified76.5%
Taylor expanded in a around 0 69.5%
Final simplification74.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -3e+51) (not (<= (* a b) 2.1e+147))) (* 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 (((a * b) <= -3e+51) || !((a * b) <= 2.1e+147)) {
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 (((a * b) <= (-3d+51)) .or. (.not. ((a * b) <= 2.1d+147))) 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 (((a * b) <= -3e+51) || !((a * b) <= 2.1e+147)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -3e+51) or not ((a * b) <= 2.1e+147): tmp = a * b else: tmp = c * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(a * b) <= -3e+51) || !(Float64(a * b) <= 2.1e+147)) 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 (((a * b) <= -3e+51) || ~(((a * b) <= 2.1e+147))) tmp = a * b; else tmp = c * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -3e+51], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.1e+147]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -3 \cdot 10^{+51} \lor \neg \left(a \cdot b \leq 2.1 \cdot 10^{+147}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -3e51 or 2.10000000000000006e147 < (*.f64 a b) Initial program 92.5%
Taylor expanded in a around inf 67.7%
if -3e51 < (*.f64 a b) < 2.10000000000000006e147Initial program 99.4%
Taylor expanded in c around inf 36.9%
Final simplification48.1%
(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.9%
Taylor expanded in a around inf 30.1%
Final simplification30.1%
herbie shell --seed 2023320
(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)))