
(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 17 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 (if (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY) (+ (fma x y (* z t)) (+ (* a b) (* c i))) (* y (+ x (+ (* a (/ b y)) (* c (/ i y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((a * b) + ((x * y) + (z * t))) + (c * i)) <= ((double) INFINITY)) {
tmp = fma(x, y, (z * t)) + ((a * b) + (c * i));
} else {
tmp = y * (x + ((a * (b / y)) + (c * (i / y))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) <= Inf) tmp = Float64(fma(x, y, Float64(z * t)) + Float64(Float64(a * b) + Float64(c * i))); else tmp = Float64(y * Float64(x + Float64(Float64(a * Float64(b / y)) + Float64(c * Float64(i / y))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x + N[(N[(a * N[(b / y), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + \left(a \cdot \frac{b}{y} + c \cdot \frac{i}{y}\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%
associate-+l+100.0%
fma-define100.0%
Simplified100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
associate-+l+0.0%
fma-define9.1%
Simplified9.1%
Taylor expanded in x around inf 18.2%
Taylor expanded in y around inf 45.5%
associate-/l*63.6%
associate-/l*72.7%
Simplified72.7%
Final simplification98.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 95.7%
+-commutative95.7%
fma-define96.8%
+-commutative96.8%
fma-define97.6%
fma-define98.0%
Simplified98.0%
(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 (* y (+ x (+ (* a (/ b y)) (* c (/ i y))))))))
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 = y * (x + ((a * (b / y)) + (c * (i / y))));
}
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 = y * (x + ((a * (b / y)) + (c * (i / y))));
}
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 = y * (x + ((a * (b / y)) + (c * (i / y)))) 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(y * Float64(x + Float64(Float64(a * Float64(b / y)) + Float64(c * Float64(i / y))))); 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 = y * (x + ((a * (b / y)) + (c * (i / y)))); 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[(y * N[(x + N[(N[(a * N[(b / y), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / y), $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}:\\
\;\;\;\;y \cdot \left(x + \left(a \cdot \frac{b}{y} + c \cdot \frac{i}{y}\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%
associate-+l+0.0%
fma-define9.1%
Simplified9.1%
Taylor expanded in x around inf 18.2%
Taylor expanded in y around inf 45.5%
associate-/l*63.6%
associate-/l*72.7%
Simplified72.7%
Final simplification98.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -9.8e+66)
(* a b)
(if (<= (* a b) -4.6e-113)
(* z t)
(if (<= (* a b) 1.3e-55)
(* c i)
(if (<= (* a b) 1.35e+165) (* z t) (* 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+66) {
tmp = a * b;
} else if ((a * b) <= -4.6e-113) {
tmp = z * t;
} else if ((a * b) <= 1.3e-55) {
tmp = c * i;
} else if ((a * b) <= 1.35e+165) {
tmp = z * t;
} 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+66)) then
tmp = a * b
else if ((a * b) <= (-4.6d-113)) then
tmp = z * t
else if ((a * b) <= 1.3d-55) then
tmp = c * i
else if ((a * b) <= 1.35d+165) then
tmp = z * t
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+66) {
tmp = a * b;
} else if ((a * b) <= -4.6e-113) {
tmp = z * t;
} else if ((a * b) <= 1.3e-55) {
tmp = c * i;
} else if ((a * b) <= 1.35e+165) {
tmp = z * t;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -9.8e+66: tmp = a * b elif (a * b) <= -4.6e-113: tmp = z * t elif (a * b) <= 1.3e-55: tmp = c * i elif (a * b) <= 1.35e+165: tmp = z * t 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+66) tmp = Float64(a * b); elseif (Float64(a * b) <= -4.6e-113) tmp = Float64(z * t); elseif (Float64(a * b) <= 1.3e-55) tmp = Float64(c * i); elseif (Float64(a * b) <= 1.35e+165) tmp = Float64(z * t); 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+66) tmp = a * b; elseif ((a * b) <= -4.6e-113) tmp = z * t; elseif ((a * b) <= 1.3e-55) tmp = c * i; elseif ((a * b) <= 1.35e+165) tmp = z * t; 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+66], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -4.6e-113], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.3e-55], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.35e+165], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -9.8 \cdot 10^{+66}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -4.6 \cdot 10^{-113}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;a \cdot b \leq 1.3 \cdot 10^{-55}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq 1.35 \cdot 10^{+165}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -9.7999999999999995e66 or 1.35e165 < (*.f64 a b) Initial program 91.9%
+-commutative91.9%
fma-define95.4%
+-commutative95.4%
fma-define97.7%
fma-define97.7%
Simplified97.7%
Taylor expanded in a around inf 64.2%
if -9.7999999999999995e66 < (*.f64 a b) < -4.60000000000000016e-113 or 1.2999999999999999e-55 < (*.f64 a b) < 1.35e165Initial program 98.6%
+-commutative98.6%
fma-define98.6%
+-commutative98.6%
fma-define98.6%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 70.9%
Taylor expanded in i around inf 65.8%
associate-+r+65.8%
Simplified65.8%
Taylor expanded in t around inf 42.6%
if -4.60000000000000016e-113 < (*.f64 a b) < 1.2999999999999999e-55Initial program 96.8%
+-commutative96.8%
fma-define96.8%
+-commutative96.8%
fma-define96.8%
fma-define96.8%
Simplified96.8%
Taylor expanded in c around inf 40.3%
Final simplification49.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+230)
(* y (+ x (/ (* c i) y)))
(if (<= (* x y) 1e-280)
(+ (* c i) (* z t))
(if (<= (* x y) 1e+86) (+ (* 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) <= -1e+230) {
tmp = y * (x + ((c * i) / y));
} else if ((x * y) <= 1e-280) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1e+86) {
tmp = (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) <= (-1d+230)) then
tmp = y * (x + ((c * i) / y))
else if ((x * y) <= 1d-280) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 1d+86) then
tmp = (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) <= -1e+230) {
tmp = y * (x + ((c * i) / y));
} else if ((x * y) <= 1e-280) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1e+86) {
tmp = (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) <= -1e+230: tmp = y * (x + ((c * i) / y)) elif (x * y) <= 1e-280: tmp = (c * i) + (z * t) elif (x * y) <= 1e+86: tmp = (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) <= -1e+230) tmp = Float64(y * Float64(x + Float64(Float64(c * i) / y))); elseif (Float64(x * y) <= 1e-280) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 1e+86) tmp = 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) <= -1e+230) tmp = y * (x + ((c * i) / y)); elseif ((x * y) <= 1e-280) tmp = (c * i) + (z * t); elseif ((x * y) <= 1e+86) tmp = (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], -1e+230], N[(y * N[(x + N[(N[(c * i), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-280], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+86], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+230}:\\
\;\;\;\;y \cdot \left(x + \frac{c \cdot i}{y}\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{-280}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 10^{+86}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.0000000000000001e230Initial program 82.4%
+-commutative82.4%
fma-define82.4%
+-commutative82.4%
fma-define85.3%
fma-define88.2%
Simplified88.2%
Taylor expanded in a around 0 82.6%
Taylor expanded in t around 0 82.6%
Taylor expanded in y around inf 91.4%
if -1.0000000000000001e230 < (*.f64 x y) < 9.9999999999999996e-281Initial program 97.4%
+-commutative97.4%
fma-define99.1%
+-commutative99.1%
fma-define99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in x around 0 87.8%
Taylor expanded in a around 0 65.5%
if 9.9999999999999996e-281 < (*.f64 x y) < 1e86Initial program 98.3%
+-commutative98.3%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 94.8%
Taylor expanded in c around 0 78.7%
if 1e86 < (*.f64 x y) Initial program 97.7%
+-commutative97.7%
fma-define97.7%
+-commutative97.7%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 91.2%
Taylor expanded in t around 0 85.3%
Final simplification75.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* c i))))
(if (<= (* x y) -6.4e+219)
t_1
(if (<= (* x y) 4.5e-280)
(+ (* c i) (* z t))
(if (<= (* x y) 1.45e+91) (+ (* a b) (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (c * i);
double tmp;
if ((x * y) <= -6.4e+219) {
tmp = t_1;
} else if ((x * y) <= 4.5e-280) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1.45e+91) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (c * i)
if ((x * y) <= (-6.4d+219)) then
tmp = t_1
else if ((x * y) <= 4.5d-280) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 1.45d+91) then
tmp = (a * b) + (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (c * i);
double tmp;
if ((x * y) <= -6.4e+219) {
tmp = t_1;
} else if ((x * y) <= 4.5e-280) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 1.45e+91) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (c * i) tmp = 0 if (x * y) <= -6.4e+219: tmp = t_1 elif (x * y) <= 4.5e-280: tmp = (c * i) + (z * t) elif (x * y) <= 1.45e+91: tmp = (a * b) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(c * i)) tmp = 0.0 if (Float64(x * y) <= -6.4e+219) tmp = t_1; elseif (Float64(x * y) <= 4.5e-280) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 1.45e+91) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (c * i); tmp = 0.0; if ((x * y) <= -6.4e+219) tmp = t_1; elseif ((x * y) <= 4.5e-280) tmp = (c * i) + (z * t); elseif ((x * y) <= 1.45e+91) tmp = (a * b) + (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -6.4e+219], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.5e-280], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.45e+91], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -6.4 \cdot 10^{+219}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{-280}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 1.45 \cdot 10^{+91}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -6.40000000000000053e219 or 1.45000000000000007e91 < (*.f64 x y) Initial program 91.1%
+-commutative91.1%
fma-define91.1%
+-commutative91.1%
fma-define93.7%
fma-define94.9%
Simplified94.9%
Taylor expanded in a around 0 87.5%
Taylor expanded in t around 0 84.2%
if -6.40000000000000053e219 < (*.f64 x y) < 4.4999999999999996e-280Initial program 97.4%
+-commutative97.4%
fma-define99.1%
+-commutative99.1%
fma-define99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in x around 0 87.8%
Taylor expanded in a around 0 65.5%
if 4.4999999999999996e-280 < (*.f64 x y) < 1.45000000000000007e91Initial program 98.3%
+-commutative98.3%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 94.8%
Taylor expanded in c around 0 78.7%
Final simplification74.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x y) (* a b))))
(if (<= (* x y) -1.04e+170)
t_1
(if (<= (* x y) 6.8e-280)
(+ (* c i) (* z t))
(if (<= (* x y) 9e+88) (+ (* a b) (* z t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -1.04e+170) {
tmp = t_1;
} else if ((x * y) <= 6.8e-280) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 9e+88) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x * y) + (a * b)
if ((x * y) <= (-1.04d+170)) then
tmp = t_1
else if ((x * y) <= 6.8d-280) then
tmp = (c * i) + (z * t)
else if ((x * y) <= 9d+88) then
tmp = (a * b) + (z * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * y) + (a * b);
double tmp;
if ((x * y) <= -1.04e+170) {
tmp = t_1;
} else if ((x * y) <= 6.8e-280) {
tmp = (c * i) + (z * t);
} else if ((x * y) <= 9e+88) {
tmp = (a * b) + (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x * y) + (a * b) tmp = 0 if (x * y) <= -1.04e+170: tmp = t_1 elif (x * y) <= 6.8e-280: tmp = (c * i) + (z * t) elif (x * y) <= 9e+88: tmp = (a * b) + (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * y) + Float64(a * b)) tmp = 0.0 if (Float64(x * y) <= -1.04e+170) tmp = t_1; elseif (Float64(x * y) <= 6.8e-280) tmp = Float64(Float64(c * i) + Float64(z * t)); elseif (Float64(x * y) <= 9e+88) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x * y) + (a * b); tmp = 0.0; if ((x * y) <= -1.04e+170) tmp = t_1; elseif ((x * y) <= 6.8e-280) tmp = (c * i) + (z * t); elseif ((x * y) <= 9e+88) tmp = (a * b) + (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.04e+170], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 6.8e-280], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9e+88], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -1.04 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 6.8 \cdot 10^{-280}:\\
\;\;\;\;c \cdot i + z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 9 \cdot 10^{+88}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 x y) < -1.04e170 or 9e88 < (*.f64 x y) Initial program 91.6%
associate-+l+91.6%
fma-define92.9%
Simplified92.9%
Taylor expanded in x around inf 87.3%
Taylor expanded in c around 0 78.0%
if -1.04e170 < (*.f64 x y) < 6.7999999999999995e-280Initial program 97.3%
+-commutative97.3%
fma-define99.1%
+-commutative99.1%
fma-define99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in x around 0 88.1%
Taylor expanded in a around 0 66.6%
if 6.7999999999999995e-280 < (*.f64 x y) < 9e88Initial program 98.3%
+-commutative98.3%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 94.8%
Taylor expanded in c around 0 78.7%
Final simplification73.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+230)
(* y (+ x (+ (* a (/ b y)) (* c (/ i y)))))
(if (<= (* x y) 1e+86)
(+ (* a b) (+ (* c i) (* z t)))
(+ (* 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) <= -1e+230) {
tmp = y * (x + ((a * (b / y)) + (c * (i / y))));
} else if ((x * y) <= 1e+86) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (x * y) + ((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) <= (-1d+230)) then
tmp = y * (x + ((a * (b / y)) + (c * (i / y))))
else if ((x * y) <= 1d+86) then
tmp = (a * b) + ((c * i) + (z * t))
else
tmp = (x * y) + ((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) <= -1e+230) {
tmp = y * (x + ((a * (b / y)) + (c * (i / y))));
} else if ((x * y) <= 1e+86) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (x * y) + ((a * b) + (c * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1e+230: tmp = y * (x + ((a * (b / y)) + (c * (i / y)))) elif (x * y) <= 1e+86: tmp = (a * b) + ((c * i) + (z * t)) else: tmp = (x * y) + ((a * b) + (c * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1e+230) tmp = Float64(y * Float64(x + Float64(Float64(a * Float64(b / y)) + Float64(c * Float64(i / y))))); elseif (Float64(x * y) <= 1e+86) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); else tmp = Float64(Float64(x * y) + 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) <= -1e+230) tmp = y * (x + ((a * (b / y)) + (c * (i / y)))); elseif ((x * y) <= 1e+86) tmp = (a * b) + ((c * i) + (z * t)); else tmp = (x * y) + ((a * b) + (c * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+230], N[(y * N[(x + N[(N[(a * N[(b / y), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+86], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+230}:\\
\;\;\;\;y \cdot \left(x + \left(a \cdot \frac{b}{y} + c \cdot \frac{i}{y}\right)\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+86}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + \left(a \cdot b + c \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.0000000000000001e230Initial program 82.4%
associate-+l+82.4%
fma-define85.3%
Simplified85.3%
Taylor expanded in x around inf 82.4%
Taylor expanded in y around inf 91.2%
associate-/l*94.1%
associate-/l*91.4%
Simplified91.4%
if -1.0000000000000001e230 < (*.f64 x y) < 1e86Initial program 97.7%
+-commutative97.7%
fma-define99.4%
+-commutative99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 90.2%
if 1e86 < (*.f64 x y) Initial program 97.7%
associate-+l+97.7%
fma-define97.8%
Simplified97.8%
Taylor expanded in x around inf 91.8%
Final simplification90.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+230)
(* y (+ x (/ (* c i) y)))
(if (<= (* x y) 1e+86)
(+ (* a b) (+ (* c i) (* z t)))
(+ (* 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) <= -1e+230) {
tmp = y * (x + ((c * i) / y));
} else if ((x * y) <= 1e+86) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (x * y) + ((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) <= (-1d+230)) then
tmp = y * (x + ((c * i) / y))
else if ((x * y) <= 1d+86) then
tmp = (a * b) + ((c * i) + (z * t))
else
tmp = (x * y) + ((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) <= -1e+230) {
tmp = y * (x + ((c * i) / y));
} else if ((x * y) <= 1e+86) {
tmp = (a * b) + ((c * i) + (z * t));
} else {
tmp = (x * y) + ((a * b) + (c * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -1e+230: tmp = y * (x + ((c * i) / y)) elif (x * y) <= 1e+86: tmp = (a * b) + ((c * i) + (z * t)) else: tmp = (x * y) + ((a * b) + (c * i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -1e+230) tmp = Float64(y * Float64(x + Float64(Float64(c * i) / y))); elseif (Float64(x * y) <= 1e+86) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t))); else tmp = Float64(Float64(x * y) + 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) <= -1e+230) tmp = y * (x + ((c * i) / y)); elseif ((x * y) <= 1e+86) tmp = (a * b) + ((c * i) + (z * t)); else tmp = (x * y) + ((a * b) + (c * i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+230], N[(y * N[(x + N[(N[(c * i), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+86], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+230}:\\
\;\;\;\;y \cdot \left(x + \frac{c \cdot i}{y}\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+86}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + \left(a \cdot b + c \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -1.0000000000000001e230Initial program 82.4%
+-commutative82.4%
fma-define82.4%
+-commutative82.4%
fma-define85.3%
fma-define88.2%
Simplified88.2%
Taylor expanded in a around 0 82.6%
Taylor expanded in t around 0 82.6%
Taylor expanded in y around inf 91.4%
if -1.0000000000000001e230 < (*.f64 x y) < 1e86Initial program 97.7%
+-commutative97.7%
fma-define99.4%
+-commutative99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 90.2%
if 1e86 < (*.f64 x y) Initial program 97.7%
associate-+l+97.7%
fma-define97.8%
Simplified97.8%
Taylor expanded in x around inf 91.8%
Final simplification90.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+230)
(* y (+ x (/ (* c i) y)))
(if (<= (* x y) 1e+59)
(+ (* a b) (+ (* c i) (* 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) <= -1e+230) {
tmp = y * (x + ((c * i) / y));
} else if ((x * y) <= 1e+59) {
tmp = (a * b) + ((c * i) + (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) <= (-1d+230)) then
tmp = y * (x + ((c * i) / y))
else if ((x * y) <= 1d+59) then
tmp = (a * b) + ((c * i) + (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) <= -1e+230) {
tmp = y * (x + ((c * i) / y));
} else if ((x * y) <= 1e+59) {
tmp = (a * b) + ((c * i) + (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) <= -1e+230: tmp = y * (x + ((c * i) / y)) elif (x * y) <= 1e+59: tmp = (a * b) + ((c * i) + (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) <= -1e+230) tmp = Float64(y * Float64(x + Float64(Float64(c * i) / y))); elseif (Float64(x * y) <= 1e+59) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + 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) <= -1e+230) tmp = y * (x + ((c * i) / y)); elseif ((x * y) <= 1e+59) tmp = (a * b) + ((c * i) + (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], -1e+230], N[(y * N[(x + N[(N[(c * i), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+59], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $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 -1 \cdot 10^{+230}:\\
\;\;\;\;y \cdot \left(x + \frac{c \cdot i}{y}\right)\\
\mathbf{elif}\;x \cdot y \leq 10^{+59}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + 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.0000000000000001e230Initial program 82.4%
+-commutative82.4%
fma-define82.4%
+-commutative82.4%
fma-define85.3%
fma-define88.2%
Simplified88.2%
Taylor expanded in a around 0 82.6%
Taylor expanded in t around 0 82.6%
Taylor expanded in y around inf 91.4%
if -1.0000000000000001e230 < (*.f64 x y) < 9.99999999999999972e58Initial program 97.7%
+-commutative97.7%
fma-define99.4%
+-commutative99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 90.1%
if 9.99999999999999972e58 < (*.f64 x y) Initial program 97.9%
+-commutative97.9%
fma-define97.9%
+-commutative97.9%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 91.8%
Final simplification90.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -1e+230)
(* y (+ x (/ (* c i) y)))
(if (<= (* x y) 2e+221)
(+ (* a b) (+ (* c i) (* 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) <= -1e+230) {
tmp = y * (x + ((c * i) / y));
} else if ((x * y) <= 2e+221) {
tmp = (a * b) + ((c * i) + (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) <= (-1d+230)) then
tmp = y * (x + ((c * i) / y))
else if ((x * y) <= 2d+221) then
tmp = (a * b) + ((c * i) + (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) <= -1e+230) {
tmp = y * (x + ((c * i) / y));
} else if ((x * y) <= 2e+221) {
tmp = (a * b) + ((c * i) + (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) <= -1e+230: tmp = y * (x + ((c * i) / y)) elif (x * y) <= 2e+221: tmp = (a * b) + ((c * i) + (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) <= -1e+230) tmp = Float64(y * Float64(x + Float64(Float64(c * i) / y))); elseif (Float64(x * y) <= 2e+221) tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + 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) <= -1e+230) tmp = y * (x + ((c * i) / y)); elseif ((x * y) <= 2e+221) tmp = (a * b) + ((c * i) + (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], -1e+230], N[(y * N[(x + N[(N[(c * i), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+221], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $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 -1 \cdot 10^{+230}:\\
\;\;\;\;y \cdot \left(x + \frac{c \cdot i}{y}\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+221}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.0000000000000001e230Initial program 82.4%
+-commutative82.4%
fma-define82.4%
+-commutative82.4%
fma-define85.3%
fma-define88.2%
Simplified88.2%
Taylor expanded in a around 0 82.6%
Taylor expanded in t around 0 82.6%
Taylor expanded in y around inf 91.4%
if -1.0000000000000001e230 < (*.f64 x y) < 2.0000000000000001e221Initial program 97.8%
+-commutative97.8%
fma-define99.4%
+-commutative99.4%
fma-define99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in x around 0 88.7%
if 2.0000000000000001e221 < (*.f64 x y) Initial program 96.9%
+-commutative96.9%
fma-define96.9%
+-commutative96.9%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in t around 0 94.7%
Final simplification89.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* x y) -6.4e+219) (* x y) (if (<= (* x y) 9e-226) (* z t) (if (<= (* x y) 9e+85) (* a b) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -6.4e+219) {
tmp = x * y;
} else if ((x * y) <= 9e-226) {
tmp = z * t;
} else if ((x * y) <= 9e+85) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x * y) <= (-6.4d+219)) then
tmp = x * y
else if ((x * y) <= 9d-226) then
tmp = z * t
else if ((x * y) <= 9d+85) then
tmp = a * b
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -6.4e+219) {
tmp = x * y;
} else if ((x * y) <= 9e-226) {
tmp = z * t;
} else if ((x * y) <= 9e+85) {
tmp = a * b;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -6.4e+219: tmp = x * y elif (x * y) <= 9e-226: tmp = z * t elif (x * y) <= 9e+85: tmp = a * b else: tmp = x * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -6.4e+219) tmp = Float64(x * y); elseif (Float64(x * y) <= 9e-226) tmp = Float64(z * t); elseif (Float64(x * y) <= 9e+85) tmp = Float64(a * b); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -6.4e+219) tmp = x * y; elseif ((x * y) <= 9e-226) tmp = z * t; elseif ((x * y) <= 9e+85) tmp = a * b; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -6.4e+219], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9e-226], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9e+85], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.4 \cdot 10^{+219}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 9 \cdot 10^{-226}:\\
\;\;\;\;z \cdot t\\
\mathbf{elif}\;x \cdot y \leq 9 \cdot 10^{+85}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if (*.f64 x y) < -6.40000000000000053e219 or 9.00000000000000013e85 < (*.f64 x y) Initial program 91.1%
associate-+l+91.1%
fma-define92.4%
Simplified92.4%
Taylor expanded in x around inf 87.8%
Taylor expanded in x around inf 75.4%
if -6.40000000000000053e219 < (*.f64 x y) < 9.00000000000000023e-226Initial program 97.5%
+-commutative97.5%
fma-define99.1%
+-commutative99.1%
fma-define99.2%
fma-define99.2%
Simplified99.2%
Taylor expanded in x around 0 88.4%
Taylor expanded in i around inf 81.4%
associate-+r+81.4%
Simplified81.4%
Taylor expanded in t around inf 35.8%
if 9.00000000000000023e-226 < (*.f64 x y) < 9.00000000000000013e85Initial program 98.1%
+-commutative98.1%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in a around inf 47.0%
Final simplification50.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.25e+225) (not (<= (* x y) 1.25e+221))) (* x y) (+ (* 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.25e+225) || !((x * y) <= 1.25e+221)) {
tmp = x * y;
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((x * y) <= (-1.25d+225)) .or. (.not. ((x * y) <= 1.25d+221))) then
tmp = x * y
else
tmp = (a * b) + (z * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((x * y) <= -1.25e+225) || !((x * y) <= 1.25e+221)) {
tmp = x * y;
} else {
tmp = (a * b) + (z * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -1.25e+225) or not ((x * y) <= 1.25e+221): tmp = x * y else: tmp = (a * b) + (z * t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -1.25e+225) || !(Float64(x * y) <= 1.25e+221)) tmp = Float64(x * y); else tmp = Float64(Float64(a * b) + Float64(z * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((x * y) <= -1.25e+225) || ~(((x * y) <= 1.25e+221))) tmp = x * y; else tmp = (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.25e+225], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.25e+221]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.25 \cdot 10^{+225} \lor \neg \left(x \cdot y \leq 1.25 \cdot 10^{+221}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\end{array}
\end{array}
if (*.f64 x y) < -1.24999999999999995e225 or 1.2500000000000001e221 < (*.f64 x y) Initial program 89.5%
associate-+l+89.5%
fma-define91.0%
Simplified91.0%
Taylor expanded in x around inf 86.9%
Taylor expanded in x around inf 82.6%
if -1.24999999999999995e225 < (*.f64 x y) < 1.2500000000000001e221Initial program 97.8%
+-commutative97.8%
fma-define99.4%
+-commutative99.4%
fma-define99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in x around 0 88.7%
Taylor expanded in c around 0 64.7%
Final simplification69.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -1.9e+240) (not (<= (* x y) 1.3e+221))) (* 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) <= -1.9e+240) || !((x * y) <= 1.3e+221)) {
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) <= (-1.9d+240)) .or. (.not. ((x * y) <= 1.3d+221))) 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) <= -1.9e+240) || !((x * y) <= 1.3e+221)) {
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) <= -1.9e+240) or not ((x * y) <= 1.3e+221): 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) <= -1.9e+240) || !(Float64(x * y) <= 1.3e+221)) 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) <= -1.9e+240) || ~(((x * y) <= 1.3e+221))) 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], -1.9e+240], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.3e+221]], $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 -1.9 \cdot 10^{+240} \lor \neg \left(x \cdot y \leq 1.3 \cdot 10^{+221}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9000000000000002e240 or 1.30000000000000002e221 < (*.f64 x y) Initial program 89.2%
associate-+l+89.2%
fma-define90.8%
Simplified90.8%
Taylor expanded in x around inf 86.5%
Taylor expanded in x around inf 83.6%
if -1.9000000000000002e240 < (*.f64 x y) < 1.30000000000000002e221Initial program 97.9%
+-commutative97.9%
fma-define99.4%
+-commutative99.4%
fma-define99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in x around 0 88.3%
Taylor expanded in c around inf 58.2%
Final simplification64.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* x y) -6.4e+219) (* x y) (if (<= (* x y) 6.4e+88) (+ (* a b) (* z t)) (+ (* x y) (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -6.4e+219) {
tmp = x * y;
} else if ((x * y) <= 6.4e+88) {
tmp = (a * b) + (z * t);
} else {
tmp = (x * y) + (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 ((x * y) <= (-6.4d+219)) then
tmp = x * y
else if ((x * y) <= 6.4d+88) then
tmp = (a * b) + (z * t)
else
tmp = (x * y) + (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 ((x * y) <= -6.4e+219) {
tmp = x * y;
} else if ((x * y) <= 6.4e+88) {
tmp = (a * b) + (z * t);
} else {
tmp = (x * y) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -6.4e+219: tmp = x * y elif (x * y) <= 6.4e+88: tmp = (a * b) + (z * t) else: tmp = (x * y) + (a * b) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -6.4e+219) tmp = Float64(x * y); elseif (Float64(x * y) <= 6.4e+88) tmp = Float64(Float64(a * b) + Float64(z * t)); else tmp = Float64(Float64(x * y) + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -6.4e+219) tmp = x * y; elseif ((x * y) <= 6.4e+88) tmp = (a * b) + (z * t); else tmp = (x * y) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -6.4e+219], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.4e+88], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.4 \cdot 10^{+219}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{+88}:\\
\;\;\;\;a \cdot b + z \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot y + a \cdot b\\
\end{array}
\end{array}
if (*.f64 x y) < -6.40000000000000053e219Initial program 82.4%
associate-+l+82.4%
fma-define85.3%
Simplified85.3%
Taylor expanded in x around inf 82.4%
Taylor expanded in x around inf 76.5%
if -6.40000000000000053e219 < (*.f64 x y) < 6.3999999999999997e88Initial program 97.7%
+-commutative97.7%
fma-define99.4%
+-commutative99.4%
fma-define99.4%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 90.2%
Taylor expanded in c around 0 66.1%
if 6.3999999999999997e88 < (*.f64 x y) Initial program 97.7%
associate-+l+97.7%
fma-define97.8%
Simplified97.8%
Taylor expanded in x around inf 91.8%
Taylor expanded in c around 0 81.1%
Final simplification70.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* a b) -3.25e+53) (not (<= (* a b) 7.6e+143))) (* 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) <= -3.25e+53) || !((a * b) <= 7.6e+143)) {
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) <= (-3.25d+53)) .or. (.not. ((a * b) <= 7.6d+143))) 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) <= -3.25e+53) || !((a * b) <= 7.6e+143)) {
tmp = a * b;
} else {
tmp = c * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((a * b) <= -3.25e+53) or not ((a * b) <= 7.6e+143): 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) <= -3.25e+53) || !(Float64(a * b) <= 7.6e+143)) 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) <= -3.25e+53) || ~(((a * b) <= 7.6e+143))) 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], -3.25e+53], N[Not[LessEqual[N[(a * b), $MachinePrecision], 7.6e+143]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -3.25 \cdot 10^{+53} \lor \neg \left(a \cdot b \leq 7.6 \cdot 10^{+143}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 a b) < -3.25000000000000008e53 or 7.60000000000000001e143 < (*.f64 a b) Initial program 92.6%
+-commutative92.6%
fma-define95.8%
+-commutative95.8%
fma-define97.9%
fma-define97.9%
Simplified97.9%
Taylor expanded in a around inf 61.1%
if -3.25000000000000008e53 < (*.f64 a b) < 7.60000000000000001e143Initial program 97.5%
+-commutative97.5%
fma-define97.5%
+-commutative97.5%
fma-define97.5%
fma-define98.1%
Simplified98.1%
Taylor expanded in c around inf 32.5%
Final simplification43.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 95.7%
+-commutative95.7%
fma-define96.8%
+-commutative96.8%
fma-define97.6%
fma-define98.0%
Simplified98.0%
Taylor expanded in a around inf 26.8%
herbie shell --seed 2024130
(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)))