
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* y (- x (* c (* (fma c b a) (/ i y)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (y * (x - (c * (fma(c, b, a) * (i / y)))));
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(y * Float64(x - Float64(c * Float64(fma(c, b, a) * Float64(i / y)))))); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(x - N[(c * N[(N[(c * b + a), $MachinePrecision] * N[(i / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x - c \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot \frac{i}{y}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 96.4%
fma-define96.4%
associate-*l*99.7%
Simplified99.7%
fma-define99.7%
+-commutative99.7%
Applied egg-rr99.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in x around inf 50.0%
Taylor expanded in t around 0 66.7%
Taylor expanded in y around inf 66.7%
mul-1-neg66.7%
unsub-neg66.7%
associate-/l*75.0%
*-commutative75.0%
associate-/l*75.0%
+-commutative75.0%
*-commutative75.0%
fma-define75.0%
Simplified75.0%
Final simplification98.6%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 2.0 (* z t)))
(t_2 (* (* a (* c i)) -2.0))
(t_3 (* (* x y) 2.0)))
(if (<= y -7.5e-41)
t_3
(if (<= y -3.6e-124)
t_1
(if (<= y -6e-291)
t_2
(if (<= y 3.6e-151)
t_1
(if (<= y 1.5e-65)
t_2
(if (<= y 4.4e-10)
t_1
(if (<= y 1.8e+17) t_2 (if (<= y 5.5e+111) t_1 t_3))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (a * (c * i)) * -2.0;
double t_3 = (x * y) * 2.0;
double tmp;
if (y <= -7.5e-41) {
tmp = t_3;
} else if (y <= -3.6e-124) {
tmp = t_1;
} else if (y <= -6e-291) {
tmp = t_2;
} else if (y <= 3.6e-151) {
tmp = t_1;
} else if (y <= 1.5e-65) {
tmp = t_2;
} else if (y <= 4.4e-10) {
tmp = t_1;
} else if (y <= 1.8e+17) {
tmp = t_2;
} else if (y <= 5.5e+111) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 2.0d0 * (z * t)
t_2 = (a * (c * i)) * (-2.0d0)
t_3 = (x * y) * 2.0d0
if (y <= (-7.5d-41)) then
tmp = t_3
else if (y <= (-3.6d-124)) then
tmp = t_1
else if (y <= (-6d-291)) then
tmp = t_2
else if (y <= 3.6d-151) then
tmp = t_1
else if (y <= 1.5d-65) then
tmp = t_2
else if (y <= 4.4d-10) then
tmp = t_1
else if (y <= 1.8d+17) then
tmp = t_2
else if (y <= 5.5d+111) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 2.0 * (z * t);
double t_2 = (a * (c * i)) * -2.0;
double t_3 = (x * y) * 2.0;
double tmp;
if (y <= -7.5e-41) {
tmp = t_3;
} else if (y <= -3.6e-124) {
tmp = t_1;
} else if (y <= -6e-291) {
tmp = t_2;
} else if (y <= 3.6e-151) {
tmp = t_1;
} else if (y <= 1.5e-65) {
tmp = t_2;
} else if (y <= 4.4e-10) {
tmp = t_1;
} else if (y <= 1.8e+17) {
tmp = t_2;
} else if (y <= 5.5e+111) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = 2.0 * (z * t) t_2 = (a * (c * i)) * -2.0 t_3 = (x * y) * 2.0 tmp = 0 if y <= -7.5e-41: tmp = t_3 elif y <= -3.6e-124: tmp = t_1 elif y <= -6e-291: tmp = t_2 elif y <= 3.6e-151: tmp = t_1 elif y <= 1.5e-65: tmp = t_2 elif y <= 4.4e-10: tmp = t_1 elif y <= 1.8e+17: tmp = t_2 elif y <= 5.5e+111: tmp = t_1 else: tmp = t_3 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(2.0 * Float64(z * t)) t_2 = Float64(Float64(a * Float64(c * i)) * -2.0) t_3 = Float64(Float64(x * y) * 2.0) tmp = 0.0 if (y <= -7.5e-41) tmp = t_3; elseif (y <= -3.6e-124) tmp = t_1; elseif (y <= -6e-291) tmp = t_2; elseif (y <= 3.6e-151) tmp = t_1; elseif (y <= 1.5e-65) tmp = t_2; elseif (y <= 4.4e-10) tmp = t_1; elseif (y <= 1.8e+17) tmp = t_2; elseif (y <= 5.5e+111) tmp = t_1; else tmp = t_3; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = 2.0 * (z * t);
t_2 = (a * (c * i)) * -2.0;
t_3 = (x * y) * 2.0;
tmp = 0.0;
if (y <= -7.5e-41)
tmp = t_3;
elseif (y <= -3.6e-124)
tmp = t_1;
elseif (y <= -6e-291)
tmp = t_2;
elseif (y <= 3.6e-151)
tmp = t_1;
elseif (y <= 1.5e-65)
tmp = t_2;
elseif (y <= 4.4e-10)
tmp = t_1;
elseif (y <= 1.8e+17)
tmp = t_2;
elseif (y <= 5.5e+111)
tmp = t_1;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[y, -7.5e-41], t$95$3, If[LessEqual[y, -3.6e-124], t$95$1, If[LessEqual[y, -6e-291], t$95$2, If[LessEqual[y, 3.6e-151], t$95$1, If[LessEqual[y, 1.5e-65], t$95$2, If[LessEqual[y, 4.4e-10], t$95$1, If[LessEqual[y, 1.8e+17], t$95$2, If[LessEqual[y, 5.5e+111], t$95$1, t$95$3]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
t_3 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{-41}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{-124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6 \cdot 10^{-291}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-65}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y < -7.50000000000000049e-41 or 5.4999999999999998e111 < y Initial program 90.5%
Taylor expanded in x around inf 43.8%
if -7.50000000000000049e-41 < y < -3.6000000000000001e-124 or -6.0000000000000001e-291 < y < 3.60000000000000032e-151 or 1.49999999999999999e-65 < y < 4.3999999999999998e-10 or 1.8e17 < y < 5.4999999999999998e111Initial program 97.2%
Taylor expanded in z around inf 38.2%
if -3.6000000000000001e-124 < y < -6.0000000000000001e-291 or 3.60000000000000032e-151 < y < 1.49999999999999999e-65 or 4.3999999999999998e-10 < y < 1.8e17Initial program 88.3%
Taylor expanded in a around inf 31.7%
mul-1-neg31.7%
*-commutative31.7%
associate-*l*30.1%
*-commutative30.1%
distribute-rgt-neg-in30.1%
*-commutative30.1%
distribute-rgt-neg-in30.1%
Simplified30.1%
Taylor expanded in c around 0 31.7%
Final simplification39.5%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* c (* (+ a (* b c)) i))) (t_2 (* 2.0 (- (* x y) t_1))))
(if (<= (* x y) -5e+34)
t_2
(if (<= (* x y) 1e+40)
(* 2.0 (- (* z t) t_1))
(if (<= (* x y) 5e+122)
(* (+ (* x y) (* z t)) 2.0)
(if (<= (* x y) 4e+292)
t_2
(* 2.0 (* x (- y (* c (* a (/ i x))))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((x * y) - t_1);
double tmp;
if ((x * y) <= -5e+34) {
tmp = t_2;
} else if ((x * y) <= 1e+40) {
tmp = 2.0 * ((z * t) - t_1);
} else if ((x * y) <= 5e+122) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((x * y) <= 4e+292) {
tmp = t_2;
} else {
tmp = 2.0 * (x * (y - (c * (a * (i / x)))));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = c * ((a + (b * c)) * i)
t_2 = 2.0d0 * ((x * y) - t_1)
if ((x * y) <= (-5d+34)) then
tmp = t_2
else if ((x * y) <= 1d+40) then
tmp = 2.0d0 * ((z * t) - t_1)
else if ((x * y) <= 5d+122) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if ((x * y) <= 4d+292) then
tmp = t_2
else
tmp = 2.0d0 * (x * (y - (c * (a * (i / x)))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = c * ((a + (b * c)) * i);
double t_2 = 2.0 * ((x * y) - t_1);
double tmp;
if ((x * y) <= -5e+34) {
tmp = t_2;
} else if ((x * y) <= 1e+40) {
tmp = 2.0 * ((z * t) - t_1);
} else if ((x * y) <= 5e+122) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if ((x * y) <= 4e+292) {
tmp = t_2;
} else {
tmp = 2.0 * (x * (y - (c * (a * (i / x)))));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = c * ((a + (b * c)) * i) t_2 = 2.0 * ((x * y) - t_1) tmp = 0 if (x * y) <= -5e+34: tmp = t_2 elif (x * y) <= 1e+40: tmp = 2.0 * ((z * t) - t_1) elif (x * y) <= 5e+122: tmp = ((x * y) + (z * t)) * 2.0 elif (x * y) <= 4e+292: tmp = t_2 else: tmp = 2.0 * (x * (y - (c * (a * (i / x))))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i)) t_2 = Float64(2.0 * Float64(Float64(x * y) - t_1)) tmp = 0.0 if (Float64(x * y) <= -5e+34) tmp = t_2; elseif (Float64(x * y) <= 1e+40) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (Float64(x * y) <= 5e+122) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (Float64(x * y) <= 4e+292) tmp = t_2; else tmp = Float64(2.0 * Float64(x * Float64(y - Float64(c * Float64(a * Float64(i / x)))))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = c * ((a + (b * c)) * i);
t_2 = 2.0 * ((x * y) - t_1);
tmp = 0.0;
if ((x * y) <= -5e+34)
tmp = t_2;
elseif ((x * y) <= 1e+40)
tmp = 2.0 * ((z * t) - t_1);
elseif ((x * y) <= 5e+122)
tmp = ((x * y) + (z * t)) * 2.0;
elseif ((x * y) <= 4e+292)
tmp = t_2;
else
tmp = 2.0 * (x * (y - (c * (a * (i / x)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+34], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1e+40], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+122], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+292], t$95$2, N[(2.0 * N[(x * N[(y - N[(c * N[(a * N[(i / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
t_2 := 2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \cdot y \leq 10^{+40}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+122}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+292}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y - c \cdot \left(a \cdot \frac{i}{x}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.9999999999999998e34 or 4.99999999999999989e122 < (*.f64 x y) < 4.0000000000000001e292Initial program 89.5%
Taylor expanded in z around 0 79.6%
if -4.9999999999999998e34 < (*.f64 x y) < 1.00000000000000003e40Initial program 94.9%
Taylor expanded in x around 0 88.8%
if 1.00000000000000003e40 < (*.f64 x y) < 4.99999999999999989e122Initial program 87.3%
Taylor expanded in c around 0 93.3%
if 4.0000000000000001e292 < (*.f64 x y) Initial program 80.8%
Taylor expanded in x around inf 84.6%
Taylor expanded in t around 0 88.5%
Taylor expanded in b around 0 96.2%
associate-/l*96.2%
associate-/l*96.2%
associate-*r*96.2%
*-commutative96.2%
associate-*r*96.2%
Simplified96.2%
Final simplification87.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
(if (<= (- t_2 (* (* c t_1) i)) INFINITY)
(* 2.0 (- t_2 (* t_1 (* c i))))
(* 2.0 (* t (- z (* a (* c (/ i t)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (t * (z - (a * (c * (i / t)))));
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (x * y) + (z * t);
double tmp;
if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
} else {
tmp = 2.0 * (t * (z - (a * (c * (i / t)))));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (x * y) + (z * t) tmp = 0 if (t_2 - ((c * t_1) * i)) <= math.inf: tmp = 2.0 * (t_2 - (t_1 * (c * i))) else: tmp = 2.0 * (t * (z - (a * (c * (i / t))))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(x * y) + Float64(z * t)) tmp = 0.0 if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf) tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i)))); else tmp = Float64(2.0 * Float64(t * Float64(z - Float64(a * Float64(c * Float64(i / t)))))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = a + (b * c);
t_2 = (x * y) + (z * t);
tmp = 0.0;
if ((t_2 - ((c * t_1) * i)) <= Inf)
tmp = 2.0 * (t_2 - (t_1 * (c * i)));
else
tmp = 2.0 * (t * (z - (a * (c * (i / t)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * N[(z - N[(a * N[(c * N[(i / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t \cdot \left(z - a \cdot \left(c \cdot \frac{i}{t}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0Initial program 96.4%
fma-define96.4%
associate-*l*99.7%
Simplified99.7%
fma-define99.7%
+-commutative99.7%
Applied egg-rr99.7%
if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) Initial program 0.0%
Taylor expanded in x around 0 50.0%
Taylor expanded in c around 0 42.3%
*-commutative42.3%
associate-*r*42.3%
Simplified42.3%
Taylor expanded in t around inf 58.3%
mul-1-neg58.3%
unsub-neg58.3%
associate-/l*66.7%
associate-/l*66.7%
Simplified66.7%
Final simplification98.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* a (* c i))))
(if (<= c -15.0)
(* 2.0 (* c (* (+ a (* b c)) (- i))))
(if (<= c 2.15e-256)
(* (+ (* x y) (* z t)) 2.0)
(if (<= c 3.9e-182)
(* 2.0 (- (* z t) t_1))
(if (<= c 1.85e-44)
(* 2.0 (- (* x y) t_1))
(* 2.0 (- (* z t) (* c (* b (* c i)))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a * (c * i);
double tmp;
if (c <= -15.0) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else if (c <= 2.15e-256) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 3.9e-182) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 1.85e-44) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = a * (c * i)
if (c <= (-15.0d0)) then
tmp = 2.0d0 * (c * ((a + (b * c)) * -i))
else if (c <= 2.15d-256) then
tmp = ((x * y) + (z * t)) * 2.0d0
else if (c <= 3.9d-182) then
tmp = 2.0d0 * ((z * t) - t_1)
else if (c <= 1.85d-44) then
tmp = 2.0d0 * ((x * y) - t_1)
else
tmp = 2.0d0 * ((z * t) - (c * (b * (c * i))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a * (c * i);
double tmp;
if (c <= -15.0) {
tmp = 2.0 * (c * ((a + (b * c)) * -i));
} else if (c <= 2.15e-256) {
tmp = ((x * y) + (z * t)) * 2.0;
} else if (c <= 3.9e-182) {
tmp = 2.0 * ((z * t) - t_1);
} else if (c <= 1.85e-44) {
tmp = 2.0 * ((x * y) - t_1);
} else {
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = a * (c * i) tmp = 0 if c <= -15.0: tmp = 2.0 * (c * ((a + (b * c)) * -i)) elif c <= 2.15e-256: tmp = ((x * y) + (z * t)) * 2.0 elif c <= 3.9e-182: tmp = 2.0 * ((z * t) - t_1) elif c <= 1.85e-44: tmp = 2.0 * ((x * y) - t_1) else: tmp = 2.0 * ((z * t) - (c * (b * (c * i)))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(a * Float64(c * i)) tmp = 0.0 if (c <= -15.0) tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))); elseif (c <= 2.15e-256) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); elseif (c <= 3.9e-182) tmp = Float64(2.0 * Float64(Float64(z * t) - t_1)); elseif (c <= 1.85e-44) tmp = Float64(2.0 * Float64(Float64(x * y) - t_1)); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = a * (c * i);
tmp = 0.0;
if (c <= -15.0)
tmp = 2.0 * (c * ((a + (b * c)) * -i));
elseif (c <= 2.15e-256)
tmp = ((x * y) + (z * t)) * 2.0;
elseif (c <= 3.9e-182)
tmp = 2.0 * ((z * t) - t_1);
elseif (c <= 1.85e-44)
tmp = 2.0 * ((x * y) - t_1);
else
tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -15.0], N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.15e-256], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 3.9e-182], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.85e-44], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(c \cdot i\right)\\
\mathbf{if}\;c \leq -15:\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{elif}\;c \leq 2.15 \cdot 10^{-256}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{elif}\;c \leq 3.9 \cdot 10^{-182}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\
\mathbf{elif}\;c \leq 1.85 \cdot 10^{-44}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if c < -15Initial program 83.6%
Taylor expanded in i around inf 74.9%
if -15 < c < 2.1500000000000001e-256Initial program 97.5%
Taylor expanded in c around 0 82.7%
if 2.1500000000000001e-256 < c < 3.9e-182Initial program 93.1%
Taylor expanded in a around inf 93.1%
*-commutative93.1%
Simplified93.1%
Taylor expanded in x around 0 97.3%
if 3.9e-182 < c < 1.85e-44Initial program 99.8%
Taylor expanded in a around inf 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in z around 0 70.4%
if 1.85e-44 < c Initial program 88.9%
Taylor expanded in x around 0 90.2%
Taylor expanded in a around 0 79.1%
Final simplification79.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (+ (* x y) (* z t)) 2.0))
(t_2 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
(if (<= c -32000.0)
t_2
(if (<= c 7.2e-256)
t_1
(if (<= c 1.1e-192)
(* 2.0 (- (* z t) (* a (* c i))))
(if (<= c 1.8e-64) t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -32000.0) {
tmp = t_2;
} else if (c <= 7.2e-256) {
tmp = t_1;
} else if (c <= 1.1e-192) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= 1.8e-64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * y) + (z * t)) * 2.0d0
t_2 = 2.0d0 * (c * ((a + (b * c)) * -i))
if (c <= (-32000.0d0)) then
tmp = t_2
else if (c <= 7.2d-256) then
tmp = t_1
else if (c <= 1.1d-192) then
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
else if (c <= 1.8d-64) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((x * y) + (z * t)) * 2.0;
double t_2 = 2.0 * (c * ((a + (b * c)) * -i));
double tmp;
if (c <= -32000.0) {
tmp = t_2;
} else if (c <= 7.2e-256) {
tmp = t_1;
} else if (c <= 1.1e-192) {
tmp = 2.0 * ((z * t) - (a * (c * i)));
} else if (c <= 1.8e-64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = ((x * y) + (z * t)) * 2.0 t_2 = 2.0 * (c * ((a + (b * c)) * -i)) tmp = 0 if c <= -32000.0: tmp = t_2 elif c <= 7.2e-256: tmp = t_1 elif c <= 1.1e-192: tmp = 2.0 * ((z * t) - (a * (c * i))) elif c <= 1.8e-64: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0) t_2 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i)))) tmp = 0.0 if (c <= -32000.0) tmp = t_2; elseif (c <= 7.2e-256) tmp = t_1; elseif (c <= 1.1e-192) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); elseif (c <= 1.8e-64) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = ((x * y) + (z * t)) * 2.0;
t_2 = 2.0 * (c * ((a + (b * c)) * -i));
tmp = 0.0;
if (c <= -32000.0)
tmp = t_2;
elseif (c <= 7.2e-256)
tmp = t_1;
elseif (c <= 1.1e-192)
tmp = 2.0 * ((z * t) - (a * (c * i)));
elseif (c <= 1.8e-64)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -32000.0], t$95$2, If[LessEqual[c, 7.2e-256], t$95$1, If[LessEqual[c, 1.1e-192], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.8e-64], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -32000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 7.2 \cdot 10^{-256}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 1.1 \cdot 10^{-192}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\mathbf{elif}\;c \leq 1.8 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -32000 or 1.7999999999999999e-64 < c Initial program 86.8%
Taylor expanded in i around inf 75.2%
if -32000 < c < 7.2000000000000004e-256 or 1.10000000000000003e-192 < c < 1.7999999999999999e-64Initial program 98.1%
Taylor expanded in c around 0 81.3%
if 7.2000000000000004e-256 < c < 1.10000000000000003e-192Initial program 92.6%
Taylor expanded in a around inf 92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in x around 0 97.0%
Final simplification78.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
(if (<= t_2 -2e+263)
(* 2.0 (* c (* t_1 (- i))))
(* (- (+ (* x y) (* z t)) t_2) 2.0))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= -2e+263) {
tmp = 2.0 * (c * (t_1 * -i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a + (b * c)
t_2 = (c * t_1) * i
if (t_2 <= (-2d+263)) then
tmp = 2.0d0 * (c * (t_1 * -i))
else
tmp = (((x * y) + (z * t)) - t_2) * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * c);
double t_2 = (c * t_1) * i;
double tmp;
if (t_2 <= -2e+263) {
tmp = 2.0 * (c * (t_1 * -i));
} else {
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = a + (b * c) t_2 = (c * t_1) * i tmp = 0 if t_2 <= -2e+263: tmp = 2.0 * (c * (t_1 * -i)) else: tmp = (((x * y) + (z * t)) - t_2) * 2.0 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * c)) t_2 = Float64(Float64(c * t_1) * i) tmp = 0.0 if (t_2 <= -2e+263) tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i)))); else tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = a + (b * c);
t_2 = (c * t_1) * i;
tmp = 0.0;
if (t_2 <= -2e+263)
tmp = 2.0 * (c * (t_1 * -i));
else
tmp = (((x * y) + (z * t)) - t_2) * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+263], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+263}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t\_1 \cdot \left(-i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -2.00000000000000003e263Initial program 75.9%
Taylor expanded in i around inf 93.9%
if -2.00000000000000003e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) Initial program 95.6%
Final simplification95.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= c -170000.0) (not (<= c 1.4e-55))) (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))) (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -170000.0) || !(c <= 1.4e-55)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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 <= (-170000.0d0)) .or. (.not. (c <= 1.4d-55))) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c <= -170000.0) || !(c <= 1.4e-55)) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (c <= -170000.0) or not (c <= 1.4e-55): tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((c <= -170000.0) || !(c <= 1.4e-55)) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c)))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((c <= -170000.0) || ~((c <= 1.4e-55)))
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
else
tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -170000.0], N[Not[LessEqual[c, 1.4e-55]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -170000 \lor \neg \left(c \leq 1.4 \cdot 10^{-55}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\
\end{array}
\end{array}
if c < -1.7e5 or 1.39999999999999992e-55 < c Initial program 86.6%
Taylor expanded in x around 0 87.4%
if -1.7e5 < c < 1.39999999999999992e-55Initial program 97.5%
Taylor expanded in a around inf 92.6%
*-commutative92.6%
Simplified92.6%
Final simplification89.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= (* x y) -5e-22) (not (<= (* x y) 5e-45))) (* (+ (* x y) (* z t)) 2.0) (* 2.0 (- (* z t) (* a (* c i))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && 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) <= -5e-22) || !((x * y) <= 5e-45)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (a * (c * i)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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) <= (-5d-22)) .or. (.not. ((x * y) <= 5d-45))) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = 2.0d0 * ((z * t) - (a * (c * i)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
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) <= -5e-22) || !((x * y) <= 5e-45)) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = 2.0 * ((z * t) - (a * (c * i)));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if ((x * y) <= -5e-22) or not ((x * y) <= 5e-45): tmp = ((x * y) + (z * t)) * 2.0 else: tmp = 2.0 * ((z * t) - (a * (c * i))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(x * y) <= -5e-22) || !(Float64(x * y) <= 5e-45)) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i)))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (((x * y) <= -5e-22) || ~(((x * y) <= 5e-45)))
tmp = ((x * y) + (z * t)) * 2.0;
else
tmp = 2.0 * ((z * t) - (a * (c * i)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e-22], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e-45]], $MachinePrecision]], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{-22} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{-45}\right):\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 x y) < -4.99999999999999954e-22 or 4.99999999999999976e-45 < (*.f64 x y) Initial program 90.6%
Taylor expanded in c around 0 66.7%
if -4.99999999999999954e-22 < (*.f64 x y) < 4.99999999999999976e-45Initial program 93.3%
Taylor expanded in a around inf 65.4%
*-commutative65.4%
Simplified65.4%
Taylor expanded in x around 0 65.7%
Final simplification66.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (<= y -1.16e+70)
(* 2.0 (* x (- y (* c (* a (/ i x))))))
(if (<= y 2.5e+105)
(* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))
(* (+ (* x y) (* z t)) 2.0))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -1.16e+70) {
tmp = 2.0 * (x * (y - (c * (a * (i / x)))));
} else if (y <= 2.5e+105) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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 (y <= (-1.16d+70)) then
tmp = 2.0d0 * (x * (y - (c * (a * (i / x)))))
else if (y <= 2.5d+105) then
tmp = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
else
tmp = ((x * y) + (z * t)) * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -1.16e+70) {
tmp = 2.0 * (x * (y - (c * (a * (i / x)))));
} else if (y <= 2.5e+105) {
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
} else {
tmp = ((x * y) + (z * t)) * 2.0;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -1.16e+70: tmp = 2.0 * (x * (y - (c * (a * (i / x))))) elif y <= 2.5e+105: tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i))) else: tmp = ((x * y) + (z * t)) * 2.0 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -1.16e+70) tmp = Float64(2.0 * Float64(x * Float64(y - Float64(c * Float64(a * Float64(i / x)))))); elseif (y <= 2.5e+105) tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i)))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (y <= -1.16e+70)
tmp = 2.0 * (x * (y - (c * (a * (i / x)))));
elseif (y <= 2.5e+105)
tmp = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
else
tmp = ((x * y) + (z * t)) * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -1.16e+70], N[(2.0 * N[(x * N[(y - N[(c * N[(a * N[(i / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+105], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.16 \cdot 10^{+70}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y - c \cdot \left(a \cdot \frac{i}{x}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+105}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\end{array}
\end{array}
if y < -1.1599999999999999e70Initial program 91.9%
Taylor expanded in x around inf 83.1%
Taylor expanded in t around 0 71.1%
Taylor expanded in b around 0 53.5%
associate-/l*53.6%
associate-/l*50.6%
associate-*r*49.0%
*-commutative49.0%
associate-*r*44.6%
Simplified44.6%
if -1.1599999999999999e70 < y < 2.50000000000000023e105Initial program 93.4%
Taylor expanded in x around 0 82.3%
if 2.50000000000000023e105 < y Initial program 86.6%
Taylor expanded in c around 0 75.6%
Final simplification71.8%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= y -7e-35) (not (<= y 2e+111))) (* (* x y) 2.0) (* 2.0 (* z t))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -7e-35) || !(y <= 2e+111)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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 ((y <= (-7d-35)) .or. (.not. (y <= 2d+111))) then
tmp = (x * y) * 2.0d0
else
tmp = 2.0d0 * (z * t)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((y <= -7e-35) || !(y <= 2e+111)) {
tmp = (x * y) * 2.0;
} else {
tmp = 2.0 * (z * t);
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (y <= -7e-35) or not (y <= 2e+111): tmp = (x * y) * 2.0 else: tmp = 2.0 * (z * t) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((y <= -7e-35) || !(y <= 2e+111)) tmp = Float64(Float64(x * y) * 2.0); else tmp = Float64(2.0 * Float64(z * t)); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((y <= -7e-35) || ~((y <= 2e+111)))
tmp = (x * y) * 2.0;
else
tmp = 2.0 * (z * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -7e-35], N[Not[LessEqual[y, 2e+111]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-35} \lor \neg \left(y \leq 2 \cdot 10^{+111}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if y < -6.99999999999999992e-35 or 1.99999999999999991e111 < y Initial program 90.4%
Taylor expanded in x around inf 43.4%
if -6.99999999999999992e-35 < y < 1.99999999999999991e111Initial program 93.2%
Taylor expanded in z around inf 33.9%
Final simplification38.6%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= i 1.5e+167) (* (+ (* x y) (* z t)) 2.0) (* (* a (* c i)) -2.0)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= 1.5e+167) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (a * (c * i)) * -2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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 (i <= 1.5d+167) then
tmp = ((x * y) + (z * t)) * 2.0d0
else
tmp = (a * (c * i)) * (-2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= 1.5e+167) {
tmp = ((x * y) + (z * t)) * 2.0;
} else {
tmp = (a * (c * i)) * -2.0;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if i <= 1.5e+167: tmp = ((x * y) + (z * t)) * 2.0 else: tmp = (a * (c * i)) * -2.0 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (i <= 1.5e+167) tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0); else tmp = Float64(Float64(a * Float64(c * i)) * -2.0); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (i <= 1.5e+167)
tmp = ((x * y) + (z * t)) * 2.0;
else
tmp = (a * (c * i)) * -2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, 1.5e+167], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.5 \cdot 10^{+167}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\end{array}
\end{array}
if i < 1.50000000000000006e167Initial program 91.8%
Taylor expanded in c around 0 58.8%
if 1.50000000000000006e167 < i Initial program 92.2%
Taylor expanded in a around inf 58.8%
mul-1-neg58.8%
*-commutative58.8%
associate-*l*53.8%
*-commutative53.8%
distribute-rgt-neg-in53.8%
*-commutative53.8%
distribute-rgt-neg-in53.8%
Simplified53.8%
Taylor expanded in c around 0 58.8%
Final simplification58.8%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
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 = 2.0d0 * (z * t)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (z * t);
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): return 2.0 * (z * t)
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(z * t)) end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = 2.0 * (z * t);
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Initial program 91.9%
Taylor expanded in z around inf 28.4%
Final simplification28.4%
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (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 = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (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 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i): return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i) return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
herbie shell --seed 2024108
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))