
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.4e-71) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (fma (* 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 <= 1.4e-71) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = fma((z * y), (t * -9.0), ((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 <= 1.4e-71) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = fma(Float64(z * y), Float64(t * -9.0), Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.4e-71], 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[(N[(z * y), $MachinePrecision] * N[(t * -9.0), $MachinePrecision] + N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{-71}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y, t \cdot -9, 27 \cdot \left(a \cdot b\right) + x \cdot 2\right)\\
\end{array}
\end{array}
if z < 1.4e-71Initial program 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
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-def94.4%
fma-neg94.4%
associate-*l*97.0%
distribute-rgt-neg-in97.0%
*-commutative97.0%
associate-*l*97.0%
*-commutative97.0%
distribute-lft-neg-in97.0%
associate-*r*97.0%
Simplified97.0%
if 1.4e-71 < z Initial program 88.0%
sub-neg88.0%
sub-neg88.0%
associate-*l*97.4%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in x around 0 87.9%
+-commutative87.9%
*-commutative87.9%
*-commutative87.9%
associate-*r*88.0%
associate-*r*87.9%
*-commutative87.9%
associate-*r*88.0%
associate-*r*97.3%
sub-neg97.3%
distribute-rgt-neg-in97.3%
*-commutative97.3%
distribute-rgt-neg-in97.3%
distribute-lft-neg-in97.3%
metadata-eval97.3%
associate-*l*97.4%
*-commutative97.4%
+-commutative97.4%
Simplified89.2%
fma-udef89.2%
associate-*r*89.2%
Applied egg-rr89.2%
Final simplification94.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* z (* y 9.0)) 1e+257) (fma (* z y) (* t -9.0) (+ (* 27.0 (* a b)) (* x 2.0))) (+ (* x 2.0) (* -9.0 (* z (* y t))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z * (y * 9.0)) <= 1e+257) {
tmp = fma((z * y), (t * -9.0), ((27.0 * (a * b)) + (x * 2.0)));
} else {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(z * Float64(y * 9.0)) <= 1e+257) tmp = fma(Float64(z * y), Float64(t * -9.0), Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0))); else tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(z * 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. 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+257], N[(N[(z * y), $MachinePrecision] * N[(t * -9.0), $MachinePrecision] + N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(y \cdot 9\right) \leq 10^{+257}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y, t \cdot -9, 27 \cdot \left(a \cdot b\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 1.00000000000000003e257Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*96.5%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in x around 0 95.2%
+-commutative95.2%
*-commutative95.2%
*-commutative95.2%
associate-*r*94.8%
associate-*r*94.8%
*-commutative94.8%
associate-*r*94.8%
associate-*r*96.5%
sub-neg96.5%
distribute-rgt-neg-in96.5%
*-commutative96.5%
distribute-rgt-neg-in96.5%
distribute-lft-neg-in96.5%
metadata-eval96.5%
associate-*l*96.5%
*-commutative96.5%
+-commutative96.5%
Simplified95.7%
fma-udef95.7%
associate-*r*95.7%
Applied egg-rr95.7%
if 1.00000000000000003e257 < (*.f64 (*.f64 y 9) z) Initial program 66.3%
sub-neg66.3%
sub-neg66.3%
associate-*l*94.1%
associate-*l*94.1%
Simplified94.1%
+-commutative94.1%
associate-+r-94.1%
associate-*r*94.1%
*-commutative94.1%
associate-*l*94.1%
associate-*l*94.0%
associate-*r*88.3%
Applied egg-rr88.3%
Taylor expanded in a around 0 72.2%
cancel-sign-sub-inv72.2%
metadata-eval72.2%
*-commutative72.2%
associate-*r*94.4%
Simplified94.4%
Final simplification95.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* z y)))))
(if (<= b -2.45e-138)
(* 27.0 (* a b))
(if (<= b 1.66e-273)
t_1
(if (<= b 1.15e-105)
(* x 2.0)
(if (<= b 6e+18)
t_1
(if (<= b 1.9e+89) (* x 2.0) (* 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) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (b <= -2.45e-138) {
tmp = 27.0 * (a * b);
} else if (b <= 1.66e-273) {
tmp = t_1;
} else if (b <= 1.15e-105) {
tmp = x * 2.0;
} else if (b <= 6e+18) {
tmp = t_1;
} else if (b <= 1.9e+89) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * 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) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (z * y))
if (b <= (-2.45d-138)) then
tmp = 27.0d0 * (a * b)
else if (b <= 1.66d-273) then
tmp = t_1
else if (b <= 1.15d-105) then
tmp = x * 2.0d0
else if (b <= 6d+18) then
tmp = t_1
else if (b <= 1.9d+89) then
tmp = x * 2.0d0
else
tmp = a * (27.0d0 * 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 t_1 = -9.0 * (t * (z * y));
double tmp;
if (b <= -2.45e-138) {
tmp = 27.0 * (a * b);
} else if (b <= 1.66e-273) {
tmp = t_1;
} else if (b <= 1.15e-105) {
tmp = x * 2.0;
} else if (b <= 6e+18) {
tmp = t_1;
} else if (b <= 1.9e+89) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * 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): t_1 = -9.0 * (t * (z * y)) tmp = 0 if b <= -2.45e-138: tmp = 27.0 * (a * b) elif b <= 1.66e-273: tmp = t_1 elif b <= 1.15e-105: tmp = x * 2.0 elif b <= 6e+18: tmp = t_1 elif b <= 1.9e+89: tmp = x * 2.0 else: tmp = a * (27.0 * 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) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (b <= -2.45e-138) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 1.66e-273) tmp = t_1; elseif (b <= 1.15e-105) tmp = Float64(x * 2.0); elseif (b <= 6e+18) tmp = t_1; elseif (b <= 1.9e+89) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(27.0 * 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)
t_1 = -9.0 * (t * (z * y));
tmp = 0.0;
if (b <= -2.45e-138)
tmp = 27.0 * (a * b);
elseif (b <= 1.66e-273)
tmp = t_1;
elseif (b <= 1.15e-105)
tmp = x * 2.0;
elseif (b <= 6e+18)
tmp = t_1;
elseif (b <= 1.9e+89)
tmp = x * 2.0;
else
tmp = a * (27.0 * 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_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.45e-138], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.66e-273], t$95$1, If[LessEqual[b, 1.15e-105], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 6e+18], t$95$1, If[LessEqual[b, 1.9e+89], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * 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}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;b \leq -2.45 \cdot 10^{-138}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 1.66 \cdot 10^{-273}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-105}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{+89}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if b < -2.45000000000000008e-138Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*95.5%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 51.4%
if -2.45000000000000008e-138 < b < 1.65999999999999995e-273 or 1.15e-105 < b < 6e18Initial program 90.2%
sub-neg90.2%
sub-neg90.2%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in y around inf 51.2%
if 1.65999999999999995e-273 < b < 1.15e-105 or 6e18 < b < 1.90000000000000012e89Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*97.6%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around inf 61.3%
if 1.90000000000000012e89 < b Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*97.2%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in a around inf 65.6%
associate-*r*65.5%
*-commutative65.5%
associate-*r*65.6%
Simplified65.6%
Final simplification55.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 (<= b -2.45e-138)
(* 27.0 (* a b))
(if (<= b 1.58e-273)
(* -9.0 (* y (* z t)))
(if (<= b 9.5e-107)
(* x 2.0)
(if (<= b 9.5e+18)
(* -9.0 (* t (* z y)))
(if (<= b 2.1e+89) (* x 2.0) (* 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) {
double tmp;
if (b <= -2.45e-138) {
tmp = 27.0 * (a * b);
} else if (b <= 1.58e-273) {
tmp = -9.0 * (y * (z * t));
} else if (b <= 9.5e-107) {
tmp = x * 2.0;
} else if (b <= 9.5e+18) {
tmp = -9.0 * (t * (z * y));
} else if (b <= 2.1e+89) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-2.45d-138)) then
tmp = 27.0d0 * (a * b)
else if (b <= 1.58d-273) then
tmp = (-9.0d0) * (y * (z * t))
else if (b <= 9.5d-107) then
tmp = x * 2.0d0
else if (b <= 9.5d+18) then
tmp = (-9.0d0) * (t * (z * y))
else if (b <= 2.1d+89) then
tmp = x * 2.0d0
else
tmp = a * (27.0d0 * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.45e-138) {
tmp = 27.0 * (a * b);
} else if (b <= 1.58e-273) {
tmp = -9.0 * (y * (z * t));
} else if (b <= 9.5e-107) {
tmp = x * 2.0;
} else if (b <= 9.5e+18) {
tmp = -9.0 * (t * (z * y));
} else if (b <= 2.1e+89) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -2.45e-138: tmp = 27.0 * (a * b) elif b <= 1.58e-273: tmp = -9.0 * (y * (z * t)) elif b <= 9.5e-107: tmp = x * 2.0 elif b <= 9.5e+18: tmp = -9.0 * (t * (z * y)) elif b <= 2.1e+89: tmp = x * 2.0 else: tmp = a * (27.0 * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.45e-138) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 1.58e-273) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (b <= 9.5e-107) tmp = Float64(x * 2.0); elseif (b <= 9.5e+18) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (b <= 2.1e+89) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(27.0 * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -2.45e-138)
tmp = 27.0 * (a * b);
elseif (b <= 1.58e-273)
tmp = -9.0 * (y * (z * t));
elseif (b <= 9.5e-107)
tmp = x * 2.0;
elseif (b <= 9.5e+18)
tmp = -9.0 * (t * (z * y));
elseif (b <= 2.1e+89)
tmp = x * 2.0;
else
tmp = a * (27.0 * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.45e-138], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.58e-273], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.5e-107], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 9.5e+18], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e+89], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.45 \cdot 10^{-138}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 1.58 \cdot 10^{-273}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{-107}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{+18}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+89}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if b < -2.45000000000000008e-138Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*95.5%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 51.4%
if -2.45000000000000008e-138 < b < 1.57999999999999994e-273Initial program 91.9%
sub-neg91.9%
sub-neg91.9%
associate-*l*97.7%
associate-*l*97.6%
Simplified97.6%
Taylor expanded in x around 0 91.8%
+-commutative91.8%
*-commutative91.8%
*-commutative91.8%
associate-*r*91.7%
associate-*r*91.8%
*-commutative91.8%
associate-*r*91.8%
associate-*r*97.7%
sub-neg97.7%
distribute-rgt-neg-in97.7%
*-commutative97.7%
distribute-rgt-neg-in97.7%
distribute-lft-neg-in97.7%
metadata-eval97.7%
associate-*l*97.8%
*-commutative97.8%
+-commutative97.8%
Simplified91.9%
Taylor expanded in y around inf 52.8%
*-commutative52.8%
associate-*r*58.9%
*-commutative58.9%
Simplified58.9%
if 1.57999999999999994e-273 < b < 9.4999999999999999e-107 or 9.5e18 < b < 2.09999999999999986e89Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*97.6%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in x around inf 61.3%
if 9.4999999999999999e-107 < b < 9.5e18Initial program 87.8%
sub-neg87.8%
sub-neg87.8%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in y around inf 49.0%
if 2.09999999999999986e89 < b Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*97.2%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in a around inf 65.6%
associate-*r*65.5%
*-commutative65.5%
associate-*r*65.6%
Simplified65.6%
Final simplification56.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.8e+46)
(* y (* -9.0 (* z t)))
(if (or (<= z 1.35e-65) (and (not (<= z 9.5e-56)) (<= z 2.2)))
(+ (* 27.0 (* a b)) (* x 2.0))
(* -9.0 (* t (* z y))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.8e+46) {
tmp = y * (-9.0 * (z * t));
} else if ((z <= 1.35e-65) || (!(z <= 9.5e-56) && (z <= 2.2))) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5.8d+46)) then
tmp = y * ((-9.0d0) * (z * t))
else if ((z <= 1.35d-65) .or. (.not. (z <= 9.5d-56)) .and. (z <= 2.2d0)) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (-9.0d0) * (t * (z * y))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.8e+46) {
tmp = y * (-9.0 * (z * t));
} else if ((z <= 1.35e-65) || (!(z <= 9.5e-56) && (z <= 2.2))) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -5.8e+46: tmp = y * (-9.0 * (z * t)) elif (z <= 1.35e-65) or (not (z <= 9.5e-56) and (z <= 2.2)): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = -9.0 * (t * (z * y)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.8e+46) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif ((z <= 1.35e-65) || (!(z <= 9.5e-56) && (z <= 2.2))) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -5.8e+46)
tmp = y * (-9.0 * (z * t));
elseif ((z <= 1.35e-65) || (~((z <= 9.5e-56)) && (z <= 2.2)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = -9.0 * (t * (z * y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.8e+46], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.35e-65], And[N[Not[LessEqual[z, 9.5e-56]], $MachinePrecision], LessEqual[z, 2.2]]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $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.8 \cdot 10^{+46}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-65} \lor \neg \left(z \leq 9.5 \cdot 10^{-56}\right) \land z \leq 2.2:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -5.8000000000000004e46Initial program 80.3%
sub-neg80.3%
sub-neg80.3%
associate-*l*87.2%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in x around 0 82.7%
+-commutative82.7%
*-commutative82.7%
*-commutative82.7%
associate-*r*80.2%
associate-*r*80.3%
*-commutative80.3%
associate-*r*80.3%
associate-*r*84.8%
sub-neg84.8%
distribute-rgt-neg-in84.8%
*-commutative84.8%
distribute-rgt-neg-in84.8%
distribute-lft-neg-in84.8%
metadata-eval84.8%
associate-*l*87.2%
*-commutative87.2%
+-commutative87.2%
Simplified82.7%
fma-udef82.7%
associate-*r*82.7%
Applied egg-rr82.7%
Taylor expanded in y around inf 53.6%
associate-*r*53.6%
*-commutative53.6%
*-commutative53.6%
associate-*l*59.7%
*-commutative59.7%
Simplified59.7%
Taylor expanded in z around 0 59.6%
if -5.8000000000000004e46 < z < 1.3499999999999999e-65 or 9.4999999999999991e-56 < z < 2.2000000000000002Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*98.6%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in y around 0 84.7%
if 1.3499999999999999e-65 < z < 9.4999999999999991e-56 or 2.2000000000000002 < z Initial program 85.5%
sub-neg85.5%
sub-neg85.5%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in y around inf 56.1%
Final simplification73.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 (<= x -170000.0)
(- (* x 2.0) (* 9.0 (* t (* z y))))
(if (<= x 860000000000.0)
(+ (* a (* 27.0 b)) (* t (* z (* y -9.0))))
(if (<= x 2.5e+99)
(+ (* x 2.0) (* -9.0 (* z (* y t))))
(+ (* 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 (x <= -170000.0) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (x <= 860000000000.0) {
tmp = (a * (27.0 * b)) + (t * (z * (y * -9.0)));
} else if (x <= 2.5e+99) {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
} 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 (x <= (-170000.0d0)) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else if (x <= 860000000000.0d0) then
tmp = (a * (27.0d0 * b)) + (t * (z * (y * (-9.0d0))))
else if (x <= 2.5d+99) then
tmp = (x * 2.0d0) + ((-9.0d0) * (z * (y * t)))
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 (x <= -170000.0) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else if (x <= 860000000000.0) {
tmp = (a * (27.0 * b)) + (t * (z * (y * -9.0)));
} else if (x <= 2.5e+99) {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
} 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 x <= -170000.0: tmp = (x * 2.0) - (9.0 * (t * (z * y))) elif x <= 860000000000.0: tmp = (a * (27.0 * b)) + (t * (z * (y * -9.0))) elif x <= 2.5e+99: tmp = (x * 2.0) + (-9.0 * (z * (y * t))) 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 (x <= -170000.0) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); elseif (x <= 860000000000.0) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(t * Float64(z * Float64(y * -9.0)))); elseif (x <= 2.5e+99) tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(z * Float64(y * t)))); 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 (x <= -170000.0)
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
elseif (x <= 860000000000.0)
tmp = (a * (27.0 * b)) + (t * (z * (y * -9.0)));
elseif (x <= 2.5e+99)
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
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[LessEqual[x, -170000.0], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 860000000000.0], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e+99], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $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}\;x \leq -170000:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;x \leq 860000000000:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+99}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if x < -1.7e5Initial program 91.7%
sub-neg91.7%
sub-neg91.7%
associate-*l*96.6%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in a around 0 78.1%
if -1.7e5 < x < 8.6e11Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in x around 0 93.4%
+-commutative93.4%
*-commutative93.4%
*-commutative93.4%
associate-*r*92.7%
associate-*r*92.7%
*-commutative92.7%
associate-*r*92.7%
associate-*r*96.8%
sub-neg96.8%
distribute-rgt-neg-in96.8%
*-commutative96.8%
distribute-rgt-neg-in96.8%
distribute-lft-neg-in96.8%
metadata-eval96.8%
associate-*l*96.9%
*-commutative96.9%
+-commutative96.9%
Simplified94.2%
Taylor expanded in x around 0 84.5%
fma-def84.5%
*-commutative84.5%
associate-*r*87.9%
*-commutative87.9%
*-commutative87.9%
associate-*l*87.9%
*-commutative87.9%
Simplified87.9%
fma-udef87.9%
*-commutative87.9%
associate-*r*87.9%
metadata-eval87.9%
distribute-lft-neg-in87.9%
*-commutative87.9%
associate-*r*83.8%
distribute-rgt-neg-in83.8%
metadata-eval83.8%
Applied egg-rr83.8%
if 8.6e11 < x < 2.50000000000000004e99Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
+-commutative99.9%
associate-+r-99.9%
associate-*r*99.9%
*-commutative99.9%
associate-*l*99.9%
associate-*l*99.7%
associate-*r*94.3%
Applied egg-rr94.3%
Taylor expanded in a around 0 83.9%
cancel-sign-sub-inv83.9%
metadata-eval83.9%
*-commutative83.9%
associate-*r*84.5%
Simplified84.5%
if 2.50000000000000004e99 < x Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*92.4%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in y around 0 82.7%
Final simplification82.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* y 9.0))))
(if (<= t_1 1e+257)
(+ (- (* x 2.0) (* t t_1)) (* b (* a 27.0)))
(+ (* x 2.0) (* -9.0 (* z (* y t)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 1e+257) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * (y * 9.0d0)
if (t_1 <= 1d+257) then
tmp = ((x * 2.0d0) - (t * t_1)) + (b * (a * 27.0d0))
else
tmp = (x * 2.0d0) + ((-9.0d0) * (z * (y * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 1e+257) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = z * (y * 9.0) tmp = 0 if t_1 <= 1e+257: tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0)) else: tmp = (x * 2.0) + (-9.0 * (z * (y * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y * 9.0)) tmp = 0.0 if (t_1 <= 1e+257) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * t_1)) + Float64(b * Float64(a * 27.0))); else tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(z * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = z * (y * 9.0);
tmp = 0.0;
if (t_1 <= 1e+257)
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
else
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+257], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t_1 \leq 10^{+257}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t_1\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 1.00000000000000003e257Initial program 94.9%
if 1.00000000000000003e257 < (*.f64 (*.f64 y 9) z) Initial program 66.3%
sub-neg66.3%
sub-neg66.3%
associate-*l*94.1%
associate-*l*94.1%
Simplified94.1%
+-commutative94.1%
associate-+r-94.1%
associate-*r*94.1%
*-commutative94.1%
associate-*l*94.1%
associate-*l*94.0%
associate-*r*88.3%
Applied egg-rr88.3%
Taylor expanded in a around 0 72.2%
cancel-sign-sub-inv72.2%
metadata-eval72.2%
*-commutative72.2%
associate-*r*94.4%
Simplified94.4%
Final simplification94.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 (* a (* 27.0 b))))
(if (<= z 2.2e+100)
(+ t_1 (- (* x 2.0) (* (* y 9.0) (* z t))))
(+ t_1 (- (* x 2.0) (* 9.0 (* z (* y t))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= 2.2e+100) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (y * t))));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= 2.2d+100) then
tmp = t_1 + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = t_1 + ((x * 2.0d0) - (9.0d0 * (z * (y * t))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= 2.2e+100) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (y * t))));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = a * (27.0 * b) tmp = 0 if z <= 2.2e+100: tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = t_1 + ((x * 2.0) - (9.0 * (z * (y * t)))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= 2.2e+100) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t))))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= 2.2e+100)
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (y * t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.2e+100], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $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}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq 2.2 \cdot 10^{+100}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if z < 2.2000000000000001e100Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*96.6%
associate-*l*96.6%
Simplified96.6%
if 2.2000000000000001e100 < z Initial program 82.1%
sub-neg82.1%
sub-neg82.1%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around 0 82.1%
associate-*r*94.8%
*-commutative94.8%
Simplified94.8%
Final simplification96.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 (<= z 6e-110) (- (+ (* 27.0 (* a b)) (* x 2.0)) (* y (* t (* z 9.0)))) (+ (* x 2.0) (- (* a (* 27.0 b)) (* z (* t (* y 9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6e-110) {
tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * (t * (z * 9.0)));
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - (z * (t * (y * 9.0))));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 6d-110) then
tmp = ((27.0d0 * (a * b)) + (x * 2.0d0)) - (y * (t * (z * 9.0d0)))
else
tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - (z * (t * (y * 9.0d0))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 6e-110) {
tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * (t * (z * 9.0)));
} else {
tmp = (x * 2.0) + ((a * (27.0 * b)) - (z * (t * (y * 9.0))));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 6e-110: tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * (t * (z * 9.0))) else: tmp = (x * 2.0) + ((a * (27.0 * b)) - (z * (t * (y * 9.0)))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 6e-110) tmp = Float64(Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)) - Float64(y * Float64(t * Float64(z * 9.0)))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(z * Float64(t * Float64(y * 9.0))))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 6e-110)
tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * (t * (z * 9.0)));
else
tmp = (x * 2.0) + ((a * (27.0 * b)) - (z * (t * (y * 9.0))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 6e-110], N[(N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(z * N[(t * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6 \cdot 10^{-110}:\\
\;\;\;\;\left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right) - y \cdot \left(t \cdot \left(z \cdot 9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - z \cdot \left(t \cdot \left(y \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if z < 5.99999999999999972e-110Initial program 95.1%
sub-neg95.1%
sub-neg95.1%
associate-*l*95.6%
associate-*l*95.6%
Simplified95.6%
+-commutative95.6%
associate-+r-95.6%
associate-*r*95.6%
*-commutative95.6%
associate-*l*95.6%
associate-*l*95.6%
associate-*r*95.0%
Applied egg-rr95.0%
if 5.99999999999999972e-110 < z Initial program 89.2%
sub-neg89.2%
sub-neg89.2%
associate-*l*97.6%
associate-*l*97.6%
Simplified97.6%
add-cube-cbrt97.3%
pow397.3%
associate-*r*97.3%
*-commutative97.3%
associate-*l*97.3%
Applied egg-rr97.3%
rem-cube-cbrt97.6%
associate-*r*97.6%
add-sqr-sqrt41.7%
associate-*r*41.7%
Applied egg-rr41.7%
associate-+l-41.7%
*-commutative41.7%
*-commutative41.7%
associate-*r*41.6%
associate-*l*41.7%
add-sqr-sqrt97.6%
*-commutative97.6%
associate-*r*97.6%
Applied egg-rr97.6%
Final simplification96.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.3e-138) (not (<= b 9e+70))) (+ (* 27.0 (* a b)) (* x 2.0)) (+ (* x 2.0) (* -9.0 (* z (* y t))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.3e-138) || !(b <= 9e+70)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.3d-138)) .or. (.not. (b <= 9d+70))) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) + ((-9.0d0) * (z * (y * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.3e-138) || !(b <= 9e+70)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.3e-138) or not (b <= 9e+70): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) + (-9.0 * (z * (y * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.3e-138) || !(b <= 9e+70)) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(z * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -1.3e-138) || ~((b <= 9e+70)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.3e-138], N[Not[LessEqual[b, 9e+70]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{-138} \lor \neg \left(b \leq 9 \cdot 10^{+70}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if b < -1.3e-138 or 8.9999999999999999e70 < b Initial program 92.5%
sub-neg92.5%
sub-neg92.5%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in y around 0 76.9%
if -1.3e-138 < b < 8.9999999999999999e70Initial program 93.5%
sub-neg93.5%
sub-neg93.5%
associate-*l*96.6%
associate-*l*96.6%
Simplified96.6%
+-commutative96.6%
associate-+r-96.6%
associate-*r*96.6%
*-commutative96.6%
associate-*l*96.6%
associate-*l*96.6%
associate-*r*96.5%
Applied egg-rr96.5%
Taylor expanded in a around 0 81.0%
cancel-sign-sub-inv81.0%
metadata-eval81.0%
*-commutative81.0%
associate-*r*82.7%
Simplified82.7%
Final simplification79.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 (or (<= b -1.28e-138) (not (<= b 9.5e+63))) (+ (* 27.0 (* a b)) (* x 2.0)) (- (* x 2.0) (* 9.0 (* t (* z y))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.28e-138) || !(b <= 9.5e+63)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.28d-138)) .or. (.not. (b <= 9.5d+63))) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.28e-138) || !(b <= 9.5e+63)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.28e-138) or not (b <= 9.5e+63): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.28e-138) || !(b <= 9.5e+63)) 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(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -1.28e-138) || ~((b <= 9.5e+63)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.28e-138], N[Not[LessEqual[b, 9.5e+63]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.28 \cdot 10^{-138} \lor \neg \left(b \leq 9.5 \cdot 10^{+63}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if b < -1.28e-138 or 9.5000000000000003e63 < b Initial program 92.6%
sub-neg92.6%
sub-neg92.6%
associate-*l*96.2%
associate-*l*96.1%
Simplified96.1%
Taylor expanded in y around 0 77.3%
if -1.28e-138 < b < 9.5000000000000003e63Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*96.5%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in a around 0 80.7%
Final simplification78.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) (* 9.0 (* z (* y t))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * 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) - (9.0d0 * (z * (y * 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) - (9.0 * (z * (y * 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) - (9.0 * (z * (y * 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(9.0 * Float64(z * Float64(y * 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) - (9.0 * (z * (y * 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[(9.0 * N[(z * N[(y * t), $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])\\
\\
a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)
\end{array}
Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in y around 0 93.3%
associate-*r*94.6%
*-commutative94.6%
Simplified94.6%
Final simplification94.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= x -3900000.0) (not (<= x 4.7e+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 ((x <= -3900000.0) || !(x <= 4.7e+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 ((x <= (-3900000.0d0)) .or. (.not. (x <= 4.7d+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 ((x <= -3900000.0) || !(x <= 4.7e+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 (x <= -3900000.0) or not (x <= 4.7e+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 ((x <= -3900000.0) || !(x <= 4.7e+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 ((x <= -3900000.0) || ~((x <= 4.7e+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[Or[LessEqual[x, -3900000.0], N[Not[LessEqual[x, 4.7e+20]], $MachinePrecision]], 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}\;x \leq -3900000 \lor \neg \left(x \leq 4.7 \cdot 10^{+20}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if x < -3.9e6 or 4.7e20 < x Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*95.6%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around inf 57.7%
if -3.9e6 < x < 4.7e20Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in a around inf 48.7%
Final simplification52.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 (or (<= x -2000000.0) (not (<= x 4.9e+24))) (* x 2.0) (* 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) {
double tmp;
if ((x <= -2000000.0) || !(x <= 4.9e+24)) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * 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 ((x <= (-2000000.0d0)) .or. (.not. (x <= 4.9d+24))) then
tmp = x * 2.0d0
else
tmp = a * (27.0d0 * 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 ((x <= -2000000.0) || !(x <= 4.9e+24)) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * 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 (x <= -2000000.0) or not (x <= 4.9e+24): tmp = x * 2.0 else: tmp = a * (27.0 * 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 ((x <= -2000000.0) || !(x <= 4.9e+24)) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(27.0 * 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 ((x <= -2000000.0) || ~((x <= 4.9e+24)))
tmp = x * 2.0;
else
tmp = a * (27.0 * 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[Or[LessEqual[x, -2000000.0], N[Not[LessEqual[x, 4.9e+24]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * 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}\;x \leq -2000000 \lor \neg \left(x \leq 4.9 \cdot 10^{+24}\right):\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if x < -2e6 or 4.90000000000000029e24 < x Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*95.6%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around inf 57.7%
if -2e6 < x < 4.90000000000000029e24Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in a around inf 48.7%
associate-*r*48.8%
*-commutative48.8%
associate-*r*48.7%
Simplified48.7%
Final simplification52.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 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in x around inf 32.2%
Final simplification32.2%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024020
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(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)))