
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma x y (fma z t (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(x, y, fma(z, t, (a * b))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(x, y, fma(z, t, Float64(a * b)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(x * y + N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Initial program 96.5%
+-commutative96.5%
fma-define97.3%
associate-+l+97.3%
fma-define98.8%
fma-define98.8%
Simplified98.8%
(FPCore (x y z t a b c i) :precision binary64 (fma c i (fma a b (fma x y (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
function code(x, y, z, t, a, b, c, i) return fma(c, i, fma(a, b, fma(x, y, Float64(z * t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Initial program 96.5%
+-commutative96.5%
fma-define97.3%
+-commutative97.3%
fma-define98.0%
fma-define98.0%
Simplified98.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* z t))))
(if (<= (* x y) -4.2e+146)
(* x y)
(if (<= (* x y) -1.65e-113)
t_1
(if (<= (* x y) 1.15e-80)
(+ (* a b) (* c i))
(if (<= (* x y) 4.7e+116) 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 = (c * i) + (z * t);
double tmp;
if ((x * y) <= -4.2e+146) {
tmp = x * y;
} else if ((x * y) <= -1.65e-113) {
tmp = t_1;
} else if ((x * y) <= 1.15e-80) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 4.7e+116) {
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 = (c * i) + (z * t)
if ((x * y) <= (-4.2d+146)) then
tmp = x * y
else if ((x * y) <= (-1.65d-113)) then
tmp = t_1
else if ((x * y) <= 1.15d-80) then
tmp = (a * b) + (c * i)
else if ((x * y) <= 4.7d+116) 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 = (c * i) + (z * t);
double tmp;
if ((x * y) <= -4.2e+146) {
tmp = x * y;
} else if ((x * y) <= -1.65e-113) {
tmp = t_1;
} else if ((x * y) <= 1.15e-80) {
tmp = (a * b) + (c * i);
} else if ((x * y) <= 4.7e+116) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (z * t) tmp = 0 if (x * y) <= -4.2e+146: tmp = x * y elif (x * y) <= -1.65e-113: tmp = t_1 elif (x * y) <= 1.15e-80: tmp = (a * b) + (c * i) elif (x * y) <= 4.7e+116: tmp = t_1 else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(z * t)) tmp = 0.0 if (Float64(x * y) <= -4.2e+146) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.65e-113) tmp = t_1; elseif (Float64(x * y) <= 1.15e-80) tmp = Float64(Float64(a * b) + Float64(c * i)); elseif (Float64(x * y) <= 4.7e+116) 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 = (c * i) + (z * t); tmp = 0.0; if ((x * y) <= -4.2e+146) tmp = x * y; elseif ((x * y) <= -1.65e-113) tmp = t_1; elseif ((x * y) <= 1.15e-80) tmp = (a * b) + (c * i); elseif ((x * y) <= 4.7e+116) 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[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.2e+146], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.65e-113], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.15e-80], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.7e+116], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -4.2 \cdot 10^{+146}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.65 \cdot 10^{-113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{-80}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{elif}\;x \cdot y \leq 4.7 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -4.2000000000000001e146 or 4.7000000000000003e116 < (*.f64 x y) Initial program 93.3%
Taylor expanded in x around inf 75.1%
Taylor expanded in y around inf 73.0%
associate-/l*74.1%
Simplified74.1%
Taylor expanded in y around inf 65.3%
if -4.2000000000000001e146 < (*.f64 x y) < -1.6500000000000001e-113 or 1.1499999999999999e-80 < (*.f64 x y) < 4.7000000000000003e116Initial program 97.4%
Taylor expanded in z around inf 64.1%
if -1.6500000000000001e-113 < (*.f64 x y) < 1.1499999999999999e-80Initial program 98.9%
Taylor expanded in a around inf 78.7%
Final simplification69.5%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)))) (if (<= t_1 INFINITY) t_1 (* z (+ t (+ (* a (/ b z)) (* c (/ i z))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (t + ((a * (b / z)) + (c * (i / z))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (t + ((a * (b / z)) + (c * (i / z))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (t + ((a * (b / z)) + (c * (i / z)))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(t + Float64(Float64(a * Float64(b / z)) + Float64(c * Float64(i / z))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + ((x * y) + (z * t))) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (t + ((a * (b / z)) + (c * (i / z)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(t + N[(N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \left(a \cdot \frac{b}{z} + c \cdot \frac{i}{z}\right)\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 x around 0 33.3%
Taylor expanded in z around inf 22.2%
associate-/l*55.6%
associate-/l*66.7%
Simplified66.7%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2e+125)
(* y (+ x (* c (/ i y))))
(if (<= (* x y) -1e+16)
(+ (* a b) (* z t))
(if (<= (* x y) 1e-16) (+ (* a b) (* c i)) (* z (+ t (/ (* x y) z)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2e+125) {
tmp = y * (x + (c * (i / y)));
} else if ((x * y) <= -1e+16) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 1e-16) {
tmp = (a * b) + (c * i);
} else {
tmp = z * (t + ((x * y) / z));
}
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) <= (-2d+125)) then
tmp = y * (x + (c * (i / y)))
else if ((x * y) <= (-1d+16)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 1d-16) then
tmp = (a * b) + (c * i)
else
tmp = z * (t + ((x * y) / z))
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) <= -2e+125) {
tmp = y * (x + (c * (i / y)));
} else if ((x * y) <= -1e+16) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 1e-16) {
tmp = (a * b) + (c * i);
} else {
tmp = z * (t + ((x * y) / z));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2e+125: tmp = y * (x + (c * (i / y))) elif (x * y) <= -1e+16: tmp = (a * b) + (z * t) elif (x * y) <= 1e-16: tmp = (a * b) + (c * i) else: tmp = z * (t + ((x * y) / z)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2e+125) tmp = Float64(y * Float64(x + Float64(c * Float64(i / y)))); elseif (Float64(x * y) <= -1e+16) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 1e-16) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = Float64(z * Float64(t + Float64(Float64(x * y) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -2e+125) tmp = y * (x + (c * (i / y))); elseif ((x * y) <= -1e+16) tmp = (a * b) + (z * t); elseif ((x * y) <= 1e-16) tmp = (a * b) + (c * i); else tmp = z * (t + ((x * y) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+125], N[(y * N[(x + N[(c * N[(i / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e+16], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-16], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+125}:\\
\;\;\;\;y \cdot \left(x + c \cdot \frac{i}{y}\right)\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+16}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 10^{-16}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + \frac{x \cdot y}{z}\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999998e125Initial program 97.5%
Taylor expanded in x around inf 78.4%
Taylor expanded in y around inf 73.8%
associate-/l*76.1%
Simplified76.1%
if -1.9999999999999998e125 < (*.f64 x y) < -1e16Initial program 95.5%
Taylor expanded in x around 0 79.8%
Taylor expanded in z around inf 67.1%
Taylor expanded in c around 0 63.1%
Taylor expanded in z around 0 71.5%
if -1e16 < (*.f64 x y) < 9.9999999999999998e-17Initial program 98.3%
Taylor expanded in a around inf 74.0%
if 9.9999999999999998e-17 < (*.f64 x y) Initial program 92.9%
Taylor expanded in a around 0 84.8%
Taylor expanded in z around inf 71.4%
+-commutative71.4%
associate-/l*68.7%
associate-/l*67.3%
Simplified67.3%
Taylor expanded in c around 0 63.4%
Final simplification71.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2e+125)
(* y (+ x (* c (/ i y))))
(if (<= (* x y) -1e+16)
(+ (* a b) (* z t))
(if (<= (* x y) 5e-81) (+ (* a b) (* c i)) (+ (* 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) <= -2e+125) {
tmp = y * (x + (c * (i / y)));
} else if ((x * y) <= -1e+16) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 5e-81) {
tmp = (a * b) + (c * i);
} 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) <= (-2d+125)) then
tmp = y * (x + (c * (i / y)))
else if ((x * y) <= (-1d+16)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 5d-81) then
tmp = (a * b) + (c * i)
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) <= -2e+125) {
tmp = y * (x + (c * (i / y)));
} else if ((x * y) <= -1e+16) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 5e-81) {
tmp = (a * b) + (c * i);
} else {
tmp = (x * y) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2e+125: tmp = y * (x + (c * (i / y))) elif (x * y) <= -1e+16: tmp = (a * b) + (z * t) elif (x * y) <= 5e-81: tmp = (a * b) + (c * i) 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) <= -2e+125) tmp = Float64(y * Float64(x + Float64(c * Float64(i / y)))); elseif (Float64(x * y) <= -1e+16) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 5e-81) tmp = Float64(Float64(a * b) + Float64(c * i)); 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) <= -2e+125) tmp = y * (x + (c * (i / y))); elseif ((x * y) <= -1e+16) tmp = (a * b) + (z * t); elseif ((x * y) <= 5e-81) tmp = (a * b) + (c * i); 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], -2e+125], N[(y * N[(x + N[(c * N[(i / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e+16], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-81], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+125}:\\
\;\;\;\;y \cdot \left(x + c \cdot \frac{i}{y}\right)\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+16}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-81}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999998e125Initial program 97.5%
Taylor expanded in x around inf 78.4%
Taylor expanded in y around inf 73.8%
associate-/l*76.1%
Simplified76.1%
if -1.9999999999999998e125 < (*.f64 x y) < -1e16Initial program 95.5%
Taylor expanded in x around 0 79.8%
Taylor expanded in z around inf 67.1%
Taylor expanded in c around 0 63.1%
Taylor expanded in z around 0 71.5%
if -1e16 < (*.f64 x y) < 4.99999999999999981e-81Initial program 99.1%
Taylor expanded in a around inf 74.4%
if 4.99999999999999981e-81 < (*.f64 x y) Initial program 92.2%
Taylor expanded in x around inf 66.5%
Final simplification72.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* c i))))
(if (<= (* x y) -5.6e+124)
t_1
(if (<= (* x y) -26500000000000.0)
(+ (* a b) (* z t))
(if (<= (* x y) 1.15e-77) (+ (* a b) (* 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 = (x * y) + (c * i);
double tmp;
if ((x * y) <= -5.6e+124) {
tmp = t_1;
} else if ((x * y) <= -26500000000000.0) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 1.15e-77) {
tmp = (a * b) + (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 = (x * y) + (c * i)
if ((x * y) <= (-5.6d+124)) then
tmp = t_1
else if ((x * y) <= (-26500000000000.0d0)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 1.15d-77) then
tmp = (a * b) + (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 = (x * y) + (c * i);
double tmp;
if ((x * y) <= -5.6e+124) {
tmp = t_1;
} else if ((x * y) <= -26500000000000.0) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 1.15e-77) {
tmp = (a * b) + (c * i);
} 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 (x * y) <= -5.6e+124: tmp = t_1 elif (x * y) <= -26500000000000.0: tmp = (a * b) + (z * t) elif (x * y) <= 1.15e-77: tmp = (a * b) + (c * i) 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(x * y) <= -5.6e+124) tmp = t_1; elseif (Float64(x * y) <= -26500000000000.0) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 1.15e-77) tmp = Float64(Float64(a * b) + 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 = (x * y) + (c * i); tmp = 0.0; if ((x * y) <= -5.6e+124) tmp = t_1; elseif ((x * y) <= -26500000000000.0) tmp = (a * b) + (z * t); elseif ((x * y) <= 1.15e-77) tmp = (a * b) + (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[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5.6e+124], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -26500000000000.0], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.15e-77], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -5.6 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -26500000000000:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{-77}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -5.59999999999999999e124 or 1.14999999999999999e-77 < (*.f64 x y) Initial program 94.0%
Taylor expanded in x around inf 70.6%
if -5.59999999999999999e124 < (*.f64 x y) < -2.65e13Initial program 95.5%
Taylor expanded in x around 0 79.8%
Taylor expanded in z around inf 67.1%
Taylor expanded in c around 0 63.1%
Taylor expanded in z around 0 71.5%
if -2.65e13 < (*.f64 x y) < 1.14999999999999999e-77Initial program 99.1%
Taylor expanded in a around inf 74.4%
Final simplification72.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -9.2e+144)
(* x y)
(if (<= (* x y) -1.65e+15)
(+ (* a b) (* z t))
(if (<= (* x y) 2.5e+46) (+ (* 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) <= -9.2e+144) {
tmp = x * y;
} else if ((x * y) <= -1.65e+15) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 2.5e+46) {
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) <= (-9.2d+144)) then
tmp = x * y
else if ((x * y) <= (-1.65d+15)) then
tmp = (a * b) + (z * t)
else if ((x * y) <= 2.5d+46) 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) <= -9.2e+144) {
tmp = x * y;
} else if ((x * y) <= -1.65e+15) {
tmp = (a * b) + (z * t);
} else if ((x * y) <= 2.5e+46) {
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) <= -9.2e+144: tmp = x * y elif (x * y) <= -1.65e+15: tmp = (a * b) + (z * t) elif (x * y) <= 2.5e+46: 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) <= -9.2e+144) tmp = Float64(x * y); elseif (Float64(x * y) <= -1.65e+15) tmp = Float64(Float64(a * b) + Float64(z * t)); elseif (Float64(x * y) <= 2.5e+46) 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) <= -9.2e+144) tmp = x * y; elseif ((x * y) <= -1.65e+15) tmp = (a * b) + (z * t); elseif ((x * y) <= 2.5e+46) 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], -9.2e+144], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.65e+15], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.5e+46], 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 -9.2 \cdot 10^{+144}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -1.65 \cdot 10^{+15}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+46}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -9.2000000000000006e144 or 2.5000000000000001e46 < (*.f64 x y) Initial program 94.2%
Taylor expanded in x around inf 71.2%
Taylor expanded in y around inf 69.4%
associate-/l*70.3%
Simplified70.3%
Taylor expanded in y around inf 60.9%
if -9.2000000000000006e144 < (*.f64 x y) < -1.65e15Initial program 96.2%
Taylor expanded in x around 0 79.4%
Taylor expanded in z around inf 68.7%
Taylor expanded in c around 0 58.4%
Taylor expanded in z around 0 65.5%
if -1.65e15 < (*.f64 x y) < 2.5000000000000001e46Initial program 98.4%
Taylor expanded in a around inf 73.3%
Final simplification67.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -2e+150) (not (<= (* x y) 5e-128))) (+ (* c i) (+ (* a b) (* x y))) (+ (* 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) <= -2e+150) || !((x * y) <= 5e-128)) {
tmp = (c * i) + ((a * b) + (x * y));
} 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) <= (-2d+150)) .or. (.not. ((x * y) <= 5d-128))) then
tmp = (c * i) + ((a * b) + (x * y))
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) <= -2e+150) || !((x * y) <= 5e-128)) {
tmp = (c * i) + ((a * b) + (x * y));
} 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) <= -2e+150) or not ((x * y) <= 5e-128): tmp = (c * i) + ((a * b) + (x * y)) 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) <= -2e+150) || !(Float64(x * y) <= 5e-128)) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); 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) <= -2e+150) || ~(((x * y) <= 5e-128))) tmp = (c * i) + ((a * b) + (x * y)); 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], -2e+150], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e-128]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $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 -2 \cdot 10^{+150} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{-128}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999996e150 or 5.0000000000000001e-128 < (*.f64 x y) Initial program 94.1%
Taylor expanded in z around 0 81.5%
if -1.99999999999999996e150 < (*.f64 x y) < 5.0000000000000001e-128Initial program 98.5%
Taylor expanded in x around 0 93.2%
Final simplification87.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2e+150)
(+ (* c i) (+ (* a b) (* x y)))
(if (<= (* x y) 1e-126)
(+ (* c i) (+ (* a b) (* z t)))
(+ (* c i) (+ (* x y) (* z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2e+150) {
tmp = (c * i) + ((a * b) + (x * y));
} else if ((x * y) <= 1e-126) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-2d+150)) then
tmp = (c * i) + ((a * b) + (x * y))
else if ((x * y) <= 1d-126) then
tmp = (c * i) + ((a * b) + (z * t))
else
tmp = (c * i) + ((x * y) + (z * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2e+150) {
tmp = (c * i) + ((a * b) + (x * y));
} else if ((x * y) <= 1e-126) {
tmp = (c * i) + ((a * b) + (z * t));
} else {
tmp = (c * i) + ((x * y) + (z * t));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2e+150: tmp = (c * i) + ((a * b) + (x * y)) elif (x * y) <= 1e-126: tmp = (c * i) + ((a * b) + (z * t)) else: tmp = (c * i) + ((x * y) + (z * t)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2e+150) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(x * y))); elseif (Float64(x * y) <= 1e-126) tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t))); else tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -2e+150) tmp = (c * i) + ((a * b) + (x * y)); elseif ((x * y) <= 1e-126) tmp = (c * i) + ((a * b) + (z * t)); else tmp = (c * i) + ((x * y) + (z * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+150], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-126], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+150}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{-126}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.99999999999999996e150Initial program 97.3%
Taylor expanded in z around 0 92.4%
if -1.99999999999999996e150 < (*.f64 x y) < 9.9999999999999995e-127Initial program 98.5%
Taylor expanded in x around 0 93.3%
if 9.9999999999999995e-127 < (*.f64 x y) Initial program 92.7%
Taylor expanded in a around 0 83.3%
Final simplification90.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2e+150)
(* y (+ x (* c (/ i y))))
(if (<= (* x y) 5e+115)
(+ (* 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) <= -2e+150) {
tmp = y * (x + (c * (i / y)));
} else if ((x * y) <= 5e+115) {
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) <= (-2d+150)) then
tmp = y * (x + (c * (i / y)))
else if ((x * y) <= 5d+115) 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) <= -2e+150) {
tmp = y * (x + (c * (i / y)));
} else if ((x * y) <= 5e+115) {
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) <= -2e+150: tmp = y * (x + (c * (i / y))) elif (x * y) <= 5e+115: 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) <= -2e+150) tmp = Float64(y * Float64(x + Float64(c * Float64(i / y)))); elseif (Float64(x * y) <= 5e+115) 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) <= -2e+150) tmp = y * (x + (c * (i / y))); elseif ((x * y) <= 5e+115) 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], -2e+150], N[(y * N[(x + N[(c * N[(i / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+115], 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 -2 \cdot 10^{+150}:\\
\;\;\;\;y \cdot \left(x + c \cdot \frac{i}{y}\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+115}:\\
\;\;\;\;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) < -1.99999999999999996e150Initial program 97.3%
Taylor expanded in x around inf 80.8%
Taylor expanded in y around inf 78.3%
associate-/l*80.9%
Simplified80.9%
if -1.99999999999999996e150 < (*.f64 x y) < 5.00000000000000008e115Initial program 98.2%
Taylor expanded in x around 0 89.1%
if 5.00000000000000008e115 < (*.f64 x y) Initial program 90.6%
Taylor expanded in x around inf 71.1%
Final simplification84.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -3.1e+124)
(* x y)
(if (<= (* x y) -8800000000000.0)
(* z t)
(if (<= (* x y) 850000.0) (* 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) <= -3.1e+124) {
tmp = x * y;
} else if ((x * y) <= -8800000000000.0) {
tmp = z * t;
} else if ((x * y) <= 850000.0) {
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) <= (-3.1d+124)) then
tmp = x * y
else if ((x * y) <= (-8800000000000.0d0)) then
tmp = z * t
else if ((x * y) <= 850000.0d0) 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) <= -3.1e+124) {
tmp = x * y;
} else if ((x * y) <= -8800000000000.0) {
tmp = z * t;
} else if ((x * y) <= 850000.0) {
tmp = c * i;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -3.1e+124: tmp = x * y elif (x * y) <= -8800000000000.0: tmp = z * t elif (x * y) <= 850000.0: 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) <= -3.1e+124) tmp = Float64(x * y); elseif (Float64(x * y) <= -8800000000000.0) tmp = Float64(z * t); elseif (Float64(x * y) <= 850000.0) 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) <= -3.1e+124) tmp = x * y; elseif ((x * y) <= -8800000000000.0) tmp = z * t; elseif ((x * y) <= 850000.0) 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], -3.1e+124], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -8800000000000.0], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 850000.0], N[(c * i), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.1 \cdot 10^{+124}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq -8800000000000:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 850000:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -3.1000000000000002e124 or 8.5e5 < (*.f64 x y) Initial program 94.6%
Taylor expanded in x around inf 70.5%
Taylor expanded in y around inf 68.0%
associate-/l*68.9%
Simplified68.9%
Taylor expanded in y around inf 59.0%
if -3.1000000000000002e124 < (*.f64 x y) < -8.8e12Initial program 95.5%
Taylor expanded in z around inf 61.9%
Taylor expanded in t around inf 57.6%
associate-/l*57.6%
Simplified57.6%
Taylor expanded in t around inf 53.8%
if -8.8e12 < (*.f64 x y) < 8.5e5Initial program 98.4%
Taylor expanded in c around inf 41.2%
Final simplification50.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -7.8e+291) (not (<= (* x y) 2.5e+46))) (* x y) (+ (* 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 (((x * y) <= -7.8e+291) || !((x * y) <= 2.5e+46)) {
tmp = x * y;
} else {
tmp = (a * b) + (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) <= (-7.8d+291)) .or. (.not. ((x * y) <= 2.5d+46))) then
tmp = x * y
else
tmp = (a * b) + (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) <= -7.8e+291) || !((x * y) <= 2.5e+46)) {
tmp = x * y;
} else {
tmp = (a * b) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -7.8e+291) or not ((x * y) <= 2.5e+46): tmp = x * y else: tmp = (a * b) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -7.8e+291) || !(Float64(x * y) <= 2.5e+46)) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) + 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) <= -7.8e+291) || ~(((x * y) <= 2.5e+46))) tmp = x * y; else tmp = (a * b) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -7.8e+291], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.5e+46]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.8 \cdot 10^{+291} \lor \neg \left(x \cdot y \leq 2.5 \cdot 10^{+46}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -7.79999999999999962e291 or 2.5000000000000001e46 < (*.f64 x y) Initial program 92.8%
Taylor expanded in x around inf 70.7%
Taylor expanded in y around inf 69.6%
associate-/l*70.8%
Simplified70.8%
Taylor expanded in y around inf 64.9%
if -7.79999999999999962e291 < (*.f64 x y) < 2.5000000000000001e46Initial program 98.2%
Taylor expanded in a around inf 64.9%
Final simplification64.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* c i) -2.3) (not (<= (* c i) 3.4e+58))) (* 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.3) || !((c * i) <= 3.4e+58)) {
tmp = c * i;
} else {
tmp = z * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((c * i) <= (-2.3d0)) .or. (.not. ((c * i) <= 3.4d+58))) then
tmp = c * i
else
tmp = z * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((c * i) <= -2.3) || !((c * i) <= 3.4e+58)) {
tmp = c * i;
} else {
tmp = z * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((c * i) <= -2.3) or not ((c * i) <= 3.4e+58): tmp = c * i else: tmp = z * t return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(c * i) <= -2.3) || !(Float64(c * i) <= 3.4e+58)) tmp = Float64(c * i); else tmp = Float64(z * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((c * i) <= -2.3) || ~(((c * i) <= 3.4e+58))) tmp = c * i; else tmp = z * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -2.3], N[Not[LessEqual[N[(c * i), $MachinePrecision], 3.4e+58]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(z * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -2.3 \lor \neg \left(c \cdot i \leq 3.4 \cdot 10^{+58}\right):\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;z \cdot t\\
\end{array}
\end{array}
if (*.f64 c i) < -2.2999999999999998 or 3.4000000000000001e58 < (*.f64 c i) Initial program 94.0%
Taylor expanded in c around inf 56.5%
if -2.2999999999999998 < (*.f64 c i) < 3.4000000000000001e58Initial program 98.5%
Taylor expanded in z around inf 33.0%
Taylor expanded in t around inf 33.0%
associate-/l*33.0%
Simplified33.0%
Taylor expanded in t around inf 30.8%
Final simplification42.5%
(FPCore (x y z t a b c i) :precision binary64 (* c i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 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 = 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 c * i;
}
def code(x, y, z, t, a, b, c, i): return c * i
function code(x, y, z, t, a, b, c, i) return Float64(c * i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = c * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i), $MachinePrecision]
\begin{array}{l}
\\
c \cdot i
\end{array}
Initial program 96.5%
Taylor expanded in c around inf 28.2%
herbie shell --seed 2024091
(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)))