
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= t 3.5e+190) (+ (- (* x 2.0) (* (* t z) (* y 9.0))) (* a (* 27.0 b))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* -9.0 z)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 3.5e+190) {
tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (-9.0 * z)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 3.5e+190) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(t * z) * Float64(y * 9.0))) + Float64(a * Float64(27.0 * b))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(-9.0 * z))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 3.5e+190], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(t * z), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{+190}:\\
\;\;\;\;\left(x \cdot 2 - \left(t \cdot z\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(-9 \cdot z\right)\right)\right)\right)\\
\end{array}
\end{array}
if t < 3.4999999999999999e190Initial program 92.5%
sub-neg92.5%
sub-neg92.5%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
if 3.4999999999999999e190 < t Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*88.0%
distribute-lft-neg-in88.0%
*-commutative88.0%
cancel-sign-sub-inv88.0%
associate-+r-88.0%
associate-*l*87.9%
fma-define87.9%
cancel-sign-sub-inv87.9%
fma-define87.9%
distribute-lft-neg-in87.9%
distribute-rgt-neg-in87.9%
*-commutative87.9%
associate-*r*99.8%
associate-*l*99.8%
neg-mul-199.8%
associate-*r*99.8%
Simplified99.8%
Final simplification95.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (fma a (* 27.0 b) (fma x 2.0 (* y (* -9.0 (* t z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return fma(a, (27.0 * b), fma(x, 2.0, (y * (-9.0 * (t * z)))));
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(-9.0 * Float64(t * z))))) end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(-9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(-9 \cdot \left(t \cdot z\right)\right)\right)\right)
\end{array}
Initial program 93.4%
+-commutative93.4%
associate-+r-93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
associate-*r*95.3%
distribute-lft-neg-in95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-+r-95.3%
associate-*l*95.3%
fma-define96.5%
fma-neg96.5%
associate-*l*96.0%
distribute-rgt-neg-in96.0%
*-commutative96.0%
associate-*l*96.1%
*-commutative96.1%
distribute-lft-neg-in96.1%
associate-*r*96.1%
Simplified96.1%
Taylor expanded in z around 0 96.1%
Final simplification96.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* -9.0 (* y (* t z)))))
(if (<= y -1.8e+147)
t_2
(if (<= y -1.3e+62)
t_1
(if (<= y -6.5e+31)
(* x 2.0)
(if (<= y -1.1e-111)
(* a (* 27.0 b))
(if (<= y -1.5e-201) (* x 2.0) (if (<= y 6e-116) t_1 t_2))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (y * (t * z));
double tmp;
if (y <= -1.8e+147) {
tmp = t_2;
} else if (y <= -1.3e+62) {
tmp = t_1;
} else if (y <= -6.5e+31) {
tmp = x * 2.0;
} else if (y <= -1.1e-111) {
tmp = a * (27.0 * b);
} else if (y <= -1.5e-201) {
tmp = x * 2.0;
} else if (y <= 6e-116) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (y * (t * z))
if (y <= (-1.8d+147)) then
tmp = t_2
else if (y <= (-1.3d+62)) then
tmp = t_1
else if (y <= (-6.5d+31)) then
tmp = x * 2.0d0
else if (y <= (-1.1d-111)) then
tmp = a * (27.0d0 * b)
else if (y <= (-1.5d-201)) then
tmp = x * 2.0d0
else if (y <= 6d-116) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (y * (t * z));
double tmp;
if (y <= -1.8e+147) {
tmp = t_2;
} else if (y <= -1.3e+62) {
tmp = t_1;
} else if (y <= -6.5e+31) {
tmp = x * 2.0;
} else if (y <= -1.1e-111) {
tmp = a * (27.0 * b);
} else if (y <= -1.5e-201) {
tmp = x * 2.0;
} else if (y <= 6e-116) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (y * (t * z)) tmp = 0 if y <= -1.8e+147: tmp = t_2 elif y <= -1.3e+62: tmp = t_1 elif y <= -6.5e+31: tmp = x * 2.0 elif y <= -1.1e-111: tmp = a * (27.0 * b) elif y <= -1.5e-201: tmp = x * 2.0 elif y <= 6e-116: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(y * Float64(t * z))) tmp = 0.0 if (y <= -1.8e+147) tmp = t_2; elseif (y <= -1.3e+62) tmp = t_1; elseif (y <= -6.5e+31) tmp = Float64(x * 2.0); elseif (y <= -1.1e-111) tmp = Float64(a * Float64(27.0 * b)); elseif (y <= -1.5e-201) tmp = Float64(x * 2.0); elseif (y <= 6e-116) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (y * (t * z));
tmp = 0.0;
if (y <= -1.8e+147)
tmp = t_2;
elseif (y <= -1.3e+62)
tmp = t_1;
elseif (y <= -6.5e+31)
tmp = x * 2.0;
elseif (y <= -1.1e-111)
tmp = a * (27.0 * b);
elseif (y <= -1.5e-201)
tmp = x * 2.0;
elseif (y <= 6e-116)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+147], t$95$2, If[LessEqual[y, -1.3e+62], t$95$1, If[LessEqual[y, -6.5e+31], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.1e-111], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.5e-201], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, 6e-116], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{+62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{+31}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-111}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-201}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-116}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.8000000000000001e147 or 6.00000000000000053e-116 < y Initial program 91.5%
sub-neg91.5%
sub-neg91.5%
associate-*l*97.5%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in y around inf 48.4%
pow148.4%
Applied egg-rr48.4%
unpow148.4%
*-commutative48.4%
associate-*l*52.0%
*-commutative52.0%
Simplified52.0%
if -1.8000000000000001e147 < y < -1.29999999999999992e62 or -1.50000000000000001e-201 < y < 6.00000000000000053e-116Initial program 94.6%
sub-neg94.6%
sub-neg94.6%
associate-*l*93.4%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around inf 53.1%
if -1.29999999999999992e62 < y < -6.5000000000000004e31 or -1.1e-111 < y < -1.50000000000000001e-201Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*91.9%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in x around inf 51.7%
if -6.5000000000000004e31 < y < -1.1e-111Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in a around inf 54.0%
associate-*r*54.1%
*-commutative54.1%
associate-*r*54.2%
Simplified54.2%
Final simplification52.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= b -2.3e-73)
t_1
(if (<= b 2.3e-200)
(* x 2.0)
(if (<= b 2.05e-10)
(* -9.0 (* t (* y z)))
(if (<= b 1.8e+61)
(* x 2.0)
(if (<= b 5.4e+100)
(* a (* 27.0 b))
(if (<= b 5.2e+111) (* x 2.0) t_1))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (b <= -2.3e-73) {
tmp = t_1;
} else if (b <= 2.3e-200) {
tmp = x * 2.0;
} else if (b <= 2.05e-10) {
tmp = -9.0 * (t * (y * z));
} else if (b <= 1.8e+61) {
tmp = x * 2.0;
} else if (b <= 5.4e+100) {
tmp = a * (27.0 * b);
} else if (b <= 5.2e+111) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (b <= (-2.3d-73)) then
tmp = t_1
else if (b <= 2.3d-200) then
tmp = x * 2.0d0
else if (b <= 2.05d-10) then
tmp = (-9.0d0) * (t * (y * z))
else if (b <= 1.8d+61) then
tmp = x * 2.0d0
else if (b <= 5.4d+100) then
tmp = a * (27.0d0 * b)
else if (b <= 5.2d+111) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (b <= -2.3e-73) {
tmp = t_1;
} else if (b <= 2.3e-200) {
tmp = x * 2.0;
} else if (b <= 2.05e-10) {
tmp = -9.0 * (t * (y * z));
} else if (b <= 1.8e+61) {
tmp = x * 2.0;
} else if (b <= 5.4e+100) {
tmp = a * (27.0 * b);
} else if (b <= 5.2e+111) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if b <= -2.3e-73: tmp = t_1 elif b <= 2.3e-200: tmp = x * 2.0 elif b <= 2.05e-10: tmp = -9.0 * (t * (y * z)) elif b <= 1.8e+61: tmp = x * 2.0 elif b <= 5.4e+100: tmp = a * (27.0 * b) elif b <= 5.2e+111: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -2.3e-73) tmp = t_1; elseif (b <= 2.3e-200) tmp = Float64(x * 2.0); elseif (b <= 2.05e-10) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (b <= 1.8e+61) tmp = Float64(x * 2.0); elseif (b <= 5.4e+100) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 5.2e+111) tmp = Float64(x * 2.0); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -2.3e-73)
tmp = t_1;
elseif (b <= 2.3e-200)
tmp = x * 2.0;
elseif (b <= 2.05e-10)
tmp = -9.0 * (t * (y * z));
elseif (b <= 1.8e+61)
tmp = x * 2.0;
elseif (b <= 5.4e+100)
tmp = a * (27.0 * b);
elseif (b <= 5.2e+111)
tmp = x * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.3e-73], t$95$1, If[LessEqual[b, 2.3e-200], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.05e-10], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e+61], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 5.4e+100], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e+111], N[(x * 2.0), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -2.3 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-200}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 2.05 \cdot 10^{-10}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{+61}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 5.4 \cdot 10^{+100}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+111}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.29999999999999988e-73 or 5.1999999999999997e111 < b Initial program 93.5%
sub-neg93.5%
sub-neg93.5%
associate-*l*93.6%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around inf 56.9%
if -2.29999999999999988e-73 < b < 2.30000000000000007e-200 or 2.0499999999999999e-10 < b < 1.80000000000000005e61 or 5.39999999999999997e100 < b < 5.1999999999999997e111Initial program 91.9%
sub-neg91.9%
sub-neg91.9%
associate-*l*95.1%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in x around inf 50.0%
if 2.30000000000000007e-200 < b < 2.0499999999999999e-10Initial program 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*97.6%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in y around inf 42.9%
if 1.80000000000000005e61 < b < 5.39999999999999997e100Initial program 84.2%
sub-neg84.2%
sub-neg84.2%
associate-*l*99.5%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around inf 50.3%
associate-*r*50.0%
*-commutative50.0%
associate-*r*50.3%
Simplified50.3%
Final simplification52.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (or (<= b -1.16e-73)
(and (not (<= b 1.7e+61)) (or (<= b 4.6e+100) (not (<= b 1.5e+117)))))
(* 27.0 (* a b))
(* x 2.0)))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.16e-73) || (!(b <= 1.7e+61) && ((b <= 4.6e+100) || !(b <= 1.5e+117)))) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.16d-73)) .or. (.not. (b <= 1.7d+61)) .and. (b <= 4.6d+100) .or. (.not. (b <= 1.5d+117))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.16e-73) || (!(b <= 1.7e+61) && ((b <= 4.6e+100) || !(b <= 1.5e+117)))) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.16e-73) or (not (b <= 1.7e+61) and ((b <= 4.6e+100) or not (b <= 1.5e+117))): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.16e-73) || (!(b <= 1.7e+61) && ((b <= 4.6e+100) || !(b <= 1.5e+117)))) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -1.16e-73) || (~((b <= 1.7e+61)) && ((b <= 4.6e+100) || ~((b <= 1.5e+117)))))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.16e-73], And[N[Not[LessEqual[b, 1.7e+61]], $MachinePrecision], Or[LessEqual[b, 4.6e+100], N[Not[LessEqual[b, 1.5e+117]], $MachinePrecision]]]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.16 \cdot 10^{-73} \lor \neg \left(b \leq 1.7 \cdot 10^{+61}\right) \land \left(b \leq 4.6 \cdot 10^{+100} \lor \neg \left(b \leq 1.5 \cdot 10^{+117}\right)\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.16e-73 or 1.70000000000000013e61 < b < 4.5999999999999998e100 or 1.5e117 < b Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*93.8%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in a around inf 56.5%
if -1.16e-73 < b < 1.70000000000000013e61 or 4.5999999999999998e100 < b < 1.5e117Initial program 93.8%
sub-neg93.8%
sub-neg93.8%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 44.7%
Final simplification50.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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= b -3.9e-69)
t_1
(if (<= b 2.9e+61)
(* x 2.0)
(if (<= b 2.7e+100)
(* a (* 27.0 b))
(if (<= b 1.95e+118) (* x 2.0) t_1))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (b <= -3.9e-69) {
tmp = t_1;
} else if (b <= 2.9e+61) {
tmp = x * 2.0;
} else if (b <= 2.7e+100) {
tmp = a * (27.0 * b);
} else if (b <= 1.95e+118) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (b <= (-3.9d-69)) then
tmp = t_1
else if (b <= 2.9d+61) then
tmp = x * 2.0d0
else if (b <= 2.7d+100) then
tmp = a * (27.0d0 * b)
else if (b <= 1.95d+118) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (b <= -3.9e-69) {
tmp = t_1;
} else if (b <= 2.9e+61) {
tmp = x * 2.0;
} else if (b <= 2.7e+100) {
tmp = a * (27.0 * b);
} else if (b <= 1.95e+118) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if b <= -3.9e-69: tmp = t_1 elif b <= 2.9e+61: tmp = x * 2.0 elif b <= 2.7e+100: tmp = a * (27.0 * b) elif b <= 1.95e+118: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -3.9e-69) tmp = t_1; elseif (b <= 2.9e+61) tmp = Float64(x * 2.0); elseif (b <= 2.7e+100) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 1.95e+118) tmp = Float64(x * 2.0); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -3.9e-69)
tmp = t_1;
elseif (b <= 2.9e+61)
tmp = x * 2.0;
elseif (b <= 2.7e+100)
tmp = a * (27.0 * b);
elseif (b <= 1.95e+118)
tmp = x * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.9e-69], t$95$1, If[LessEqual[b, 2.9e+61], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.7e+100], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.95e+118], N[(x * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -3.9 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.9 \cdot 10^{+61}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 2.7 \cdot 10^{+100}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{+118}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.89999999999999981e-69 or 1.95e118 < b Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*93.6%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in a around inf 56.8%
if -3.89999999999999981e-69 < b < 2.9000000000000001e61 or 2.69999999999999998e100 < b < 1.95e118Initial program 93.8%
sub-neg93.8%
sub-neg93.8%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 44.7%
if 2.9000000000000001e61 < b < 2.69999999999999998e100Initial program 84.2%
sub-neg84.2%
sub-neg84.2%
associate-*l*99.5%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around inf 50.3%
associate-*r*50.0%
*-commutative50.0%
associate-*r*50.3%
Simplified50.3%
Final simplification50.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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -3.8e-148)
(+ (* a (* 27.0 b)) (* y (* t (* -9.0 z))))
(if (<= z 6.5e-45) (+ t_1 (* x 2.0)) (- t_1 (* 9.0 (* t (* y z))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -3.8e-148) {
tmp = (a * (27.0 * b)) + (y * (t * (-9.0 * z)));
} else if (z <= 6.5e-45) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-3.8d-148)) then
tmp = (a * (27.0d0 * b)) + (y * (t * ((-9.0d0) * z)))
else if (z <= 6.5d-45) then
tmp = t_1 + (x * 2.0d0)
else
tmp = t_1 - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -3.8e-148) {
tmp = (a * (27.0 * b)) + (y * (t * (-9.0 * z)));
} else if (z <= 6.5e-45) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -3.8e-148: tmp = (a * (27.0 * b)) + (y * (t * (-9.0 * z))) elif z <= 6.5e-45: tmp = t_1 + (x * 2.0) else: tmp = t_1 - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -3.8e-148) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(y * Float64(t * Float64(-9.0 * z)))); elseif (z <= 6.5e-45) tmp = Float64(t_1 + Float64(x * 2.0)); else tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -3.8e-148)
tmp = (a * (27.0 * b)) + (y * (t * (-9.0 * z)));
elseif (z <= 6.5e-45)
tmp = t_1 + (x * 2.0);
else
tmp = t_1 - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e-148], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-45], N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{-148}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + y \cdot \left(t \cdot \left(-9 \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-45}:\\
\;\;\;\;t\_1 + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -3.80000000000000014e-148Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*92.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in x around 0 67.6%
sub-neg67.6%
+-commutative67.6%
distribute-lft-neg-in67.6%
metadata-eval67.6%
*-commutative67.6%
associate-*r*69.2%
associate-*l*69.3%
*-commutative69.3%
*-commutative69.3%
associate-*l*69.2%
*-commutative69.2%
associate-*r*69.2%
*-commutative69.2%
Applied egg-rr69.2%
if -3.80000000000000014e-148 < z < 6.4999999999999995e-45Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 89.5%
if 6.4999999999999995e-45 < z Initial program 83.9%
sub-neg83.9%
sub-neg83.9%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in x around 0 69.6%
Final simplification76.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -3.05e-148)
(- t_1 (* 9.0 (* y (* t z))))
(if (<= z 3.3e-45) (+ t_1 (* x 2.0)) (- t_1 (* 9.0 (* t (* y z))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -3.05e-148) {
tmp = t_1 - (9.0 * (y * (t * z)));
} else if (z <= 3.3e-45) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-3.05d-148)) then
tmp = t_1 - (9.0d0 * (y * (t * z)))
else if (z <= 3.3d-45) then
tmp = t_1 + (x * 2.0d0)
else
tmp = t_1 - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -3.05e-148) {
tmp = t_1 - (9.0 * (y * (t * z)));
} else if (z <= 3.3e-45) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -3.05e-148: tmp = t_1 - (9.0 * (y * (t * z))) elif z <= 3.3e-45: tmp = t_1 + (x * 2.0) else: tmp = t_1 - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -3.05e-148) tmp = Float64(t_1 - Float64(9.0 * Float64(y * Float64(t * z)))); elseif (z <= 3.3e-45) tmp = Float64(t_1 + Float64(x * 2.0)); else tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -3.05e-148)
tmp = t_1 - (9.0 * (y * (t * z)));
elseif (z <= 3.3e-45)
tmp = t_1 + (x * 2.0);
else
tmp = t_1 - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.05e-148], N[(t$95$1 - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e-45], N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -3.05 \cdot 10^{-148}:\\
\;\;\;\;t\_1 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-45}:\\
\;\;\;\;t\_1 + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -3.04999999999999988e-148Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*92.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in x around 0 67.6%
pow142.4%
Applied egg-rr67.6%
unpow142.4%
*-commutative42.4%
associate-*l*45.0%
*-commutative45.0%
Simplified69.2%
if -3.04999999999999988e-148 < z < 3.3000000000000001e-45Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 89.5%
if 3.3000000000000001e-45 < z Initial program 83.9%
sub-neg83.9%
sub-neg83.9%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in x around 0 69.6%
Final simplification76.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.3e-73) (not (<= b 4.6e+27))) (+ (* 27.0 (* a b)) (* x 2.0)) (- (* x 2.0) (* 9.0 (* t (* y z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.3e-73) || !(b <= 4.6e+27)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-2.3d-73)) .or. (.not. (b <= 4.6d+27))) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.3e-73) || !(b <= 4.6e+27)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.3e-73) or not (b <= 4.6e+27): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.3e-73) || !(b <= 4.6e+27)) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -2.3e-73) || ~((b <= 4.6e+27)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.3e-73], N[Not[LessEqual[b, 4.6e+27]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{-73} \lor \neg \left(b \leq 4.6 \cdot 10^{+27}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if b < -2.29999999999999988e-73 or 4.6000000000000001e27 < b Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*94.2%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in y around 0 72.8%
if -2.29999999999999988e-73 < b < 4.6000000000000001e27Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in a around 0 78.7%
Final simplification75.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 (or (<= b -2e-69) (not (<= b 1.95e+118))) (+ (* 27.0 (* a b)) (* x 2.0)) (- (* x 2.0) (* 9.0 (* y (* t z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2e-69) || !(b <= 1.95e+118)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (y * (t * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-2d-69)) .or. (.not. (b <= 1.95d+118))) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (y * (t * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2e-69) || !(b <= 1.95e+118)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (y * (t * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -2e-69) or not (b <= 1.95e+118): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (y * (t * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2e-69) || !(b <= 1.95e+118)) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -2e-69) || ~((b <= 1.95e+118)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (y * (t * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2e-69], N[Not[LessEqual[b, 1.95e+118]], $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[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{-69} \lor \neg \left(b \leq 1.95 \cdot 10^{+118}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\end{array}
\end{array}
if b < -1.9999999999999999e-69 or 1.95e118 < b Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*93.6%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in y around 0 73.7%
if -1.9999999999999999e-69 < b < 1.95e118Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*96.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in a around 0 75.9%
pow135.0%
Applied egg-rr75.9%
unpow135.0%
*-commutative35.0%
associate-*l*39.0%
*-commutative39.0%
Simplified77.9%
Final simplification75.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.6e+54)
(+ (* a (* 27.0 b)) (* y (* t (* -9.0 z))))
(if (<= y 6.2e-116)
(+ (* 27.0 (* a b)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* y z)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e+54) {
tmp = (a * (27.0 * b)) + (y * (t * (-9.0 * z)));
} else if (y <= 6.2e-116) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.6d+54)) then
tmp = (a * (27.0d0 * b)) + (y * (t * ((-9.0d0) * z)))
else if (y <= 6.2d-116) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6e+54) {
tmp = (a * (27.0 * b)) + (y * (t * (-9.0 * z)));
} else if (y <= 6.2e-116) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -1.6e+54: tmp = (a * (27.0 * b)) + (y * (t * (-9.0 * z))) elif y <= 6.2e-116: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.6e+54) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(y * Float64(t * Float64(-9.0 * z)))); elseif (y <= 6.2e-116) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -1.6e+54)
tmp = (a * (27.0 * b)) + (y * (t * (-9.0 * z)));
elseif (y <= 6.2e-116)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.6e+54], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-116], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+54}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + y \cdot \left(t \cdot \left(-9 \cdot z\right)\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-116}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if y < -1.6e54Initial program 82.3%
sub-neg82.3%
sub-neg82.3%
associate-*l*99.7%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in x around 0 71.3%
sub-neg71.3%
+-commutative71.3%
distribute-lft-neg-in71.3%
metadata-eval71.3%
*-commutative71.3%
associate-*r*88.7%
associate-*l*88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*88.7%
*-commutative88.7%
associate-*r*88.6%
*-commutative88.6%
Applied egg-rr88.6%
if -1.6e54 < y < 6.20000000000000036e-116Initial program 97.3%
sub-neg97.3%
sub-neg97.3%
associate-*l*91.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in y around 0 88.7%
if 6.20000000000000036e-116 < y Initial program 94.5%
sub-neg94.5%
sub-neg94.5%
associate-*l*96.7%
associate-*l*96.7%
Simplified96.7%
Taylor expanded in a around 0 72.9%
Final simplification82.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -1900000000000.0) (not (<= z 3.9e-22))) (* -9.0 (* y (* t z))) (+ (* 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 <= -1900000000000.0) || !(z <= 3.9e-22)) {
tmp = -9.0 * (y * (t * z));
} else {
tmp = (27.0 * (a * b)) + (x * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1900000000000.0d0)) .or. (.not. (z <= 3.9d-22))) then
tmp = (-9.0d0) * (y * (t * z))
else
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1900000000000.0) || !(z <= 3.9e-22)) {
tmp = -9.0 * (y * (t * z));
} else {
tmp = (27.0 * (a * b)) + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -1900000000000.0) or not (z <= 3.9e-22): tmp = -9.0 * (y * (t * z)) else: tmp = (27.0 * (a * b)) + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1900000000000.0) || !(z <= 3.9e-22)) tmp = Float64(-9.0 * Float64(y * Float64(t * z))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -1900000000000.0) || ~((z <= 3.9e-22)))
tmp = -9.0 * (y * (t * z));
else
tmp = (27.0 * (a * b)) + (x * 2.0);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1900000000000.0], N[Not[LessEqual[z, 3.9e-22]], $MachinePrecision]], N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1900000000000 \lor \neg \left(z \leq 3.9 \cdot 10^{-22}\right):\\
\;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -1.9e12 or 3.89999999999999998e-22 < z Initial program 87.4%
sub-neg87.4%
sub-neg87.4%
associate-*l*89.7%
associate-*l*89.7%
Simplified89.7%
Taylor expanded in y around inf 45.6%
pow145.6%
Applied egg-rr45.6%
unpow145.6%
*-commutative45.6%
associate-*l*49.1%
*-commutative49.1%
Simplified49.1%
if -1.9e12 < z < 3.89999999999999998e-22Initial program 99.1%
sub-neg99.1%
sub-neg99.1%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 82.2%
Final simplification66.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (* a (* 27.0 b)) (- (* x 2.0) (* 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) {
return (a * (27.0 * b)) + ((x * 2.0) - (z * (t * (y * 9.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 = (a * (27.0d0 * b)) + ((x * 2.0d0) - (z * (t * (y * 9.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 (a * (27.0 * b)) + ((x * 2.0) - (z * (t * (y * 9.0))));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return (a * (27.0 * b)) + ((x * 2.0) - (z * (t * (y * 9.0))))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(z * Float64(t * Float64(y * 9.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 = (a * (27.0 * b)) + ((x * 2.0) - (z * (t * (y * 9.0))));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $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])\\
\\
a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - z \cdot \left(t \cdot \left(y \cdot 9\right)\right)\right)
\end{array}
Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in y around 0 93.8%
*-commutative93.8%
associate-*l*93.4%
*-commutative93.4%
associate-*r*93.4%
*-commutative93.4%
associate-*r*95.3%
*-commutative95.3%
Simplified95.3%
Final simplification95.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 (+ (- (* x 2.0) (* (* t z) (* y 9.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) {
return ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - ((t * z) * (y * 9.0d0))) + (a * (27.0d0 * b))
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(t * z) * Float64(y * 9.0))) + Float64(a * Float64(27.0 * b))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(t * z), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - \left(t \cdot z\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Final simplification94.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
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.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in x around inf 31.3%
Final simplification31.3%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024050
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))