
(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 13 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 5e-9) (- (* a (* 27.0 b)) (- (* (* y 9.0) (* z t)) (* x 2.0))) (* z (+ (/ (+ (* x 2.0) (* 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 <= 5e-9) {
tmp = (a * (27.0 * b)) - (((y * 9.0) * (z * t)) - (x * 2.0));
} else {
tmp = z * ((((x * 2.0) + (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 <= 5d-9) then
tmp = (a * (27.0d0 * b)) - (((y * 9.0d0) * (z * t)) - (x * 2.0d0))
else
tmp = z * ((((x * 2.0d0) + (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 <= 5e-9) {
tmp = (a * (27.0 * b)) - (((y * 9.0) * (z * t)) - (x * 2.0));
} else {
tmp = z * ((((x * 2.0) + (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 <= 5e-9: tmp = (a * (27.0 * b)) - (((y * 9.0) * (z * t)) - (x * 2.0)) else: tmp = z * ((((x * 2.0) + (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 <= 5e-9) tmp = Float64(Float64(a * Float64(27.0 * b)) - Float64(Float64(Float64(y * 9.0) * Float64(z * t)) - Float64(x * 2.0))); else tmp = Float64(z * Float64(Float64(Float64(Float64(x * 2.0) + Float64(27.0 * 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 <= 5e-9)
tmp = (a * (27.0 * b)) - (((y * 9.0) * (z * t)) - (x * 2.0));
else
tmp = z * ((((x * 2.0) + (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, 5e-9], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $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 5 \cdot 10^{-9}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{x \cdot 2 + 27 \cdot \left(a \cdot b\right)}{z} + -9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < 5.0000000000000001e-9Initial program 97.9%
associate-+l-97.9%
*-commutative97.9%
*-commutative97.9%
associate-*l*97.8%
associate-+l-97.8%
associate-*l*97.9%
*-commutative97.9%
*-commutative97.9%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
if 5.0000000000000001e-9 < z Initial program 93.6%
associate-+l-93.6%
*-commutative93.6%
*-commutative93.6%
associate-*l*93.6%
associate-+l-93.6%
associate-*l*93.6%
*-commutative93.6%
*-commutative93.6%
associate-*l*89.1%
associate-*l*89.1%
Simplified89.1%
Taylor expanded in z around -inf 99.9%
Final simplification96.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 (* b (* a 27.0))))
(if (<= z 1e-239)
(- (+ (* x 2.0) t_1) (* y (* 9.0 (* z t))))
(+ (- (* x 2.0) (* t (* 9.0 (* 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 = b * (a * 27.0);
double tmp;
if (z <= 1e-239) {
tmp = ((x * 2.0) + t_1) - (y * (9.0 * (z * t)));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + 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 = b * (a * 27.0d0)
if (z <= 1d-239) then
tmp = ((x * 2.0d0) + t_1) - (y * (9.0d0 * (z * t)))
else
tmp = ((x * 2.0d0) - (t * (9.0d0 * (z * y)))) + 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 = b * (a * 27.0);
double tmp;
if (z <= 1e-239) {
tmp = ((x * 2.0) + t_1) - (y * (9.0 * (z * t)));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + 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 = b * (a * 27.0) tmp = 0 if z <= 1e-239: tmp = ((x * 2.0) + t_1) - (y * (9.0 * (z * t))) else: tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + 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(b * Float64(a * 27.0)) tmp = 0.0 if (z <= 1e-239) tmp = Float64(Float64(Float64(x * 2.0) + t_1) - Float64(y * Float64(9.0 * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(z * y)))) + 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 = b * (a * 27.0);
tmp = 0.0;
if (z <= 1e-239)
tmp = ((x * 2.0) + t_1) - (y * (9.0 * (z * t)));
else
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + 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[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1e-239], N[(N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $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 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq 10^{-239}:\\
\;\;\;\;\left(x \cdot 2 + t\_1\right) - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + t\_1\\
\end{array}
\end{array}
if z < 1.0000000000000001e-239Initial program 97.3%
+-commutative97.3%
associate-+r-97.3%
*-commutative97.3%
cancel-sign-sub-inv97.3%
associate-*r*94.2%
distribute-lft-neg-in94.2%
*-commutative94.2%
cancel-sign-sub-inv94.2%
associate-+r-94.2%
associate-*l*94.1%
fma-define94.1%
cancel-sign-sub-inv94.1%
fma-define94.1%
*-commutative94.1%
distribute-rgt-neg-in94.1%
distribute-lft-neg-out94.1%
associate-*r*97.3%
associate-*l*97.2%
Simplified97.2%
fma-undefine97.2%
fma-undefine97.2%
associate-+r+97.2%
*-commutative97.2%
associate-*l*94.2%
*-commutative94.2%
associate-*r*94.2%
*-commutative94.2%
*-commutative94.2%
associate-*r*94.2%
associate-*l*94.2%
metadata-eval94.2%
distribute-lft-neg-in94.2%
*-commutative94.2%
distribute-rgt-neg-in94.2%
*-commutative94.2%
associate-+r+94.2%
sub-neg94.2%
Applied egg-rr94.3%
if 1.0000000000000001e-239 < z Initial program 96.1%
Taylor expanded in y around 0 96.1%
Final simplification95.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. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e-7) (- (* a (* 27.0 b)) (- (* (* y 9.0) (* z t)) (* x 2.0))) (+ (- (* x 2.0) (* t (* 9.0 (* z y)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-7) {
tmp = (a * (27.0 * b)) - (((y * 9.0) * (z * t)) - (x * 2.0));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 2d-7) then
tmp = (a * (27.0d0 * b)) - (((y * 9.0d0) * (z * t)) - (x * 2.0d0))
else
tmp = ((x * 2.0d0) - (t * (9.0d0 * (z * y)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-7) {
tmp = (a * (27.0 * b)) - (((y * 9.0) * (z * t)) - (x * 2.0));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 2e-7: tmp = (a * (27.0 * b)) - (((y * 9.0) * (z * t)) - (x * 2.0)) else: tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e-7) tmp = Float64(Float64(a * Float64(27.0 * b)) - Float64(Float64(Float64(y * 9.0) * Float64(z * t)) - Float64(x * 2.0))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(z * y)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 2e-7)
tmp = (a * (27.0 * b)) - (((y * 9.0) * (z * t)) - (x * 2.0));
else
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2e-7], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-7}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) - \left(\left(y \cdot 9\right) \cdot \left(z \cdot t\right) - x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 1.9999999999999999e-7Initial program 97.9%
associate-+l-97.9%
*-commutative97.9%
*-commutative97.9%
associate-*l*97.8%
associate-+l-97.8%
associate-*l*97.9%
*-commutative97.9%
*-commutative97.9%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
if 1.9999999999999999e-7 < z Initial program 93.6%
Taylor expanded in y around 0 93.6%
Final simplification95.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. (FPCore (x y z t a b) :precision binary64 (if (<= z -3.2e+70) (- (* 27.0 (* a b)) (* 9.0 (* z (* y t)))) (+ (- (* x 2.0) (* t (* 9.0 (* z y)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.2e+70) {
tmp = (27.0 * (a * b)) - (9.0 * (z * (y * t)));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.2d+70)) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * (z * (y * t)))
else
tmp = ((x * 2.0d0) - (t * (9.0d0 * (z * y)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.2e+70) {
tmp = (27.0 * (a * b)) - (9.0 * (z * (y * t)));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3.2e+70: tmp = (27.0 * (a * b)) - (9.0 * (z * (y * t))) else: tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.2e+70) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(z * Float64(y * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(z * y)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -3.2e+70)
tmp = (27.0 * (a * b)) - (9.0 * (z * (y * t)));
else
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.2e+70], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+70}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -3.2000000000000002e70Initial program 94.5%
associate-+l-94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*94.3%
associate-+l-94.3%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*85.1%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in x around 0 84.9%
pow184.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*90.4%
Applied egg-rr90.4%
unpow190.4%
*-commutative90.4%
Simplified90.4%
if -3.2000000000000002e70 < z Initial program 97.4%
Taylor expanded in y around 0 97.4%
Final simplification96.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. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.2e-34) (not (<= b 1.82e+106))) (+ (* x 2.0) (* 27.0 (* a b))) (- (* x 2.0) (* (* y 9.0) (* z 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 ((b <= -1.2e-34) || !(b <= 1.82e+106)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - ((y * 9.0) * (z * 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 ((b <= (-1.2d-34)) .or. (.not. (b <= 1.82d+106))) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - ((y * 9.0d0) * (z * 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 ((b <= -1.2e-34) || !(b <= 1.82e+106)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - ((y * 9.0) * (z * 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 (b <= -1.2e-34) or not (b <= 1.82e+106): tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - ((y * 9.0) * (z * 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 ((b <= -1.2e-34) || !(b <= 1.82e+106)) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * 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 ((b <= -1.2e-34) || ~((b <= 1.82e+106)))
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - ((y * 9.0) * (z * 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[Or[LessEqual[b, -1.2e-34], N[Not[LessEqual[b, 1.82e+106]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $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}\;b \leq -1.2 \cdot 10^{-34} \lor \neg \left(b \leq 1.82 \cdot 10^{+106}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if b < -1.19999999999999996e-34 or 1.8199999999999999e106 < b Initial program 96.0%
+-commutative96.0%
associate-+r-96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-*r*92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-+r-92.3%
associate-*l*92.3%
fma-define92.3%
cancel-sign-sub-inv92.3%
fma-define92.3%
*-commutative92.3%
distribute-rgt-neg-in92.3%
distribute-lft-neg-out92.3%
associate-*r*96.0%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in t around 0 73.2%
if -1.19999999999999996e-34 < b < 1.8199999999999999e106Initial program 97.4%
associate-+l-97.4%
*-commutative97.4%
*-commutative97.4%
associate-*l*97.3%
associate-+l-97.3%
associate-*l*97.4%
*-commutative97.4%
*-commutative97.4%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in a around 0 80.7%
pow180.7%
*-commutative80.7%
associate-*l*78.9%
Applied egg-rr78.9%
unpow178.9%
associate-*r*78.9%
*-commutative78.9%
Simplified78.9%
Final simplification76.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 (or (<= b -3.1e-33) (not (<= b 3.4e+118))) (+ (* 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 ((b <= -3.1e-33) || !(b <= 3.4e+118)) {
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 ((b <= (-3.1d-33)) .or. (.not. (b <= 3.4d+118))) 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 ((b <= -3.1e-33) || !(b <= 3.4e+118)) {
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 (b <= -3.1e-33) or not (b <= 3.4e+118): 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 ((b <= -3.1e-33) || !(b <= 3.4e+118)) 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 ((b <= -3.1e-33) || ~((b <= 3.4e+118)))
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[b, -3.1e-33], N[Not[LessEqual[b, 3.4e+118]], $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}\;b \leq -3.1 \cdot 10^{-33} \lor \neg \left(b \leq 3.4 \cdot 10^{+118}\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 b < -3.09999999999999997e-33 or 3.39999999999999986e118 < b Initial program 95.9%
+-commutative95.9%
associate-+r-95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-*r*92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-+r-92.3%
associate-*l*92.3%
fma-define92.3%
cancel-sign-sub-inv92.3%
fma-define92.3%
*-commutative92.3%
distribute-rgt-neg-in92.3%
distribute-lft-neg-out92.3%
associate-*r*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in t around 0 73.9%
if -3.09999999999999997e-33 < b < 3.39999999999999986e118Initial program 97.4%
associate-+l-97.4%
*-commutative97.4%
*-commutative97.4%
associate-*l*97.4%
associate-+l-97.4%
associate-*l*97.4%
*-commutative97.4%
*-commutative97.4%
associate-*l*95.0%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in a around 0 80.8%
Final simplification78.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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= b -2.7e-43)
(- t_1 (* 9.0 (* t (* z y))))
(if (<= b 1e+105)
(- (* x 2.0) (* (* y 9.0) (* z t)))
(+ (* x 2.0) t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (b <= -2.7e-43) {
tmp = t_1 - (9.0 * (t * (z * y)));
} else if (b <= 1e+105) {
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
} 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.
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 (b <= (-2.7d-43)) then
tmp = t_1 - (9.0d0 * (t * (z * y)))
else if (b <= 1d+105) then
tmp = (x * 2.0d0) - ((y * 9.0d0) * (z * t))
else
tmp = (x * 2.0d0) + 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 = 27.0 * (a * b);
double tmp;
if (b <= -2.7e-43) {
tmp = t_1 - (9.0 * (t * (z * y)));
} else if (b <= 1e+105) {
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
} else {
tmp = (x * 2.0) + 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 = 27.0 * (a * b) tmp = 0 if b <= -2.7e-43: tmp = t_1 - (9.0 * (t * (z * y))) elif b <= 1e+105: tmp = (x * 2.0) - ((y * 9.0) * (z * t)) else: tmp = (x * 2.0) + 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(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -2.7e-43) tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(z * y)))); elseif (b <= 1e+105) tmp = Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))); 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])){:}
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 (b <= -2.7e-43)
tmp = t_1 - (9.0 * (t * (z * y)));
elseif (b <= 1e+105)
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
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.
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[b, -2.7e-43], N[(t$95$1 - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e+105], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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])\\\\
[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}\;b \leq -2.7 \cdot 10^{-43}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 10^{+105}:\\
\;\;\;\;x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\end{array}
\end{array}
if b < -2.69999999999999991e-43Initial program 95.0%
associate-+l-95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*95.0%
associate-+l-95.0%
associate-*l*95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*90.5%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in x around 0 74.4%
if -2.69999999999999991e-43 < b < 9.9999999999999994e104Initial program 98.0%
associate-+l-98.0%
*-commutative98.0%
*-commutative98.0%
associate-*l*97.9%
associate-+l-97.9%
associate-*l*98.0%
*-commutative98.0%
*-commutative98.0%
associate-*l*94.8%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in a around 0 81.5%
pow181.5%
*-commutative81.5%
associate-*l*79.0%
Applied egg-rr79.0%
unpow179.0%
associate-*r*79.0%
*-commutative79.0%
Simplified79.0%
if 9.9999999999999994e104 < b Initial program 95.5%
+-commutative95.5%
associate-+r-95.5%
*-commutative95.5%
cancel-sign-sub-inv95.5%
associate-*r*87.2%
distribute-lft-neg-in87.2%
*-commutative87.2%
cancel-sign-sub-inv87.2%
associate-+r-87.2%
associate-*l*87.2%
fma-define87.2%
cancel-sign-sub-inv87.2%
fma-define87.2%
*-commutative87.2%
distribute-rgt-neg-in87.2%
distribute-lft-neg-out87.2%
associate-*r*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in t around 0 86.6%
Final simplification79.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.9e-123) (not (<= b 1.5e+119))) (* 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 ((b <= -1.9e-123) || !(b <= 1.5e+119)) {
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 ((b <= (-1.9d-123)) .or. (.not. (b <= 1.5d+119))) 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 ((b <= -1.9e-123) || !(b <= 1.5e+119)) {
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 (b <= -1.9e-123) or not (b <= 1.5e+119): 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 ((b <= -1.9e-123) || !(b <= 1.5e+119)) 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 ((b <= -1.9e-123) || ~((b <= 1.5e+119)))
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[b, -1.9e-123], N[Not[LessEqual[b, 1.5e+119]], $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}\;b \leq -1.9 \cdot 10^{-123} \lor \neg \left(b \leq 1.5 \cdot 10^{+119}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.89999999999999998e-123 or 1.50000000000000001e119 < b Initial program 95.9%
+-commutative95.9%
associate-+r-95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-*r*91.6%
distribute-lft-neg-in91.6%
*-commutative91.6%
cancel-sign-sub-inv91.6%
associate-+r-91.6%
associate-*l*91.5%
fma-define91.5%
cancel-sign-sub-inv91.5%
fma-define91.5%
*-commutative91.5%
distribute-rgt-neg-in91.5%
distribute-lft-neg-out91.5%
associate-*r*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in a around inf 49.1%
if -1.89999999999999998e-123 < b < 1.50000000000000001e119Initial program 97.7%
+-commutative97.7%
associate-+r-97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
associate-*r*96.2%
distribute-lft-neg-in96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-+r-96.2%
associate-*l*96.2%
fma-define96.2%
cancel-sign-sub-inv96.2%
fma-define96.2%
*-commutative96.2%
distribute-rgt-neg-in96.2%
distribute-lft-neg-out96.2%
associate-*r*97.7%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in t around 0 53.8%
Taylor expanded in x around inf 38.9%
Final simplification43.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= y -1.38e+75) (* 9.0 (* y (- (* z t)))) (if (<= y -2.4e-168) (* 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 (y <= -1.38e+75) {
tmp = 9.0 * (y * -(z * t));
} else if (y <= -2.4e-168) {
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 (y <= (-1.38d+75)) then
tmp = 9.0d0 * (y * -(z * t))
else if (y <= (-2.4d-168)) 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 (y <= -1.38e+75) {
tmp = 9.0 * (y * -(z * t));
} else if (y <= -2.4e-168) {
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 y <= -1.38e+75: tmp = 9.0 * (y * -(z * t)) elif y <= -2.4e-168: 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 (y <= -1.38e+75) tmp = Float64(9.0 * Float64(y * Float64(-Float64(z * t)))); elseif (y <= -2.4e-168) 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 (y <= -1.38e+75)
tmp = 9.0 * (y * -(z * t));
elseif (y <= -2.4e-168)
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[LessEqual[y, -1.38e+75], N[(9.0 * N[(y * (-N[(z * t), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.4e-168], 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}\;y \leq -1.38 \cdot 10^{+75}:\\
\;\;\;\;9 \cdot \left(y \cdot \left(-z \cdot t\right)\right)\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-168}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if y < -1.3799999999999999e75Initial program 92.2%
+-commutative92.2%
associate-+r-92.2%
*-commutative92.2%
cancel-sign-sub-inv92.2%
associate-*r*85.2%
distribute-lft-neg-in85.2%
*-commutative85.2%
cancel-sign-sub-inv85.2%
associate-+r-85.2%
associate-*l*85.2%
fma-define85.2%
cancel-sign-sub-inv85.2%
fma-define85.2%
*-commutative85.2%
distribute-rgt-neg-in85.2%
distribute-lft-neg-out85.2%
associate-*r*92.2%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in t around inf 62.7%
*-commutative62.7%
associate-*r*62.7%
associate-*l*62.6%
Simplified62.6%
Taylor expanded in y around 0 62.7%
*-commutative62.7%
associate-*r*62.7%
metadata-eval62.7%
*-commutative62.7%
distribute-lft-neg-in62.7%
*-commutative62.7%
associate-*l*65.1%
Applied egg-rr65.1%
if -1.3799999999999999e75 < y < -2.3999999999999999e-168Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-*r*97.7%
distribute-lft-neg-in97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
associate-+r-97.7%
associate-*l*97.6%
fma-define97.6%
cancel-sign-sub-inv97.6%
fma-define97.6%
*-commutative97.6%
distribute-rgt-neg-in97.6%
distribute-lft-neg-out97.6%
associate-*r*95.5%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in a around inf 48.9%
if -2.3999999999999999e-168 < y Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-*r*94.9%
distribute-lft-neg-in94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-+r-94.9%
associate-*l*94.9%
fma-define94.9%
cancel-sign-sub-inv94.9%
fma-define94.9%
*-commutative94.9%
distribute-rgt-neg-in94.9%
distribute-lft-neg-out94.9%
associate-*r*98.2%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in t around 0 65.5%
Taylor expanded in x around inf 38.5%
Final simplification44.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 (<= y -1.65e+75) (* -9.0 (* t (* z y))) (if (<= y -3.9e-168) (* 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 (y <= -1.65e+75) {
tmp = -9.0 * (t * (z * y));
} else if (y <= -3.9e-168) {
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 (y <= (-1.65d+75)) then
tmp = (-9.0d0) * (t * (z * y))
else if (y <= (-3.9d-168)) 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 (y <= -1.65e+75) {
tmp = -9.0 * (t * (z * y));
} else if (y <= -3.9e-168) {
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 y <= -1.65e+75: tmp = -9.0 * (t * (z * y)) elif y <= -3.9e-168: 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 (y <= -1.65e+75) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (y <= -3.9e-168) 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 (y <= -1.65e+75)
tmp = -9.0 * (t * (z * y));
elseif (y <= -3.9e-168)
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[LessEqual[y, -1.65e+75], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.9e-168], 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}\;y \leq -1.65 \cdot 10^{+75}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-168}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if y < -1.64999999999999999e75Initial program 92.2%
+-commutative92.2%
associate-+r-92.2%
*-commutative92.2%
cancel-sign-sub-inv92.2%
associate-*r*85.2%
distribute-lft-neg-in85.2%
*-commutative85.2%
cancel-sign-sub-inv85.2%
associate-+r-85.2%
associate-*l*85.2%
fma-define85.2%
cancel-sign-sub-inv85.2%
fma-define85.2%
*-commutative85.2%
distribute-rgt-neg-in85.2%
distribute-lft-neg-out85.2%
associate-*r*92.2%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in t around inf 62.7%
if -1.64999999999999999e75 < y < -3.90000000000000012e-168Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-*r*97.7%
distribute-lft-neg-in97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
associate-+r-97.7%
associate-*l*97.6%
fma-define97.6%
cancel-sign-sub-inv97.6%
fma-define97.6%
*-commutative97.6%
distribute-rgt-neg-in97.6%
distribute-lft-neg-out97.6%
associate-*r*95.5%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in a around inf 48.9%
if -3.90000000000000012e-168 < y Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-*r*94.9%
distribute-lft-neg-in94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-+r-94.9%
associate-*l*94.9%
fma-define94.9%
cancel-sign-sub-inv94.9%
fma-define94.9%
*-commutative94.9%
distribute-rgt-neg-in94.9%
distribute-lft-neg-out94.9%
associate-*r*98.2%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in t around 0 65.5%
Taylor expanded in x around inf 38.5%
Final simplification44.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. (FPCore (x y z t a b) :precision binary64 (if (<= b -1.9e-123) (* b (* a 27.0)) (if (<= b 1.95e+122) (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.9e-123) {
tmp = b * (a * 27.0);
} else if (b <= 1.95e+122) {
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.
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 (b <= (-1.9d-123)) then
tmp = b * (a * 27.0d0)
else if (b <= 1.95d+122) 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;
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 (b <= -1.9e-123) {
tmp = b * (a * 27.0);
} else if (b <= 1.95e+122) {
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]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -1.9e-123: tmp = b * (a * 27.0) elif b <= 1.95e+122: 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]) 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 (b <= -1.9e-123) tmp = Float64(b * Float64(a * 27.0)); elseif (b <= 1.95e+122) 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])){:}
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 (b <= -1.9e-123)
tmp = b * (a * 27.0);
elseif (b <= 1.95e+122)
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. 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[b, -1.9e-123], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.95e+122], 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.9 \cdot 10^{-123}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{+122}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -1.89999999999999998e-123Initial program 96.3%
+-commutative96.3%
associate-+r-96.3%
*-commutative96.3%
cancel-sign-sub-inv96.3%
associate-*r*94.2%
distribute-lft-neg-in94.2%
*-commutative94.2%
cancel-sign-sub-inv94.2%
associate-+r-94.2%
associate-*l*94.1%
fma-define94.1%
cancel-sign-sub-inv94.1%
fma-define94.1%
*-commutative94.1%
distribute-rgt-neg-in94.1%
distribute-lft-neg-out94.1%
associate-*r*96.2%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in t around 0 65.5%
Taylor expanded in x around 0 36.6%
associate-*r*36.6%
*-commutative36.6%
Simplified36.6%
if -1.89999999999999998e-123 < b < 1.95e122Initial program 97.7%
+-commutative97.7%
associate-+r-97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
associate-*r*96.2%
distribute-lft-neg-in96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-+r-96.2%
associate-*l*96.2%
fma-define96.2%
cancel-sign-sub-inv96.2%
fma-define96.2%
*-commutative96.2%
distribute-rgt-neg-in96.2%
distribute-lft-neg-out96.2%
associate-*r*97.7%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in t around 0 53.8%
Taylor expanded in x around inf 38.9%
if 1.95e122 < b Initial program 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-*r*86.6%
distribute-lft-neg-in86.6%
*-commutative86.6%
cancel-sign-sub-inv86.6%
associate-+r-86.6%
associate-*l*86.6%
fma-define86.6%
cancel-sign-sub-inv86.6%
fma-define86.6%
*-commutative86.6%
distribute-rgt-neg-in86.6%
distribute-lft-neg-out86.6%
associate-*r*95.3%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in a around inf 72.7%
Final simplification43.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= y -6.3e+136) (* 9.0 (* y (- (* z t)))) (+ (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.3e+136) {
tmp = 9.0 * (y * -(z * t));
} 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.
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 <= (-6.3d+136)) then
tmp = 9.0d0 * (y * -(z * t))
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;
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 <= -6.3e+136) {
tmp = 9.0 * (y * -(z * t));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
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 y <= -6.3e+136: tmp = 9.0 * (y * -(z * t)) else: tmp = (x * 2.0) + (27.0 * (a * b)) 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 (y <= -6.3e+136) tmp = Float64(9.0 * Float64(y * Float64(-Float64(z * t)))); 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])){:}
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 <= -6.3e+136)
tmp = 9.0 * (y * -(z * t));
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. 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, -6.3e+136], N[(9.0 * N[(y * (-N[(z * t), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.3 \cdot 10^{+136}:\\
\;\;\;\;9 \cdot \left(y \cdot \left(-z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -6.2999999999999997e136Initial program 91.2%
+-commutative91.2%
associate-+r-91.2%
*-commutative91.2%
cancel-sign-sub-inv91.2%
associate-*r*88.5%
distribute-lft-neg-in88.5%
*-commutative88.5%
cancel-sign-sub-inv88.5%
associate-+r-88.5%
associate-*l*88.5%
fma-define88.5%
cancel-sign-sub-inv88.5%
fma-define88.5%
*-commutative88.5%
distribute-rgt-neg-in88.5%
distribute-lft-neg-out88.5%
associate-*r*91.2%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in t around inf 62.9%
*-commutative62.9%
associate-*r*62.9%
associate-*l*62.8%
Simplified62.8%
Taylor expanded in y around 0 62.9%
*-commutative62.9%
associate-*r*62.9%
metadata-eval62.9%
*-commutative62.9%
distribute-lft-neg-in62.9%
*-commutative62.9%
associate-*l*65.7%
Applied egg-rr65.7%
if -6.2999999999999997e136 < y Initial program 97.7%
+-commutative97.7%
associate-+r-97.7%
*-commutative97.7%
cancel-sign-sub-inv97.7%
associate-*r*94.7%
distribute-lft-neg-in94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-+r-94.7%
associate-*l*94.7%
fma-define94.7%
cancel-sign-sub-inv94.7%
fma-define94.7%
*-commutative94.7%
distribute-rgt-neg-in94.7%
distribute-lft-neg-out94.7%
associate-*r*97.7%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in t around 0 67.3%
Final simplification67.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 96.8%
+-commutative96.8%
associate-+r-96.8%
*-commutative96.8%
cancel-sign-sub-inv96.8%
associate-*r*93.9%
distribute-lft-neg-in93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
associate-+r-93.9%
associate-*l*93.9%
fma-define93.9%
cancel-sign-sub-inv93.9%
fma-define93.9%
*-commutative93.9%
distribute-rgt-neg-in93.9%
distribute-lft-neg-out93.9%
associate-*r*96.8%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in t around 0 63.5%
Taylor expanded in x around inf 32.3%
Final simplification32.3%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024182
(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)))