
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 3.7e+55) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (* z (- (+ (* 2.0 (/ x z)) (* 27.0 (/ (* a b) z))) (* 9.0 (* y t))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 3.7e+55) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / z))) - (9.0 * (y * t)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 3.7e+55) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(z * Float64(Float64(Float64(2.0 * Float64(x / z)) + Float64(27.0 * Float64(Float64(a * b) / z))) - Float64(9.0 * Float64(y * t)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 3.7e+55], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(N[(2.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.7 \cdot 10^{+55}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(2 \cdot \frac{x}{z} + 27 \cdot \frac{a \cdot b}{z}\right) - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < 3.7000000000000002e55Initial program 96.6%
Simplified96.3%
if 3.7000000000000002e55 < z Initial program 88.3%
associate-+l-88.3%
*-commutative88.3%
*-commutative88.3%
associate-*l*88.3%
associate-+l-88.3%
associate-*l*88.3%
*-commutative88.3%
*-commutative88.3%
associate-*l*86.7%
associate-*l*86.7%
Simplified86.7%
Taylor expanded in z around inf 97.6%
Final simplification96.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* z (* y 9.0)) 1e+241) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0))))) (- (* x 2.0) (* z (* y (* t 9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z * (y * 9.0)) <= 1e+241) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
} else {
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(z * Float64(y * 9.0)) <= 1e+241) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); else tmp = Float64(Float64(x * 2.0) - Float64(z * Float64(y * Float64(t * 9.0)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision], 1e+241], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(y * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(y \cdot 9\right) \leq 10^{+241}:\\
\;\;\;\;\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)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - z \cdot \left(y \cdot \left(t \cdot 9\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1.0000000000000001e241Initial program 96.5%
+-commutative96.5%
associate-+r-96.5%
*-commutative96.5%
cancel-sign-sub-inv96.5%
associate-*r*95.4%
distribute-lft-neg-in95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-+r-95.4%
associate-*l*95.4%
fma-define96.2%
cancel-sign-sub-inv96.2%
fma-define96.2%
*-commutative96.2%
distribute-rgt-neg-in96.2%
distribute-lft-neg-out96.2%
associate-*r*97.3%
associate-*l*97.4%
Simplified97.4%
if 1.0000000000000001e241 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 76.8%
associate-+l-76.8%
*-commutative76.8%
*-commutative76.8%
associate-*l*76.8%
associate-+l-76.8%
associate-*l*76.8%
*-commutative76.8%
*-commutative76.8%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in a around 0 76.9%
pow176.9%
*-commutative76.9%
associate-*r*82.3%
*-commutative82.3%
Applied egg-rr82.3%
unpow182.3%
associate-*r*82.3%
*-commutative82.3%
associate-*r*82.3%
*-commutative82.3%
*-commutative82.3%
*-commutative82.3%
associate-*l*82.3%
Simplified82.3%
Final simplification96.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= b -3.9e-57)
(* a (* 27.0 b))
(if (<= b -7.2e-172)
(* (* z t) (* y -9.0))
(if (<= b 1.7e-279)
(* x 2.0)
(if (<= b 9e-74)
(* -9.0 (* y (* z t)))
(if (<= b 5.6e+37) (* x 2.0) (* b (* a 27.0))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.9e-57) {
tmp = a * (27.0 * b);
} else if (b <= -7.2e-172) {
tmp = (z * t) * (y * -9.0);
} else if (b <= 1.7e-279) {
tmp = x * 2.0;
} else if (b <= 9e-74) {
tmp = -9.0 * (y * (z * t));
} else if (b <= 5.6e+37) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-3.9d-57)) then
tmp = a * (27.0d0 * b)
else if (b <= (-7.2d-172)) then
tmp = (z * t) * (y * (-9.0d0))
else if (b <= 1.7d-279) then
tmp = x * 2.0d0
else if (b <= 9d-74) then
tmp = (-9.0d0) * (y * (z * t))
else if (b <= 5.6d+37) then
tmp = x * 2.0d0
else
tmp = b * (a * 27.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.9e-57) {
tmp = a * (27.0 * b);
} else if (b <= -7.2e-172) {
tmp = (z * t) * (y * -9.0);
} else if (b <= 1.7e-279) {
tmp = x * 2.0;
} else if (b <= 9e-74) {
tmp = -9.0 * (y * (z * t));
} else if (b <= 5.6e+37) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -3.9e-57: tmp = a * (27.0 * b) elif b <= -7.2e-172: tmp = (z * t) * (y * -9.0) elif b <= 1.7e-279: tmp = x * 2.0 elif b <= 9e-74: tmp = -9.0 * (y * (z * t)) elif b <= 5.6e+37: tmp = x * 2.0 else: tmp = b * (a * 27.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.9e-57) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= -7.2e-172) tmp = Float64(Float64(z * t) * Float64(y * -9.0)); elseif (b <= 1.7e-279) tmp = Float64(x * 2.0); elseif (b <= 9e-74) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (b <= 5.6e+37) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(a * 27.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -3.9e-57)
tmp = a * (27.0 * b);
elseif (b <= -7.2e-172)
tmp = (z * t) * (y * -9.0);
elseif (b <= 1.7e-279)
tmp = x * 2.0;
elseif (b <= 9e-74)
tmp = -9.0 * (y * (z * t));
elseif (b <= 5.6e+37)
tmp = x * 2.0;
else
tmp = b * (a * 27.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.9e-57], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -7.2e-172], N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.7e-279], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 9e-74], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.6e+37], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.9 \cdot 10^{-57}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq -7.2 \cdot 10^{-172}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;b \leq 1.7 \cdot 10^{-279}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 9 \cdot 10^{-74}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+37}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if b < -3.90000000000000006e-57Initial program 93.6%
+-commutative93.6%
associate-+r-93.6%
*-commutative93.6%
cancel-sign-sub-inv93.6%
associate-*r*92.6%
distribute-lft-neg-in92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
associate-+r-92.6%
associate-*l*92.7%
fma-define95.1%
cancel-sign-sub-inv95.1%
fma-define95.1%
*-commutative95.1%
distribute-rgt-neg-in95.1%
distribute-lft-neg-out95.1%
associate-*r*96.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around 0 63.8%
Taylor expanded in a around inf 53.4%
Taylor expanded in x around 0 44.8%
if -3.90000000000000006e-57 < b < -7.20000000000000029e-172Initial program 96.6%
+-commutative96.6%
associate-+r-96.6%
*-commutative96.6%
cancel-sign-sub-inv96.6%
associate-*r*93.1%
distribute-lft-neg-in93.1%
*-commutative93.1%
cancel-sign-sub-inv93.1%
associate-+r-93.1%
associate-*l*93.1%
fma-define93.1%
cancel-sign-sub-inv93.1%
fma-define93.1%
*-commutative93.1%
distribute-rgt-neg-in93.1%
distribute-lft-neg-out93.1%
associate-*r*96.6%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in t around inf 49.9%
*-commutative49.9%
associate-*r*49.7%
associate-*l*49.7%
Simplified49.7%
Taylor expanded in t around 0 49.9%
*-commutative49.9%
associate-*r*49.8%
*-commutative49.8%
associate-*l*49.8%
*-commutative49.8%
associate-*l*49.8%
*-commutative49.8%
*-commutative49.8%
Simplified49.8%
if -7.20000000000000029e-172 < b < 1.70000000000000007e-279 or 8.9999999999999998e-74 < b < 5.5999999999999996e37Initial program 95.9%
+-commutative95.9%
associate-+r-95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-*r*96.1%
distribute-lft-neg-in96.1%
*-commutative96.1%
cancel-sign-sub-inv96.1%
associate-+r-96.1%
associate-*l*96.1%
fma-define96.1%
cancel-sign-sub-inv96.1%
fma-define96.1%
*-commutative96.1%
distribute-rgt-neg-in96.1%
distribute-lft-neg-out96.1%
associate-*r*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in t around 0 72.6%
Taylor expanded in x around inf 58.0%
if 1.70000000000000007e-279 < b < 8.9999999999999998e-74Initial program 97.8%
+-commutative97.8%
associate-+r-97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-*r*97.9%
distribute-lft-neg-in97.9%
*-commutative97.9%
cancel-sign-sub-inv97.9%
associate-+r-97.9%
associate-*l*97.9%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
distribute-lft-neg-out97.9%
associate-*r*97.8%
associate-*l*97.8%
Simplified97.8%
fma-undefine97.8%
fma-undefine97.8%
associate-+r+97.8%
*-commutative97.8%
associate-*l*93.4%
*-commutative93.4%
associate-*r*93.5%
*-commutative93.5%
*-commutative93.5%
associate-*r*93.4%
associate-*l*93.5%
metadata-eval93.5%
distribute-lft-neg-in93.5%
*-commutative93.5%
distribute-rgt-neg-in93.5%
*-commutative93.5%
associate-+r+93.5%
sub-neg93.5%
Applied egg-rr93.4%
Taylor expanded in y around inf 48.2%
*-commutative48.2%
associate-*r*46.1%
*-commutative46.1%
Simplified46.1%
if 5.5999999999999996e37 < b Initial program 94.0%
+-commutative94.0%
associate-+r-94.0%
*-commutative94.0%
cancel-sign-sub-inv94.0%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*95.9%
fma-define97.8%
cancel-sign-sub-inv97.8%
fma-define97.8%
*-commutative97.8%
distribute-rgt-neg-in97.8%
distribute-lft-neg-out97.8%
associate-*r*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in a around inf 57.9%
*-commutative57.9%
*-commutative57.9%
associate-*r*58.0%
*-commutative58.0%
Simplified58.0%
Final simplification50.8%
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 (* y (* z t)))))
(if (<= b -4.5e-58)
(* a (* 27.0 b))
(if (<= b -3.4e-173)
t_1
(if (<= b 6.5e-280)
(* x 2.0)
(if (<= b 1e-73)
t_1
(if (<= b 6.5e+33) (* x 2.0) (* b (* a 27.0)))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (y * (z * t));
double tmp;
if (b <= -4.5e-58) {
tmp = a * (27.0 * b);
} else if (b <= -3.4e-173) {
tmp = t_1;
} else if (b <= 6.5e-280) {
tmp = x * 2.0;
} else if (b <= 1e-73) {
tmp = t_1;
} else if (b <= 6.5e+33) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (y * (z * t))
if (b <= (-4.5d-58)) then
tmp = a * (27.0d0 * b)
else if (b <= (-3.4d-173)) then
tmp = t_1
else if (b <= 6.5d-280) then
tmp = x * 2.0d0
else if (b <= 1d-73) then
tmp = t_1
else if (b <= 6.5d+33) then
tmp = x * 2.0d0
else
tmp = b * (a * 27.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (y * (z * t));
double tmp;
if (b <= -4.5e-58) {
tmp = a * (27.0 * b);
} else if (b <= -3.4e-173) {
tmp = t_1;
} else if (b <= 6.5e-280) {
tmp = x * 2.0;
} else if (b <= 1e-73) {
tmp = t_1;
} else if (b <= 6.5e+33) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (y * (z * t)) tmp = 0 if b <= -4.5e-58: tmp = a * (27.0 * b) elif b <= -3.4e-173: tmp = t_1 elif b <= 6.5e-280: tmp = x * 2.0 elif b <= 1e-73: tmp = t_1 elif b <= 6.5e+33: tmp = x * 2.0 else: tmp = b * (a * 27.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (b <= -4.5e-58) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= -3.4e-173) tmp = t_1; elseif (b <= 6.5e-280) tmp = Float64(x * 2.0); elseif (b <= 1e-73) tmp = t_1; elseif (b <= 6.5e+33) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(a * 27.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (y * (z * t));
tmp = 0.0;
if (b <= -4.5e-58)
tmp = a * (27.0 * b);
elseif (b <= -3.4e-173)
tmp = t_1;
elseif (b <= 6.5e-280)
tmp = x * 2.0;
elseif (b <= 1e-73)
tmp = t_1;
elseif (b <= 6.5e+33)
tmp = x * 2.0;
else
tmp = b * (a * 27.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.5e-58], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.4e-173], t$95$1, If[LessEqual[b, 6.5e-280], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1e-73], t$95$1, If[LessEqual[b, 6.5e+33], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;b \leq -4.5 \cdot 10^{-58}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq -3.4 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{-280}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{+33}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if b < -4.5000000000000003e-58Initial program 93.6%
+-commutative93.6%
associate-+r-93.6%
*-commutative93.6%
cancel-sign-sub-inv93.6%
associate-*r*92.6%
distribute-lft-neg-in92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
associate-+r-92.6%
associate-*l*92.7%
fma-define95.1%
cancel-sign-sub-inv95.1%
fma-define95.1%
*-commutative95.1%
distribute-rgt-neg-in95.1%
distribute-lft-neg-out95.1%
associate-*r*96.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around 0 63.8%
Taylor expanded in a around inf 53.4%
Taylor expanded in x around 0 44.8%
if -4.5000000000000003e-58 < b < -3.3999999999999999e-173 or 6.5000000000000005e-280 < b < 9.99999999999999997e-74Initial program 97.3%
+-commutative97.3%
associate-+r-97.3%
*-commutative97.3%
cancel-sign-sub-inv97.3%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
distribute-lft-neg-out96.0%
associate-*r*97.3%
associate-*l*97.3%
Simplified97.3%
fma-undefine97.3%
fma-undefine97.3%
associate-+r+97.3%
*-commutative97.3%
associate-*l*93.3%
*-commutative93.3%
associate-*r*93.4%
*-commutative93.4%
*-commutative93.4%
associate-*r*93.3%
associate-*l*93.4%
metadata-eval93.4%
distribute-lft-neg-in93.4%
*-commutative93.4%
distribute-rgt-neg-in93.4%
*-commutative93.4%
associate-+r+93.4%
sub-neg93.4%
Applied egg-rr93.3%
Taylor expanded in y around inf 48.8%
*-commutative48.8%
associate-*r*47.6%
*-commutative47.6%
Simplified47.6%
if -3.3999999999999999e-173 < b < 6.5000000000000005e-280 or 9.99999999999999997e-74 < b < 6.49999999999999993e33Initial program 95.7%
+-commutative95.7%
associate-+r-95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-*r*95.9%
distribute-lft-neg-in95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-+r-95.9%
associate-*l*95.9%
fma-define95.9%
cancel-sign-sub-inv95.9%
fma-define95.9%
*-commutative95.9%
distribute-rgt-neg-in95.9%
distribute-lft-neg-out95.9%
associate-*r*95.7%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in t around 0 73.5%
Taylor expanded in x around inf 60.4%
if 6.49999999999999993e33 < b Initial program 94.3%
+-commutative94.3%
associate-+r-94.3%
*-commutative94.3%
cancel-sign-sub-inv94.3%
associate-*r*96.1%
distribute-lft-neg-in96.1%
*-commutative96.1%
cancel-sign-sub-inv96.1%
associate-+r-96.1%
associate-*l*96.0%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
distribute-lft-neg-out97.9%
associate-*r*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around inf 57.6%
*-commutative57.6%
*-commutative57.6%
associate-*r*57.7%
*-commutative57.7%
Simplified57.7%
Final simplification51.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* z y)))))
(if (<= b -4.3e-58)
(* a (* 27.0 b))
(if (<= b -5.8e-173)
t_1
(if (<= b 5.8e-280)
(* x 2.0)
(if (<= b 9.5e-74)
t_1
(if (<= b 4e+35) (* x 2.0) (* b (* a 27.0)))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (b <= -4.3e-58) {
tmp = a * (27.0 * b);
} else if (b <= -5.8e-173) {
tmp = t_1;
} else if (b <= 5.8e-280) {
tmp = x * 2.0;
} else if (b <= 9.5e-74) {
tmp = t_1;
} else if (b <= 4e+35) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (z * y))
if (b <= (-4.3d-58)) then
tmp = a * (27.0d0 * b)
else if (b <= (-5.8d-173)) then
tmp = t_1
else if (b <= 5.8d-280) then
tmp = x * 2.0d0
else if (b <= 9.5d-74) then
tmp = t_1
else if (b <= 4d+35) then
tmp = x * 2.0d0
else
tmp = b * (a * 27.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (b <= -4.3e-58) {
tmp = a * (27.0 * b);
} else if (b <= -5.8e-173) {
tmp = t_1;
} else if (b <= 5.8e-280) {
tmp = x * 2.0;
} else if (b <= 9.5e-74) {
tmp = t_1;
} else if (b <= 4e+35) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (z * y)) tmp = 0 if b <= -4.3e-58: tmp = a * (27.0 * b) elif b <= -5.8e-173: tmp = t_1 elif b <= 5.8e-280: tmp = x * 2.0 elif b <= 9.5e-74: tmp = t_1 elif b <= 4e+35: tmp = x * 2.0 else: tmp = b * (a * 27.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (b <= -4.3e-58) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= -5.8e-173) tmp = t_1; elseif (b <= 5.8e-280) tmp = Float64(x * 2.0); elseif (b <= 9.5e-74) tmp = t_1; elseif (b <= 4e+35) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(a * 27.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (z * y));
tmp = 0.0;
if (b <= -4.3e-58)
tmp = a * (27.0 * b);
elseif (b <= -5.8e-173)
tmp = t_1;
elseif (b <= 5.8e-280)
tmp = x * 2.0;
elseif (b <= 9.5e-74)
tmp = t_1;
elseif (b <= 4e+35)
tmp = x * 2.0;
else
tmp = b * (a * 27.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.3e-58], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -5.8e-173], t$95$1, If[LessEqual[b, 5.8e-280], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 9.5e-74], t$95$1, If[LessEqual[b, 4e+35], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;b \leq -4.3 \cdot 10^{-58}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq -5.8 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{-280}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4 \cdot 10^{+35}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if b < -4.2999999999999999e-58Initial program 93.6%
+-commutative93.6%
associate-+r-93.6%
*-commutative93.6%
cancel-sign-sub-inv93.6%
associate-*r*92.6%
distribute-lft-neg-in92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
associate-+r-92.6%
associate-*l*92.7%
fma-define95.1%
cancel-sign-sub-inv95.1%
fma-define95.1%
*-commutative95.1%
distribute-rgt-neg-in95.1%
distribute-lft-neg-out95.1%
associate-*r*96.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around 0 63.8%
Taylor expanded in a around inf 53.4%
Taylor expanded in x around 0 44.8%
if -4.2999999999999999e-58 < b < -5.7999999999999997e-173 or 5.8e-280 < b < 9.5000000000000007e-74Initial program 97.3%
+-commutative97.3%
associate-+r-97.3%
*-commutative97.3%
cancel-sign-sub-inv97.3%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
distribute-lft-neg-out96.0%
associate-*r*97.3%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in t around inf 48.8%
if -5.7999999999999997e-173 < b < 5.8e-280 or 9.5000000000000007e-74 < b < 3.9999999999999999e35Initial program 95.8%
+-commutative95.8%
associate-+r-95.8%
*-commutative95.8%
cancel-sign-sub-inv95.8%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
distribute-lft-neg-out96.0%
associate-*r*95.8%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in t around 0 72.0%
Taylor expanded in x around inf 59.2%
if 3.9999999999999999e35 < b Initial program 94.1%
+-commutative94.1%
associate-+r-94.1%
*-commutative94.1%
cancel-sign-sub-inv94.1%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*95.9%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
distribute-lft-neg-out97.9%
associate-*r*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around inf 58.7%
*-commutative58.7%
*-commutative58.7%
associate-*r*58.8%
*-commutative58.8%
Simplified58.8%
Final simplification51.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 8e+41) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (* z (- (+ (* 2.0 (/ x z)) (* 27.0 (/ (* a b) z))) (* 9.0 (* y t))))))
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 <= 8e+41) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / z))) - (9.0 * (y * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= 8d+41) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = z * (((2.0d0 * (x / z)) + (27.0d0 * ((a * b) / z))) - (9.0d0 * (y * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 8e+41) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / z))) - (9.0 * (y * t)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 8e+41: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / z))) - (9.0 * (y * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 8e+41) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(z * Float64(Float64(Float64(2.0 * Float64(x / z)) + Float64(27.0 * Float64(Float64(a * b) / z))) - Float64(9.0 * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 8e+41)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / z))) - (9.0 * (y * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 8e+41], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(N[(2.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 8 \cdot 10^{+41}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(2 \cdot \frac{x}{z} + 27 \cdot \frac{a \cdot b}{z}\right) - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < 8.00000000000000005e41Initial program 97.0%
associate-+l-97.0%
*-commutative97.0%
*-commutative97.0%
associate-*l*97.0%
associate-+l-97.0%
associate-*l*97.0%
*-commutative97.0%
*-commutative97.0%
associate-*l*95.6%
associate-*l*95.6%
Simplified95.6%
if 8.00000000000000005e41 < z Initial program 87.7%
associate-+l-87.7%
*-commutative87.7%
*-commutative87.7%
associate-*l*87.7%
associate-+l-87.7%
associate-*l*87.7%
*-commutative87.7%
*-commutative87.7%
associate-*l*84.6%
associate-*l*84.6%
Simplified84.6%
Taylor expanded in z around inf 95.8%
Final simplification95.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* y 9.0))))
(if (<= t_1 1e+241)
(+ (- (* x 2.0) (* t t_1)) (* b (* a 27.0)))
(- (* x 2.0) (* z (* y (* t 9.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 1e+241) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * (y * 9.0d0)
if (t_1 <= 1d+241) then
tmp = ((x * 2.0d0) - (t * t_1)) + (b * (a * 27.0d0))
else
tmp = (x * 2.0d0) - (z * (y * (t * 9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 1e+241) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = z * (y * 9.0) tmp = 0 if t_1 <= 1e+241: tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0)) else: tmp = (x * 2.0) - (z * (y * (t * 9.0))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y * 9.0)) tmp = 0.0 if (t_1 <= 1e+241) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * t_1)) + Float64(b * Float64(a * 27.0))); else tmp = Float64(Float64(x * 2.0) - Float64(z * Float64(y * Float64(t * 9.0)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = z * (y * 9.0);
tmp = 0.0;
if (t_1 <= 1e+241)
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
else
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+241], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(y * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t\_1 \leq 10^{+241}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t\_1\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - z \cdot \left(y \cdot \left(t \cdot 9\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1.0000000000000001e241Initial program 96.5%
if 1.0000000000000001e241 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 76.8%
associate-+l-76.8%
*-commutative76.8%
*-commutative76.8%
associate-*l*76.8%
associate-+l-76.8%
associate-*l*76.8%
*-commutative76.8%
*-commutative76.8%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in a around 0 76.9%
pow176.9%
*-commutative76.9%
associate-*r*82.3%
*-commutative82.3%
Applied egg-rr82.3%
unpow182.3%
associate-*r*82.3%
*-commutative82.3%
associate-*r*82.3%
*-commutative82.3%
*-commutative82.3%
*-commutative82.3%
associate-*l*82.3%
Simplified82.3%
Final simplification95.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (* z y))))
(if (<= b -1.05e-59)
(- (* 27.0 (* a b)) (* 9.0 t_1))
(if (<= b 5.8e+34)
(- (* x 2.0) (* z (* y (* t 9.0))))
(* b (+ (* -9.0 (/ t_1 b)) (* a 27.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (z * y);
double tmp;
if (b <= -1.05e-59) {
tmp = (27.0 * (a * b)) - (9.0 * t_1);
} else if (b <= 5.8e+34) {
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
} else {
tmp = b * ((-9.0 * (t_1 / b)) + (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (z * y)
if (b <= (-1.05d-59)) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * t_1)
else if (b <= 5.8d+34) then
tmp = (x * 2.0d0) - (z * (y * (t * 9.0d0)))
else
tmp = b * (((-9.0d0) * (t_1 / b)) + (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (z * y);
double tmp;
if (b <= -1.05e-59) {
tmp = (27.0 * (a * b)) - (9.0 * t_1);
} else if (b <= 5.8e+34) {
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
} else {
tmp = b * ((-9.0 * (t_1 / b)) + (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = t * (z * y) tmp = 0 if b <= -1.05e-59: tmp = (27.0 * (a * b)) - (9.0 * t_1) elif b <= 5.8e+34: tmp = (x * 2.0) - (z * (y * (t * 9.0))) else: tmp = b * ((-9.0 * (t_1 / b)) + (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(z * y)) tmp = 0.0 if (b <= -1.05e-59) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * t_1)); elseif (b <= 5.8e+34) tmp = Float64(Float64(x * 2.0) - Float64(z * Float64(y * Float64(t * 9.0)))); else tmp = Float64(b * Float64(Float64(-9.0 * Float64(t_1 / b)) + Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (z * y);
tmp = 0.0;
if (b <= -1.05e-59)
tmp = (27.0 * (a * b)) - (9.0 * t_1);
elseif (b <= 5.8e+34)
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
else
tmp = b * ((-9.0 * (t_1 / b)) + (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.05e-59], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.8e+34], N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(y * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(-9.0 * N[(t$95$1 / b), $MachinePrecision]), $MachinePrecision] + N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot y\right)\\
\mathbf{if}\;b \leq -1.05 \cdot 10^{-59}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot t\_1\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{+34}:\\
\;\;\;\;x \cdot 2 - z \cdot \left(y \cdot \left(t \cdot 9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(-9 \cdot \frac{t\_1}{b} + a \cdot 27\right)\\
\end{array}
\end{array}
if b < -1.04999999999999998e-59Initial program 92.6%
associate-+l-92.6%
*-commutative92.6%
*-commutative92.6%
associate-*l*92.7%
associate-+l-92.7%
associate-*l*92.6%
*-commutative92.6%
*-commutative92.6%
associate-*l*91.9%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in x around 0 74.2%
if -1.04999999999999998e-59 < b < 5.8000000000000003e34Initial program 97.5%
associate-+l-97.5%
*-commutative97.5%
*-commutative97.5%
associate-*l*97.5%
associate-+l-97.5%
associate-*l*97.5%
*-commutative97.5%
*-commutative97.5%
associate-*l*95.8%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in a around 0 87.3%
pow187.3%
*-commutative87.3%
associate-*r*84.9%
*-commutative84.9%
Applied egg-rr84.9%
unpow184.9%
associate-*r*85.0%
*-commutative85.0%
associate-*r*84.9%
*-commutative84.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*84.9%
Simplified84.9%
if 5.8000000000000003e34 < b Initial program 94.1%
associate-+l-94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*94.2%
associate-+l-94.2%
associate-*l*94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*90.7%
associate-*l*90.6%
Simplified90.6%
Taylor expanded in x around 0 76.8%
Taylor expanded in b around inf 78.8%
Final simplification80.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.3e-59) (not (<= b 3.45e+34))) (- (* 27.0 (* a b)) (* 9.0 (* t (* z y)))) (- (* x 2.0) (* z (* y (* t 9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.3e-59) || !(b <= 3.45e+34)) {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-2.3d-59)) .or. (.not. (b <= 3.45d+34))) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * (t * (z * y)))
else
tmp = (x * 2.0d0) - (z * (y * (t * 9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.3e-59) || !(b <= 3.45e+34)) {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.3e-59) or not (b <= 3.45e+34): tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y))) else: tmp = (x * 2.0) - (z * (y * (t * 9.0))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.3e-59) || !(b <= 3.45e+34)) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(x * 2.0) - Float64(z * Float64(y * Float64(t * 9.0)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -2.3e-59) || ~((b <= 3.45e+34)))
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
else
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.3e-59], N[Not[LessEqual[b, 3.45e+34]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(y * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{-59} \lor \neg \left(b \leq 3.45 \cdot 10^{+34}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - z \cdot \left(y \cdot \left(t \cdot 9\right)\right)\\
\end{array}
\end{array}
if b < -2.29999999999999979e-59 or 3.45000000000000019e34 < b Initial program 93.2%
associate-+l-93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
associate-+l-93.2%
associate-*l*93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*91.5%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around 0 75.2%
if -2.29999999999999979e-59 < b < 3.45000000000000019e34Initial program 97.5%
associate-+l-97.5%
*-commutative97.5%
*-commutative97.5%
associate-*l*97.5%
associate-+l-97.5%
associate-*l*97.5%
*-commutative97.5%
*-commutative97.5%
associate-*l*95.8%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in a around 0 87.3%
pow187.3%
*-commutative87.3%
associate-*r*84.9%
*-commutative84.9%
Applied egg-rr84.9%
unpow184.9%
associate-*r*85.0%
*-commutative85.0%
associate-*r*84.9%
*-commutative84.9%
*-commutative84.9%
*-commutative84.9%
associate-*l*84.9%
Simplified84.9%
Final simplification79.8%
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 (<= x -5.4e-43)
(- (* x 2.0) (* 9.0 (* t (* z y))))
(if (<= x 3.7e+30)
(+ (* a (* 27.0 b)) (* y (* -9.0 (* z t))))
(+ (* x 2.0) (* 27.0 (* a b))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.4e-43) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (x <= 3.7e+30) {
tmp = (a * (27.0 * b)) + (y * (-9.0 * (z * t)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-5.4d-43)) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else if (x <= 3.7d+30) then
tmp = (a * (27.0d0 * b)) + (y * ((-9.0d0) * (z * t)))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.4e-43) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (x <= 3.7e+30) {
tmp = (a * (27.0 * b)) + (y * (-9.0 * (z * t)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if x <= -5.4e-43: tmp = (x * 2.0) - (9.0 * (t * (z * y))) elif x <= 3.7e+30: tmp = (a * (27.0 * b)) + (y * (-9.0 * (z * t))) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5.4e-43) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); elseif (x <= 3.7e+30) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(y * Float64(-9.0 * Float64(z * t)))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -5.4e-43)
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
elseif (x <= 3.7e+30)
tmp = (a * (27.0 * b)) + (y * (-9.0 * (z * t)));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.4e-43], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.7e+30], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{-43}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+30}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -5.39999999999999982e-43Initial program 97.0%
associate-+l-97.0%
*-commutative97.0%
*-commutative97.0%
associate-*l*97.0%
associate-+l-97.0%
associate-*l*97.0%
*-commutative97.0%
*-commutative97.0%
associate-*l*92.9%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around 0 82.3%
if -5.39999999999999982e-43 < x < 3.70000000000000016e30Initial program 93.1%
associate-+l-93.1%
*-commutative93.1%
*-commutative93.1%
associate-*l*93.1%
associate-+l-93.1%
associate-*l*93.1%
*-commutative93.1%
*-commutative93.1%
associate-*l*91.9%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in x around 0 83.5%
pow183.5%
*-commutative83.5%
associate-*l*82.3%
Applied egg-rr82.3%
unpow182.3%
*-commutative82.3%
Simplified82.3%
cancel-sign-sub-inv82.3%
metadata-eval82.3%
rem-cube-cbrt81.8%
+-commutative81.8%
*-commutative81.8%
rem-cube-cbrt82.3%
associate-*l*82.3%
*-commutative82.3%
*-commutative82.3%
associate-*l*82.3%
Applied egg-rr82.3%
if 3.70000000000000016e30 < x Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
*-commutative98.1%
cancel-sign-sub-inv98.1%
associate-*r*99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
associate-+r-99.9%
associate-*l*99.9%
fma-define99.9%
cancel-sign-sub-inv99.9%
fma-define99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
distribute-lft-neg-out99.9%
associate-*r*98.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in t around 0 87.3%
Final simplification83.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2.5e+67) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (* z (- (* 27.0 (/ (* a b) z)) (* 9.0 (* y t))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.5e+67) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = z * ((27.0 * ((a * b) / z)) - (9.0 * (y * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 2.5d+67) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = z * ((27.0d0 * ((a * b) / z)) - (9.0d0 * (y * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2.5e+67) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = z * ((27.0 * ((a * b) / z)) - (9.0 * (y * t)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 2.5e+67: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = z * ((27.0 * ((a * b) / z)) - (9.0 * (y * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2.5e+67) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(z * Float64(Float64(27.0 * Float64(Float64(a * b) / z)) - Float64(9.0 * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 2.5e+67)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = z * ((27.0 * ((a * b) / z)) - (9.0 * (y * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2.5e+67], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.5 \cdot 10^{+67}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(27 \cdot \frac{a \cdot b}{z} - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < 2.49999999999999988e67Initial program 96.6%
associate-+l-96.6%
*-commutative96.6%
*-commutative96.6%
associate-*l*96.7%
associate-+l-96.7%
associate-*l*96.6%
*-commutative96.6%
*-commutative96.6%
associate-*l*94.9%
associate-*l*95.0%
Simplified95.0%
if 2.49999999999999988e67 < z Initial program 87.4%
associate-+l-87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*87.5%
associate-+l-87.5%
associate-*l*87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*85.8%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in x around 0 70.3%
Taylor expanded in z around inf 82.6%
Final simplification93.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.65e+73) (not (<= y 2.6e-160))) (- (* x 2.0) (* 9.0 (* t (* z y)))) (+ (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.65e+73) || !(y <= 2.6e-160)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-3.65d+73)) .or. (.not. (y <= 2.6d-160))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.65e+73) || !(y <= 2.6e-160)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.65e+73) or not (y <= 2.6e-160): tmp = (x * 2.0) - (9.0 * (t * (z * y))) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.65e+73) || !(y <= 2.6e-160)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((y <= -3.65e+73) || ~((y <= 2.6e-160)))
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.65e+73], N[Not[LessEqual[y, 2.6e-160]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.65 \cdot 10^{+73} \lor \neg \left(y \leq 2.6 \cdot 10^{-160}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -3.65000000000000012e73 or 2.60000000000000003e-160 < y Initial program 91.1%
associate-+l-91.1%
*-commutative91.1%
*-commutative91.1%
associate-*l*91.1%
associate-+l-91.1%
associate-*l*91.1%
*-commutative91.1%
*-commutative91.1%
associate-*l*94.8%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in a around 0 67.8%
if -3.65000000000000012e73 < y < 2.60000000000000003e-160Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.8%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
distribute-lft-neg-out99.8%
associate-*r*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around 0 77.4%
Final simplification72.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= y -7.8e+72)
(- (* x 2.0) (* 9.0 (* t (* z y))))
(if (<= y 2.6e-160)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* z (* y (* t 9.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.8e+72) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (y <= 2.6e-160) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-7.8d+72)) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else if (y <= 2.6d-160) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (z * (y * (t * 9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.8e+72) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (y <= 2.6e-160) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -7.8e+72: tmp = (x * 2.0) - (9.0 * (t * (z * y))) elif y <= 2.6e-160: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (z * (y * (t * 9.0))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.8e+72) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); elseif (y <= 2.6e-160) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(z * Float64(y * Float64(t * 9.0)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -7.8e+72)
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
elseif (y <= 2.6e-160)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (z * (y * (t * 9.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.8e+72], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e-160], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(y * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+72}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-160}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - z \cdot \left(y \cdot \left(t \cdot 9\right)\right)\\
\end{array}
\end{array}
if y < -7.79999999999999984e72Initial program 87.4%
associate-+l-87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*87.5%
associate-+l-87.5%
associate-*l*87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*97.3%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in a around 0 80.4%
if -7.79999999999999984e72 < y < 2.60000000000000003e-160Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.8%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
distribute-lft-neg-out99.8%
associate-*r*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in t around 0 77.4%
if 2.60000000000000003e-160 < y Initial program 92.6%
associate-+l-92.6%
*-commutative92.6%
*-commutative92.6%
associate-*l*92.6%
associate-+l-92.6%
associate-*l*92.6%
*-commutative92.6%
*-commutative92.6%
associate-*l*93.7%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in a around 0 62.5%
pow162.5%
*-commutative62.5%
associate-*r*61.5%
*-commutative61.5%
Applied egg-rr61.5%
unpow161.5%
associate-*r*60.8%
*-commutative60.8%
associate-*r*60.8%
*-commutative60.8%
*-commutative60.8%
*-commutative60.8%
associate-*l*60.8%
Simplified60.8%
Final simplification71.7%
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-58) (not (<= b 1.9e+35))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.3e-58) || !(b <= 1.9e+35)) {
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.
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-58)) .or. (.not. (b <= 1.9d+35))) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.3e-58) || !(b <= 1.9e+35)) {
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]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.3e-58) or not (b <= 1.9e+35): 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]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.3e-58) || !(b <= 1.9e+35)) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -1.3e-58) || ~((b <= 1.9e+35)))
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. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.3e-58], N[Not[LessEqual[b, 1.9e+35]], $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])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{-58} \lor \neg \left(b \leq 1.9 \cdot 10^{+35}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.30000000000000003e-58 or 1.9e35 < b Initial program 93.8%
+-commutative93.8%
associate-+r-93.8%
*-commutative93.8%
cancel-sign-sub-inv93.8%
associate-*r*93.9%
distribute-lft-neg-in93.9%
*-commutative93.9%
cancel-sign-sub-inv93.9%
associate-+r-93.9%
associate-*l*93.9%
fma-define96.2%
cancel-sign-sub-inv96.2%
fma-define96.2%
*-commutative96.2%
distribute-rgt-neg-in96.2%
distribute-lft-neg-out96.2%
associate-*r*96.0%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around inf 50.2%
if -1.30000000000000003e-58 < b < 1.9e35Initial program 96.7%
+-commutative96.7%
associate-+r-96.7%
*-commutative96.7%
cancel-sign-sub-inv96.7%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
distribute-lft-neg-out96.0%
associate-*r*96.7%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in t around 0 58.8%
Taylor expanded in x around inf 48.5%
Final simplification49.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= b -3.8e-57) (* a (* 27.0 b)) (if (<= b 5.9e+34) (* x 2.0) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.8e-57) {
tmp = a * (27.0 * b);
} else if (b <= 5.9e+34) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-3.8d-57)) then
tmp = a * (27.0d0 * b)
else if (b <= 5.9d+34) then
tmp = x * 2.0d0
else
tmp = b * (a * 27.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.8e-57) {
tmp = a * (27.0 * b);
} else if (b <= 5.9e+34) {
tmp = x * 2.0;
} else {
tmp = b * (a * 27.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -3.8e-57: tmp = a * (27.0 * b) elif b <= 5.9e+34: tmp = x * 2.0 else: tmp = b * (a * 27.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.8e-57) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 5.9e+34) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(a * 27.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -3.8e-57)
tmp = a * (27.0 * b);
elseif (b <= 5.9e+34)
tmp = x * 2.0;
else
tmp = b * (a * 27.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.8e-57], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.9e+34], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{-57}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 5.9 \cdot 10^{+34}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if b < -3.7999999999999997e-57Initial program 93.6%
+-commutative93.6%
associate-+r-93.6%
*-commutative93.6%
cancel-sign-sub-inv93.6%
associate-*r*92.6%
distribute-lft-neg-in92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
associate-+r-92.6%
associate-*l*92.7%
fma-define95.1%
cancel-sign-sub-inv95.1%
fma-define95.1%
*-commutative95.1%
distribute-rgt-neg-in95.1%
distribute-lft-neg-out95.1%
associate-*r*96.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around 0 63.8%
Taylor expanded in a around inf 53.4%
Taylor expanded in x around 0 44.8%
if -3.7999999999999997e-57 < b < 5.8999999999999999e34Initial program 96.7%
+-commutative96.7%
associate-+r-96.7%
*-commutative96.7%
cancel-sign-sub-inv96.7%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
distribute-lft-neg-out96.0%
associate-*r*96.7%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in t around 0 58.8%
Taylor expanded in x around inf 48.5%
if 5.8999999999999999e34 < b Initial program 94.1%
+-commutative94.1%
associate-+r-94.1%
*-commutative94.1%
cancel-sign-sub-inv94.1%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*95.9%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
distribute-lft-neg-out97.9%
associate-*r*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around inf 58.7%
*-commutative58.7%
*-commutative58.7%
associate-*r*58.8%
*-commutative58.8%
Simplified58.8%
Final simplification49.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= b -3.6e-57) (* a (* 27.0 b)) (if (<= b 5.5e+33) (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.6e-57) {
tmp = a * (27.0 * b);
} else if (b <= 5.5e+33) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-3.6d-57)) then
tmp = a * (27.0d0 * b)
else if (b <= 5.5d+33) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.6e-57) {
tmp = a * (27.0 * b);
} else if (b <= 5.5e+33) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -3.6e-57: tmp = a * (27.0 * b) elif b <= 5.5e+33: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.6e-57) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 5.5e+33) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -3.6e-57)
tmp = a * (27.0 * b);
elseif (b <= 5.5e+33)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.6e-57], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.5e+33], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.6 \cdot 10^{-57}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{+33}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -3.6000000000000002e-57Initial program 93.6%
+-commutative93.6%
associate-+r-93.6%
*-commutative93.6%
cancel-sign-sub-inv93.6%
associate-*r*92.6%
distribute-lft-neg-in92.6%
*-commutative92.6%
cancel-sign-sub-inv92.6%
associate-+r-92.6%
associate-*l*92.7%
fma-define95.1%
cancel-sign-sub-inv95.1%
fma-define95.1%
*-commutative95.1%
distribute-rgt-neg-in95.1%
distribute-lft-neg-out95.1%
associate-*r*96.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in t around 0 63.8%
Taylor expanded in a around inf 53.4%
Taylor expanded in x around 0 44.8%
if -3.6000000000000002e-57 < b < 5.5000000000000006e33Initial program 96.7%
+-commutative96.7%
associate-+r-96.7%
*-commutative96.7%
cancel-sign-sub-inv96.7%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
distribute-lft-neg-out96.0%
associate-*r*96.7%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in t around 0 59.2%
Taylor expanded in x around inf 48.9%
if 5.5000000000000006e33 < b Initial program 94.3%
+-commutative94.3%
associate-+r-94.3%
*-commutative94.3%
cancel-sign-sub-inv94.3%
associate-*r*96.1%
distribute-lft-neg-in96.1%
*-commutative96.1%
cancel-sign-sub-inv96.1%
associate-+r-96.1%
associate-*l*96.0%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
distribute-lft-neg-out97.9%
associate-*r*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in a around inf 57.6%
Final simplification49.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= y -2.25e+201) (* (* z t) (* y -9.0)) (+ (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.25e+201) {
tmp = (z * t) * (y * -9.0);
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-2.25d+201)) then
tmp = (z * t) * (y * (-9.0d0))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.25e+201) {
tmp = (z * t) * (y * -9.0);
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -2.25e+201: tmp = (z * t) * (y * -9.0) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.25e+201) tmp = Float64(Float64(z * t) * Float64(y * -9.0)); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -2.25e+201)
tmp = (z * t) * (y * -9.0);
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.25e+201], N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.25 \cdot 10^{+201}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -2.25000000000000005e201Initial program 82.1%
+-commutative82.1%
associate-+r-82.1%
*-commutative82.1%
cancel-sign-sub-inv82.1%
associate-*r*82.5%
distribute-lft-neg-in82.5%
*-commutative82.5%
cancel-sign-sub-inv82.5%
associate-+r-82.5%
associate-*l*82.5%
fma-define87.1%
cancel-sign-sub-inv87.1%
fma-define87.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
distribute-lft-neg-out87.1%
associate-*r*86.6%
associate-*l*86.7%
Simplified86.7%
Taylor expanded in t around inf 60.8%
*-commutative60.8%
associate-*r*60.7%
associate-*l*60.8%
Simplified60.8%
Taylor expanded in t around 0 60.8%
*-commutative60.8%
associate-*r*69.4%
*-commutative69.4%
associate-*l*69.3%
*-commutative69.3%
associate-*l*69.4%
*-commutative69.4%
*-commutative69.4%
Simplified69.4%
if -2.25000000000000005e201 < y Initial program 96.4%
+-commutative96.4%
associate-+r-96.4%
*-commutative96.4%
cancel-sign-sub-inv96.4%
associate-*r*96.1%
distribute-lft-neg-in96.1%
*-commutative96.1%
cancel-sign-sub-inv96.1%
associate-+r-96.1%
associate-*l*96.1%
fma-define96.9%
cancel-sign-sub-inv96.9%
fma-define96.9%
*-commutative96.9%
distribute-rgt-neg-in96.9%
distribute-lft-neg-out96.9%
associate-*r*97.3%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in t around 0 66.9%
Final simplification67.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 95.2%
+-commutative95.2%
associate-+r-95.2%
*-commutative95.2%
cancel-sign-sub-inv95.2%
associate-*r*94.9%
distribute-lft-neg-in94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-+r-94.9%
associate-*l*94.9%
fma-define96.1%
cancel-sign-sub-inv96.1%
fma-define96.1%
*-commutative96.1%
distribute-rgt-neg-in96.1%
distribute-lft-neg-out96.1%
associate-*r*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in t around 0 63.8%
Taylor expanded in x around inf 34.0%
Final simplification34.0%
(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 2024170
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< y 7590524218811189/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b))))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))