
(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 15 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 (<= z -2e-300) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (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 <= -2e-300) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} 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 <= -2e-300) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); 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, -2e-300], 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[(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 -2 \cdot 10^{-300}:\\
\;\;\;\;\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}:\\
\;\;\;\;\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 < -2.00000000000000005e-300Initial program 93.4%
Simplified89.9%
if -2.00000000000000005e-300 < z Initial program 93.5%
+-commutative93.5%
associate-+r-93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
associate-*r*93.6%
distribute-lft-neg-in93.6%
*-commutative93.6%
cancel-sign-sub-inv93.6%
associate-+r-93.6%
associate-*l*93.6%
fma-define93.6%
cancel-sign-sub-inv93.6%
fma-define93.6%
distribute-lft-neg-in93.6%
distribute-rgt-neg-in93.6%
*-commutative93.6%
associate-*r*93.5%
associate-*l*92.8%
neg-mul-192.8%
associate-*r*92.8%
Simplified92.8%
Final simplification91.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 (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) {
return fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.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 fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.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[(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])\\
\\
\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}
Initial program 93.5%
+-commutative93.5%
associate-+r-93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
associate-*r*93.4%
distribute-lft-neg-in93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
associate-+r-93.4%
associate-*l*93.4%
fma-define94.2%
cancel-sign-sub-inv94.2%
fma-define94.6%
distribute-lft-neg-in94.6%
distribute-rgt-neg-in94.6%
*-commutative94.6%
associate-*r*94.6%
associate-*l*94.3%
neg-mul-194.3%
associate-*r*94.3%
Simplified94.3%
Final simplification94.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 (+ (* y (* t (* z -9.0))) (* b (* a 27.0)))))
(if (<= (* a 27.0) -1e+206)
t_1
(if (<= (* a 27.0) -2e+44)
(+ (* x 2.0) (* 27.0 (* a b)))
(if (<= (* a 27.0) 1e-64) (- (* x 2.0) (* 9.0 (* t (* z y)))) 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 = (y * (t * (z * -9.0))) + (b * (a * 27.0));
double tmp;
if ((a * 27.0) <= -1e+206) {
tmp = t_1;
} else if ((a * 27.0) <= -2e+44) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if ((a * 27.0) <= 1e-64) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} 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 = (y * (t * (z * (-9.0d0)))) + (b * (a * 27.0d0))
if ((a * 27.0d0) <= (-1d+206)) then
tmp = t_1
else if ((a * 27.0d0) <= (-2d+44)) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else if ((a * 27.0d0) <= 1d-64) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
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 = (y * (t * (z * -9.0))) + (b * (a * 27.0));
double tmp;
if ((a * 27.0) <= -1e+206) {
tmp = t_1;
} else if ((a * 27.0) <= -2e+44) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if ((a * 27.0) <= 1e-64) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} 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 = (y * (t * (z * -9.0))) + (b * (a * 27.0)) tmp = 0 if (a * 27.0) <= -1e+206: tmp = t_1 elif (a * 27.0) <= -2e+44: tmp = (x * 2.0) + (27.0 * (a * b)) elif (a * 27.0) <= 1e-64: tmp = (x * 2.0) - (9.0 * (t * (z * y))) 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(Float64(y * Float64(t * Float64(z * -9.0))) + Float64(b * Float64(a * 27.0))) tmp = 0.0 if (Float64(a * 27.0) <= -1e+206) tmp = t_1; elseif (Float64(a * 27.0) <= -2e+44) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); elseif (Float64(a * 27.0) <= 1e-64) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); 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 = (y * (t * (z * -9.0))) + (b * (a * 27.0));
tmp = 0.0;
if ((a * 27.0) <= -1e+206)
tmp = t_1;
elseif ((a * 27.0) <= -2e+44)
tmp = (x * 2.0) + (27.0 * (a * b));
elseif ((a * 27.0) <= 1e-64)
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
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[(N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * 27.0), $MachinePrecision], -1e+206], t$95$1, If[LessEqual[N[(a * 27.0), $MachinePrecision], -2e+44], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], 1e-64], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := y \cdot \left(t \cdot \left(z \cdot -9\right)\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;a \cdot 27 \leq -1 \cdot 10^{+206}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot 27 \leq -2 \cdot 10^{+44}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \cdot 27 \leq 10^{-64}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a #s(literal 27 binary64)) < -1e206 or 9.99999999999999965e-65 < (*.f64 a #s(literal 27 binary64)) Initial program 96.1%
sub-neg96.1%
sub-neg96.1%
associate-*l*92.4%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around 0 78.4%
sub-neg78.4%
+-commutative78.4%
*-commutative78.4%
distribute-rgt-neg-in78.4%
metadata-eval78.4%
associate-*r*78.4%
associate-*r*78.4%
*-commutative78.4%
associate-*l*74.7%
associate-*r*74.7%
*-commutative74.7%
*-commutative74.7%
Applied egg-rr74.7%
if -1e206 < (*.f64 a #s(literal 27 binary64)) < -2.0000000000000002e44Initial program 77.1%
+-commutative77.1%
associate-+r-77.1%
*-commutative77.1%
cancel-sign-sub-inv77.1%
associate-*r*83.1%
distribute-lft-neg-in83.1%
*-commutative83.1%
cancel-sign-sub-inv83.1%
associate-+r-83.1%
associate-*l*83.2%
fma-define86.6%
cancel-sign-sub-inv86.6%
fma-define89.9%
distribute-lft-neg-in89.9%
distribute-rgt-neg-in89.9%
*-commutative89.9%
associate-*r*83.8%
associate-*l*83.8%
neg-mul-183.8%
associate-*r*83.8%
Simplified83.8%
Taylor expanded in t around 0 80.4%
if -2.0000000000000002e44 < (*.f64 a #s(literal 27 binary64)) < 9.99999999999999965e-65Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*90.0%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in a around 0 80.0%
Final simplification77.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 (* 27.0 (* a b))))
(if (<= z -1.25e-51)
(* z (* t (* y -9.0)))
(if (<= z -7.5e-203)
t_1
(if (<= z 8e-198)
(* x 2.0)
(if (<= z 1.52e-66) t_1 (* 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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -1.25e-51) {
tmp = z * (t * (y * -9.0));
} else if (z <= -7.5e-203) {
tmp = t_1;
} else if (z <= 8e-198) {
tmp = x * 2.0;
} else if (z <= 1.52e-66) {
tmp = t_1;
} 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.
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 = 27.0d0 * (a * b)
if (z <= (-1.25d-51)) then
tmp = z * (t * (y * (-9.0d0)))
else if (z <= (-7.5d-203)) then
tmp = t_1
else if (z <= 8d-198) then
tmp = x * 2.0d0
else if (z <= 1.52d-66) then
tmp = t_1
else
tmp = t * (y * (z * (-9.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 tmp;
if (z <= -1.25e-51) {
tmp = z * (t * (y * -9.0));
} else if (z <= -7.5e-203) {
tmp = t_1;
} else if (z <= 8e-198) {
tmp = x * 2.0;
} else if (z <= 1.52e-66) {
tmp = t_1;
} else {
tmp = 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]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -1.25e-51: tmp = z * (t * (y * -9.0)) elif z <= -7.5e-203: tmp = t_1 elif z <= 8e-198: tmp = x * 2.0 elif z <= 1.52e-66: tmp = t_1 else: tmp = 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) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -1.25e-51) tmp = Float64(z * Float64(t * Float64(y * -9.0))); elseif (z <= -7.5e-203) tmp = t_1; elseif (z <= 8e-198) tmp = Float64(x * 2.0); elseif (z <= 1.52e-66) tmp = t_1; 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])){:}
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);
tmp = 0.0;
if (z <= -1.25e-51)
tmp = z * (t * (y * -9.0));
elseif (z <= -7.5e-203)
tmp = t_1;
elseif (z <= 8e-198)
tmp = x * 2.0;
elseif (z <= 1.52e-66)
tmp = t_1;
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.
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]}, If[LessEqual[z, -1.25e-51], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.5e-203], t$95$1, If[LessEqual[z, 8e-198], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.52e-66], t$95$1, 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])\\\\
[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)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{-51}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-203}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-198}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.25000000000000001e-51Initial program 90.9%
+-commutative90.9%
associate-+r-90.9%
*-commutative90.9%
cancel-sign-sub-inv90.9%
associate-*r*93.0%
distribute-lft-neg-in93.0%
*-commutative93.0%
cancel-sign-sub-inv93.0%
associate-+r-93.0%
associate-*l*93.0%
fma-define95.3%
cancel-sign-sub-inv95.3%
fma-define96.4%
distribute-lft-neg-in96.4%
distribute-rgt-neg-in96.4%
*-commutative96.4%
associate-*r*94.3%
associate-*l*94.3%
neg-mul-194.3%
associate-*r*94.3%
Simplified94.3%
Taylor expanded in t around inf 52.2%
*-commutative52.2%
associate-*r*52.2%
associate-*l*52.3%
Simplified52.3%
associate-*r*52.2%
associate-*r*52.2%
metadata-eval52.2%
distribute-rgt-neg-in52.2%
*-commutative52.2%
associate-*l*45.8%
associate-*r*45.9%
*-commutative45.9%
associate-*r*45.9%
*-commutative45.9%
Applied egg-rr45.9%
associate-*r*52.2%
*-commutative52.2%
*-commutative52.2%
associate-*r*52.2%
*-commutative52.2%
distribute-rgt-neg-in52.2%
*-commutative52.2%
associate-*l*52.2%
metadata-eval52.2%
associate-*r*52.2%
*-commutative52.2%
associate-*r*52.3%
associate-*r*52.3%
*-commutative52.3%
Applied egg-rr52.3%
if -1.25000000000000001e-51 < z < -7.50000000000000027e-203 or 7.9999999999999993e-198 < z < 1.51999999999999995e-66Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
*-commutative98.1%
cancel-sign-sub-inv98.1%
associate-*r*92.6%
distribute-lft-neg-in92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
associate-+r-92.6%
associate-*l*92.6%
fma-define92.6%
cancel-sign-sub-inv92.6%
fma-define92.6%
distribute-lft-neg-in92.6%
distribute-rgt-neg-in92.6%
*-commutative92.6%
associate-*r*98.1%
associate-*l*98.1%
neg-mul-198.1%
associate-*r*98.1%
Simplified98.1%
Taylor expanded in a around inf 43.5%
if -7.50000000000000027e-203 < z < 7.9999999999999993e-198Initial program 97.1%
+-commutative97.1%
associate-+r-97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
associate-*r*88.8%
distribute-lft-neg-in88.8%
*-commutative88.8%
cancel-sign-sub-inv88.8%
associate-+r-88.8%
associate-*l*88.8%
fma-define88.8%
cancel-sign-sub-inv88.8%
fma-define88.8%
distribute-lft-neg-in88.8%
distribute-rgt-neg-in88.8%
*-commutative88.8%
associate-*r*97.1%
associate-*l*97.1%
neg-mul-197.1%
associate-*r*97.1%
Simplified97.1%
Taylor expanded in t around 0 82.9%
Taylor expanded in x around inf 39.6%
if 1.51999999999999995e-66 < z Initial program 91.7%
+-commutative91.7%
associate-+r-91.7%
*-commutative91.7%
cancel-sign-sub-inv91.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*91.7%
associate-*l*90.7%
neg-mul-190.7%
associate-*r*90.7%
Simplified90.7%
Taylor expanded in t around inf 54.7%
*-commutative54.7%
associate-*r*54.7%
associate-*l*54.9%
Simplified54.9%
Final simplification49.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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -2.3e-54)
(* t (* -9.0 (* z y)))
(if (<= z -1.4e-199)
t_1
(if (<= z 1.02e-197)
(* x 2.0)
(if (<= z 3.6e-68) t_1 (* 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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -2.3e-54) {
tmp = t * (-9.0 * (z * y));
} else if (z <= -1.4e-199) {
tmp = t_1;
} else if (z <= 1.02e-197) {
tmp = x * 2.0;
} else if (z <= 3.6e-68) {
tmp = t_1;
} 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.
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 = 27.0d0 * (a * b)
if (z <= (-2.3d-54)) then
tmp = t * ((-9.0d0) * (z * y))
else if (z <= (-1.4d-199)) then
tmp = t_1
else if (z <= 1.02d-197) then
tmp = x * 2.0d0
else if (z <= 3.6d-68) then
tmp = t_1
else
tmp = t * (y * (z * (-9.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 tmp;
if (z <= -2.3e-54) {
tmp = t * (-9.0 * (z * y));
} else if (z <= -1.4e-199) {
tmp = t_1;
} else if (z <= 1.02e-197) {
tmp = x * 2.0;
} else if (z <= 3.6e-68) {
tmp = t_1;
} else {
tmp = 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]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -2.3e-54: tmp = t * (-9.0 * (z * y)) elif z <= -1.4e-199: tmp = t_1 elif z <= 1.02e-197: tmp = x * 2.0 elif z <= 3.6e-68: tmp = t_1 else: tmp = 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) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -2.3e-54) tmp = Float64(t * Float64(-9.0 * Float64(z * y))); elseif (z <= -1.4e-199) tmp = t_1; elseif (z <= 1.02e-197) tmp = Float64(x * 2.0); elseif (z <= 3.6e-68) tmp = t_1; 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])){:}
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);
tmp = 0.0;
if (z <= -2.3e-54)
tmp = t * (-9.0 * (z * y));
elseif (z <= -1.4e-199)
tmp = t_1;
elseif (z <= 1.02e-197)
tmp = x * 2.0;
elseif (z <= 3.6e-68)
tmp = t_1;
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.
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]}, If[LessEqual[z, -2.3e-54], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.4e-199], t$95$1, If[LessEqual[z, 1.02e-197], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 3.6e-68], t$95$1, 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])\\\\
[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)\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{-54}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-197}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-68}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -2.2999999999999999e-54Initial program 90.9%
+-commutative90.9%
associate-+r-90.9%
*-commutative90.9%
cancel-sign-sub-inv90.9%
associate-*r*93.0%
distribute-lft-neg-in93.0%
*-commutative93.0%
cancel-sign-sub-inv93.0%
associate-+r-93.0%
associate-*l*93.0%
fma-define95.3%
cancel-sign-sub-inv95.3%
fma-define96.4%
distribute-lft-neg-in96.4%
distribute-rgt-neg-in96.4%
*-commutative96.4%
associate-*r*94.3%
associate-*l*94.3%
neg-mul-194.3%
associate-*r*94.3%
Simplified94.3%
Taylor expanded in t around inf 52.2%
*-commutative52.2%
associate-*r*52.2%
associate-*l*52.3%
Simplified52.3%
Taylor expanded in y around 0 52.2%
if -2.2999999999999999e-54 < z < -1.40000000000000009e-199 or 1.0199999999999999e-197 < z < 3.60000000000000007e-68Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
*-commutative98.1%
cancel-sign-sub-inv98.1%
associate-*r*92.6%
distribute-lft-neg-in92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
associate-+r-92.6%
associate-*l*92.6%
fma-define92.6%
cancel-sign-sub-inv92.6%
fma-define92.6%
distribute-lft-neg-in92.6%
distribute-rgt-neg-in92.6%
*-commutative92.6%
associate-*r*98.1%
associate-*l*98.1%
neg-mul-198.1%
associate-*r*98.1%
Simplified98.1%
Taylor expanded in a around inf 43.5%
if -1.40000000000000009e-199 < z < 1.0199999999999999e-197Initial program 97.1%
+-commutative97.1%
associate-+r-97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
associate-*r*88.8%
distribute-lft-neg-in88.8%
*-commutative88.8%
cancel-sign-sub-inv88.8%
associate-+r-88.8%
associate-*l*88.8%
fma-define88.8%
cancel-sign-sub-inv88.8%
fma-define88.8%
distribute-lft-neg-in88.8%
distribute-rgt-neg-in88.8%
*-commutative88.8%
associate-*r*97.1%
associate-*l*97.1%
neg-mul-197.1%
associate-*r*97.1%
Simplified97.1%
Taylor expanded in t around 0 82.9%
Taylor expanded in x around inf 39.6%
if 3.60000000000000007e-68 < z Initial program 91.7%
+-commutative91.7%
associate-+r-91.7%
*-commutative91.7%
cancel-sign-sub-inv91.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*91.7%
associate-*l*90.7%
neg-mul-190.7%
associate-*r*90.7%
Simplified90.7%
Taylor expanded in t around inf 54.7%
*-commutative54.7%
associate-*r*54.7%
associate-*l*54.9%
Simplified54.9%
Final simplification49.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
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* t (* -9.0 (* z y)))))
(if (<= z -3.8e-56)
t_2
(if (<= z -1.5e-204)
t_1
(if (<= z 1.05e-197) (* x 2.0) (if (<= z 6.8e-68) t_1 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 = 27.0 * (a * b);
double t_2 = t * (-9.0 * (z * y));
double tmp;
if (z <= -3.8e-56) {
tmp = t_2;
} else if (z <= -1.5e-204) {
tmp = t_1;
} else if (z <= 1.05e-197) {
tmp = x * 2.0;
} else if (z <= 6.8e-68) {
tmp = t_1;
} 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 = 27.0d0 * (a * b)
t_2 = t * ((-9.0d0) * (z * y))
if (z <= (-3.8d-56)) then
tmp = t_2
else if (z <= (-1.5d-204)) then
tmp = t_1
else if (z <= 1.05d-197) then
tmp = x * 2.0d0
else if (z <= 6.8d-68) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = t * (-9.0 * (z * y));
double tmp;
if (z <= -3.8e-56) {
tmp = t_2;
} else if (z <= -1.5e-204) {
tmp = t_1;
} else if (z <= 1.05e-197) {
tmp = x * 2.0;
} else if (z <= 6.8e-68) {
tmp = t_1;
} 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 = 27.0 * (a * b) t_2 = t * (-9.0 * (z * y)) tmp = 0 if z <= -3.8e-56: tmp = t_2 elif z <= -1.5e-204: tmp = t_1 elif z <= 1.05e-197: tmp = x * 2.0 elif z <= 6.8e-68: tmp = t_1 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(27.0 * Float64(a * b)) t_2 = Float64(t * Float64(-9.0 * Float64(z * y))) tmp = 0.0 if (z <= -3.8e-56) tmp = t_2; elseif (z <= -1.5e-204) tmp = t_1; elseif (z <= 1.05e-197) tmp = Float64(x * 2.0); elseif (z <= 6.8e-68) tmp = t_1; 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 = 27.0 * (a * b);
t_2 = t * (-9.0 * (z * y));
tmp = 0.0;
if (z <= -3.8e-56)
tmp = t_2;
elseif (z <= -1.5e-204)
tmp = t_1;
elseif (z <= 1.05e-197)
tmp = x * 2.0;
elseif (z <= 6.8e-68)
tmp = t_1;
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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e-56], t$95$2, If[LessEqual[z, -1.5e-204], t$95$1, If[LessEqual[z, 1.05e-197], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 6.8e-68], t$95$1, 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 := 27 \cdot \left(a \cdot b\right)\\
t_2 := t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{-56}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-204}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-197}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-68}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3.8000000000000002e-56 or 6.80000000000000037e-68 < z Initial program 91.3%
+-commutative91.3%
associate-+r-91.3%
*-commutative91.3%
cancel-sign-sub-inv91.3%
associate-*r*94.6%
distribute-lft-neg-in94.6%
*-commutative94.6%
cancel-sign-sub-inv94.6%
associate-+r-94.6%
associate-*l*94.6%
fma-define95.8%
cancel-sign-sub-inv95.8%
fma-define96.4%
distribute-lft-neg-in96.4%
distribute-rgt-neg-in96.4%
*-commutative96.4%
associate-*r*93.0%
associate-*l*92.5%
neg-mul-192.5%
associate-*r*92.5%
Simplified92.5%
Taylor expanded in t around inf 53.4%
*-commutative53.4%
associate-*r*53.4%
associate-*l*53.6%
Simplified53.6%
Taylor expanded in y around 0 53.4%
if -3.8000000000000002e-56 < z < -1.4999999999999999e-204 or 1.05e-197 < z < 6.80000000000000037e-68Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
*-commutative98.1%
cancel-sign-sub-inv98.1%
associate-*r*92.6%
distribute-lft-neg-in92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
associate-+r-92.6%
associate-*l*92.6%
fma-define92.6%
cancel-sign-sub-inv92.6%
fma-define92.6%
distribute-lft-neg-in92.6%
distribute-rgt-neg-in92.6%
*-commutative92.6%
associate-*r*98.1%
associate-*l*98.1%
neg-mul-198.1%
associate-*r*98.1%
Simplified98.1%
Taylor expanded in a around inf 43.5%
if -1.4999999999999999e-204 < z < 1.05e-197Initial program 97.1%
+-commutative97.1%
associate-+r-97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
associate-*r*88.8%
distribute-lft-neg-in88.8%
*-commutative88.8%
cancel-sign-sub-inv88.8%
associate-+r-88.8%
associate-*l*88.8%
fma-define88.8%
cancel-sign-sub-inv88.8%
fma-define88.8%
distribute-lft-neg-in88.8%
distribute-rgt-neg-in88.8%
*-commutative88.8%
associate-*r*97.1%
associate-*l*97.1%
neg-mul-197.1%
associate-*r*97.1%
Simplified97.1%
Taylor expanded in t around 0 82.9%
Taylor expanded in x around inf 39.6%
Final simplification49.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 (* 27.0 (* a b))) (t_2 (* -9.0 (* t (* z y)))))
(if (<= z -3.4e-56)
t_2
(if (<= z -1.7e-197)
t_1
(if (<= z 1.4e-197) (* x 2.0) (if (<= z 4.2e-68) t_1 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 = 27.0 * (a * b);
double t_2 = -9.0 * (t * (z * y));
double tmp;
if (z <= -3.4e-56) {
tmp = t_2;
} else if (z <= -1.7e-197) {
tmp = t_1;
} else if (z <= 1.4e-197) {
tmp = x * 2.0;
} else if (z <= 4.2e-68) {
tmp = t_1;
} 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 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (t * (z * y))
if (z <= (-3.4d-56)) then
tmp = t_2
else if (z <= (-1.7d-197)) then
tmp = t_1
else if (z <= 1.4d-197) then
tmp = x * 2.0d0
else if (z <= 4.2d-68) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 tmp;
if (z <= -3.4e-56) {
tmp = t_2;
} else if (z <= -1.7e-197) {
tmp = t_1;
} else if (z <= 1.4e-197) {
tmp = x * 2.0;
} else if (z <= 4.2e-68) {
tmp = t_1;
} 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 = 27.0 * (a * b) t_2 = -9.0 * (t * (z * y)) tmp = 0 if z <= -3.4e-56: tmp = t_2 elif z <= -1.7e-197: tmp = t_1 elif z <= 1.4e-197: tmp = x * 2.0 elif z <= 4.2e-68: tmp = t_1 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(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (z <= -3.4e-56) tmp = t_2; elseif (z <= -1.7e-197) tmp = t_1; elseif (z <= 1.4e-197) tmp = Float64(x * 2.0); elseif (z <= 4.2e-68) tmp = t_1; 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 = 27.0 * (a * b);
t_2 = -9.0 * (t * (z * y));
tmp = 0.0;
if (z <= -3.4e-56)
tmp = t_2;
elseif (z <= -1.7e-197)
tmp = t_1;
elseif (z <= 1.4e-197)
tmp = x * 2.0;
elseif (z <= 4.2e-68)
tmp = t_1;
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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e-56], t$95$2, If[LessEqual[z, -1.7e-197], t$95$1, If[LessEqual[z, 1.4e-197], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 4.2e-68], t$95$1, 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 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{-56}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-197}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-68}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3.39999999999999982e-56 or 4.20000000000000016e-68 < z Initial program 91.3%
+-commutative91.3%
associate-+r-91.3%
*-commutative91.3%
cancel-sign-sub-inv91.3%
associate-*r*94.6%
distribute-lft-neg-in94.6%
*-commutative94.6%
cancel-sign-sub-inv94.6%
associate-+r-94.6%
associate-*l*94.6%
fma-define95.8%
cancel-sign-sub-inv95.8%
fma-define96.4%
distribute-lft-neg-in96.4%
distribute-rgt-neg-in96.4%
*-commutative96.4%
associate-*r*93.0%
associate-*l*92.5%
neg-mul-192.5%
associate-*r*92.5%
Simplified92.5%
Taylor expanded in t around inf 53.4%
if -3.39999999999999982e-56 < z < -1.6999999999999999e-197 or 1.4000000000000001e-197 < z < 4.20000000000000016e-68Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-*r*92.4%
distribute-lft-neg-in92.4%
*-commutative92.4%
cancel-sign-sub-inv92.4%
associate-+r-92.4%
associate-*l*92.5%
fma-define92.5%
cancel-sign-sub-inv92.5%
fma-define92.5%
distribute-lft-neg-in92.5%
distribute-rgt-neg-in92.5%
*-commutative92.5%
associate-*r*98.1%
associate-*l*98.0%
neg-mul-198.0%
associate-*r*98.0%
Simplified98.0%
Taylor expanded in a around inf 44.3%
if -1.6999999999999999e-197 < z < 1.4000000000000001e-197Initial program 97.1%
+-commutative97.1%
associate-+r-97.1%
*-commutative97.1%
cancel-sign-sub-inv97.1%
associate-*r*89.1%
distribute-lft-neg-in89.1%
*-commutative89.1%
cancel-sign-sub-inv89.1%
associate-+r-89.1%
associate-*l*89.1%
fma-define89.1%
cancel-sign-sub-inv89.1%
fma-define89.1%
distribute-lft-neg-in89.1%
distribute-rgt-neg-in89.1%
*-commutative89.1%
associate-*r*97.1%
associate-*l*97.2%
neg-mul-197.2%
associate-*r*97.2%
Simplified97.2%
Taylor expanded in t around 0 83.4%
Taylor expanded in x around inf 41.3%
Final simplification49.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 (* 9.0 (* t (* z y)))))
(if (<= (* a 27.0) -5e+19)
(- (* 27.0 (* a b)) t_1)
(if (<= (* a 27.0) 1e-64)
(- (* x 2.0) t_1)
(+ (* y (* t (* z -9.0))) (* 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 t_1 = 9.0 * (t * (z * y));
double tmp;
if ((a * 27.0) <= -5e+19) {
tmp = (27.0 * (a * b)) - t_1;
} else if ((a * 27.0) <= 1e-64) {
tmp = (x * 2.0) - t_1;
} else {
tmp = (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.
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 ((a * 27.0d0) <= (-5d+19)) then
tmp = (27.0d0 * (a * b)) - t_1
else if ((a * 27.0d0) <= 1d-64) then
tmp = (x * 2.0d0) - t_1
else
tmp = (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;
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 ((a * 27.0) <= -5e+19) {
tmp = (27.0 * (a * b)) - t_1;
} else if ((a * 27.0) <= 1e-64) {
tmp = (x * 2.0) - t_1;
} else {
tmp = (y * (t * (z * -9.0))) + (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): t_1 = 9.0 * (t * (z * y)) tmp = 0 if (a * 27.0) <= -5e+19: tmp = (27.0 * (a * b)) - t_1 elif (a * 27.0) <= 1e-64: tmp = (x * 2.0) - t_1 else: tmp = (y * (t * (z * -9.0))) + (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) t_1 = Float64(9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (Float64(a * 27.0) <= -5e+19) tmp = Float64(Float64(27.0 * Float64(a * b)) - t_1); elseif (Float64(a * 27.0) <= 1e-64) tmp = Float64(Float64(x * 2.0) - t_1); else tmp = Float64(Float64(y * Float64(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])){:}
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 ((a * 27.0) <= -5e+19)
tmp = (27.0 * (a * b)) - t_1;
elseif ((a * 27.0) <= 1e-64)
tmp = (x * 2.0) - t_1;
else
tmp = (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.
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[N[(a * 27.0), $MachinePrecision], -5e+19], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * 27.0), $MachinePrecision], 1e-64], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(y * N[(t * 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])\\\\
[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}\;a \cdot 27 \leq -5 \cdot 10^{+19}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t\_1\\
\mathbf{elif}\;a \cdot 27 \leq 10^{-64}:\\
\;\;\;\;x \cdot 2 - t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if (*.f64 a #s(literal 27 binary64)) < -5e19Initial program 82.7%
sub-neg82.7%
sub-neg82.7%
associate-*l*82.1%
associate-*l*82.2%
Simplified82.2%
Taylor expanded in x around 0 65.3%
if -5e19 < (*.f64 a #s(literal 27 binary64)) < 9.99999999999999965e-65Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*90.4%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in a around 0 82.4%
if 9.99999999999999965e-65 < (*.f64 a #s(literal 27 binary64)) Initial program 97.5%
sub-neg97.5%
sub-neg97.5%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in x around 0 78.8%
sub-neg78.8%
+-commutative78.8%
*-commutative78.8%
distribute-rgt-neg-in78.8%
metadata-eval78.8%
associate-*r*78.9%
associate-*r*78.9%
*-commutative78.9%
associate-*l*75.5%
associate-*r*75.4%
*-commutative75.4%
*-commutative75.4%
Applied egg-rr75.4%
Final simplification76.4%
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 (* z (* y 9.0))))
(if (<= t_1 5e+249)
(+ (- (* x 2.0) (* t t_1)) (* b (* a 27.0)))
(- (* x 2.0) (* 9.0 (* z (* 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 t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 5e+249) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = (x * 2.0) - (9.0 * (z * (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) :: t_1
real(8) :: tmp
t_1 = z * (y * 9.0d0)
if (t_1 <= 5d+249) then
tmp = ((x * 2.0d0) - (t * t_1)) + (b * (a * 27.0d0))
else
tmp = (x * 2.0d0) - (9.0d0 * (z * (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 t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 5e+249) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = (x * 2.0) - (9.0 * (z * (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): t_1 = z * (y * 9.0) tmp = 0 if t_1 <= 5e+249: tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0)) else: tmp = (x * 2.0) - (9.0 * (z * (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) t_1 = Float64(z * Float64(y * 9.0)) tmp = 0.0 if (t_1 <= 5e+249) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * t_1)) + Float64(b * Float64(a * 27.0))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * 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)
t_1 = z * (y * 9.0);
tmp = 0.0;
if (t_1 <= 5e+249)
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
else
tmp = (x * 2.0) - (9.0 * (z * (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_] := Block[{t$95$1 = N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+249], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * 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}
t_1 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+249}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t\_1\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 4.9999999999999996e249Initial program 94.5%
if 4.9999999999999996e249 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 83.1%
+-commutative83.1%
associate-+r-83.1%
*-commutative83.1%
cancel-sign-sub-inv83.1%
associate-*r*95.5%
distribute-lft-neg-in95.5%
*-commutative95.5%
cancel-sign-sub-inv95.5%
associate-+r-95.5%
associate-*l*95.5%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*r*87.3%
associate-*l*87.3%
neg-mul-187.3%
associate-*r*87.3%
Simplified87.3%
fma-undefine83.1%
fma-undefine83.1%
associate-+r+83.1%
*-commutative83.1%
associate-*l*95.7%
*-commutative95.7%
associate-*r*95.6%
*-commutative95.6%
*-commutative95.6%
associate-*r*95.6%
associate-*l*95.7%
metadata-eval95.7%
distribute-lft-neg-in95.7%
*-commutative95.7%
distribute-rgt-neg-in95.7%
*-commutative95.7%
associate-+r+95.7%
sub-neg95.7%
Applied egg-rr95.6%
Taylor expanded in b around 0 83.5%
*-commutative83.5%
*-commutative83.5%
associate-*r*96.0%
*-commutative96.0%
Simplified96.0%
Final simplification94.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 2.5e+19) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (* z (- (* 27.0 (/ (* a b) 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 <= 2.5e+19) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = z * ((27.0 * ((a * b) / 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 <= 2.5d+19) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = z * ((27.0d0 * ((a * b) / 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 <= 2.5e+19) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = z * ((27.0 * ((a * b) / 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 <= 2.5e+19: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = z * ((27.0 * ((a * b) / 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 <= 2.5e+19) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(z * Float64(Float64(27.0 * Float64(Float64(a * b) / 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 <= 2.5e+19)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = z * ((27.0 * ((a * b) / 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, 2.5e+19], 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[(z * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - 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 2.5 \cdot 10^{+19}:\\
\;\;\;\;\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}:\\
\;\;\;\;z \cdot \left(27 \cdot \frac{a \cdot b}{z} - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < 2.5e19Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*91.9%
associate-*l*91.9%
Simplified91.9%
if 2.5e19 < z Initial program 89.1%
sub-neg89.1%
sub-neg89.1%
associate-*l*83.2%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in x around 0 75.6%
Taylor expanded in z around inf 81.7%
Final simplification89.4%
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 -2.9e+42) (not (<= a 2.5e-66))) (+ (* x 2.0) (* 27.0 (* a b))) (- (* x 2.0) (* 9.0 (* t (* z y))))))
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 <= -2.9e+42) || !(a <= 2.5e-66)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (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.
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 <= (-2.9d+42)) .or. (.not. (a <= 2.5d-66))) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
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 <= -2.9e+42) || !(a <= 2.5e-66)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
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 <= -2.9e+42) or not (a <= 2.5e-66): tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) 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 <= -2.9e+42) || !(a <= 2.5e-66)) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - 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])){:}
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 <= -2.9e+42) || ~((a <= 2.5e-66)))
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (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. 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, -2.9e+42], N[Not[LessEqual[a, 2.5e-66]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{+42} \lor \neg \left(a \leq 2.5 \cdot 10^{-66}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if a < -2.89999999999999981e42 or 2.49999999999999981e-66 < a Initial program 91.9%
+-commutative91.9%
associate-+r-91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
associate-*r*91.2%
distribute-lft-neg-in91.2%
*-commutative91.2%
cancel-sign-sub-inv91.2%
associate-+r-91.2%
associate-*l*91.2%
fma-define92.6%
cancel-sign-sub-inv92.6%
fma-define93.4%
distribute-lft-neg-in93.4%
distribute-rgt-neg-in93.4%
*-commutative93.4%
associate-*r*94.1%
associate-*l*94.1%
neg-mul-194.1%
associate-*r*94.1%
Simplified94.1%
Taylor expanded in t around 0 71.0%
if -2.89999999999999981e42 < a < 2.49999999999999981e-66Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*89.9%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in a around 0 79.8%
Final simplification75.2%
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 -4.3e-51)
(- (* x 2.0) (* 9.0 (* z (* y t))))
(if (<= z 1.06e-68)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))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 <= -4.3e-51) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if (z <= 1.06e-68) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (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.
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 <= (-4.3d-51)) then
tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
else if (z <= 1.06d-68) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
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 <= -4.3e-51) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if (z <= 1.06e-68) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
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 <= -4.3e-51: tmp = (x * 2.0) - (9.0 * (z * (y * t))) elif z <= 1.06e-68: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) 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 <= -4.3e-51) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))); elseif (z <= 1.06e-68) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - 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])){:}
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 <= -4.3e-51)
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
elseif (z <= 1.06e-68)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (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. 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, -4.3e-51], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.06e-68], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-51}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-68}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -4.2999999999999997e-51Initial program 90.9%
+-commutative90.9%
associate-+r-90.9%
*-commutative90.9%
cancel-sign-sub-inv90.9%
associate-*r*93.0%
distribute-lft-neg-in93.0%
*-commutative93.0%
cancel-sign-sub-inv93.0%
associate-+r-93.0%
associate-*l*93.0%
fma-define95.3%
cancel-sign-sub-inv95.3%
fma-define96.4%
distribute-lft-neg-in96.4%
distribute-rgt-neg-in96.4%
*-commutative96.4%
associate-*r*94.3%
associate-*l*94.3%
neg-mul-194.3%
associate-*r*94.3%
Simplified94.3%
fma-undefine92.0%
fma-undefine90.8%
associate-+r+90.8%
*-commutative90.8%
associate-*l*80.9%
*-commutative80.9%
associate-*r*80.9%
*-commutative80.9%
*-commutative80.9%
associate-*r*80.9%
associate-*l*82.1%
metadata-eval82.1%
distribute-lft-neg-in82.1%
*-commutative82.1%
distribute-rgt-neg-in82.1%
*-commutative82.1%
associate-+r+82.1%
sub-neg82.1%
Applied egg-rr81.0%
Taylor expanded in b around 0 67.7%
*-commutative67.7%
*-commutative67.7%
associate-*r*68.6%
*-commutative68.6%
Simplified68.6%
if -4.2999999999999997e-51 < z < 1.06e-68Initial program 97.7%
+-commutative97.7%
associate-+r-97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
associate-*r*91.1%
distribute-lft-neg-in91.1%
*-commutative91.1%
cancel-sign-sub-inv91.1%
associate-+r-91.1%
associate-*l*91.1%
fma-define91.1%
cancel-sign-sub-inv91.1%
fma-define91.1%
distribute-lft-neg-in91.1%
distribute-rgt-neg-in91.1%
*-commutative91.1%
associate-*r*97.7%
associate-*l*97.7%
neg-mul-197.7%
associate-*r*97.7%
Simplified97.7%
Taylor expanded in t around 0 86.2%
if 1.06e-68 < z Initial program 91.7%
sub-neg91.7%
sub-neg91.7%
associate-*l*87.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in a around 0 68.4%
Final simplification74.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 -2.1e+60) (* z (* t (* y -9.0))) (if (<= z 3.4e-66) (+ (* x 2.0) (* 27.0 (* a b))) (* 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 <= -2.1e+60) {
tmp = z * (t * (y * -9.0));
} else if (z <= 3.4e-66) {
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.
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.1d+60)) then
tmp = z * (t * (y * (-9.0d0)))
else if (z <= 3.4d-66) 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;
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.1e+60) {
tmp = z * (t * (y * -9.0));
} else if (z <= 3.4e-66) {
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]) [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.1e+60: tmp = z * (t * (y * -9.0)) elif z <= 3.4e-66: 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]) 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.1e+60) tmp = Float64(z * Float64(t * Float64(y * -9.0))); elseif (z <= 3.4e-66) 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])){:}
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.1e+60)
tmp = z * (t * (y * -9.0));
elseif (z <= 3.4e-66)
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. 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.1e+60], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e-66], 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+60}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-66}:\\
\;\;\;\;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 < -2.1000000000000001e60Initial program 89.2%
+-commutative89.2%
associate-+r-89.2%
*-commutative89.2%
cancel-sign-sub-inv89.2%
associate-*r*93.5%
distribute-lft-neg-in93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
associate-+r-93.5%
associate-*l*93.5%
fma-define96.7%
cancel-sign-sub-inv96.7%
fma-define96.7%
distribute-lft-neg-in96.7%
distribute-rgt-neg-in96.7%
*-commutative96.7%
associate-*r*92.4%
associate-*l*92.4%
neg-mul-192.4%
associate-*r*92.4%
Simplified92.4%
Taylor expanded in t around inf 54.9%
*-commutative54.9%
associate-*r*54.8%
associate-*l*54.9%
Simplified54.9%
associate-*r*54.8%
associate-*r*54.9%
metadata-eval54.9%
distribute-rgt-neg-in54.9%
*-commutative54.9%
associate-*l*47.6%
associate-*r*47.6%
*-commutative47.6%
associate-*r*47.6%
*-commutative47.6%
Applied egg-rr47.6%
associate-*r*56.2%
*-commutative56.2%
*-commutative56.2%
associate-*r*56.2%
*-commutative56.2%
distribute-rgt-neg-in56.2%
*-commutative56.2%
associate-*l*54.9%
metadata-eval54.9%
associate-*r*54.8%
*-commutative54.8%
associate-*r*54.9%
associate-*r*56.3%
*-commutative56.3%
Applied egg-rr56.3%
if -2.1000000000000001e60 < z < 3.39999999999999997e-66Initial program 97.2%
+-commutative97.2%
associate-+r-97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-*r*91.2%
distribute-lft-neg-in91.2%
*-commutative91.2%
cancel-sign-sub-inv91.2%
associate-+r-91.2%
associate-*l*91.2%
fma-define91.2%
cancel-sign-sub-inv91.2%
fma-define92.1%
distribute-lft-neg-in92.1%
distribute-rgt-neg-in92.1%
*-commutative92.1%
associate-*r*98.1%
associate-*l*98.1%
neg-mul-198.1%
associate-*r*98.1%
Simplified98.1%
Taylor expanded in t around 0 80.3%
if 3.39999999999999997e-66 < z Initial program 91.7%
+-commutative91.7%
associate-+r-91.7%
*-commutative91.7%
cancel-sign-sub-inv91.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*91.7%
associate-*l*90.7%
neg-mul-190.7%
associate-*r*90.7%
Simplified90.7%
Taylor expanded in t around inf 54.7%
*-commutative54.7%
associate-*r*54.7%
associate-*l*54.9%
Simplified54.9%
Final simplification66.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 (<= a -3.6e+111) (not (<= a 2.6e-57))) (* 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 <= -3.6e+111) || !(a <= 2.6e-57)) {
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 <= (-3.6d+111)) .or. (.not. (a <= 2.6d-57))) 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 <= -3.6e+111) || !(a <= 2.6e-57)) {
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 <= -3.6e+111) or not (a <= 2.6e-57): 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 <= -3.6e+111) || !(a <= 2.6e-57)) 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 <= -3.6e+111) || ~((a <= 2.6e-57)))
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, -3.6e+111], N[Not[LessEqual[a, 2.6e-57]], $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 -3.6 \cdot 10^{+111} \lor \neg \left(a \leq 2.6 \cdot 10^{-57}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -3.6000000000000002e111 or 2.59999999999999985e-57 < a Initial program 92.0%
+-commutative92.0%
associate-+r-92.0%
*-commutative92.0%
cancel-sign-sub-inv92.0%
associate-*r*91.3%
distribute-lft-neg-in91.3%
*-commutative91.3%
cancel-sign-sub-inv91.3%
associate-+r-91.3%
associate-*l*91.3%
fma-define92.9%
cancel-sign-sub-inv92.9%
fma-define92.9%
distribute-lft-neg-in92.9%
distribute-rgt-neg-in92.9%
*-commutative92.9%
associate-*r*93.6%
associate-*l*93.6%
neg-mul-193.6%
associate-*r*93.6%
Simplified93.6%
Taylor expanded in a around inf 54.1%
if -3.6000000000000002e111 < a < 2.59999999999999985e-57Initial program 94.8%
+-commutative94.8%
associate-+r-94.8%
*-commutative94.8%
cancel-sign-sub-inv94.8%
associate-*r*95.5%
distribute-lft-neg-in95.5%
*-commutative95.5%
cancel-sign-sub-inv95.5%
associate-+r-95.5%
associate-*l*95.4%
fma-define95.4%
cancel-sign-sub-inv95.4%
fma-define96.2%
distribute-lft-neg-in96.2%
distribute-rgt-neg-in96.2%
*-commutative96.2%
associate-*r*95.5%
associate-*l*94.9%
neg-mul-194.9%
associate-*r*94.9%
Simplified94.9%
Taylor expanded in t around 0 51.3%
Taylor expanded in x around inf 36.9%
Final simplification45.2%
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 93.5%
+-commutative93.5%
associate-+r-93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
associate-*r*93.4%
distribute-lft-neg-in93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
associate-+r-93.4%
associate-*l*93.4%
fma-define94.2%
cancel-sign-sub-inv94.2%
fma-define94.6%
distribute-lft-neg-in94.6%
distribute-rgt-neg-in94.6%
*-commutative94.6%
associate-*r*94.6%
associate-*l*94.3%
neg-mul-194.3%
associate-*r*94.3%
Simplified94.3%
Taylor expanded in t around 0 60.5%
Taylor expanded in x around inf 27.8%
Final simplification27.8%
(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 2024165
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< y 7590524218811189/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b))))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))