
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= t 200.0) (+ (- (* x 2.0) (* 9.0 (* z (* y t)))) (* a (* 27.0 b))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 200.0) {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 200.0) tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + Float64(a * Float64(27.0 * b))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 200.0], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 200:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if t < 200Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*95.5%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in y around 0 94.6%
associate-*r*97.8%
Simplified97.8%
if 200 < t Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
associate-*r*93.3%
distribute-lft-neg-in93.3%
*-commutative93.3%
cancel-sign-sub-inv93.3%
associate-+r-93.3%
associate-*l*93.3%
fma-define93.3%
cancel-sign-sub-inv93.3%
fma-define93.3%
distribute-lft-neg-in93.3%
distribute-rgt-neg-in93.3%
*-commutative93.3%
associate-*r*99.9%
associate-*l*99.9%
neg-mul-199.9%
associate-*r*99.9%
Simplified99.9%
Final simplification98.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))) end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)
\end{array}
Initial program 95.4%
+-commutative95.4%
associate-+r-95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-*r*96.5%
distribute-lft-neg-in96.5%
*-commutative96.5%
cancel-sign-sub-inv96.5%
associate-+r-96.5%
associate-*l*96.9%
fma-define97.2%
fmm-def97.2%
associate-*l*96.2%
distribute-rgt-neg-in96.2%
*-commutative96.2%
associate-*l*96.2%
*-commutative96.2%
distribute-lft-neg-in96.2%
associate-*r*96.1%
Simplified96.1%
Final simplification96.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* -9.0 (* t (* y z)))))
(if (<= y -6.3e+125)
t_2
(if (<= y -2.45e+70)
t_1
(if (<= y -2.8e+63)
t_2
(if (<= y -3.9e-111)
(* x 2.0)
(if (<= y -1.35e-162)
(* a (* 27.0 b))
(if (<= y 9.4e-257) (* x 2.0) (if (<= y 3.5e-108) t_1 t_2)))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (t * (y * z));
double tmp;
if (y <= -6.3e+125) {
tmp = t_2;
} else if (y <= -2.45e+70) {
tmp = t_1;
} else if (y <= -2.8e+63) {
tmp = t_2;
} else if (y <= -3.9e-111) {
tmp = x * 2.0;
} else if (y <= -1.35e-162) {
tmp = a * (27.0 * b);
} else if (y <= 9.4e-257) {
tmp = x * 2.0;
} else if (y <= 3.5e-108) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (t * (y * z))
if (y <= (-6.3d+125)) then
tmp = t_2
else if (y <= (-2.45d+70)) then
tmp = t_1
else if (y <= (-2.8d+63)) then
tmp = t_2
else if (y <= (-3.9d-111)) then
tmp = x * 2.0d0
else if (y <= (-1.35d-162)) then
tmp = a * (27.0d0 * b)
else if (y <= 9.4d-257) then
tmp = x * 2.0d0
else if (y <= 3.5d-108) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (t * (y * z));
double tmp;
if (y <= -6.3e+125) {
tmp = t_2;
} else if (y <= -2.45e+70) {
tmp = t_1;
} else if (y <= -2.8e+63) {
tmp = t_2;
} else if (y <= -3.9e-111) {
tmp = x * 2.0;
} else if (y <= -1.35e-162) {
tmp = a * (27.0 * b);
} else if (y <= 9.4e-257) {
tmp = x * 2.0;
} else if (y <= 3.5e-108) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (t * (y * z)) tmp = 0 if y <= -6.3e+125: tmp = t_2 elif y <= -2.45e+70: tmp = t_1 elif y <= -2.8e+63: tmp = t_2 elif y <= -3.9e-111: tmp = x * 2.0 elif y <= -1.35e-162: tmp = a * (27.0 * b) elif y <= 9.4e-257: tmp = x * 2.0 elif y <= 3.5e-108: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (y <= -6.3e+125) tmp = t_2; elseif (y <= -2.45e+70) tmp = t_1; elseif (y <= -2.8e+63) tmp = t_2; elseif (y <= -3.9e-111) tmp = Float64(x * 2.0); elseif (y <= -1.35e-162) tmp = Float64(a * Float64(27.0 * b)); elseif (y <= 9.4e-257) tmp = Float64(x * 2.0); elseif (y <= 3.5e-108) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (t * (y * z));
tmp = 0.0;
if (y <= -6.3e+125)
tmp = t_2;
elseif (y <= -2.45e+70)
tmp = t_1;
elseif (y <= -2.8e+63)
tmp = t_2;
elseif (y <= -3.9e-111)
tmp = x * 2.0;
elseif (y <= -1.35e-162)
tmp = a * (27.0 * b);
elseif (y <= 9.4e-257)
tmp = x * 2.0;
elseif (y <= 3.5e-108)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.3e+125], t$95$2, If[LessEqual[y, -2.45e+70], t$95$1, If[LessEqual[y, -2.8e+63], t$95$2, If[LessEqual[y, -3.9e-111], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.35e-162], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.4e-257], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, 3.5e-108], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;y \leq -6.3 \cdot 10^{+125}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.45 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{+63}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-111}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-162}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;y \leq 9.4 \cdot 10^{-257}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -6.3000000000000002e125 or -2.45000000000000014e70 < y < -2.79999999999999987e63 or 3.4999999999999999e-108 < y Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*98.4%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in y around inf 60.3%
if -6.3000000000000002e125 < y < -2.45000000000000014e70 or 9.3999999999999996e-257 < y < 3.4999999999999999e-108Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*89.9%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in a around inf 35.7%
if -2.79999999999999987e63 < y < -3.9000000000000003e-111 or -1.34999999999999992e-162 < y < 9.3999999999999996e-257Initial program 98.5%
sub-neg98.5%
sub-neg98.5%
associate-*l*93.5%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in x around inf 44.3%
if -3.9000000000000003e-111 < y < -1.34999999999999992e-162Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*93.9%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in a around inf 57.6%
associate-*r*57.5%
*-commutative57.5%
associate-*r*57.7%
Simplified57.7%
Final simplification51.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* 27.0 (* a b)) (* x 2.0))) (t_2 (* y (* -9.0 (* z t)))))
(if (<= y -1.06e+218)
t_2
(if (<= y -1.2e+172)
t_1
(if (<= y -6.3e+125)
t_2
(if (<= y 4.5e-108) t_1 (* -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)) + (x * 2.0);
double t_2 = y * (-9.0 * (z * t));
double tmp;
if (y <= -1.06e+218) {
tmp = t_2;
} else if (y <= -1.2e+172) {
tmp = t_1;
} else if (y <= -6.3e+125) {
tmp = t_2;
} else if (y <= 4.5e-108) {
tmp = t_1;
} 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)) + (x * 2.0d0)
t_2 = y * ((-9.0d0) * (z * t))
if (y <= (-1.06d+218)) then
tmp = t_2
else if (y <= (-1.2d+172)) then
tmp = t_1
else if (y <= (-6.3d+125)) then
tmp = t_2
else if (y <= 4.5d-108) then
tmp = t_1
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)) + (x * 2.0);
double t_2 = y * (-9.0 * (z * t));
double tmp;
if (y <= -1.06e+218) {
tmp = t_2;
} else if (y <= -1.2e+172) {
tmp = t_1;
} else if (y <= -6.3e+125) {
tmp = t_2;
} else if (y <= 4.5e-108) {
tmp = t_1;
} 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)) + (x * 2.0) t_2 = y * (-9.0 * (z * t)) tmp = 0 if y <= -1.06e+218: tmp = t_2 elif y <= -1.2e+172: tmp = t_1 elif y <= -6.3e+125: tmp = t_2 elif y <= 4.5e-108: tmp = t_1 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(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)) t_2 = Float64(y * Float64(-9.0 * Float64(z * t))) tmp = 0.0 if (y <= -1.06e+218) tmp = t_2; elseif (y <= -1.2e+172) tmp = t_1; elseif (y <= -6.3e+125) tmp = t_2; elseif (y <= 4.5e-108) tmp = t_1; 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)) + (x * 2.0);
t_2 = y * (-9.0 * (z * t));
tmp = 0.0;
if (y <= -1.06e+218)
tmp = t_2;
elseif (y <= -1.2e+172)
tmp = t_1;
elseif (y <= -6.3e+125)
tmp = t_2;
elseif (y <= 4.5e-108)
tmp = t_1;
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[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.06e+218], t$95$2, If[LessEqual[y, -1.2e+172], t$95$1, If[LessEqual[y, -6.3e+125], t$95$2, If[LessEqual[y, 4.5e-108], t$95$1, 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) + x \cdot 2\\
t_2 := y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;y \leq -1.06 \cdot 10^{+218}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.3 \cdot 10^{+125}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if y < -1.06e218 or -1.2e172 < y < -6.3000000000000002e125Initial program 82.0%
sub-neg82.0%
sub-neg82.0%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around 0 70.2%
Taylor expanded in y around inf 85.3%
Taylor expanded in x around 0 80.9%
if -1.06e218 < y < -1.2e172 or -6.3000000000000002e125 < y < 4.4999999999999997e-108Initial program 97.7%
sub-neg97.7%
sub-neg97.7%
associate-*l*92.9%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in y around 0 77.6%
if 4.4999999999999997e-108 < y Initial program 97.5%
sub-neg97.5%
sub-neg97.5%
associate-*l*97.6%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in y around inf 58.2%
Final simplification71.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.72e-46)
(* -9.0 (* z (* y t)))
(if (<= z -3.8e-125)
(* 27.0 (* a b))
(if (<= z -6.2e-226)
(* x 2.0)
(if (<= z 4.4e-166) (* 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 tmp;
if (z <= -1.72e-46) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -3.8e-125) {
tmp = 27.0 * (a * b);
} else if (z <= -6.2e-226) {
tmp = x * 2.0;
} else if (z <= 4.4e-166) {
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) :: tmp
if (z <= (-1.72d-46)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= (-3.8d-125)) then
tmp = 27.0d0 * (a * b)
else if (z <= (-6.2d-226)) then
tmp = x * 2.0d0
else if (z <= 4.4d-166) 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 tmp;
if (z <= -1.72e-46) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -3.8e-125) {
tmp = 27.0 * (a * b);
} else if (z <= -6.2e-226) {
tmp = x * 2.0;
} else if (z <= 4.4e-166) {
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): tmp = 0 if z <= -1.72e-46: tmp = -9.0 * (z * (y * t)) elif z <= -3.8e-125: tmp = 27.0 * (a * b) elif z <= -6.2e-226: tmp = x * 2.0 elif z <= 4.4e-166: 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) tmp = 0.0 if (z <= -1.72e-46) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= -3.8e-125) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= -6.2e-226) tmp = Float64(x * 2.0); elseif (z <= 4.4e-166) 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)
tmp = 0.0;
if (z <= -1.72e-46)
tmp = -9.0 * (z * (y * t));
elseif (z <= -3.8e-125)
tmp = 27.0 * (a * b);
elseif (z <= -6.2e-226)
tmp = x * 2.0;
elseif (z <= 4.4e-166)
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_] := If[LessEqual[z, -1.72e-46], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.8e-125], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.2e-226], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 4.4e-166], 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}
\mathbf{if}\;z \leq -1.72 \cdot 10^{-46}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-125}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-226}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-166}:\\
\;\;\;\;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 < -1.7199999999999999e-46Initial program 95.9%
sub-neg95.9%
sub-neg95.9%
associate-*l*91.2%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in y around inf 54.0%
pow154.0%
*-commutative54.0%
associate-*l*50.4%
Applied egg-rr50.4%
unpow150.4%
associate-*r*54.0%
*-commutative54.0%
associate-*r*53.9%
Simplified53.9%
if -1.7199999999999999e-46 < z < -3.8000000000000001e-125Initial program 90.6%
sub-neg90.6%
sub-neg90.6%
associate-*l*90.6%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in a around inf 47.3%
if -3.8000000000000001e-125 < z < -6.19999999999999978e-226Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 34.7%
if -6.19999999999999978e-226 < z < 4.4000000000000002e-166Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 41.4%
associate-*r*41.4%
*-commutative41.4%
associate-*r*41.5%
Simplified41.5%
if 4.4000000000000002e-166 < z Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in y around inf 45.5%
Final simplification46.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.5e-46)
(* -9.0 (* z (* y t)))
(if (<= z -7.5e-124)
(* 27.0 (* a b))
(if (<= z -4.8e-226)
(* x 2.0)
(if (<= z 1.85e-166) (* a (* 27.0 b)) (* 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 (z <= -5.5e-46) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -7.5e-124) {
tmp = 27.0 * (a * b);
} else if (z <= -4.8e-226) {
tmp = x * 2.0;
} else if (z <= 1.85e-166) {
tmp = a * (27.0 * b);
} else {
tmp = 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 (z <= (-5.5d-46)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= (-7.5d-124)) then
tmp = 27.0d0 * (a * b)
else if (z <= (-4.8d-226)) then
tmp = x * 2.0d0
else if (z <= 1.85d-166) then
tmp = a * (27.0d0 * b)
else
tmp = 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 (z <= -5.5e-46) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -7.5e-124) {
tmp = 27.0 * (a * b);
} else if (z <= -4.8e-226) {
tmp = x * 2.0;
} else if (z <= 1.85e-166) {
tmp = a * (27.0 * b);
} else {
tmp = 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 z <= -5.5e-46: tmp = -9.0 * (z * (y * t)) elif z <= -7.5e-124: tmp = 27.0 * (a * b) elif z <= -4.8e-226: tmp = x * 2.0 elif z <= 1.85e-166: tmp = a * (27.0 * b) else: tmp = 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 (z <= -5.5e-46) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= -7.5e-124) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= -4.8e-226) tmp = Float64(x * 2.0); elseif (z <= 1.85e-166) tmp = Float64(a * Float64(27.0 * b)); else tmp = Float64(y * Float64(-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 (z <= -5.5e-46)
tmp = -9.0 * (z * (y * t));
elseif (z <= -7.5e-124)
tmp = 27.0 * (a * b);
elseif (z <= -4.8e-226)
tmp = x * 2.0;
elseif (z <= 1.85e-166)
tmp = a * (27.0 * b);
else
tmp = 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[LessEqual[z, -5.5e-46], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.5e-124], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.8e-226], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.85e-166], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], N[(y * N[(-9.0 * 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}\;z \leq -5.5 \cdot 10^{-46}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-124}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-226}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-166}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -5.49999999999999983e-46Initial program 95.9%
sub-neg95.9%
sub-neg95.9%
associate-*l*91.2%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in y around inf 54.0%
pow154.0%
*-commutative54.0%
associate-*l*50.4%
Applied egg-rr50.4%
unpow150.4%
associate-*r*54.0%
*-commutative54.0%
associate-*r*53.9%
Simplified53.9%
if -5.49999999999999983e-46 < z < -7.4999999999999996e-124Initial program 90.6%
sub-neg90.6%
sub-neg90.6%
associate-*l*90.6%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in a around inf 47.3%
if -7.4999999999999996e-124 < z < -4.7999999999999999e-226Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 34.7%
if -4.7999999999999999e-226 < z < 1.8500000000000001e-166Initial program 97.8%
sub-neg97.8%
sub-neg97.8%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in a around inf 41.4%
associate-*r*41.4%
*-commutative41.4%
associate-*r*41.5%
Simplified41.5%
if 1.8500000000000001e-166 < z Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in a around 0 68.8%
Taylor expanded in y around inf 64.4%
Taylor expanded in x around 0 47.9%
Final simplification47.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)))))
(if (or (<= b -9.5e-46) (not (<= b 6e+124)))
(- (* 27.0 (* a b)) t_1)
(- (* 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 = 9.0 * (t * (y * z));
double tmp;
if ((b <= -9.5e-46) || !(b <= 6e+124)) {
tmp = (27.0 * (a * b)) - t_1;
} 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 = 9.0d0 * (t * (y * z))
if ((b <= (-9.5d-46)) .or. (.not. (b <= 6d+124))) then
tmp = (27.0d0 * (a * b)) - t_1
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 = 9.0 * (t * (y * z));
double tmp;
if ((b <= -9.5e-46) || !(b <= 6e+124)) {
tmp = (27.0 * (a * b)) - t_1;
} 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 = 9.0 * (t * (y * z)) tmp = 0 if (b <= -9.5e-46) or not (b <= 6e+124): tmp = (27.0 * (a * b)) - t_1 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(9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if ((b <= -9.5e-46) || !(b <= 6e+124)) tmp = Float64(Float64(27.0 * Float64(a * b)) - t_1); 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 = 9.0 * (t * (y * z));
tmp = 0.0;
if ((b <= -9.5e-46) || ~((b <= 6e+124)))
tmp = (27.0 * (a * b)) - t_1;
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[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[b, -9.5e-46], N[Not[LessEqual[b, 6e+124]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $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 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;b \leq -9.5 \cdot 10^{-46} \lor \neg \left(b \leq 6 \cdot 10^{+124}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t\_1\\
\end{array}
\end{array}
if b < -9.49999999999999993e-46 or 5.9999999999999999e124 < b Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*94.8%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around 0 79.1%
if -9.49999999999999993e-46 < b < 5.9999999999999999e124Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in a around 0 79.2%
Final simplification79.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.5e-46) (not (<= z 1.96e-165))) (+ (* x 2.0) (* z (* y (* t -9.0)))) (+ (* 27.0 (* a b)) (* x 2.0))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.5e-46) || !(z <= 1.96e-165)) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else {
tmp = (27.0 * (a * b)) + (x * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-9.5d-46)) .or. (.not. (z <= 1.96d-165))) then
tmp = (x * 2.0d0) + (z * (y * (t * (-9.0d0))))
else
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.5e-46) || !(z <= 1.96e-165)) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else {
tmp = (27.0 * (a * b)) + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -9.5e-46) or not (z <= 1.96e-165): tmp = (x * 2.0) + (z * (y * (t * -9.0))) else: tmp = (27.0 * (a * b)) + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.5e-46) || !(z <= 1.96e-165)) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(y * Float64(t * -9.0)))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -9.5e-46) || ~((z <= 1.96e-165)))
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
else
tmp = (27.0 * (a * b)) + (x * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.5e-46], N[Not[LessEqual[z, 1.96e-165]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-46} \lor \neg \left(z \leq 1.96 \cdot 10^{-165}\right):\\
\;\;\;\;x \cdot 2 + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -9.49999999999999993e-46 or 1.96e-165 < z Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*94.3%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in a around 0 73.1%
cancel-sign-sub-inv73.1%
*-commutative73.1%
metadata-eval73.1%
+-commutative73.1%
associate-*r*73.1%
associate-*r*75.0%
*-commutative75.0%
Applied egg-rr75.0%
if -9.49999999999999993e-46 < z < 1.96e-165Initial program 97.0%
sub-neg97.0%
sub-neg97.0%
associate-*l*98.4%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in y around 0 82.9%
Final simplification77.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.15e-113)
(+ (* x 2.0) (* z (* y (* t -9.0))))
(if (<= t 3.1)
(+ (* 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 (t <= -1.15e-113) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (t <= 3.1) {
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 (t <= (-1.15d-113)) then
tmp = (x * 2.0d0) + (z * (y * (t * (-9.0d0))))
else if (t <= 3.1d0) 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 (t <= -1.15e-113) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (t <= 3.1) {
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 t <= -1.15e-113: tmp = (x * 2.0) + (z * (y * (t * -9.0))) elif t <= 3.1: 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 (t <= -1.15e-113) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(y * Float64(t * -9.0)))); elseif (t <= 3.1) 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 (t <= -1.15e-113)
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
elseif (t <= 3.1)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.15e-113], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1], 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}\;t \leq -1.15 \cdot 10^{-113}:\\
\;\;\;\;x \cdot 2 + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;t \leq 3.1:\\
\;\;\;\;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 t < -1.15000000000000004e-113Initial program 95.5%
sub-neg95.5%
sub-neg95.5%
associate-*l*90.3%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in a around 0 78.5%
cancel-sign-sub-inv78.5%
*-commutative78.5%
metadata-eval78.5%
+-commutative78.5%
associate-*r*78.5%
associate-*r*79.5%
*-commutative79.5%
Applied egg-rr79.5%
if -1.15000000000000004e-113 < t < 3.10000000000000009Initial program 92.9%
sub-neg92.9%
sub-neg92.9%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 80.2%
if 3.10000000000000009 < t Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in a around 0 84.5%
Final simplification80.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 (+ (- (* x 2.0) (* 9.0 (* z (* y 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) - (9.0 * (z * (y * 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) - (9.0d0 * (z * (y * 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) - (9.0 * (z * (y * 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) - (9.0 * (z * (y * 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(9.0 * Float64(z * Float64(y * t)))) + Float64(a * Float64(27.0 * b))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - (9.0 * (z * (y * 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[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*95.4%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in y around 0 95.8%
associate-*r*96.8%
Simplified96.8%
Final simplification96.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 (+ (* a (* 27.0 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) {
return (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
}
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 = (a * (27.0d0 * b)) + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
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 (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
}
[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 (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)))
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(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))) 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 = (a * (27.0 * b)) + ((x * 2.0) - ((y * 9.0) * (z * t)));
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * 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])\\
\\
a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)
\end{array}
Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*95.4%
associate-*l*95.8%
Simplified95.8%
Final simplification95.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 (<= a -8.5e+116) (not (<= a 5.2e-23))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.5e+116) || !(a <= 5.2e-23)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-8.5d+116)) .or. (.not. (a <= 5.2d-23))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8.5e+116) || !(a <= 5.2e-23)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -8.5e+116) or not (a <= 5.2e-23): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8.5e+116) || !(a <= 5.2e-23)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -8.5e+116) || ~((a <= 5.2e-23)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8.5e+116], N[Not[LessEqual[a, 5.2e-23]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{+116} \lor \neg \left(a \leq 5.2 \cdot 10^{-23}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -8.5000000000000002e116 or 5.2e-23 < a Initial program 95.6%
sub-neg95.6%
sub-neg95.6%
associate-*l*94.7%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in a around inf 51.7%
if -8.5000000000000002e116 < a < 5.2e-23Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 41.9%
Final simplification46.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 (<= a -8.5e+116) (* a (* 27.0 b)) (if (<= a 2.3e-20) (* 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 (a <= -8.5e+116) {
tmp = a * (27.0 * b);
} else if (a <= 2.3e-20) {
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 (a <= (-8.5d+116)) then
tmp = a * (27.0d0 * b)
else if (a <= 2.3d-20) 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 (a <= -8.5e+116) {
tmp = a * (27.0 * b);
} else if (a <= 2.3e-20) {
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 a <= -8.5e+116: tmp = a * (27.0 * b) elif a <= 2.3e-20: 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 (a <= -8.5e+116) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= 2.3e-20) 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 (a <= -8.5e+116)
tmp = a * (27.0 * b);
elseif (a <= 2.3e-20)
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[a, -8.5e+116], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.3e-20], 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}\;a \leq -8.5 \cdot 10^{+116}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-20}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -8.5000000000000002e116Initial program 97.3%
sub-neg97.3%
sub-neg97.3%
associate-*l*90.0%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in a around inf 60.0%
associate-*r*59.9%
*-commutative59.9%
associate-*r*60.0%
Simplified60.0%
if -8.5000000000000002e116 < a < 2.2999999999999999e-20Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 42.3%
if 2.2999999999999999e-20 < a Initial program 94.6%
sub-neg94.6%
sub-neg94.6%
associate-*l*97.2%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in a around inf 47.9%
Final simplification46.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 (<= a -8.5e+116) (* a (* 27.0 b)) (if (<= a 5.6e-21) (* x 2.0) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8.5e+116) {
tmp = a * (27.0 * b);
} else if (a <= 5.6e-21) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-8.5d+116)) then
tmp = a * (27.0d0 * b)
else if (a <= 5.6d-21) then
tmp = x * 2.0d0
else
tmp = b * (a * 27.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8.5e+116) {
tmp = a * (27.0 * b);
} else if (a <= 5.6e-21) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if a <= -8.5e+116: tmp = a * (27.0 * b) elif a <= 5.6e-21: tmp = x * 2.0 else: tmp = b * (a * 27.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -8.5e+116) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= 5.6e-21) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(a * 27.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -8.5e+116)
tmp = a * (27.0 * b);
elseif (a <= 5.6e-21)
tmp = x * 2.0;
else
tmp = b * (a * 27.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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[a, -8.5e+116], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.6e-21], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{+116}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{-21}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if a < -8.5000000000000002e116Initial program 97.3%
sub-neg97.3%
sub-neg97.3%
associate-*l*90.0%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in a around inf 60.0%
associate-*r*59.9%
*-commutative59.9%
associate-*r*60.0%
Simplified60.0%
if -8.5000000000000002e116 < a < 5.60000000000000008e-21Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 42.3%
if 5.60000000000000008e-21 < a Initial program 94.6%
sub-neg94.6%
sub-neg94.6%
associate-*l*97.2%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in a around inf 47.9%
associate-*r*47.9%
Simplified47.9%
Final simplification46.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 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*95.4%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in x around inf 29.8%
Final simplification29.8%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024076
(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)))