
(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 18 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. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e+37) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (+ (- (* x 2.0) (* (* y t) (* z 9.0))) (* b (* a 27.0)))))
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+37) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = ((x * 2.0) - ((y * t) * (z * 9.0))) + (b * (a * 27.0));
}
return tmp;
}
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+37) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * t) * Float64(z * 9.0))) + Float64(b * Float64(a * 27.0))); end return tmp end
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+37], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * t), $MachinePrecision] * N[(z * 9.0), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+37}:\\
\;\;\;\;\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)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot t\right) \cdot \left(z \cdot 9\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 1.99999999999999991e37Initial program 97.7%
+-commutative97.7%
associate-+r-97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
associate-*r*91.9%
distribute-lft-neg-in91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
associate-+r-91.9%
associate-*l*92.0%
fma-def93.0%
fma-neg93.0%
associate-*l*98.1%
distribute-rgt-neg-in98.1%
*-commutative98.1%
associate-*l*98.1%
*-commutative98.1%
distribute-lft-neg-in98.1%
associate-*r*98.2%
Simplified98.2%
if 1.99999999999999991e37 < z Initial program 92.2%
add-cbrt-cube73.2%
pow373.2%
associate-*l*73.2%
Applied egg-rr73.2%
unpow373.2%
add-cbrt-cube92.2%
add-sqr-sqrt92.1%
sqrt-unprod55.7%
swap-sqr55.7%
metadata-eval55.7%
metadata-eval55.7%
swap-sqr55.7%
*-commutative55.7%
*-commutative55.7%
sqrt-unprod0.0%
add-sqr-sqrt41.8%
add-log-exp25.6%
exp-prod19.0%
Applied egg-rr38.1%
log-pow38.1%
log-pow38.1%
associate-*r*37.7%
*-commutative37.7%
log-pow37.7%
rem-log-exp98.2%
*-commutative98.2%
Simplified98.2%
Final simplification98.2%
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 1e+39) (fma a (* 27.0 b) (- (* x 2.0) (* y (* 9.0 (* z t))))) (+ (- (* x 2.0) (* (* y t) (* z 9.0))) (* b (* a 27.0)))))
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 <= 1e+39) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (y * (9.0 * (z * t)))));
} else {
tmp = ((x * 2.0) - ((y * t) * (z * 9.0))) + (b * (a * 27.0));
}
return tmp;
}
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 <= 1e+39) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(y * Float64(9.0 * Float64(z * t))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * t) * Float64(z * 9.0))) + Float64(b * Float64(a * 27.0))); end return tmp end
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, 1e+39], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * t), $MachinePrecision] * N[(z * 9.0), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot t\right) \cdot \left(z \cdot 9\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 9.9999999999999994e38Initial program 97.7%
+-commutative97.7%
associate-+r-97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
associate-*r*91.9%
distribute-lft-neg-in91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
associate-+r-91.9%
associate-*l*92.0%
fma-def93.0%
fma-neg93.0%
associate-*l*98.1%
distribute-rgt-neg-in98.1%
*-commutative98.1%
associate-*l*98.1%
*-commutative98.1%
distribute-lft-neg-in98.1%
associate-*r*98.2%
Simplified98.2%
*-commutative98.2%
associate-*r*98.1%
associate-*l*98.1%
metadata-eval98.1%
distribute-lft-neg-in98.1%
*-commutative98.1%
distribute-rgt-neg-in98.1%
*-commutative98.1%
fma-neg98.1%
associate-*l*98.1%
Applied egg-rr98.1%
if 9.9999999999999994e38 < z Initial program 92.2%
add-cbrt-cube73.2%
pow373.2%
associate-*l*73.2%
Applied egg-rr73.2%
unpow373.2%
add-cbrt-cube92.2%
add-sqr-sqrt92.1%
sqrt-unprod55.7%
swap-sqr55.7%
metadata-eval55.7%
metadata-eval55.7%
swap-sqr55.7%
*-commutative55.7%
*-commutative55.7%
sqrt-unprod0.0%
add-sqr-sqrt41.8%
add-log-exp25.6%
exp-prod19.0%
Applied egg-rr38.1%
log-pow38.1%
log-pow38.1%
associate-*r*37.7%
*-commutative37.7%
log-pow37.7%
rem-log-exp98.2%
*-commutative98.2%
Simplified98.2%
Final simplification98.1%
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 (* -9.0 (* t (* z y)))))
(if (<= z -1.46e+28)
t_1
(if (<= z -6.6e-30)
(* b (* a 27.0))
(if (<= z -3.6e-138)
t_1
(if (<= z -2.1e-232)
(* 27.0 (* a b))
(if (<= z 1.2e-72) (* x 2.0) t_1)))))))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 = -9.0 * (t * (z * y));
double tmp;
if (z <= -1.46e+28) {
tmp = t_1;
} else if (z <= -6.6e-30) {
tmp = b * (a * 27.0);
} else if (z <= -3.6e-138) {
tmp = t_1;
} else if (z <= -2.1e-232) {
tmp = 27.0 * (a * b);
} else if (z <= 1.2e-72) {
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.
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 = (-9.0d0) * (t * (z * y))
if (z <= (-1.46d+28)) then
tmp = t_1
else if (z <= (-6.6d-30)) then
tmp = b * (a * 27.0d0)
else if (z <= (-3.6d-138)) then
tmp = t_1
else if (z <= (-2.1d-232)) then
tmp = 27.0d0 * (a * b)
else if (z <= 1.2d-72) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (z <= -1.46e+28) {
tmp = t_1;
} else if (z <= -6.6e-30) {
tmp = b * (a * 27.0);
} else if (z <= -3.6e-138) {
tmp = t_1;
} else if (z <= -2.1e-232) {
tmp = 27.0 * (a * b);
} else if (z <= 1.2e-72) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (z * y)) tmp = 0 if z <= -1.46e+28: tmp = t_1 elif z <= -6.6e-30: tmp = b * (a * 27.0) elif z <= -3.6e-138: tmp = t_1 elif z <= -2.1e-232: tmp = 27.0 * (a * b) elif z <= 1.2e-72: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (z <= -1.46e+28) tmp = t_1; elseif (z <= -6.6e-30) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= -3.6e-138) tmp = t_1; elseif (z <= -2.1e-232) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 1.2e-72) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (z * y));
tmp = 0.0;
if (z <= -1.46e+28)
tmp = t_1;
elseif (z <= -6.6e-30)
tmp = b * (a * 27.0);
elseif (z <= -3.6e-138)
tmp = t_1;
elseif (z <= -2.1e-232)
tmp = 27.0 * (a * b);
elseif (z <= 1.2e-72)
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.46e+28], t$95$1, If[LessEqual[z, -6.6e-30], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-138], t$95$1, If[LessEqual[z, -2.1e-232], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-72], 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])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -1.46 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-30}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-232}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-72}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.46e28 or -6.6000000000000006e-30 < z < -3.60000000000000018e-138 or 1.2e-72 < z Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*91.3%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in y around inf 51.6%
if -1.46e28 < z < -6.6000000000000006e-30Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 38.2%
associate-*r*38.2%
Simplified38.2%
if -3.60000000000000018e-138 < z < -2.1e-232Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 67.8%
if -2.1e-232 < z < 1.2e-72Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 54.8%
Final simplification53.1%
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 (* t (* y (* z -9.0)))))
(if (<= z -4e+21)
t_1
(if (<= z -1.25e-29)
(* b (* a 27.0))
(if (<= z -1.35e-139)
(* -9.0 (* t (* z y)))
(if (<= z -2.2e-232)
(* 27.0 (* a b))
(if (<= z 1.45e-72) (* x 2.0) t_1)))))))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 = t * (y * (z * -9.0));
double tmp;
if (z <= -4e+21) {
tmp = t_1;
} else if (z <= -1.25e-29) {
tmp = b * (a * 27.0);
} else if (z <= -1.35e-139) {
tmp = -9.0 * (t * (z * y));
} else if (z <= -2.2e-232) {
tmp = 27.0 * (a * b);
} else if (z <= 1.45e-72) {
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.
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 = t * (y * (z * (-9.0d0)))
if (z <= (-4d+21)) then
tmp = t_1
else if (z <= (-1.25d-29)) then
tmp = b * (a * 27.0d0)
else if (z <= (-1.35d-139)) then
tmp = (-9.0d0) * (t * (z * y))
else if (z <= (-2.2d-232)) then
tmp = 27.0d0 * (a * b)
else if (z <= 1.45d-72) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (y * (z * -9.0));
double tmp;
if (z <= -4e+21) {
tmp = t_1;
} else if (z <= -1.25e-29) {
tmp = b * (a * 27.0);
} else if (z <= -1.35e-139) {
tmp = -9.0 * (t * (z * y));
} else if (z <= -2.2e-232) {
tmp = 27.0 * (a * b);
} else if (z <= 1.45e-72) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = t * (y * (z * -9.0)) tmp = 0 if z <= -4e+21: tmp = t_1 elif z <= -1.25e-29: tmp = b * (a * 27.0) elif z <= -1.35e-139: tmp = -9.0 * (t * (z * y)) elif z <= -2.2e-232: tmp = 27.0 * (a * b) elif z <= 1.45e-72: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(y * Float64(z * -9.0))) tmp = 0.0 if (z <= -4e+21) tmp = t_1; elseif (z <= -1.25e-29) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= -1.35e-139) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (z <= -2.2e-232) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 1.45e-72) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (y * (z * -9.0));
tmp = 0.0;
if (z <= -4e+21)
tmp = t_1;
elseif (z <= -1.25e-29)
tmp = b * (a * 27.0);
elseif (z <= -1.35e-139)
tmp = -9.0 * (t * (z * y));
elseif (z <= -2.2e-232)
tmp = 27.0 * (a * b);
elseif (z <= 1.45e-72)
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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+21], t$95$1, If[LessEqual[z, -1.25e-29], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.35e-139], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e-232], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-72], 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])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{if}\;z \leq -4 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-29}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-139}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-232}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-72}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4e21 or 1.44999999999999999e-72 < z Initial program 93.5%
sub-neg93.5%
sub-neg93.5%
associate-*l*89.9%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in y around inf 53.3%
*-commutative53.3%
associate-*l*53.3%
associate-*l*53.3%
Simplified53.3%
if -4e21 < z < -1.24999999999999996e-29Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 38.2%
associate-*r*38.2%
Simplified38.2%
if -1.24999999999999996e-29 < z < -1.3499999999999999e-139Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around inf 40.2%
if -1.3499999999999999e-139 < z < -2.20000000000000002e-232Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 67.8%
if -2.20000000000000002e-232 < z < 1.44999999999999999e-72Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 54.8%
Final simplification53.1%
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.55e+21)
(* y (* t (* z -9.0)))
(if (<= z -1.6e-29)
(* b (* a 27.0))
(if (<= z -4.2e-135)
(* -9.0 (* t (* z y)))
(if (<= z -2e-232)
(* 27.0 (* a b))
(if (<= z 3.3e-72) (* x 2.0) (* t (* y (* z -9.0)))))))))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.55e+21) {
tmp = y * (t * (z * -9.0));
} else if (z <= -1.6e-29) {
tmp = b * (a * 27.0);
} else if (z <= -4.2e-135) {
tmp = -9.0 * (t * (z * y));
} else if (z <= -2e-232) {
tmp = 27.0 * (a * b);
} else if (z <= 3.3e-72) {
tmp = x * 2.0;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
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.55d+21)) then
tmp = y * (t * (z * (-9.0d0)))
else if (z <= (-1.6d-29)) then
tmp = b * (a * 27.0d0)
else if (z <= (-4.2d-135)) then
tmp = (-9.0d0) * (t * (z * y))
else if (z <= (-2d-232)) then
tmp = 27.0d0 * (a * b)
else if (z <= 3.3d-72) then
tmp = x * 2.0d0
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
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.55e+21) {
tmp = y * (t * (z * -9.0));
} else if (z <= -1.6e-29) {
tmp = b * (a * 27.0);
} else if (z <= -4.2e-135) {
tmp = -9.0 * (t * (z * y));
} else if (z <= -2e-232) {
tmp = 27.0 * (a * b);
} else if (z <= 3.3e-72) {
tmp = x * 2.0;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[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.55e+21: tmp = y * (t * (z * -9.0)) elif z <= -1.6e-29: tmp = b * (a * 27.0) elif z <= -4.2e-135: tmp = -9.0 * (t * (z * y)) elif z <= -2e-232: tmp = 27.0 * (a * b) elif z <= 3.3e-72: tmp = x * 2.0 else: tmp = t * (y * (z * -9.0)) return tmp
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.55e+21) tmp = Float64(y * Float64(t * Float64(z * -9.0))); elseif (z <= -1.6e-29) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= -4.2e-135) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (z <= -2e-232) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 3.3e-72) tmp = Float64(x * 2.0); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
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.55e+21)
tmp = y * (t * (z * -9.0));
elseif (z <= -1.6e-29)
tmp = b * (a * 27.0);
elseif (z <= -4.2e-135)
tmp = -9.0 * (t * (z * y));
elseif (z <= -2e-232)
tmp = 27.0 * (a * b);
elseif (z <= 3.3e-72)
tmp = x * 2.0;
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
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.55e+21], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.6e-29], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-135], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2e-232], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e-72], N[(x * 2.0), $MachinePrecision], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+21}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-29}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-135}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-232}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-72}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.55e21Initial program 94.6%
+-commutative94.6%
associate-+r-94.6%
*-commutative94.6%
cancel-sign-sub-inv94.6%
associate-*r*98.0%
distribute-lft-neg-in98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-+r-98.0%
associate-*l*98.0%
fma-def99.8%
fma-neg99.8%
associate-*l*96.3%
distribute-rgt-neg-in96.3%
*-commutative96.3%
associate-*l*96.3%
*-commutative96.3%
distribute-lft-neg-in96.3%
associate-*r*96.4%
Simplified96.4%
*-commutative96.4%
associate-*r*96.3%
associate-*l*96.3%
metadata-eval96.3%
distribute-lft-neg-in96.3%
*-commutative96.3%
distribute-rgt-neg-in96.3%
*-commutative96.3%
fma-neg96.3%
associate-*l*96.3%
Applied egg-rr96.3%
Taylor expanded in y around inf 57.1%
*-commutative57.1%
*-commutative57.1%
associate-*r*59.5%
associate-*l*59.6%
*-commutative59.6%
associate-*l*59.6%
Simplified59.6%
if -1.55e21 < z < -1.6e-29Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 38.2%
associate-*r*38.2%
Simplified38.2%
if -1.6e-29 < z < -4.2e-135Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around inf 40.2%
if -4.2e-135 < z < -2.00000000000000005e-232Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 67.8%
if -2.00000000000000005e-232 < z < 3.3e-72Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 54.8%
if 3.3e-72 < z Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*86.8%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in y around inf 50.7%
*-commutative50.7%
associate-*l*50.7%
associate-*l*50.8%
Simplified50.8%
Final simplification53.6%
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 -4e+28)
(* -9.0 (* z (* y t)))
(if (<= z -9e-30)
(* b (* a 27.0))
(if (<= z -1.6e-135)
(* -9.0 (* t (* z y)))
(if (<= z -2.1e-232)
(* 27.0 (* a b))
(if (<= z 2.6e-71) (* x 2.0) (* t (* y (* z -9.0)))))))))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 <= -4e+28) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -9e-30) {
tmp = b * (a * 27.0);
} else if (z <= -1.6e-135) {
tmp = -9.0 * (t * (z * y));
} else if (z <= -2.1e-232) {
tmp = 27.0 * (a * b);
} else if (z <= 2.6e-71) {
tmp = x * 2.0;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
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 <= (-4d+28)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= (-9d-30)) then
tmp = b * (a * 27.0d0)
else if (z <= (-1.6d-135)) then
tmp = (-9.0d0) * (t * (z * y))
else if (z <= (-2.1d-232)) then
tmp = 27.0d0 * (a * b)
else if (z <= 2.6d-71) then
tmp = x * 2.0d0
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
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 <= -4e+28) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -9e-30) {
tmp = b * (a * 27.0);
} else if (z <= -1.6e-135) {
tmp = -9.0 * (t * (z * y));
} else if (z <= -2.1e-232) {
tmp = 27.0 * (a * b);
} else if (z <= 2.6e-71) {
tmp = x * 2.0;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[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 <= -4e+28: tmp = -9.0 * (z * (y * t)) elif z <= -9e-30: tmp = b * (a * 27.0) elif z <= -1.6e-135: tmp = -9.0 * (t * (z * y)) elif z <= -2.1e-232: tmp = 27.0 * (a * b) elif z <= 2.6e-71: tmp = x * 2.0 else: tmp = t * (y * (z * -9.0)) return tmp
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 <= -4e+28) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= -9e-30) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= -1.6e-135) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (z <= -2.1e-232) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 2.6e-71) tmp = Float64(x * 2.0); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
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 <= -4e+28)
tmp = -9.0 * (z * (y * t));
elseif (z <= -9e-30)
tmp = b * (a * 27.0);
elseif (z <= -1.6e-135)
tmp = -9.0 * (t * (z * y));
elseif (z <= -2.1e-232)
tmp = 27.0 * (a * b);
elseif (z <= 2.6e-71)
tmp = x * 2.0;
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
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, -4e+28], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-30], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.6e-135], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e-232], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-71], N[(x * 2.0), $MachinePrecision], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+28}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-30}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-135}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-232}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-71}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -3.99999999999999983e28Initial program 94.6%
sub-neg94.6%
sub-neg94.6%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in y around inf 57.1%
*-commutative57.1%
associate-*r*59.5%
Simplified59.5%
if -3.99999999999999983e28 < z < -8.99999999999999935e-30Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 38.2%
associate-*r*38.2%
Simplified38.2%
if -8.99999999999999935e-30 < z < -1.6e-135Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around inf 40.2%
if -1.6e-135 < z < -2.1e-232Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 67.8%
if -2.1e-232 < z < 2.5999999999999999e-71Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 54.8%
if 2.5999999999999999e-71 < z Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*86.8%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in y around inf 50.7%
*-commutative50.7%
associate-*l*50.7%
associate-*l*50.8%
Simplified50.8%
Final simplification53.6%
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 (* z y))))
(t_3 (- (* x 2.0) t_2)))
(if (<= (* x 2.0) -5e-37)
t_3
(if (<= (* x 2.0) 4e-37)
(- t_1 t_2)
(if (<= (* x 2.0) 5e+184) t_3 (+ (* x 2.0) t_1))))))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 * (z * y));
double t_3 = (x * 2.0) - t_2;
double tmp;
if ((x * 2.0) <= -5e-37) {
tmp = t_3;
} else if ((x * 2.0) <= 4e-37) {
tmp = t_1 - t_2;
} else if ((x * 2.0) <= 5e+184) {
tmp = t_3;
} else {
tmp = (x * 2.0) + t_1;
}
return tmp;
}
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) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = 9.0d0 * (t * (z * y))
t_3 = (x * 2.0d0) - t_2
if ((x * 2.0d0) <= (-5d-37)) then
tmp = t_3
else if ((x * 2.0d0) <= 4d-37) then
tmp = t_1 - t_2
else if ((x * 2.0d0) <= 5d+184) then
tmp = t_3
else
tmp = (x * 2.0d0) + t_1
end if
code = tmp
end function
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 * (z * y));
double t_3 = (x * 2.0) - t_2;
double tmp;
if ((x * 2.0) <= -5e-37) {
tmp = t_3;
} else if ((x * 2.0) <= 4e-37) {
tmp = t_1 - t_2;
} else if ((x * 2.0) <= 5e+184) {
tmp = t_3;
} else {
tmp = (x * 2.0) + t_1;
}
return tmp;
}
[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 * (z * y)) t_3 = (x * 2.0) - t_2 tmp = 0 if (x * 2.0) <= -5e-37: tmp = t_3 elif (x * 2.0) <= 4e-37: tmp = t_1 - t_2 elif (x * 2.0) <= 5e+184: tmp = t_3 else: tmp = (x * 2.0) + t_1 return tmp
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(z * y))) t_3 = Float64(Float64(x * 2.0) - t_2) tmp = 0.0 if (Float64(x * 2.0) <= -5e-37) tmp = t_3; elseif (Float64(x * 2.0) <= 4e-37) tmp = Float64(t_1 - t_2); elseif (Float64(x * 2.0) <= 5e+184) tmp = t_3; else tmp = Float64(Float64(x * 2.0) + t_1); end return tmp end
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 * (z * y));
t_3 = (x * 2.0) - t_2;
tmp = 0.0;
if ((x * 2.0) <= -5e-37)
tmp = t_3;
elseif ((x * 2.0) <= 4e-37)
tmp = t_1 - t_2;
elseif ((x * 2.0) <= 5e+184)
tmp = t_3;
else
tmp = (x * 2.0) + 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.
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[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[N[(x * 2.0), $MachinePrecision], -5e-37], t$95$3, If[LessEqual[N[(x * 2.0), $MachinePrecision], 4e-37], N[(t$95$1 - t$95$2), $MachinePrecision], If[LessEqual[N[(x * 2.0), $MachinePrecision], 5e+184], t$95$3, N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
[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(z \cdot y\right)\right)\\
t_3 := x \cdot 2 - t\_2\\
\mathbf{if}\;x \cdot 2 \leq -5 \cdot 10^{-37}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \cdot 2 \leq 4 \cdot 10^{-37}:\\
\;\;\;\;t\_1 - t\_2\\
\mathbf{elif}\;x \cdot 2 \leq 5 \cdot 10^{+184}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\end{array}
\end{array}
if (*.f64 x 2) < -4.9999999999999997e-37 or 4.00000000000000027e-37 < (*.f64 x 2) < 4.9999999999999999e184Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*97.0%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in a around 0 76.2%
if -4.9999999999999997e-37 < (*.f64 x 2) < 4.00000000000000027e-37Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*90.2%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in x around 0 90.5%
if 4.9999999999999999e184 < (*.f64 x 2) Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*97.4%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in y around 0 92.0%
Final simplification84.9%
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 2.5e+98) (+ (* a (* 27.0 b)) (+ (* y (* z (* t -9.0))) (* x 2.0))) (- (* 27.0 (* a b)) (* 9.0 (* t (* z y))))))
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 <= 2.5e+98) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
}
return tmp;
}
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 <= 2.5d+98) then
tmp = (a * (27.0d0 * b)) + ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0))
else
tmp = (27.0d0 * (a * b)) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
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 <= 2.5e+98) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
}
return tmp;
}
[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 <= 2.5e+98: tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0)) else: tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y))) return tmp
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 <= 2.5e+98) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0))); else tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
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 <= 2.5e+98)
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
else
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
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, 2.5e+98], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.5 \cdot 10^{+98}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 2.4999999999999999e98Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*97.1%
associate-*l*97.2%
Simplified97.2%
sub-neg97.2%
+-commutative97.2%
*-commutative97.2%
distribute-rgt-neg-in97.2%
*-commutative97.2%
distribute-lft-neg-in97.2%
metadata-eval97.2%
associate-*l*97.2%
associate-*r*97.2%
*-commutative97.2%
Applied egg-rr97.2%
if 2.4999999999999999e98 < z Initial program 91.2%
sub-neg91.2%
sub-neg91.2%
associate-*l*82.2%
associate-*l*84.0%
Simplified84.0%
Taylor expanded in x around 0 79.4%
Final simplification93.5%
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 2.35e+98) (+ (- (* x 2.0) (* (* z t) (* y 9.0))) (* a (* 27.0 b))) (- (* 27.0 (* a b)) (* 9.0 (* t (* z y))))))
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 <= 2.35e+98) {
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
}
return tmp;
}
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 <= 2.35d+98) then
tmp = ((x * 2.0d0) - ((z * t) * (y * 9.0d0))) + (a * (27.0d0 * b))
else
tmp = (27.0d0 * (a * b)) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
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 <= 2.35e+98) {
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
}
return tmp;
}
[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 <= 2.35e+98: tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b)) else: tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y))) return tmp
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 <= 2.35e+98) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(z * t) * Float64(y * 9.0))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
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 <= 2.35e+98)
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
else
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
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, 2.35e+98], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(z * t), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.35 \cdot 10^{+98}:\\
\;\;\;\;\left(x \cdot 2 - \left(z \cdot t\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 2.34999999999999985e98Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*97.1%
associate-*l*97.2%
Simplified97.2%
if 2.34999999999999985e98 < z Initial program 91.2%
sub-neg91.2%
sub-neg91.2%
associate-*l*82.2%
associate-*l*84.0%
Simplified84.0%
Taylor expanded in x around 0 79.4%
Final simplification93.5%
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.4e+34) (+ (- (* x 2.0) (* (* z t) (* y 9.0))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* (* y t) (* z 9.0))) (* b (* a 27.0)))))
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.4e+34) {
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - ((y * t) * (z * 9.0))) + (b * (a * 27.0));
}
return tmp;
}
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.4d+34) then
tmp = ((x * 2.0d0) - ((z * t) * (y * 9.0d0))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - ((y * t) * (z * 9.0d0))) + (b * (a * 27.0d0))
end if
code = tmp
end function
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.4e+34) {
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - ((y * t) * (z * 9.0))) + (b * (a * 27.0));
}
return tmp;
}
[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.4e+34: tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - ((y * t) * (z * 9.0))) + (b * (a * 27.0)) return tmp
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.4e+34) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(z * t) * Float64(y * 9.0))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * t) * Float64(z * 9.0))) + Float64(b * Float64(a * 27.0))); end return tmp end
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.4e+34)
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - ((y * t) * (z * 9.0))) + (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.4e+34], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(z * t), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * t), $MachinePrecision] * N[(z * 9.0), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{+34}:\\
\;\;\;\;\left(x \cdot 2 - \left(z \cdot t\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot t\right) \cdot \left(z \cdot 9\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 1.40000000000000004e34Initial program 97.7%
sub-neg97.7%
sub-neg97.7%
associate-*l*97.0%
associate-*l*97.1%
Simplified97.1%
if 1.40000000000000004e34 < z Initial program 92.3%
add-cbrt-cube73.6%
pow373.6%
associate-*l*73.6%
Applied egg-rr73.6%
unpow373.6%
add-cbrt-cube92.3%
add-sqr-sqrt92.2%
sqrt-unprod56.4%
swap-sqr56.4%
metadata-eval56.4%
metadata-eval56.4%
swap-sqr56.4%
*-commutative56.4%
*-commutative56.4%
sqrt-unprod0.0%
add-sqr-sqrt41.1%
add-log-exp25.2%
exp-prod18.7%
Applied egg-rr37.6%
log-pow37.6%
log-pow37.6%
associate-*r*37.1%
*-commutative37.1%
log-pow37.1%
rem-log-exp98.3%
*-commutative98.3%
Simplified98.3%
Final simplification97.4%
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.32e+22) (+ (- (* x 2.0) (* (* z t) (* y 9.0))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
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.32e+22) {
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
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.32d+22) then
tmp = ((x * 2.0d0) - ((z * t) * (y * 9.0d0))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
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.32e+22) {
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
[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.32e+22: tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0)) return tmp
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.32e+22) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(z * t) * Float64(y * 9.0))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0))); end return tmp end
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.32e+22)
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.32e+22], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(z * t), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.32 \cdot 10^{+22}:\\
\;\;\;\;\left(x \cdot 2 - \left(z \cdot t\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 1.32e22Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*97.5%
associate-*l*97.5%
Simplified97.5%
if 1.32e22 < z Initial program 91.4%
Final simplification95.9%
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 (<= y -1.4e+106) (not (<= y 4.1e-169))) (+ (* x 2.0) (* (* t -9.0) (* z y))) (+ (* x 2.0) (* 27.0 (* 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 <= -1.4e+106) || !(y <= 4.1e-169)) {
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
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 ((y <= (-1.4d+106)) .or. (.not. (y <= 4.1d-169))) then
tmp = (x * 2.0d0) + ((t * (-9.0d0)) * (z * y))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
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 ((y <= -1.4e+106) || !(y <= 4.1e-169)) {
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.4e+106) or not (y <= 4.1e-169): tmp = (x * 2.0) + ((t * -9.0) * (z * y)) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
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 ((y <= -1.4e+106) || !(y <= 4.1e-169)) tmp = Float64(Float64(x * 2.0) + Float64(Float64(t * -9.0) * Float64(z * y))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
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 ((y <= -1.4e+106) || ~((y <= 4.1e-169)))
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
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[y, -1.4e+106], N[Not[LessEqual[y, 4.1e-169]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(t * -9.0), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+106} \lor \neg \left(y \leq 4.1 \cdot 10^{-169}\right):\\
\;\;\;\;x \cdot 2 + \left(t \cdot -9\right) \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -1.39999999999999996e106 or 4.0999999999999998e-169 < y Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*96.3%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in a around 0 72.7%
cancel-sign-sub-inv72.7%
metadata-eval72.7%
*-commutative72.7%
*-commutative72.7%
+-commutative72.7%
*-commutative72.7%
associate-*l*72.7%
Applied egg-rr72.7%
if -1.39999999999999996e106 < y < 4.0999999999999998e-169Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around 0 82.4%
Final simplification76.6%
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 -4e+106)
(- (* x 2.0) (* 9.0 (* t (* z y))))
(if (<= y 4.2e-169)
(+ (* x 2.0) (* 27.0 (* a b)))
(+ (* x 2.0) (* (* t -9.0) (* z y))))))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 <= -4e+106) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (y <= 4.2e-169) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
}
return tmp;
}
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 (y <= (-4d+106)) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else if (y <= 4.2d-169) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) + ((t * (-9.0d0)) * (z * y))
end if
code = tmp
end function
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 (y <= -4e+106) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (y <= 4.2e-169) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -4e+106: tmp = (x * 2.0) - (9.0 * (t * (z * y))) elif y <= 4.2e-169: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) + ((t * -9.0) * (z * y)) return tmp
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 (y <= -4e+106) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); elseif (y <= 4.2e-169) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(t * -9.0) * Float64(z * y))); end return tmp end
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 (y <= -4e+106)
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
elseif (y <= 4.2e-169)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
end
tmp_2 = tmp;
end
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[y, -4e+106], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-169], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(t * -9.0), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+106}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-169}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(t \cdot -9\right) \cdot \left(z \cdot y\right)\\
\end{array}
\end{array}
if y < -4.00000000000000036e106Initial program 92.5%
sub-neg92.5%
sub-neg92.5%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 83.3%
if -4.00000000000000036e106 < y < 4.2000000000000001e-169Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around 0 82.4%
if 4.2000000000000001e-169 < y Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*96.8%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in a around 0 68.9%
cancel-sign-sub-inv68.9%
metadata-eval68.9%
*-commutative68.9%
*-commutative68.9%
+-commutative68.9%
*-commutative68.9%
associate-*l*69.0%
Applied egg-rr69.0%
Final simplification76.6%
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 -2.05e+106)
(- (* x 2.0) (* y (* t (* z 9.0))))
(if (<= y 4.4e-169)
(+ (* x 2.0) (* 27.0 (* a b)))
(+ (* x 2.0) (* (* t -9.0) (* z y))))))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 <= -2.05e+106) {
tmp = (x * 2.0) - (y * (t * (z * 9.0)));
} else if (y <= 4.4e-169) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
}
return tmp;
}
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 (y <= (-2.05d+106)) then
tmp = (x * 2.0d0) - (y * (t * (z * 9.0d0)))
else if (y <= 4.4d-169) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) + ((t * (-9.0d0)) * (z * y))
end if
code = tmp
end function
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 (y <= -2.05e+106) {
tmp = (x * 2.0) - (y * (t * (z * 9.0)));
} else if (y <= 4.4e-169) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -2.05e+106: tmp = (x * 2.0) - (y * (t * (z * 9.0))) elif y <= 4.4e-169: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) + ((t * -9.0) * (z * y)) return tmp
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 (y <= -2.05e+106) tmp = Float64(Float64(x * 2.0) - Float64(y * Float64(t * Float64(z * 9.0)))); elseif (y <= 4.4e-169) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(t * -9.0) * Float64(z * y))); end return tmp end
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 (y <= -2.05e+106)
tmp = (x * 2.0) - (y * (t * (z * 9.0)));
elseif (y <= 4.4e-169)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
end
tmp_2 = tmp;
end
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[y, -2.05e+106], N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e-169], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(t * -9.0), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+106}:\\
\;\;\;\;x \cdot 2 - y \cdot \left(t \cdot \left(z \cdot 9\right)\right)\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-169}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(t \cdot -9\right) \cdot \left(z \cdot y\right)\\
\end{array}
\end{array}
if y < -2.0500000000000001e106Initial program 92.5%
sub-neg92.5%
sub-neg92.5%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 83.3%
cancel-sign-sub-inv83.3%
metadata-eval83.3%
+-commutative83.3%
fma-def83.3%
associate-*r*78.8%
Simplified78.8%
fma-udef78.7%
metadata-eval78.7%
*-commutative78.7%
*-commutative78.7%
distribute-lft-neg-in78.7%
associate-*r*78.7%
*-commutative78.7%
*-commutative78.7%
+-commutative78.7%
sub-neg78.7%
*-commutative78.7%
associate-*l*85.4%
Applied egg-rr85.4%
if -2.0500000000000001e106 < y < 4.40000000000000015e-169Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around 0 82.4%
if 4.40000000000000015e-169 < y Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*96.8%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in a around 0 68.9%
cancel-sign-sub-inv68.9%
metadata-eval68.9%
*-commutative68.9%
*-commutative68.9%
+-commutative68.9%
*-commutative68.9%
associate-*l*69.0%
Applied egg-rr69.0%
Final simplification77.0%
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 -6.6e+56) (* -9.0 (* z (* y t))) (if (<= z 1.15e-69) (+ (* x 2.0) (* 27.0 (* a b))) (* t (* y (* z -9.0))))))
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 <= -6.6e+56) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.15e-69) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
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 <= (-6.6d+56)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 1.15d-69) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
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 <= -6.6e+56) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.15e-69) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[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 <= -6.6e+56: tmp = -9.0 * (z * (y * t)) elif z <= 1.15e-69: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = t * (y * (z * -9.0)) return tmp
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 <= -6.6e+56) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 1.15e-69) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
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 <= -6.6e+56)
tmp = -9.0 * (z * (y * t));
elseif (z <= 1.15e-69)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
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, -6.6e+56], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-69], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+56}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-69}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -6.60000000000000004e56Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*94.1%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in y around inf 57.5%
*-commutative57.5%
associate-*r*60.1%
Simplified60.1%
if -6.60000000000000004e56 < z < 1.15e-69Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*98.6%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in y around 0 79.9%
if 1.15e-69 < z Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*86.8%
associate-*l*88.1%
Simplified88.1%
Taylor expanded in y around inf 50.7%
*-commutative50.7%
associate-*l*50.7%
associate-*l*50.8%
Simplified50.8%
Final simplification66.9%
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 (<= x -2.9e-37) (not (<= x 2.3e-36))) (* x 2.0) (* 27.0 (* 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 ((x <= -2.9e-37) || !(x <= 2.3e-36)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
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 ((x <= (-2.9d-37)) .or. (.not. (x <= 2.3d-36))) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
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 ((x <= -2.9e-37) || !(x <= 2.3e-36)) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (x <= -2.9e-37) or not (x <= 2.3e-36): tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
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 ((x <= -2.9e-37) || !(x <= 2.3e-36)) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
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 ((x <= -2.9e-37) || ~((x <= 2.3e-36)))
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
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[x, -2.9e-37], N[Not[LessEqual[x, 2.3e-36]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{-37} \lor \neg \left(x \leq 2.3 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -2.90000000000000005e-37 or 2.29999999999999996e-36 < x Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x around inf 51.3%
if -2.90000000000000005e-37 < x < 2.29999999999999996e-36Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*90.2%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in a around inf 42.4%
Final simplification47.3%
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 (<= x -3.3e-37) (not (<= x 2.1e-36))) (* x 2.0) (* b (* a 27.0))))
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 ((x <= -3.3e-37) || !(x <= 2.1e-36)) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
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 ((x <= (-3.3d-37)) .or. (.not. (x <= 2.1d-36))) then
tmp = x * 2.0d0
else
tmp = b * (a * 27.0d0)
end if
code = tmp
end function
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 ((x <= -3.3e-37) || !(x <= 2.1e-36)) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (x <= -3.3e-37) or not (x <= 2.1e-36): tmp = x * 2.0 else: tmp = b * (a * 27.0) return tmp
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 ((x <= -3.3e-37) || !(x <= 2.1e-36)) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(a * 27.0)); end return tmp end
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 ((x <= -3.3e-37) || ~((x <= 2.1e-36)))
tmp = x * 2.0;
else
tmp = 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. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -3.3e-37], N[Not[LessEqual[x, 2.1e-36]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{-37} \lor \neg \left(x \leq 2.1 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if x < -3.29999999999999982e-37 or 2.09999999999999991e-36 < x Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x around inf 51.3%
if -3.29999999999999982e-37 < x < 2.09999999999999991e-36Initial program 97.2%
sub-neg97.2%
sub-neg97.2%
associate-*l*90.2%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in a around inf 42.4%
associate-*r*43.1%
Simplified43.1%
Final simplification47.6%
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);
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.
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;
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]) 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]) 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])){:}
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. 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 \cdot 2
\end{array}
Initial program 96.4%
sub-neg96.4%
sub-neg96.4%
associate-*l*94.0%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in x around inf 32.6%
Final simplification32.6%
(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 2024040
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(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)))