
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* (* y 9.0) z) 5e+219) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0))))) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * 9.0) * z) <= 5e+219) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * 9.0) * z) <= 5e+219) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], 5e+219], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 5 \cdot 10^{+219}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 5e219Initial program 97.7%
+-commutative97.7%
associate-+r-97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
associate-*r*96.8%
distribute-lft-neg-in96.8%
*-commutative96.8%
cancel-sign-sub-inv96.8%
associate-+r-96.8%
associate-*l*96.8%
fma-define96.8%
cancel-sign-sub-inv96.8%
fma-define96.8%
distribute-lft-neg-in96.8%
distribute-rgt-neg-in96.8%
*-commutative96.8%
associate-*r*97.6%
associate-*l*97.6%
neg-mul-197.6%
associate-*r*97.6%
Simplified97.6%
if 5e219 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 81.9%
+-commutative81.9%
associate-+r-81.9%
*-commutative81.9%
cancel-sign-sub-inv81.9%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.2%
fma-define97.2%
fma-neg97.2%
associate-*l*97.1%
distribute-rgt-neg-in97.1%
*-commutative97.1%
associate-*l*97.2%
*-commutative97.2%
distribute-lft-neg-in97.2%
associate-*r*97.1%
Simplified97.1%
Final simplification97.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -3e+75) (* y (- (+ (* 2.0 (/ x y)) (* 27.0 (/ (* a b) y))) (* 9.0 (* z t)))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3e+75) {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * t)));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3e+75) tmp = Float64(y * Float64(Float64(Float64(2.0 * Float64(x / y)) + Float64(27.0 * Float64(Float64(a * b) / y))) - Float64(9.0 * Float64(z * t)))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3e+75], N[(y * N[(N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+75}:\\
\;\;\;\;y \cdot \left(\left(2 \cdot \frac{x}{y} + 27 \cdot \frac{a \cdot b}{y}\right) - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -3e75Initial program 88.6%
sub-neg88.6%
sub-neg88.6%
associate-*l*93.2%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in y around inf 79.7%
if -3e75 < z Initial program 96.7%
+-commutative96.7%
associate-+r-96.7%
*-commutative96.7%
cancel-sign-sub-inv96.7%
associate-*r*96.3%
distribute-lft-neg-in96.3%
*-commutative96.3%
cancel-sign-sub-inv96.3%
associate-+r-96.3%
associate-*l*96.3%
fma-define96.3%
cancel-sign-sub-inv96.3%
fma-define96.3%
distribute-lft-neg-in96.3%
distribute-rgt-neg-in96.3%
*-commutative96.3%
associate-*r*96.7%
associate-*l*96.7%
neg-mul-196.7%
associate-*r*96.7%
Simplified96.7%
Final simplification93.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* 27.0 b))) (t_2 (* -9.0 (* t (* y z)))))
(if (<= z -2.1e-89)
t_2
(if (<= z -1.4e-174)
(* x 2.0)
(if (<= z -2.3e-212)
t_1
(if (<= z -3.6e-279)
(* x 2.0)
(if (<= z 6.2e-297) t_1 (if (<= z 1.4e-87) (* x 2.0) t_2))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double t_2 = -9.0 * (t * (y * z));
double tmp;
if (z <= -2.1e-89) {
tmp = t_2;
} else if (z <= -1.4e-174) {
tmp = x * 2.0;
} else if (z <= -2.3e-212) {
tmp = t_1;
} else if (z <= -3.6e-279) {
tmp = x * 2.0;
} else if (z <= 6.2e-297) {
tmp = t_1;
} else if (z <= 1.4e-87) {
tmp = x * 2.0;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (27.0d0 * b)
t_2 = (-9.0d0) * (t * (y * z))
if (z <= (-2.1d-89)) then
tmp = t_2
else if (z <= (-1.4d-174)) then
tmp = x * 2.0d0
else if (z <= (-2.3d-212)) then
tmp = t_1
else if (z <= (-3.6d-279)) then
tmp = x * 2.0d0
else if (z <= 6.2d-297) then
tmp = t_1
else if (z <= 1.4d-87) then
tmp = x * 2.0d0
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double t_2 = -9.0 * (t * (y * z));
double tmp;
if (z <= -2.1e-89) {
tmp = t_2;
} else if (z <= -1.4e-174) {
tmp = x * 2.0;
} else if (z <= -2.3e-212) {
tmp = t_1;
} else if (z <= -3.6e-279) {
tmp = x * 2.0;
} else if (z <= 6.2e-297) {
tmp = t_1;
} else if (z <= 1.4e-87) {
tmp = x * 2.0;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) t_2 = -9.0 * (t * (y * z)) tmp = 0 if z <= -2.1e-89: tmp = t_2 elif z <= -1.4e-174: tmp = x * 2.0 elif z <= -2.3e-212: tmp = t_1 elif z <= -3.6e-279: tmp = x * 2.0 elif z <= 6.2e-297: tmp = t_1 elif z <= 1.4e-87: tmp = x * 2.0 else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) t_2 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (z <= -2.1e-89) tmp = t_2; elseif (z <= -1.4e-174) tmp = Float64(x * 2.0); elseif (z <= -2.3e-212) tmp = t_1; elseif (z <= -3.6e-279) tmp = Float64(x * 2.0); elseif (z <= 6.2e-297) tmp = t_1; elseif (z <= 1.4e-87) tmp = Float64(x * 2.0); else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
t_2 = -9.0 * (t * (y * z));
tmp = 0.0;
if (z <= -2.1e-89)
tmp = t_2;
elseif (z <= -1.4e-174)
tmp = x * 2.0;
elseif (z <= -2.3e-212)
tmp = t_1;
elseif (z <= -3.6e-279)
tmp = x * 2.0;
elseif (z <= 6.2e-297)
tmp = t_1;
elseif (z <= 1.4e-87)
tmp = x * 2.0;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e-89], t$95$2, If[LessEqual[z, -1.4e-174], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -2.3e-212], t$95$1, If[LessEqual[z, -3.6e-279], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 6.2e-297], t$95$1, If[LessEqual[z, 1.4e-87], N[(x * 2.0), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
t_2 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{-89}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-174}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-279}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-297}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-87}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.1000000000000001e-89 or 1.4e-87 < z Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in y around inf 51.1%
if -2.1000000000000001e-89 < z < -1.39999999999999999e-174 or -2.3000000000000001e-212 < z < -3.5999999999999997e-279 or 6.1999999999999993e-297 < z < 1.4e-87Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*97.8%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around inf 55.4%
if -1.39999999999999999e-174 < z < -2.3000000000000001e-212 or -3.5999999999999997e-279 < z < 6.1999999999999993e-297Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 75.6%
associate-*r*75.7%
*-commutative75.7%
associate-*r*75.8%
Simplified75.8%
Final simplification54.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* 27.0 b))))
(if (<= z -1.42e-89)
(* -9.0 (* y (* z t)))
(if (<= z -1.62e-174)
(* x 2.0)
(if (<= z -6.5e-211)
t_1
(if (<= z -1.12e-278)
(* x 2.0)
(if (<= z 6.5e-295)
t_1
(if (<= z 2.1e-86) (* x 2.0) (* -9.0 (* t (* y z)))))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= -1.42e-89) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -1.62e-174) {
tmp = x * 2.0;
} else if (z <= -6.5e-211) {
tmp = t_1;
} else if (z <= -1.12e-278) {
tmp = x * 2.0;
} else if (z <= 6.5e-295) {
tmp = t_1;
} else if (z <= 2.1e-86) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= (-1.42d-89)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= (-1.62d-174)) then
tmp = x * 2.0d0
else if (z <= (-6.5d-211)) then
tmp = t_1
else if (z <= (-1.12d-278)) then
tmp = x * 2.0d0
else if (z <= 6.5d-295) then
tmp = t_1
else if (z <= 2.1d-86) then
tmp = x * 2.0d0
else
tmp = (-9.0d0) * (t * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= -1.42e-89) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -1.62e-174) {
tmp = x * 2.0;
} else if (z <= -6.5e-211) {
tmp = t_1;
} else if (z <= -1.12e-278) {
tmp = x * 2.0;
} else if (z <= 6.5e-295) {
tmp = t_1;
} else if (z <= 2.1e-86) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if z <= -1.42e-89: tmp = -9.0 * (y * (z * t)) elif z <= -1.62e-174: tmp = x * 2.0 elif z <= -6.5e-211: tmp = t_1 elif z <= -1.12e-278: tmp = x * 2.0 elif z <= 6.5e-295: tmp = t_1 elif z <= 2.1e-86: tmp = x * 2.0 else: tmp = -9.0 * (t * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -1.42e-89) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= -1.62e-174) tmp = Float64(x * 2.0); elseif (z <= -6.5e-211) tmp = t_1; elseif (z <= -1.12e-278) tmp = Float64(x * 2.0); elseif (z <= 6.5e-295) tmp = t_1; elseif (z <= 2.1e-86) tmp = Float64(x * 2.0); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= -1.42e-89)
tmp = -9.0 * (y * (z * t));
elseif (z <= -1.62e-174)
tmp = x * 2.0;
elseif (z <= -6.5e-211)
tmp = t_1;
elseif (z <= -1.12e-278)
tmp = x * 2.0;
elseif (z <= 6.5e-295)
tmp = t_1;
elseif (z <= 2.1e-86)
tmp = x * 2.0;
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.42e-89], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.62e-174], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -6.5e-211], t$95$1, If[LessEqual[z, -1.12e-278], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 6.5e-295], t$95$1, If[LessEqual[z, 2.1e-86], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -1.42 \cdot 10^{-89}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.62 \cdot 10^{-174}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-211}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-278}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-295}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-86}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.42e-89Initial program 93.6%
sub-neg93.6%
sub-neg93.6%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in y around inf 84.8%
Taylor expanded in y around inf 54.2%
*-commutative54.2%
associate-*l*55.4%
*-commutative55.4%
Simplified55.4%
if -1.42e-89 < z < -1.6200000000000001e-174 or -6.4999999999999996e-211 < z < -1.12e-278 or 6.4999999999999998e-295 < z < 2.1e-86Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*97.8%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around inf 55.4%
if -1.6200000000000001e-174 < z < -6.4999999999999996e-211 or -1.12e-278 < z < 6.4999999999999998e-295Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 75.6%
associate-*r*75.7%
*-commutative75.7%
associate-*r*75.8%
Simplified75.8%
if 2.1e-86 < z Initial program 90.9%
sub-neg90.9%
sub-neg90.9%
associate-*l*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in y around inf 48.0%
Final simplification54.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* 27.0 b))))
(if (<= z -2e-89)
(* -9.0 (* y (* z t)))
(if (<= z -3.8e-174)
(* x 2.0)
(if (<= z -1.75e-210)
t_1
(if (<= z -1.5e-277)
(* x 2.0)
(if (<= z 3.2e-296)
t_1
(if (<= z 1.6e-86) (* x 2.0) (* t (* -9.0 (* y z)))))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= -2e-89) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -3.8e-174) {
tmp = x * 2.0;
} else if (z <= -1.75e-210) {
tmp = t_1;
} else if (z <= -1.5e-277) {
tmp = x * 2.0;
} else if (z <= 3.2e-296) {
tmp = t_1;
} else if (z <= 1.6e-86) {
tmp = x * 2.0;
} else {
tmp = t * (-9.0 * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= (-2d-89)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= (-3.8d-174)) then
tmp = x * 2.0d0
else if (z <= (-1.75d-210)) then
tmp = t_1
else if (z <= (-1.5d-277)) then
tmp = x * 2.0d0
else if (z <= 3.2d-296) then
tmp = t_1
else if (z <= 1.6d-86) then
tmp = x * 2.0d0
else
tmp = t * ((-9.0d0) * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= -2e-89) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -3.8e-174) {
tmp = x * 2.0;
} else if (z <= -1.75e-210) {
tmp = t_1;
} else if (z <= -1.5e-277) {
tmp = x * 2.0;
} else if (z <= 3.2e-296) {
tmp = t_1;
} else if (z <= 1.6e-86) {
tmp = x * 2.0;
} else {
tmp = t * (-9.0 * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if z <= -2e-89: tmp = -9.0 * (y * (z * t)) elif z <= -3.8e-174: tmp = x * 2.0 elif z <= -1.75e-210: tmp = t_1 elif z <= -1.5e-277: tmp = x * 2.0 elif z <= 3.2e-296: tmp = t_1 elif z <= 1.6e-86: tmp = x * 2.0 else: tmp = t * (-9.0 * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -2e-89) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= -3.8e-174) tmp = Float64(x * 2.0); elseif (z <= -1.75e-210) tmp = t_1; elseif (z <= -1.5e-277) tmp = Float64(x * 2.0); elseif (z <= 3.2e-296) tmp = t_1; elseif (z <= 1.6e-86) tmp = Float64(x * 2.0); else tmp = Float64(t * Float64(-9.0 * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= -2e-89)
tmp = -9.0 * (y * (z * t));
elseif (z <= -3.8e-174)
tmp = x * 2.0;
elseif (z <= -1.75e-210)
tmp = t_1;
elseif (z <= -1.5e-277)
tmp = x * 2.0;
elseif (z <= 3.2e-296)
tmp = t_1;
elseif (z <= 1.6e-86)
tmp = x * 2.0;
else
tmp = t * (-9.0 * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e-89], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.8e-174], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.75e-210], t$95$1, If[LessEqual[z, -1.5e-277], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 3.2e-296], t$95$1, If[LessEqual[z, 1.6e-86], N[(x * 2.0), $MachinePrecision], N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{-89}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-174}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-210}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-277}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-86}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -2.00000000000000008e-89Initial program 93.6%
sub-neg93.6%
sub-neg93.6%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in y around inf 84.8%
Taylor expanded in y around inf 54.2%
*-commutative54.2%
associate-*l*55.4%
*-commutative55.4%
Simplified55.4%
if -2.00000000000000008e-89 < z < -3.80000000000000021e-174 or -1.75000000000000008e-210 < z < -1.49999999999999989e-277 or 3.20000000000000013e-296 < z < 1.60000000000000003e-86Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*97.8%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around inf 55.4%
if -3.80000000000000021e-174 < z < -1.75000000000000008e-210 or -1.49999999999999989e-277 < z < 3.20000000000000013e-296Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 75.6%
associate-*r*75.7%
*-commutative75.7%
associate-*r*75.8%
Simplified75.8%
if 1.60000000000000003e-86 < z Initial program 90.9%
sub-neg90.9%
sub-neg90.9%
associate-*l*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around 0 67.6%
Taylor expanded in t around inf 65.2%
Taylor expanded in x around 0 48.0%
Final simplification54.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b)))
(t_2 (* 9.0 (* t (* y z))))
(t_3 (- (* x 2.0) t_2))
(t_4 (- t_1 t_2)))
(if (<= a -2e+132)
t_4
(if (<= a -2.5e+81)
t_3
(if (<= a -0.0022) t_4 (if (<= a 2.6e+46) t_3 (+ t_1 (* x 2.0))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double t_3 = (x * 2.0) - t_2;
double t_4 = t_1 - t_2;
double tmp;
if (a <= -2e+132) {
tmp = t_4;
} else if (a <= -2.5e+81) {
tmp = t_3;
} else if (a <= -0.0022) {
tmp = t_4;
} else if (a <= 2.6e+46) {
tmp = t_3;
} else {
tmp = t_1 + (x * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = 9.0d0 * (t * (y * z))
t_3 = (x * 2.0d0) - t_2
t_4 = t_1 - t_2
if (a <= (-2d+132)) then
tmp = t_4
else if (a <= (-2.5d+81)) then
tmp = t_3
else if (a <= (-0.0022d0)) then
tmp = t_4
else if (a <= 2.6d+46) then
tmp = t_3
else
tmp = t_1 + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double t_3 = (x * 2.0) - t_2;
double t_4 = t_1 - t_2;
double tmp;
if (a <= -2e+132) {
tmp = t_4;
} else if (a <= -2.5e+81) {
tmp = t_3;
} else if (a <= -0.0022) {
tmp = t_4;
} else if (a <= 2.6e+46) {
tmp = t_3;
} else {
tmp = t_1 + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = 9.0 * (t * (y * z)) t_3 = (x * 2.0) - t_2 t_4 = t_1 - t_2 tmp = 0 if a <= -2e+132: tmp = t_4 elif a <= -2.5e+81: tmp = t_3 elif a <= -0.0022: tmp = t_4 elif a <= 2.6e+46: tmp = t_3 else: tmp = t_1 + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(9.0 * Float64(t * Float64(y * z))) t_3 = Float64(Float64(x * 2.0) - t_2) t_4 = Float64(t_1 - t_2) tmp = 0.0 if (a <= -2e+132) tmp = t_4; elseif (a <= -2.5e+81) tmp = t_3; elseif (a <= -0.0022) tmp = t_4; elseif (a <= 2.6e+46) tmp = t_3; else tmp = Float64(t_1 + Float64(x * 2.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = 9.0 * (t * (y * z));
t_3 = (x * 2.0) - t_2;
t_4 = t_1 - t_2;
tmp = 0.0;
if (a <= -2e+132)
tmp = t_4;
elseif (a <= -2.5e+81)
tmp = t_3;
elseif (a <= -0.0022)
tmp = t_4;
elseif (a <= 2.6e+46)
tmp = t_3;
else
tmp = t_1 + (x * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 - t$95$2), $MachinePrecision]}, If[LessEqual[a, -2e+132], t$95$4, If[LessEqual[a, -2.5e+81], t$95$3, If[LessEqual[a, -0.0022], t$95$4, If[LessEqual[a, 2.6e+46], t$95$3, N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_3 := x \cdot 2 - t\_2\\
t_4 := t\_1 - t\_2\\
\mathbf{if}\;a \leq -2 \cdot 10^{+132}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;a \leq -2.5 \cdot 10^{+81}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq -0.0022:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+46}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x \cdot 2\\
\end{array}
\end{array}
if a < -1.99999999999999998e132 or -2.4999999999999999e81 < a < -0.00220000000000000013Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in x around 0 88.0%
if -1.99999999999999998e132 < a < -2.4999999999999999e81 or -0.00220000000000000013 < a < 2.60000000000000013e46Initial program 95.6%
sub-neg95.6%
sub-neg95.6%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around 0 83.5%
if 2.60000000000000013e46 < a Initial program 92.5%
sub-neg92.5%
sub-neg92.5%
associate-*l*99.8%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in y around 0 70.1%
Final simplification81.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -1.8e+122)
(not (or (<= a -2.6e+81) (and (not (<= a -4.6e-5)) (<= a 2.5e+26)))))
(* 27.0 (* a b))
(* x 2.0)))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.8e+122) || !((a <= -2.6e+81) || (!(a <= -4.6e-5) && (a <= 2.5e+26)))) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((a <= (-1.8d+122)) .or. (.not. (a <= (-2.6d+81)) .or. (.not. (a <= (-4.6d-5))) .and. (a <= 2.5d+26))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.8e+122) || !((a <= -2.6e+81) || (!(a <= -4.6e-5) && (a <= 2.5e+26)))) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.8e+122) or not ((a <= -2.6e+81) or (not (a <= -4.6e-5) and (a <= 2.5e+26))): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.8e+122) || !((a <= -2.6e+81) || (!(a <= -4.6e-5) && (a <= 2.5e+26)))) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -1.8e+122) || ~(((a <= -2.6e+81) || (~((a <= -4.6e-5)) && (a <= 2.5e+26)))))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.8e+122], N[Not[Or[LessEqual[a, -2.6e+81], And[N[Not[LessEqual[a, -4.6e-5]], $MachinePrecision], LessEqual[a, 2.5e+26]]]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+122} \lor \neg \left(a \leq -2.6 \cdot 10^{+81} \lor \neg \left(a \leq -4.6 \cdot 10^{-5}\right) \land a \leq 2.5 \cdot 10^{+26}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -1.8000000000000001e122 or -2.59999999999999992e81 < a < -4.6e-5 or 2.5e26 < a Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 56.6%
if -1.8000000000000001e122 < a < -2.59999999999999992e81 or -4.6e-5 < a < 2.5e26Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*96.6%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in x around inf 49.0%
Final simplification52.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* 27.0 b))))
(if (<= a -1.8e+122)
t_1
(if (<= a -2.6e+81)
(* x 2.0)
(if (<= a -0.0102) (* 27.0 (* a b)) (if (<= a 8e+24) (* x 2.0) t_1))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (a <= -1.8e+122) {
tmp = t_1;
} else if (a <= -2.6e+81) {
tmp = x * 2.0;
} else if (a <= -0.0102) {
tmp = 27.0 * (a * b);
} else if (a <= 8e+24) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (a <= (-1.8d+122)) then
tmp = t_1
else if (a <= (-2.6d+81)) then
tmp = x * 2.0d0
else if (a <= (-0.0102d0)) then
tmp = 27.0d0 * (a * b)
else if (a <= 8d+24) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (a <= -1.8e+122) {
tmp = t_1;
} else if (a <= -2.6e+81) {
tmp = x * 2.0;
} else if (a <= -0.0102) {
tmp = 27.0 * (a * b);
} else if (a <= 8e+24) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if a <= -1.8e+122: tmp = t_1 elif a <= -2.6e+81: tmp = x * 2.0 elif a <= -0.0102: tmp = 27.0 * (a * b) elif a <= 8e+24: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (a <= -1.8e+122) tmp = t_1; elseif (a <= -2.6e+81) tmp = Float64(x * 2.0); elseif (a <= -0.0102) tmp = Float64(27.0 * Float64(a * b)); elseif (a <= 8e+24) tmp = Float64(x * 2.0); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (a <= -1.8e+122)
tmp = t_1;
elseif (a <= -2.6e+81)
tmp = x * 2.0;
elseif (a <= -0.0102)
tmp = 27.0 * (a * b);
elseif (a <= 8e+24)
tmp = x * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.8e+122], t$95$1, If[LessEqual[a, -2.6e+81], N[(x * 2.0), $MachinePrecision], If[LessEqual[a, -0.0102], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8e+24], N[(x * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;a \leq -1.8 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.6 \cdot 10^{+81}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \leq -0.0102:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+24}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.8000000000000001e122 or 7.9999999999999999e24 < a Initial program 95.9%
sub-neg95.9%
sub-neg95.9%
associate-*l*95.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in a around inf 55.8%
associate-*r*55.9%
*-commutative55.9%
associate-*r*55.9%
Simplified55.9%
if -1.8000000000000001e122 < a < -2.59999999999999992e81 or -0.010200000000000001 < a < 7.9999999999999999e24Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*96.6%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in x around inf 49.0%
if -2.59999999999999992e81 < a < -0.010200000000000001Initial program 92.1%
sub-neg92.1%
sub-neg92.1%
associate-*l*92.2%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in a around inf 62.7%
Final simplification52.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -2e-132) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e-132) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-2d-132)) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e-132) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2e-132: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2e-132) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2e-132)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2e-132], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-132}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -2e-132Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
if -2e-132 < z Initial program 96.0%
Final simplification96.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -6e-76) (not (<= z 3.2e-126))) (+ (* x 2.0) (* z (* -9.0 (* y t)))) (+ (* 27.0 (* a b)) (* x 2.0))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6e-76) || !(z <= 3.2e-126)) {
tmp = (x * 2.0) + (z * (-9.0 * (y * t)));
} else {
tmp = (27.0 * (a * b)) + (x * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((z <= (-6d-76)) .or. (.not. (z <= 3.2d-126))) then
tmp = (x * 2.0d0) + (z * ((-9.0d0) * (y * t)))
else
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6e-76) || !(z <= 3.2e-126)) {
tmp = (x * 2.0) + (z * (-9.0 * (y * t)));
} else {
tmp = (27.0 * (a * b)) + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -6e-76) or not (z <= 3.2e-126): tmp = (x * 2.0) + (z * (-9.0 * (y * t))) else: tmp = (27.0 * (a * b)) + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6e-76) || !(z <= 3.2e-126)) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(-9.0 * Float64(y * t)))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -6e-76) || ~((z <= 3.2e-126)))
tmp = (x * 2.0) + (z * (-9.0 * (y * t)));
else
tmp = (27.0 * (a * b)) + (x * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6e-76], N[Not[LessEqual[z, 3.2e-126]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-76} \lor \neg \left(z \leq 3.2 \cdot 10^{-126}\right):\\
\;\;\;\;x \cdot 2 + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -6.00000000000000048e-76 or 3.2000000000000001e-126 < z Initial program 92.7%
sub-neg92.7%
sub-neg92.7%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in a around 0 72.0%
cancel-sign-sub-inv72.0%
*-commutative72.0%
metadata-eval72.0%
+-commutative72.0%
associate-*r*72.0%
associate-*r*77.3%
*-commutative77.3%
Applied egg-rr77.3%
Taylor expanded in t around 0 77.3%
if -6.00000000000000048e-76 < z < 3.2000000000000001e-126Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*98.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 89.1%
Final simplification81.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.2e-74)
(+ (* x 2.0) (* z (* y (* t -9.0))))
(if (<= z 4.4e-126)
(+ (* 27.0 (* a b)) (* x 2.0))
(+ (* x 2.0) (* z (* -9.0 (* y t)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.2e-74) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (z <= 4.4e-126) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) + (z * (-9.0 * (y * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-5.2d-74)) then
tmp = (x * 2.0d0) + (z * (y * (t * (-9.0d0))))
else if (z <= 4.4d-126) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) + (z * ((-9.0d0) * (y * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.2e-74) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (z <= 4.4e-126) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) + (z * (-9.0 * (y * t)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -5.2e-74: tmp = (x * 2.0) + (z * (y * (t * -9.0))) elif z <= 4.4e-126: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) + (z * (-9.0 * (y * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.2e-74) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(y * Float64(t * -9.0)))); elseif (z <= 4.4e-126) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(-9.0 * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -5.2e-74)
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
elseif (z <= 4.4e-126)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) + (z * (-9.0 * (y * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.2e-74], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e-126], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-74}:\\
\;\;\;\;x \cdot 2 + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-126}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -5.2000000000000002e-74Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around 0 76.4%
cancel-sign-sub-inv76.4%
*-commutative76.4%
metadata-eval76.4%
+-commutative76.4%
associate-*r*76.4%
associate-*r*81.4%
*-commutative81.4%
Applied egg-rr81.4%
if -5.2000000000000002e-74 < z < 4.40000000000000029e-126Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*98.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 89.1%
if 4.40000000000000029e-126 < z Initial program 92.1%
sub-neg92.1%
sub-neg92.1%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in a around 0 68.3%
cancel-sign-sub-inv68.3%
*-commutative68.3%
metadata-eval68.3%
+-commutative68.3%
associate-*r*68.3%
associate-*r*73.8%
*-commutative73.8%
Applied egg-rr73.8%
Taylor expanded in t around 0 73.8%
Final simplification81.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.26e-74)
(+ (* x 2.0) (* z (* y (* t -9.0))))
(if (<= z 1.5e-127)
(+ (* 27.0 (* a b)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.26e-74) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (z <= 1.5e-127) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-1.26d-74)) then
tmp = (x * 2.0d0) + (z * (y * (t * (-9.0d0))))
else if (z <= 1.5d-127) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.26e-74) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (z <= 1.5e-127) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.26e-74: tmp = (x * 2.0) + (z * (y * (t * -9.0))) elif z <= 1.5e-127: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.26e-74) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(y * Float64(t * -9.0)))); elseif (z <= 1.5e-127) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.26e-74)
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
elseif (z <= 1.5e-127)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.26e-74], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e-127], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{-74}:\\
\;\;\;\;x \cdot 2 + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-127}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.25999999999999997e-74Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around 0 76.4%
cancel-sign-sub-inv76.4%
*-commutative76.4%
metadata-eval76.4%
+-commutative76.4%
associate-*r*76.4%
associate-*r*81.4%
*-commutative81.4%
Applied egg-rr81.4%
if -1.25999999999999997e-74 < z < 1.50000000000000004e-127Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*98.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 89.1%
if 1.50000000000000004e-127 < z Initial program 92.1%
sub-neg92.1%
sub-neg92.1%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in a around 0 68.3%
Final simplification79.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.38e-73)
(* y (- (* 2.0 (/ x y)) (* 9.0 (* z t))))
(if (<= z 1.75e-126)
(+ (* 27.0 (* a b)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.38e-73) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if (z <= 1.75e-126) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-1.38d-73)) then
tmp = y * ((2.0d0 * (x / y)) - (9.0d0 * (z * t)))
else if (z <= 1.75d-126) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.38e-73) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if (z <= 1.75e-126) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.38e-73: tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t))) elif z <= 1.75e-126: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.38e-73) tmp = Float64(y * Float64(Float64(2.0 * Float64(x / y)) - Float64(9.0 * Float64(z * t)))); elseif (z <= 1.75e-126) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.38e-73)
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
elseif (z <= 1.75e-126)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.38e-73], N[(y * N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-126], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.38 \cdot 10^{-73}:\\
\;\;\;\;y \cdot \left(2 \cdot \frac{x}{y} - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-126}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.37999999999999996e-73Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around 0 76.4%
Taylor expanded in y around inf 68.7%
if -1.37999999999999996e-73 < z < 1.75e-126Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*98.0%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 89.1%
if 1.75e-126 < z Initial program 92.1%
sub-neg92.1%
sub-neg92.1%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in a around 0 68.3%
Final simplification76.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -3.5e-20) (* -9.0 (* y (* z t))) (if (<= z 2.9e+71) (+ (* 27.0 (* a b)) (* x 2.0)) (* t (* -9.0 (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.5e-20) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 2.9e+71) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t * (-9.0 * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (z <= (-3.5d-20)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 2.9d+71) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = t * ((-9.0d0) * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.5e-20) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 2.9e+71) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = t * (-9.0 * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3.5e-20: tmp = -9.0 * (y * (z * t)) elif z <= 2.9e+71: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = t * (-9.0 * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.5e-20) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 2.9e+71) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(t * Float64(-9.0 * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -3.5e-20)
tmp = -9.0 * (y * (z * t));
elseif (z <= 2.9e+71)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = t * (-9.0 * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.5e-20], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+71], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-20}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+71}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -3.50000000000000003e-20Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*95.3%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in y around inf 84.7%
Taylor expanded in y around inf 60.9%
*-commutative60.9%
associate-*l*62.4%
*-commutative62.4%
Simplified62.4%
if -3.50000000000000003e-20 < z < 2.90000000000000007e71Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*97.9%
associate-*l*97.9%
Simplified97.9%
Taylor expanded in y around 0 85.9%
if 2.90000000000000007e71 < z Initial program 86.9%
sub-neg86.9%
sub-neg86.9%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in a around 0 72.3%
Taylor expanded in t around inf 70.5%
Taylor expanded in x around 0 60.7%
Final simplification75.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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
code = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Final simplification96.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
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
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in x around inf 34.3%
Final simplification34.3%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024073
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))