
(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 14 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 1e-123) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1e-123) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1e-123) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1e-123], 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[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 10^{-123}:\\
\;\;\;\;\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(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < 1.0000000000000001e-123Initial program 96.3%
+-commutative96.3%
associate-+r-96.3%
*-commutative96.3%
cancel-sign-sub-inv96.3%
associate-*r*95.7%
distribute-lft-neg-in95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-+r-95.7%
associate-*l*95.7%
fma-define96.9%
fma-neg96.9%
associate-*l*97.0%
distribute-rgt-neg-in97.0%
*-commutative97.0%
associate-*l*96.5%
*-commutative96.5%
distribute-lft-neg-in96.5%
associate-*r*96.4%
Simplified96.4%
if 1.0000000000000001e-123 < z Initial program 94.4%
+-commutative94.4%
associate-+r-94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-*r*97.8%
distribute-lft-neg-in97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-+r-97.8%
associate-*l*97.7%
fma-define97.7%
cancel-sign-sub-inv97.7%
fma-define97.7%
distribute-lft-neg-in97.7%
distribute-rgt-neg-in97.7%
*-commutative97.7%
associate-*r*94.3%
associate-*l*94.3%
neg-mul-194.3%
associate-*r*94.3%
Simplified94.3%
Final simplification95.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -7.5e+41) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.5e+41) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.5e+41) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.5e+41], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+41}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -7.50000000000000072e41Initial program 89.9%
sub-neg89.9%
sub-neg89.9%
associate-*l*87.8%
associate-*l*87.7%
Simplified87.7%
if -7.50000000000000072e41 < z Initial program 97.2%
+-commutative97.2%
associate-+r-97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-*r*96.5%
distribute-lft-neg-in96.5%
*-commutative96.5%
cancel-sign-sub-inv96.5%
associate-+r-96.5%
associate-*l*96.5%
fma-define96.5%
cancel-sign-sub-inv96.5%
fma-define96.5%
distribute-lft-neg-in96.5%
distribute-rgt-neg-in96.5%
*-commutative96.5%
associate-*r*97.2%
associate-*l*97.2%
neg-mul-197.2%
associate-*r*97.2%
Simplified97.2%
Final simplification95.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))) (t_2 (* -9.0 (* t (* z y)))))
(if (<= z -1.05e-46)
t_2
(if (<= z -1.85e-143)
t_1
(if (<= z -8.5e-240)
(* x 2.0)
(if (<= z -2.26e-293)
t_1
(if (<= z 1.45e-253)
(* x 2.0)
(if (<= z 2.55e-141) t_1 (if (<= z 1.1e-58) (* x 2.0) t_2)))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (t * (z * y));
double tmp;
if (z <= -1.05e-46) {
tmp = t_2;
} else if (z <= -1.85e-143) {
tmp = t_1;
} else if (z <= -8.5e-240) {
tmp = x * 2.0;
} else if (z <= -2.26e-293) {
tmp = t_1;
} else if (z <= 1.45e-253) {
tmp = x * 2.0;
} else if (z <= 2.55e-141) {
tmp = t_1;
} else if (z <= 1.1e-58) {
tmp = x * 2.0;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (-9.0d0) * (t * (z * y))
if (z <= (-1.05d-46)) then
tmp = t_2
else if (z <= (-1.85d-143)) then
tmp = t_1
else if (z <= (-8.5d-240)) then
tmp = x * 2.0d0
else if (z <= (-2.26d-293)) then
tmp = t_1
else if (z <= 1.45d-253) then
tmp = x * 2.0d0
else if (z <= 2.55d-141) then
tmp = t_1
else if (z <= 1.1d-58) then
tmp = x * 2.0d0
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = -9.0 * (t * (z * y));
double tmp;
if (z <= -1.05e-46) {
tmp = t_2;
} else if (z <= -1.85e-143) {
tmp = t_1;
} else if (z <= -8.5e-240) {
tmp = x * 2.0;
} else if (z <= -2.26e-293) {
tmp = t_1;
} else if (z <= 1.45e-253) {
tmp = x * 2.0;
} else if (z <= 2.55e-141) {
tmp = t_1;
} else if (z <= 1.1e-58) {
tmp = x * 2.0;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = -9.0 * (t * (z * y)) tmp = 0 if z <= -1.05e-46: tmp = t_2 elif z <= -1.85e-143: tmp = t_1 elif z <= -8.5e-240: tmp = x * 2.0 elif z <= -2.26e-293: tmp = t_1 elif z <= 1.45e-253: tmp = x * 2.0 elif z <= 2.55e-141: tmp = t_1 elif z <= 1.1e-58: tmp = x * 2.0 else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (z <= -1.05e-46) tmp = t_2; elseif (z <= -1.85e-143) tmp = t_1; elseif (z <= -8.5e-240) tmp = Float64(x * 2.0); elseif (z <= -2.26e-293) tmp = t_1; elseif (z <= 1.45e-253) tmp = Float64(x * 2.0); elseif (z <= 2.55e-141) tmp = t_1; elseif (z <= 1.1e-58) tmp = Float64(x * 2.0); else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = -9.0 * (t * (z * y));
tmp = 0.0;
if (z <= -1.05e-46)
tmp = t_2;
elseif (z <= -1.85e-143)
tmp = t_1;
elseif (z <= -8.5e-240)
tmp = x * 2.0;
elseif (z <= -2.26e-293)
tmp = t_1;
elseif (z <= 1.45e-253)
tmp = x * 2.0;
elseif (z <= 2.55e-141)
tmp = t_1;
elseif (z <= 1.1e-58)
tmp = x * 2.0;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e-46], t$95$2, If[LessEqual[z, -1.85e-143], t$95$1, If[LessEqual[z, -8.5e-240], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -2.26e-293], t$95$1, If[LessEqual[z, 1.45e-253], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.55e-141], t$95$1, If[LessEqual[z, 1.1e-58], N[(x * 2.0), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-46}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-240}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -2.26 \cdot 10^{-293}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-253}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-58}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.04999999999999994e-46 or 1.10000000000000003e-58 < z Initial program 92.7%
sub-neg92.7%
sub-neg92.7%
associate-*l*89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in y around inf 54.7%
if -1.04999999999999994e-46 < z < -1.85e-143 or -8.5e-240 < z < -2.26e-293 or 1.4499999999999999e-253 < z < 2.54999999999999989e-141Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 55.2%
if -1.85e-143 < z < -8.5e-240 or -2.26e-293 < z < 1.4499999999999999e-253 or 2.54999999999999989e-141 < z < 1.10000000000000003e-58Initial program 98.9%
sub-neg98.9%
sub-neg98.9%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 47.5%
Final simplification53.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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -9.8e-46)
(* -9.0 (* z (* y t)))
(if (<= z -1.45e-145)
t_1
(if (<= z -7.4e-240)
(* x 2.0)
(if (<= z -1.26e-292)
t_1
(if (<= z 1.45e-253)
(* x 2.0)
(if (<= z 5e-141)
t_1
(if (<= z 6.2e-60) (* 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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -9.8e-46) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -1.45e-145) {
tmp = t_1;
} else if (z <= -7.4e-240) {
tmp = x * 2.0;
} else if (z <= -1.26e-292) {
tmp = t_1;
} else if (z <= 1.45e-253) {
tmp = x * 2.0;
} else if (z <= 5e-141) {
tmp = t_1;
} else if (z <= 6.2e-60) {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-9.8d-46)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= (-1.45d-145)) then
tmp = t_1
else if (z <= (-7.4d-240)) then
tmp = x * 2.0d0
else if (z <= (-1.26d-292)) then
tmp = t_1
else if (z <= 1.45d-253) then
tmp = x * 2.0d0
else if (z <= 5d-141) then
tmp = t_1
else if (z <= 6.2d-60) then
tmp = 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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -9.8e-46) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -1.45e-145) {
tmp = t_1;
} else if (z <= -7.4e-240) {
tmp = x * 2.0;
} else if (z <= -1.26e-292) {
tmp = t_1;
} else if (z <= 1.45e-253) {
tmp = x * 2.0;
} else if (z <= 5e-141) {
tmp = t_1;
} else if (z <= 6.2e-60) {
tmp = 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): t_1 = 27.0 * (a * b) tmp = 0 if z <= -9.8e-46: tmp = -9.0 * (z * (y * t)) elif z <= -1.45e-145: tmp = t_1 elif z <= -7.4e-240: tmp = x * 2.0 elif z <= -1.26e-292: tmp = t_1 elif z <= 1.45e-253: tmp = x * 2.0 elif z <= 5e-141: tmp = t_1 elif z <= 6.2e-60: tmp = 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) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -9.8e-46) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= -1.45e-145) tmp = t_1; elseif (z <= -7.4e-240) tmp = Float64(x * 2.0); elseif (z <= -1.26e-292) tmp = t_1; elseif (z <= 1.45e-253) tmp = Float64(x * 2.0); elseif (z <= 5e-141) tmp = t_1; elseif (z <= 6.2e-60) tmp = 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)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -9.8e-46)
tmp = -9.0 * (z * (y * t));
elseif (z <= -1.45e-145)
tmp = t_1;
elseif (z <= -7.4e-240)
tmp = x * 2.0;
elseif (z <= -1.26e-292)
tmp = t_1;
elseif (z <= 1.45e-253)
tmp = x * 2.0;
elseif (z <= 5e-141)
tmp = t_1;
elseif (z <= 6.2e-60)
tmp = 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_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.8e-46], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.45e-145], t$95$1, If[LessEqual[z, -7.4e-240], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.26e-292], t$95$1, If[LessEqual[z, 1.45e-253], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 5e-141], t$95$1, If[LessEqual[z, 6.2e-60], N[(x * 2.0), $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}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -9.8 \cdot 10^{-46}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -7.4 \cdot 10^{-240}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.26 \cdot 10^{-292}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-253}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-60}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -9.8000000000000002e-46Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*90.4%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in y around inf 63.5%
pow163.5%
*-commutative63.5%
associate-*l*64.4%
Applied egg-rr64.4%
unpow164.4%
associate-*r*63.5%
*-commutative63.5%
associate-*r*67.2%
Simplified67.2%
if -9.8000000000000002e-46 < z < -1.44999999999999992e-145 or -7.4000000000000003e-240 < z < -1.25999999999999998e-292 or 1.4499999999999999e-253 < z < 4.9999999999999999e-141Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 55.2%
if -1.44999999999999992e-145 < z < -7.4000000000000003e-240 or -1.25999999999999998e-292 < z < 1.4499999999999999e-253 or 4.9999999999999999e-141 < z < 6.19999999999999976e-60Initial program 98.9%
sub-neg98.9%
sub-neg98.9%
associate-*l*99.7%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 47.5%
if 6.19999999999999976e-60 < z Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*88.0%
associate-*l*88.0%
Simplified88.0%
Taylor expanded in y around inf 45.8%
Final simplification54.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 (+ (* x 2.0) (* 27.0 (* a b)))) (t_2 (* -9.0 (* z (* y t)))))
(if (<= z -1.75e+50)
t_2
(if (<= z -0.0142)
t_1
(if (<= z -1.2e-39)
t_2
(if (<= z 5.1e-30) t_1 (* -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 t_1 = (x * 2.0) + (27.0 * (a * b));
double t_2 = -9.0 * (z * (y * t));
double tmp;
if (z <= -1.75e+50) {
tmp = t_2;
} else if (z <= -0.0142) {
tmp = t_1;
} else if (z <= -1.2e-39) {
tmp = t_2;
} else if (z <= 5.1e-30) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * 2.0d0) + (27.0d0 * (a * b))
t_2 = (-9.0d0) * (z * (y * t))
if (z <= (-1.75d+50)) then
tmp = t_2
else if (z <= (-0.0142d0)) then
tmp = t_1
else if (z <= (-1.2d-39)) then
tmp = t_2
else if (z <= 5.1d-30) then
tmp = t_1
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 t_1 = (x * 2.0) + (27.0 * (a * b));
double t_2 = -9.0 * (z * (y * t));
double tmp;
if (z <= -1.75e+50) {
tmp = t_2;
} else if (z <= -0.0142) {
tmp = t_1;
} else if (z <= -1.2e-39) {
tmp = t_2;
} else if (z <= 5.1e-30) {
tmp = t_1;
} 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): t_1 = (x * 2.0) + (27.0 * (a * b)) t_2 = -9.0 * (z * (y * t)) tmp = 0 if z <= -1.75e+50: tmp = t_2 elif z <= -0.0142: tmp = t_1 elif z <= -1.2e-39: tmp = t_2 elif z <= 5.1e-30: tmp = t_1 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) t_1 = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))) t_2 = Float64(-9.0 * Float64(z * Float64(y * t))) tmp = 0.0 if (z <= -1.75e+50) tmp = t_2; elseif (z <= -0.0142) tmp = t_1; elseif (z <= -1.2e-39) tmp = t_2; elseif (z <= 5.1e-30) tmp = t_1; 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)
t_1 = (x * 2.0) + (27.0 * (a * b));
t_2 = -9.0 * (z * (y * t));
tmp = 0.0;
if (z <= -1.75e+50)
tmp = t_2;
elseif (z <= -0.0142)
tmp = t_1;
elseif (z <= -1.2e-39)
tmp = t_2;
elseif (z <= 5.1e-30)
tmp = t_1;
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_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+50], t$95$2, If[LessEqual[z, -0.0142], t$95$1, If[LessEqual[z, -1.2e-39], t$95$2, If[LessEqual[z, 5.1e-30], t$95$1, 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}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+50}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -0.0142:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-39}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.75000000000000003e50 or -0.014200000000000001 < z < -1.20000000000000008e-39Initial program 90.8%
sub-neg90.8%
sub-neg90.8%
associate-*l*88.8%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in y around inf 69.8%
pow169.8%
*-commutative69.8%
associate-*l*70.9%
Applied egg-rr70.9%
unpow170.9%
associate-*r*69.8%
*-commutative69.8%
associate-*r*74.2%
Simplified74.2%
if -1.75000000000000003e50 < z < -0.014200000000000001 or -1.20000000000000008e-39 < z < 5.09999999999999972e-30Initial program 99.5%
sub-neg99.5%
sub-neg99.5%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 83.0%
if 5.09999999999999972e-30 < z Initial program 92.4%
sub-neg92.4%
sub-neg92.4%
associate-*l*86.6%
associate-*l*86.5%
Simplified86.5%
Taylor expanded in y around inf 48.1%
Final simplification72.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 (<= z 2.3e+75) (+ (* a (* 27.0 b)) (+ (* y (* z (* t -9.0))) (* x 2.0))) (+ (* x 2.0) (* (* t -9.0) (* 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 <= 2.3e+75) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = (x * 2.0) + ((t * -9.0) * (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 <= 2.3d+75) then
tmp = (a * (27.0d0 * b)) + ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0))
else
tmp = (x * 2.0d0) + ((t * (-9.0d0)) * (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 <= 2.3e+75) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = (x * 2.0) + ((t * -9.0) * (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 <= 2.3e+75: tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0)) else: tmp = (x * 2.0) + ((t * -9.0) * (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 <= 2.3e+75) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(t * -9.0) * 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 <= 2.3e+75)
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
else
tmp = (x * 2.0) + ((t * -9.0) * (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, 2.3e+75], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(t * -9.0), $MachinePrecision] * 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 2.3 \cdot 10^{+75}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(t \cdot -9\right) \cdot \left(z \cdot y\right)\\
\end{array}
\end{array}
if z < 2.2999999999999999e75Initial program 97.0%
sub-neg97.0%
sub-neg97.0%
associate-*l*96.2%
associate-*l*96.2%
Simplified96.2%
sub-neg96.2%
*-commutative96.2%
distribute-rgt-neg-in96.2%
*-commutative96.2%
distribute-lft-neg-in96.2%
metadata-eval96.2%
associate-*l*95.8%
associate-*r*95.8%
*-commutative95.8%
Applied egg-rr95.8%
if 2.2999999999999999e75 < z Initial program 88.1%
sub-neg88.1%
sub-neg88.1%
associate-*l*81.4%
associate-*l*81.4%
Simplified81.4%
Taylor expanded in a around 0 78.8%
cancel-sign-sub-inv78.8%
*-commutative78.8%
metadata-eval78.8%
+-commutative78.8%
associate-*r*78.8%
associate-*r*88.2%
*-commutative88.2%
Applied egg-rr88.2%
Taylor expanded in t around 0 78.8%
associate-*r*78.8%
Simplified78.8%
Final simplification93.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1e-140) (+ (* a (* 27.0 b)) (+ (* y (* z (* t -9.0))) (* x 2.0))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1e-140) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 1d-140) then
tmp = (a * (27.0d0 * b)) + ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1e-140) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1e-140: tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1e-140) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1e-140)
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1e-140], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.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 10^{-140}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 9.9999999999999998e-141Initial program 96.2%
sub-neg96.2%
sub-neg96.2%
associate-*l*95.8%
associate-*l*95.7%
Simplified95.7%
sub-neg95.7%
*-commutative95.7%
distribute-rgt-neg-in95.7%
*-commutative95.7%
distribute-lft-neg-in95.7%
metadata-eval95.7%
associate-*l*95.2%
associate-*r*95.2%
*-commutative95.2%
Applied egg-rr95.2%
if 9.9999999999999998e-141 < z Initial program 94.5%
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 (if (<= z 9e-141) (- (+ (* x 2.0) (* 27.0 (* a b))) (* y (* t (* z 9.0)))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 9e-141) {
tmp = ((x * 2.0) + (27.0 * (a * b))) - (y * (t * (z * 9.0)));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 9d-141) then
tmp = ((x * 2.0d0) + (27.0d0 * (a * b))) - (y * (t * (z * 9.0d0)))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 9e-141) {
tmp = ((x * 2.0) + (27.0 * (a * b))) - (y * (t * (z * 9.0)));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 9e-141: tmp = ((x * 2.0) + (27.0 * (a * b))) - (y * (t * (z * 9.0))) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 9e-141) tmp = Float64(Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))) - Float64(y * Float64(t * Float64(z * 9.0)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 9e-141)
tmp = ((x * 2.0) + (27.0 * (a * b))) - (y * (t * (z * 9.0)));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 9e-141], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(t * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.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 9 \cdot 10^{-141}:\\
\;\;\;\;\left(x \cdot 2 + 27 \cdot \left(a \cdot b\right)\right) - y \cdot \left(t \cdot \left(z \cdot 9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 9.0000000000000001e-141Initial program 96.2%
sub-neg96.2%
sub-neg96.2%
associate-*l*95.8%
associate-*l*95.7%
Simplified95.7%
+-commutative95.7%
associate-+r-95.7%
associate-*r*95.8%
*-commutative95.8%
associate-*l*95.8%
associate-*l*95.3%
associate-*r*95.2%
Applied egg-rr95.2%
if 9.0000000000000001e-141 < z Initial program 94.5%
Final simplification95.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 (<= z -5.2e-41) (not (<= z 4e-141))) (+ (* x 2.0) (* (* t -9.0) (* z y))) (+ (* 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 ((z <= -5.2e-41) || !(z <= 4e-141)) {
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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.2d-41)) .or. (.not. (z <= 4d-141))) then
tmp = (x * 2.0d0) + ((t * (-9.0d0)) * (z * y))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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.2e-41) || !(z <= 4e-141)) {
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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.2e-41) or not (z <= 4e-141): tmp = (x * 2.0) + ((t * -9.0) * (z * y)) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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.2e-41) || !(z <= 4e-141)) tmp = Float64(Float64(x * 2.0) + Float64(Float64(t * -9.0) * Float64(z * y))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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.2e-41) || ~((z <= 4e-141)))
tmp = (x * 2.0) + ((t * -9.0) * (z * y));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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, -5.2e-41], N[Not[LessEqual[z, 4e-141]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(t * -9.0), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-41} \lor \neg \left(z \leq 4 \cdot 10^{-141}\right):\\
\;\;\;\;x \cdot 2 + \left(t \cdot -9\right) \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -5.1999999999999999e-41 or 4.0000000000000002e-141 < z Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*90.4%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in a around 0 74.2%
cancel-sign-sub-inv74.2%
*-commutative74.2%
metadata-eval74.2%
+-commutative74.2%
associate-*r*73.7%
associate-*r*76.8%
*-commutative76.8%
Applied egg-rr76.8%
Taylor expanded in t around 0 74.2%
associate-*r*73.7%
Simplified73.7%
if -5.1999999999999999e-41 < z < 4.0000000000000002e-141Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 88.6%
Final simplification79.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.5e-41)
(+ (* x 2.0) (* z (* y (* t -9.0))))
(if (<= z 5.8e-141)
(+ (* x 2.0) (* 27.0 (* a b)))
(+ (* x 2.0) (* (* t -9.0) (* 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 <= -2.5e-41) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (z <= 5.8e-141) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + ((t * -9.0) * (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 <= (-2.5d-41)) then
tmp = (x * 2.0d0) + (z * (y * (t * (-9.0d0))))
else if (z <= 5.8d-141) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) + ((t * (-9.0d0)) * (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 <= -2.5e-41) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (z <= 5.8e-141) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) + ((t * -9.0) * (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 <= -2.5e-41: tmp = (x * 2.0) + (z * (y * (t * -9.0))) elif z <= 5.8e-141: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) + ((t * -9.0) * (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 <= -2.5e-41) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(y * Float64(t * -9.0)))); elseif (z <= 5.8e-141) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(t * -9.0) * 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 <= -2.5e-41)
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
elseif (z <= 5.8e-141)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) + ((t * -9.0) * (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, -2.5e-41], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-141], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(t * -9.0), $MachinePrecision] * 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 -2.5 \cdot 10^{-41}:\\
\;\;\;\;x \cdot 2 + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-141}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(t \cdot -9\right) \cdot \left(z \cdot y\right)\\
\end{array}
\end{array}
if z < -2.4999999999999998e-41Initial program 92.0%
sub-neg92.0%
sub-neg92.0%
associate-*l*90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in a around 0 75.8%
cancel-sign-sub-inv75.8%
*-commutative75.8%
metadata-eval75.8%
+-commutative75.8%
associate-*r*75.9%
associate-*r*79.5%
*-commutative79.5%
Applied egg-rr79.5%
if -2.4999999999999998e-41 < z < 5.7999999999999999e-141Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 88.6%
if 5.7999999999999999e-141 < z Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*90.5%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in a around 0 73.0%
cancel-sign-sub-inv73.0%
*-commutative73.0%
metadata-eval73.0%
+-commutative73.0%
associate-*r*72.0%
associate-*r*74.7%
*-commutative74.7%
Applied egg-rr74.7%
Taylor expanded in t around 0 73.0%
associate-*r*72.0%
Simplified72.0%
Final simplification80.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 (<= z -2.4e-41)
(+ (* x 2.0) (* z (* y (* t -9.0))))
(if (<= z 4.4e-141)
(+ (* x 2.0) (* 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 <= -2.4e-41) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (z <= 4.4e-141) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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 (z <= (-2.4d-41)) then
tmp = (x * 2.0d0) + (z * (y * (t * (-9.0d0))))
else if (z <= 4.4d-141) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
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 (z <= -2.4e-41) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if (z <= 4.4e-141) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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 z <= -2.4e-41: tmp = (x * 2.0) + (z * (y * (t * -9.0))) elif z <= 4.4e-141: tmp = (x * 2.0) + (27.0 * (a * b)) 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 (z <= -2.4e-41) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(y * Float64(t * -9.0)))); elseif (z <= 4.4e-141) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); 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 (z <= -2.4e-41)
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
elseif (z <= 4.4e-141)
tmp = (x * 2.0) + (27.0 * (a * b));
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[LessEqual[z, -2.4e-41], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e-141], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $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}\;z \leq -2.4 \cdot 10^{-41}:\\
\;\;\;\;x \cdot 2 + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-141}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -2.40000000000000022e-41Initial program 92.0%
sub-neg92.0%
sub-neg92.0%
associate-*l*90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in a around 0 75.8%
cancel-sign-sub-inv75.8%
*-commutative75.8%
metadata-eval75.8%
+-commutative75.8%
associate-*r*75.9%
associate-*r*79.5%
*-commutative79.5%
Applied egg-rr79.5%
if -2.40000000000000022e-41 < z < 4.40000000000000018e-141Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 88.6%
if 4.40000000000000018e-141 < z Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*90.5%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in a around 0 73.0%
Final simplification80.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 (<= a -2.2e+96) (not (<= a 5.2e+14))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.2e+96) || !(a <= 5.2e+14)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2.2d+96)) .or. (.not. (a <= 5.2d+14))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.2e+96) || !(a <= 5.2e+14)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.2e+96) or not (a <= 5.2e+14): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.2e+96) || !(a <= 5.2e+14)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -2.2e+96) || ~((a <= 5.2e+14)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.2e+96], N[Not[LessEqual[a, 5.2e+14]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{+96} \lor \neg \left(a \leq 5.2 \cdot 10^{+14}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -2.1999999999999999e96 or 5.2e14 < a Initial program 91.8%
sub-neg91.8%
sub-neg91.8%
associate-*l*92.4%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in a around inf 58.4%
if -2.1999999999999999e96 < a < 5.2e14Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in x around inf 39.5%
Final simplification47.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 (<= a -1.65e+97) (* 27.0 (* a b)) (if (<= a 41000000000000.0) (* 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 (a <= -1.65e+97) {
tmp = 27.0 * (a * b);
} else if (a <= 41000000000000.0) {
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 (a <= (-1.65d+97)) then
tmp = 27.0d0 * (a * b)
else if (a <= 41000000000000.0d0) 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 (a <= -1.65e+97) {
tmp = 27.0 * (a * b);
} else if (a <= 41000000000000.0) {
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 a <= -1.65e+97: tmp = 27.0 * (a * b) elif a <= 41000000000000.0: 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 (a <= -1.65e+97) tmp = Float64(27.0 * Float64(a * b)); elseif (a <= 41000000000000.0) 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 (a <= -1.65e+97)
tmp = 27.0 * (a * b);
elseif (a <= 41000000000000.0)
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[a, -1.65e+97], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 41000000000000.0], 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}\;a \leq -1.65 \cdot 10^{+97}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 41000000000000:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if a < -1.6500000000000001e97Initial program 90.4%
sub-neg90.4%
sub-neg90.4%
associate-*l*92.9%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in a around inf 72.6%
if -1.6500000000000001e97 < a < 4.1e13Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in x around inf 39.5%
if 4.1e13 < a Initial program 92.7%
sub-neg92.7%
sub-neg92.7%
associate-*l*92.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in a around inf 49.2%
associate-*r*49.2%
*-commutative49.2%
associate-*r*49.1%
Simplified49.1%
Final simplification47.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 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 95.6%
sub-neg95.6%
sub-neg95.6%
associate-*l*93.9%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in x around inf 32.3%
Final simplification32.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 2024053
(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)))