
(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 11 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 1.85e+75) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (* t (- (* 27.0 (/ (* a b) t)) (* 9.0 (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.85e+75) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 1.85d+75) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = t * ((27.0d0 * ((a * b) / t)) - (9.0d0 * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.85e+75) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1.85e+75: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.85e+75) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(t * Float64(Float64(27.0 * Float64(Float64(a * b) / t)) - Float64(9.0 * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1.85e+75)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.85e+75], 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[(t * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.85 \cdot 10^{+75}:\\
\;\;\;\;\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}:\\
\;\;\;\;t \cdot \left(27 \cdot \frac{a \cdot b}{t} - 9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 1.85000000000000005e75Initial program 98.9%
associate-+l-98.9%
*-commutative98.9%
*-commutative98.9%
associate-*l*98.9%
associate-+l-98.9%
associate-*l*98.9%
*-commutative98.9%
*-commutative98.9%
associate-*l*98.4%
associate-*l*98.4%
Simplified98.4%
if 1.85000000000000005e75 < z Initial program 86.7%
associate-+l-86.7%
*-commutative86.7%
*-commutative86.7%
associate-*l*86.7%
associate-+l-86.7%
associate-*l*86.7%
*-commutative86.7%
*-commutative86.7%
associate-*l*88.7%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in x around 0 64.3%
Taylor expanded in t around inf 56.1%
Final simplification90.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
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* -9.0 (* y (* z t)))))
(if (<= z -8.8e-110)
t_2
(if (<= z -1.32e-213)
t_1
(if (<= z -9.2e-268)
(* x 2.0)
(if (<= z 4.2e-260)
t_1
(if (<= z 1.6e-91)
(* x 2.0)
(if (<= z 1.35e-52)
t_2
(if (<= z 2.1e-16)
(* a (* 27.0 b))
(* -9.0 (* t (* y z))))))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (y * (z * t));
double tmp;
if (z <= -8.8e-110) {
tmp = t_2;
} else if (z <= -1.32e-213) {
tmp = t_1;
} else if (z <= -9.2e-268) {
tmp = x * 2.0;
} else if (z <= 4.2e-260) {
tmp = t_1;
} else if (z <= 1.6e-91) {
tmp = x * 2.0;
} else if (z <= 1.35e-52) {
tmp = t_2;
} else if (z <= 2.1e-16) {
tmp = a * (27.0 * b);
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (y * (z * t))
if (z <= (-8.8d-110)) then
tmp = t_2
else if (z <= (-1.32d-213)) then
tmp = t_1
else if (z <= (-9.2d-268)) then
tmp = x * 2.0d0
else if (z <= 4.2d-260) then
tmp = t_1
else if (z <= 1.6d-91) then
tmp = x * 2.0d0
else if (z <= 1.35d-52) then
tmp = t_2
else if (z <= 2.1d-16) then
tmp = a * (27.0d0 * b)
else
tmp = (-9.0d0) * (t * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (y * (z * t));
double tmp;
if (z <= -8.8e-110) {
tmp = t_2;
} else if (z <= -1.32e-213) {
tmp = t_1;
} else if (z <= -9.2e-268) {
tmp = x * 2.0;
} else if (z <= 4.2e-260) {
tmp = t_1;
} else if (z <= 1.6e-91) {
tmp = x * 2.0;
} else if (z <= 1.35e-52) {
tmp = t_2;
} else if (z <= 2.1e-16) {
tmp = a * (27.0 * b);
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (y * (z * t)) tmp = 0 if z <= -8.8e-110: tmp = t_2 elif z <= -1.32e-213: tmp = t_1 elif z <= -9.2e-268: tmp = x * 2.0 elif z <= 4.2e-260: tmp = t_1 elif z <= 1.6e-91: tmp = x * 2.0 elif z <= 1.35e-52: tmp = t_2 elif z <= 2.1e-16: tmp = a * (27.0 * b) else: tmp = -9.0 * (t * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (z <= -8.8e-110) tmp = t_2; elseif (z <= -1.32e-213) tmp = t_1; elseif (z <= -9.2e-268) tmp = Float64(x * 2.0); elseif (z <= 4.2e-260) tmp = t_1; elseif (z <= 1.6e-91) tmp = Float64(x * 2.0); elseif (z <= 1.35e-52) tmp = t_2; elseif (z <= 2.1e-16) tmp = Float64(a * Float64(27.0 * b)); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (y * (z * t));
tmp = 0.0;
if (z <= -8.8e-110)
tmp = t_2;
elseif (z <= -1.32e-213)
tmp = t_1;
elseif (z <= -9.2e-268)
tmp = x * 2.0;
elseif (z <= 4.2e-260)
tmp = t_1;
elseif (z <= 1.6e-91)
tmp = x * 2.0;
elseif (z <= 1.35e-52)
tmp = t_2;
elseif (z <= 2.1e-16)
tmp = a * (27.0 * b);
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e-110], t$95$2, If[LessEqual[z, -1.32e-213], t$95$1, If[LessEqual[z, -9.2e-268], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 4.2e-260], t$95$1, If[LessEqual[z, 1.6e-91], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.35e-52], t$95$2, If[LessEqual[z, 2.1e-16], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{-110}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.32 \cdot 10^{-213}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-268}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-260}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-91}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-52}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-16}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -8.7999999999999997e-110 or 1.59999999999999998e-91 < z < 1.35000000000000005e-52Initial 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*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around 0 75.7%
Taylor expanded in a around 0 53.4%
*-commutative53.4%
associate-*l*52.2%
*-commutative52.2%
Simplified52.2%
if -8.7999999999999997e-110 < z < -1.3199999999999999e-213 or -9.20000000000000042e-268 < z < 4.20000000000000009e-260Initial program 99.9%
associate-+l-99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.8%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around 0 70.7%
Taylor expanded in a around inf 50.3%
if -1.3199999999999999e-213 < z < -9.20000000000000042e-268 or 4.20000000000000009e-260 < z < 1.59999999999999998e-91Initial program 99.9%
associate-+l-99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 43.5%
if 1.35000000000000005e-52 < z < 2.1000000000000001e-16Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*99.7%
associate-+l-99.7%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*99.7%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around 0 89.3%
Taylor expanded in a around inf 57.3%
*-commutative57.3%
associate-*r*57.3%
*-commutative57.3%
Simplified57.3%
if 2.1000000000000001e-16 < z Initial program 90.1%
associate-+l-90.1%
*-commutative90.1%
*-commutative90.1%
associate-*l*90.1%
associate-+l-90.1%
associate-*l*90.1%
*-commutative90.1%
*-commutative90.1%
associate-*l*91.6%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in y around inf 47.6%
Final simplification49.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))) (t_2 (* -9.0 (* y (* z t)))))
(if (<= z -2.35e-116)
t_2
(if (<= z -8e-215)
t_1
(if (<= z -7e-268)
(* x 2.0)
(if (<= z 1.2e-260)
t_1
(if (<= z 1.06e-95)
(* x 2.0)
(if (<= z 9.2e-53)
t_2
(if (<= z 2.05e-17)
(* a (* 27.0 b))
(* t (* z (* y -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 t_2 = -9.0 * (y * (z * t));
double tmp;
if (z <= -2.35e-116) {
tmp = t_2;
} else if (z <= -8e-215) {
tmp = t_1;
} else if (z <= -7e-268) {
tmp = x * 2.0;
} else if (z <= 1.2e-260) {
tmp = t_1;
} else if (z <= 1.06e-95) {
tmp = x * 2.0;
} else if (z <= 9.2e-53) {
tmp = t_2;
} else if (z <= 2.05e-17) {
tmp = a * (27.0 * b);
} else {
tmp = t * (z * (y * -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) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (y * (z * t))
if (z <= (-2.35d-116)) then
tmp = t_2
else if (z <= (-8d-215)) then
tmp = t_1
else if (z <= (-7d-268)) then
tmp = x * 2.0d0
else if (z <= 1.2d-260) then
tmp = t_1
else if (z <= 1.06d-95) then
tmp = x * 2.0d0
else if (z <= 9.2d-53) then
tmp = t_2
else if (z <= 2.05d-17) then
tmp = a * (27.0d0 * b)
else
tmp = t * (z * (y * (-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 t_2 = -9.0 * (y * (z * t));
double tmp;
if (z <= -2.35e-116) {
tmp = t_2;
} else if (z <= -8e-215) {
tmp = t_1;
} else if (z <= -7e-268) {
tmp = x * 2.0;
} else if (z <= 1.2e-260) {
tmp = t_1;
} else if (z <= 1.06e-95) {
tmp = x * 2.0;
} else if (z <= 9.2e-53) {
tmp = t_2;
} else if (z <= 2.05e-17) {
tmp = a * (27.0 * b);
} else {
tmp = t * (z * (y * -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) t_2 = -9.0 * (y * (z * t)) tmp = 0 if z <= -2.35e-116: tmp = t_2 elif z <= -8e-215: tmp = t_1 elif z <= -7e-268: tmp = x * 2.0 elif z <= 1.2e-260: tmp = t_1 elif z <= 1.06e-95: tmp = x * 2.0 elif z <= 9.2e-53: tmp = t_2 elif z <= 2.05e-17: tmp = a * (27.0 * b) else: tmp = t * (z * (y * -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)) t_2 = Float64(-9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (z <= -2.35e-116) tmp = t_2; elseif (z <= -8e-215) tmp = t_1; elseif (z <= -7e-268) tmp = Float64(x * 2.0); elseif (z <= 1.2e-260) tmp = t_1; elseif (z <= 1.06e-95) tmp = Float64(x * 2.0); elseif (z <= 9.2e-53) tmp = t_2; elseif (z <= 2.05e-17) tmp = Float64(a * Float64(27.0 * b)); else tmp = Float64(t * Float64(z * Float64(y * -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);
t_2 = -9.0 * (y * (z * t));
tmp = 0.0;
if (z <= -2.35e-116)
tmp = t_2;
elseif (z <= -8e-215)
tmp = t_1;
elseif (z <= -7e-268)
tmp = x * 2.0;
elseif (z <= 1.2e-260)
tmp = t_1;
elseif (z <= 1.06e-95)
tmp = x * 2.0;
elseif (z <= 9.2e-53)
tmp = t_2;
elseif (z <= 2.05e-17)
tmp = a * (27.0 * b);
else
tmp = t * (z * (y * -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]}, Block[{t$95$2 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.35e-116], t$95$2, If[LessEqual[z, -8e-215], t$95$1, If[LessEqual[z, -7e-268], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.2e-260], t$95$1, If[LessEqual[z, 1.06e-95], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 9.2e-53], t$95$2, If[LessEqual[z, 2.05e-17], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -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)\\
t_2 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -2.35 \cdot 10^{-116}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-268}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-260}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-95}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-53}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-17}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -2.34999999999999997e-116 or 1.06e-95 < z < 9.2000000000000005e-53Initial 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*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around 0 76.0%
Taylor expanded in a around 0 52.8%
*-commutative52.8%
associate-*l*51.6%
*-commutative51.6%
Simplified51.6%
if -2.34999999999999997e-116 < z < -8.00000000000000033e-215 or -7.00000000000000011e-268 < z < 1.2e-260Initial program 99.9%
associate-+l-99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.8%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around 0 70.1%
Taylor expanded in a around inf 49.2%
if -8.00000000000000033e-215 < z < -7.00000000000000011e-268 or 1.2e-260 < z < 1.06e-95Initial program 99.9%
associate-+l-99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 43.5%
if 9.2000000000000005e-53 < z < 2.05e-17Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around 0 87.9%
Taylor expanded in a around inf 63.7%
*-commutative63.7%
associate-*r*63.7%
*-commutative63.7%
Simplified63.7%
if 2.05e-17 < z Initial program 90.3%
associate-+l-90.3%
*-commutative90.3%
*-commutative90.3%
associate-*l*90.3%
associate-+l-90.3%
associate-*l*90.3%
*-commutative90.3%
*-commutative90.3%
associate-*l*91.7%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in a around 0 70.8%
Taylor expanded in x around 0 48.3%
*-commutative48.3%
associate-*l*48.3%
*-commutative48.3%
associate-*l*48.3%
Simplified48.3%
Final simplification49.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)) (* x 2.0))) (t_2 (* t (* z (* y -9.0)))))
(if (<= z -1.05e+14)
(* -9.0 (* z (* y t)))
(if (<= z -1.15e-62)
t_1
(if (<= z -1.48e-108)
t_2
(if (<= z 1.6e-16)
t_1
(if (<= z 4.4e+42)
(* -9.0 (* y (* z t)))
(if (<= z 1e+83) 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)) + (x * 2.0);
double t_2 = t * (z * (y * -9.0));
double tmp;
if (z <= -1.05e+14) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -1.15e-62) {
tmp = t_1;
} else if (z <= -1.48e-108) {
tmp = t_2;
} else if (z <= 1.6e-16) {
tmp = t_1;
} else if (z <= 4.4e+42) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 1e+83) {
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)) + (x * 2.0d0)
t_2 = t * (z * (y * (-9.0d0)))
if (z <= (-1.05d+14)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= (-1.15d-62)) then
tmp = t_1
else if (z <= (-1.48d-108)) then
tmp = t_2
else if (z <= 1.6d-16) then
tmp = t_1
else if (z <= 4.4d+42) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 1d+83) 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)) + (x * 2.0);
double t_2 = t * (z * (y * -9.0));
double tmp;
if (z <= -1.05e+14) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -1.15e-62) {
tmp = t_1;
} else if (z <= -1.48e-108) {
tmp = t_2;
} else if (z <= 1.6e-16) {
tmp = t_1;
} else if (z <= 4.4e+42) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 1e+83) {
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)) + (x * 2.0) t_2 = t * (z * (y * -9.0)) tmp = 0 if z <= -1.05e+14: tmp = -9.0 * (z * (y * t)) elif z <= -1.15e-62: tmp = t_1 elif z <= -1.48e-108: tmp = t_2 elif z <= 1.6e-16: tmp = t_1 elif z <= 4.4e+42: tmp = -9.0 * (y * (z * t)) elif z <= 1e+83: 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(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)) t_2 = Float64(t * Float64(z * Float64(y * -9.0))) tmp = 0.0 if (z <= -1.05e+14) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= -1.15e-62) tmp = t_1; elseif (z <= -1.48e-108) tmp = t_2; elseif (z <= 1.6e-16) tmp = t_1; elseif (z <= 4.4e+42) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 1e+83) 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)) + (x * 2.0);
t_2 = t * (z * (y * -9.0));
tmp = 0.0;
if (z <= -1.05e+14)
tmp = -9.0 * (z * (y * t));
elseif (z <= -1.15e-62)
tmp = t_1;
elseif (z <= -1.48e-108)
tmp = t_2;
elseif (z <= 1.6e-16)
tmp = t_1;
elseif (z <= 4.4e+42)
tmp = -9.0 * (y * (z * t));
elseif (z <= 1e+83)
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[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+14], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.15e-62], t$95$1, If[LessEqual[z, -1.48e-108], t$95$2, If[LessEqual[z, 1.6e-16], t$95$1, If[LessEqual[z, 4.4e+42], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+83], 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) + x \cdot 2\\
t_2 := t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+14}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.48 \cdot 10^{-108}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+42}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.05e14Initial program 95.5%
associate-+l-95.5%
*-commutative95.5%
*-commutative95.5%
associate-*l*95.5%
associate-+l-95.5%
associate-*l*95.5%
*-commutative95.5%
*-commutative95.5%
associate-*l*93.5%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in y around inf 55.1%
pow155.1%
*-commutative55.1%
*-commutative55.1%
associate-*l*57.2%
Applied egg-rr57.2%
unpow157.2%
*-commutative57.2%
Simplified57.2%
if -1.05e14 < z < -1.15e-62 or -1.47999999999999992e-108 < z < 1.60000000000000011e-16 or 4.4000000000000003e42 < z < 1.00000000000000003e83Initial program 99.1%
associate-+l-99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
associate-+l-99.1%
associate-*l*99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.8%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in y around 0 76.7%
if -1.15e-62 < z < -1.47999999999999992e-108 or 1.00000000000000003e83 < z Initial program 89.3%
associate-+l-89.3%
*-commutative89.3%
*-commutative89.3%
associate-*l*89.3%
associate-+l-89.3%
associate-*l*89.3%
*-commutative89.3%
*-commutative89.3%
associate-*l*89.3%
associate-*l*87.6%
Simplified87.6%
Taylor expanded in a around 0 73.0%
Taylor expanded in x around 0 47.5%
*-commutative47.5%
associate-*l*47.5%
*-commutative47.5%
associate-*l*47.5%
Simplified47.5%
if 1.60000000000000011e-16 < z < 4.4000000000000003e42Initial program 99.7%
associate-+l-99.7%
*-commutative99.7%
*-commutative99.7%
associate-*l*99.9%
associate-+l-99.9%
associate-*l*99.7%
*-commutative99.7%
*-commutative99.7%
associate-*l*99.9%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in a around 0 75.4%
*-commutative75.4%
associate-*l*75.4%
*-commutative75.4%
Simplified75.4%
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
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* 9.0 (* t (* y z)))) (t_3 (- t_1 t_2)))
(if (<= b -1.3e-164)
t_3
(if (<= b 3.75e-22)
(- (* x 2.0) t_2)
(if (or (<= b 1.02e+77) (not (<= b 3.3e+100)))
t_3
(+ t_1 (* x 2.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double t_3 = t_1 - t_2;
double tmp;
if (b <= -1.3e-164) {
tmp = t_3;
} else if (b <= 3.75e-22) {
tmp = (x * 2.0) - t_2;
} else if ((b <= 1.02e+77) || !(b <= 3.3e+100)) {
tmp = t_3;
} else {
tmp = t_1 + (x * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = 9.0d0 * (t * (y * z))
t_3 = t_1 - t_2
if (b <= (-1.3d-164)) then
tmp = t_3
else if (b <= 3.75d-22) then
tmp = (x * 2.0d0) - t_2
else if ((b <= 1.02d+77) .or. (.not. (b <= 3.3d+100))) then
tmp = t_3
else
tmp = t_1 + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (y * z));
double t_3 = t_1 - t_2;
double tmp;
if (b <= -1.3e-164) {
tmp = t_3;
} else if (b <= 3.75e-22) {
tmp = (x * 2.0) - t_2;
} else if ((b <= 1.02e+77) || !(b <= 3.3e+100)) {
tmp = t_3;
} else {
tmp = t_1 + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = 9.0 * (t * (y * z)) t_3 = t_1 - t_2 tmp = 0 if b <= -1.3e-164: tmp = t_3 elif b <= 3.75e-22: tmp = (x * 2.0) - t_2 elif (b <= 1.02e+77) or not (b <= 3.3e+100): tmp = t_3 else: tmp = t_1 + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(9.0 * Float64(t * Float64(y * z))) t_3 = Float64(t_1 - t_2) tmp = 0.0 if (b <= -1.3e-164) tmp = t_3; elseif (b <= 3.75e-22) tmp = Float64(Float64(x * 2.0) - t_2); elseif ((b <= 1.02e+77) || !(b <= 3.3e+100)) tmp = t_3; else tmp = Float64(t_1 + Float64(x * 2.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = 9.0 * (t * (y * z));
t_3 = t_1 - t_2;
tmp = 0.0;
if (b <= -1.3e-164)
tmp = t_3;
elseif (b <= 3.75e-22)
tmp = (x * 2.0) - t_2;
elseif ((b <= 1.02e+77) || ~((b <= 3.3e+100)))
tmp = t_3;
else
tmp = t_1 + (x * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 - t$95$2), $MachinePrecision]}, If[LessEqual[b, -1.3e-164], t$95$3, If[LessEqual[b, 3.75e-22], N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision], If[Or[LessEqual[b, 1.02e+77], N[Not[LessEqual[b, 3.3e+100]], $MachinePrecision]], t$95$3, N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_3 := t\_1 - t\_2\\
\mathbf{if}\;b \leq -1.3 \cdot 10^{-164}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;b \leq 3.75 \cdot 10^{-22}:\\
\;\;\;\;x \cdot 2 - t\_2\\
\mathbf{elif}\;b \leq 1.02 \cdot 10^{+77} \lor \neg \left(b \leq 3.3 \cdot 10^{+100}\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x \cdot 2\\
\end{array}
\end{array}
if b < -1.3000000000000001e-164 or 3.74999999999999989e-22 < b < 1.02e77 or 3.3000000000000001e100 < b Initial program 96.6%
associate-+l-96.6%
*-commutative96.6%
*-commutative96.6%
associate-*l*96.6%
associate-+l-96.6%
associate-*l*96.6%
*-commutative96.6%
*-commutative96.6%
associate-*l*96.5%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in x around 0 78.8%
if -1.3000000000000001e-164 < b < 3.74999999999999989e-22Initial program 96.0%
associate-+l-96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.0%
associate-+l-96.0%
associate-*l*96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.3%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in a around 0 90.0%
if 1.02e77 < b < 3.3000000000000001e100Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-+l-100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in y around 0 100.0%
Final simplification83.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 (* y z)))) (t_2 (* 27.0 (* a b))))
(if (<= b -1.3e-164)
t_2
(if (<= b 2.5e-211)
t_1
(if (<= b 1.05e-150) (* x 2.0) (if (<= b 3.3e+71) 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 = -9.0 * (t * (y * z));
double t_2 = 27.0 * (a * b);
double tmp;
if (b <= -1.3e-164) {
tmp = t_2;
} else if (b <= 2.5e-211) {
tmp = t_1;
} else if (b <= 1.05e-150) {
tmp = x * 2.0;
} else if (b <= 3.3e+71) {
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 = (-9.0d0) * (t * (y * z))
t_2 = 27.0d0 * (a * b)
if (b <= (-1.3d-164)) then
tmp = t_2
else if (b <= 2.5d-211) then
tmp = t_1
else if (b <= 1.05d-150) then
tmp = x * 2.0d0
else if (b <= 3.3d+71) 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 = -9.0 * (t * (y * z));
double t_2 = 27.0 * (a * b);
double tmp;
if (b <= -1.3e-164) {
tmp = t_2;
} else if (b <= 2.5e-211) {
tmp = t_1;
} else if (b <= 1.05e-150) {
tmp = x * 2.0;
} else if (b <= 3.3e+71) {
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 = -9.0 * (t * (y * z)) t_2 = 27.0 * (a * b) tmp = 0 if b <= -1.3e-164: tmp = t_2 elif b <= 2.5e-211: tmp = t_1 elif b <= 1.05e-150: tmp = x * 2.0 elif b <= 3.3e+71: 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(-9.0 * Float64(t * Float64(y * z))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -1.3e-164) tmp = t_2; elseif (b <= 2.5e-211) tmp = t_1; elseif (b <= 1.05e-150) tmp = Float64(x * 2.0); elseif (b <= 3.3e+71) 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 = -9.0 * (t * (y * z));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -1.3e-164)
tmp = t_2;
elseif (b <= 2.5e-211)
tmp = t_1;
elseif (b <= 1.05e-150)
tmp = x * 2.0;
elseif (b <= 3.3e+71)
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[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.3e-164], t$95$2, If[LessEqual[b, 2.5e-211], t$95$1, If[LessEqual[b, 1.05e-150], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 3.3e+71], 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 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -1.3 \cdot 10^{-164}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{-211}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{-150}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.3000000000000001e-164 or 3.2999999999999998e71 < b Initial program 97.1%
associate-+l-97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
associate-+l-97.1%
associate-*l*97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around 0 77.9%
Taylor expanded in a around inf 52.8%
if -1.3000000000000001e-164 < b < 2.5000000000000001e-211 or 1.0500000000000001e-150 < b < 3.2999999999999998e71Initial program 95.1%
associate-+l-95.1%
*-commutative95.1%
*-commutative95.1%
associate-*l*95.0%
associate-+l-95.0%
associate-*l*95.1%
*-commutative95.1%
*-commutative95.1%
associate-*l*95.2%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in y around inf 48.3%
if 2.5000000000000001e-211 < b < 1.0500000000000001e-150Initial program 99.6%
associate-+l-99.6%
*-commutative99.6%
*-commutative99.6%
associate-*l*99.7%
associate-+l-99.7%
associate-*l*99.6%
*-commutative99.6%
*-commutative99.6%
associate-*l*99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 49.3%
Final simplification50.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (or (<= b -3.8e-180)
(and (not (<= b 1.35e-20))
(or (<= b 1.75e+78) (not (<= b 1.32e+101)))))
(* 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 <= -3.8e-180) || (!(b <= 1.35e-20) && ((b <= 1.75e+78) || !(b <= 1.32e+101)))) {
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 <= (-3.8d-180)) .or. (.not. (b <= 1.35d-20)) .and. (b <= 1.75d+78) .or. (.not. (b <= 1.32d+101))) 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 <= -3.8e-180) || (!(b <= 1.35e-20) && ((b <= 1.75e+78) || !(b <= 1.32e+101)))) {
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 <= -3.8e-180) or (not (b <= 1.35e-20) and ((b <= 1.75e+78) or not (b <= 1.32e+101))): 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 <= -3.8e-180) || (!(b <= 1.35e-20) && ((b <= 1.75e+78) || !(b <= 1.32e+101)))) 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 <= -3.8e-180) || (~((b <= 1.35e-20)) && ((b <= 1.75e+78) || ~((b <= 1.32e+101)))))
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, -3.8e-180], And[N[Not[LessEqual[b, 1.35e-20]], $MachinePrecision], Or[LessEqual[b, 1.75e+78], N[Not[LessEqual[b, 1.32e+101]], $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 -3.8 \cdot 10^{-180} \lor \neg \left(b \leq 1.35 \cdot 10^{-20}\right) \land \left(b \leq 1.75 \cdot 10^{+78} \lor \neg \left(b \leq 1.32 \cdot 10^{+101}\right)\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -3.79999999999999999e-180 or 1.35e-20 < b < 1.7500000000000001e78 or 1.32e101 < b Initial program 96.7%
associate-+l-96.7%
*-commutative96.7%
*-commutative96.7%
associate-*l*96.7%
associate-+l-96.7%
associate-*l*96.7%
*-commutative96.7%
*-commutative96.7%
associate-*l*96.6%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around 0 78.1%
Taylor expanded in a around inf 52.3%
if -3.79999999999999999e-180 < b < 1.35e-20 or 1.7500000000000001e78 < b < 1.32e101Initial program 96.1%
associate-+l-96.1%
*-commutative96.1%
*-commutative96.1%
associate-*l*96.1%
associate-+l-96.1%
associate-*l*96.1%
*-commutative96.1%
*-commutative96.1%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 41.2%
Final simplification47.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.85e+75) (+ (+ (* (* a 27.0) b) (* x 2.0)) (* y (* z (* t -9.0)))) (* t (- (* 27.0 (/ (* a b) t)) (* 9.0 (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.85e+75) {
tmp = (((a * 27.0) * b) + (x * 2.0)) + (y * (z * (t * -9.0)));
} else {
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 1.85d+75) then
tmp = (((a * 27.0d0) * b) + (x * 2.0d0)) + (y * (z * (t * (-9.0d0))))
else
tmp = t * ((27.0d0 * ((a * b) / t)) - (9.0d0 * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.85e+75) {
tmp = (((a * 27.0) * b) + (x * 2.0)) + (y * (z * (t * -9.0)));
} else {
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1.85e+75: tmp = (((a * 27.0) * b) + (x * 2.0)) + (y * (z * (t * -9.0))) else: tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.85e+75) tmp = Float64(Float64(Float64(Float64(a * 27.0) * b) + Float64(x * 2.0)) + Float64(y * Float64(z * Float64(t * -9.0)))); else tmp = Float64(t * Float64(Float64(27.0 * Float64(Float64(a * b) / t)) - Float64(9.0 * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1.85e+75)
tmp = (((a * 27.0) * b) + (x * 2.0)) + (y * (z * (t * -9.0)));
else
tmp = t * ((27.0 * ((a * b) / t)) - (9.0 * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.85e+75], N[(N[(N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.85 \cdot 10^{+75}:\\
\;\;\;\;\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(27 \cdot \frac{a \cdot b}{t} - 9 \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 1.85000000000000005e75Initial program 98.9%
+-commutative98.9%
associate-+r-98.9%
*-commutative98.9%
cancel-sign-sub-inv98.9%
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%
fma-neg96.2%
associate-*l*98.4%
distribute-rgt-neg-in98.4%
*-commutative98.4%
associate-*l*98.3%
*-commutative98.3%
distribute-lft-neg-in98.3%
associate-*r*97.9%
Simplified97.9%
fma-undefine97.9%
fma-undefine97.9%
associate-+r+97.9%
associate-*r*98.0%
*-commutative98.0%
Applied egg-rr98.0%
if 1.85000000000000005e75 < z Initial program 86.7%
associate-+l-86.7%
*-commutative86.7%
*-commutative86.7%
associate-*l*86.7%
associate-+l-86.7%
associate-*l*86.7%
*-commutative86.7%
*-commutative86.7%
associate-*l*88.7%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in x around 0 64.3%
Taylor expanded in t around inf 56.1%
Final simplification89.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 -1.3e-164) (not (<= b 3.8e+71))) (+ (* 27.0 (* a b)) (* x 2.0)) (- (* x 2.0) (* 9.0 (* t (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.3e-164) || !(b <= 3.8e+71)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.3d-164)) .or. (.not. (b <= 3.8d+71))) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.3e-164) || !(b <= 3.8e+71)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.3e-164) or not (b <= 3.8e+71): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.3e-164) || !(b <= 3.8e+71)) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -1.3e-164) || ~((b <= 3.8e+71)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.3e-164], N[Not[LessEqual[b, 3.8e+71]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{-164} \lor \neg \left(b \leq 3.8 \cdot 10^{+71}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if b < -1.3000000000000001e-164 or 3.8000000000000001e71 < b Initial program 97.1%
associate-+l-97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
associate-+l-97.1%
associate-*l*97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in y around 0 72.3%
if -1.3000000000000001e-164 < b < 3.8000000000000001e71Initial program 95.6%
associate-+l-95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*95.6%
associate-+l-95.6%
associate-*l*95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*95.8%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in a around 0 84.4%
Final simplification77.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * 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])\\
\\
\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}
Initial program 96.4%
Final simplification96.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 (* 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.4%
associate-+l-96.4%
*-commutative96.4%
*-commutative96.4%
associate-*l*96.4%
associate-+l-96.4%
associate-*l*96.4%
*-commutative96.4%
*-commutative96.4%
associate-*l*96.5%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in x around inf 29.2%
Final simplification29.2%
(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 2024071
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))