
(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 (<= (* (* y 9.0) z) 2e+219) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0))))) (* z (+ (fma 2.0 (/ x z) (* 27.0 (* a (/ b z)))) (* -9.0 (* y t))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * 9.0) * z) <= 2e+219) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
} else {
tmp = z * (fma(2.0, (x / z), (27.0 * (a * (b / z)))) + (-9.0 * (y * t)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * 9.0) * z) <= 2e+219) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); else tmp = Float64(z * Float64(fma(2.0, Float64(x / z), Float64(27.0 * Float64(a * Float64(b / z)))) + Float64(-9.0 * Float64(y * t)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], 2e+219], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(2.0 * N[(x / z), $MachinePrecision] + N[(27.0 * N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 2 \cdot 10^{+219}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\mathsf{fma}\left(2, \frac{x}{z}, 27 \cdot \left(a \cdot \frac{b}{z}\right)\right) + -9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1.99999999999999993e219Initial program 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-*r*96.2%
distribute-lft-neg-in96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-+r-96.2%
associate-*l*96.1%
fma-define96.6%
cancel-sign-sub-inv96.6%
fma-define96.6%
distribute-lft-neg-in96.6%
distribute-rgt-neg-in96.6%
*-commutative96.6%
associate-*r*95.7%
associate-*l*95.7%
neg-mul-195.7%
associate-*r*95.7%
Simplified95.7%
if 1.99999999999999993e219 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 69.6%
sub-neg69.6%
sub-neg69.6%
associate-*l*95.2%
associate-*l*95.2%
Simplified95.2%
+-commutative95.2%
associate-+r-95.2%
associate-*r*95.2%
*-commutative95.2%
associate-*l*95.3%
associate-*l*95.5%
associate-*r*95.4%
Applied egg-rr95.4%
Taylor expanded in z around inf 95.3%
cancel-sign-sub-inv95.3%
fma-define95.3%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification96.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* y 9.0) z)))
(if (<= t_1 2e+219)
(+ (- (* x 2.0) (* t_1 t)) (* b (* a 27.0)))
(* z (+ (fma 2.0 (/ x z) (* 27.0 (* a (/ b z)))) (* -9.0 (* y t)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 2e+219) {
tmp = ((x * 2.0) - (t_1 * t)) + (b * (a * 27.0));
} else {
tmp = z * (fma(2.0, (x / z), (27.0 * (a * (b / z)))) + (-9.0 * (y * t)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(y * 9.0) * z) tmp = 0.0 if (t_1 <= 2e+219) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(b * Float64(a * 27.0))); else tmp = Float64(z * Float64(fma(2.0, Float64(x / z), Float64(27.0 * Float64(a * Float64(b / z)))) + Float64(-9.0 * Float64(y * t)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+219], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(2.0 * N[(x / z), $MachinePrecision] + N[(27.0 * N[(a * N[(b / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+219}:\\
\;\;\;\;\left(x \cdot 2 - t\_1 \cdot t\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\mathsf{fma}\left(2, \frac{x}{z}, 27 \cdot \left(a \cdot \frac{b}{z}\right)\right) + -9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1.99999999999999993e219Initial program 95.3%
if 1.99999999999999993e219 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 69.6%
sub-neg69.6%
sub-neg69.6%
associate-*l*95.2%
associate-*l*95.2%
Simplified95.2%
+-commutative95.2%
associate-+r-95.2%
associate-*r*95.2%
*-commutative95.2%
associate-*l*95.3%
associate-*l*95.5%
associate-*r*95.4%
Applied egg-rr95.4%
Taylor expanded in z around inf 95.3%
cancel-sign-sub-inv95.3%
fma-define95.3%
associate-/l*99.9%
metadata-eval99.9%
Simplified99.9%
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 -3.5e-45) (* y (+ (fma 2.0 (/ x y) (* 27.0 (* a (/ b y)))) (* -9.0 (* z t)))) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* 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 <= -3.5e-45) {
tmp = y * (fma(2.0, (x / y), (27.0 * (a * (b / y)))) + (-9.0 * (z * t)));
} else {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (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 <= -3.5e-45) tmp = Float64(y * Float64(fma(2.0, Float64(x / y), Float64(27.0 * Float64(a * Float64(b / y)))) + Float64(-9.0 * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(b * Float64(a * 27.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, -3.5e-45], N[(y * N[(N[(2.0 * N[(x / y), $MachinePrecision] + N[(27.0 * N[(a * N[(b / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $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 -3.5 \cdot 10^{-45}:\\
\;\;\;\;y \cdot \left(\mathsf{fma}\left(2, \frac{x}{y}, 27 \cdot \left(a \cdot \frac{b}{y}\right)\right) + -9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -3.5e-45Initial program 88.4%
sub-neg88.4%
sub-neg88.4%
associate-*l*92.8%
associate-*l*92.9%
Simplified92.9%
+-commutative92.9%
associate-+r-92.9%
associate-*r*92.8%
*-commutative92.8%
associate-*l*92.8%
associate-*l*92.9%
associate-*r*92.8%
Applied egg-rr92.8%
Taylor expanded in y around inf 78.4%
cancel-sign-sub-inv78.4%
fma-define78.4%
associate-/l*73.8%
metadata-eval73.8%
Simplified73.8%
if -3.5e-45 < z Initial program 95.4%
Final simplification88.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= a -7.7e+93)
(* a (* 27.0 b))
(if (<= a -5.4e-186)
(* t (* z (* y -9.0)))
(if (<= a 1.85e-203)
(* x 2.0)
(if (<= a 2.25e-181)
(* -9.0 (* t (* y z)))
(if (<= a 2.5e-82) (* x 2.0) (* 27.0 (* a b))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -7.7e+93) {
tmp = a * (27.0 * b);
} else if (a <= -5.4e-186) {
tmp = t * (z * (y * -9.0));
} else if (a <= 1.85e-203) {
tmp = x * 2.0;
} else if (a <= 2.25e-181) {
tmp = -9.0 * (t * (y * z));
} else if (a <= 2.5e-82) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-7.7d+93)) then
tmp = a * (27.0d0 * b)
else if (a <= (-5.4d-186)) then
tmp = t * (z * (y * (-9.0d0)))
else if (a <= 1.85d-203) then
tmp = x * 2.0d0
else if (a <= 2.25d-181) then
tmp = (-9.0d0) * (t * (y * z))
else if (a <= 2.5d-82) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -7.7e+93) {
tmp = a * (27.0 * b);
} else if (a <= -5.4e-186) {
tmp = t * (z * (y * -9.0));
} else if (a <= 1.85e-203) {
tmp = x * 2.0;
} else if (a <= 2.25e-181) {
tmp = -9.0 * (t * (y * z));
} else if (a <= 2.5e-82) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if a <= -7.7e+93: tmp = a * (27.0 * b) elif a <= -5.4e-186: tmp = t * (z * (y * -9.0)) elif a <= 1.85e-203: tmp = x * 2.0 elif a <= 2.25e-181: tmp = -9.0 * (t * (y * z)) elif a <= 2.5e-82: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -7.7e+93) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= -5.4e-186) tmp = Float64(t * Float64(z * Float64(y * -9.0))); elseif (a <= 1.85e-203) tmp = Float64(x * 2.0); elseif (a <= 2.25e-181) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (a <= 2.5e-82) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -7.7e+93)
tmp = a * (27.0 * b);
elseif (a <= -5.4e-186)
tmp = t * (z * (y * -9.0));
elseif (a <= 1.85e-203)
tmp = x * 2.0;
elseif (a <= 2.25e-181)
tmp = -9.0 * (t * (y * z));
elseif (a <= 2.5e-82)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -7.7e+93], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5.4e-186], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.85e-203], N[(x * 2.0), $MachinePrecision], If[LessEqual[a, 2.25e-181], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.5e-82], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.7 \cdot 10^{+93}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq -5.4 \cdot 10^{-186}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{-203}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-181}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-82}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -7.70000000000000004e93Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*95.2%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in a around inf 79.7%
associate-*r*79.8%
*-commutative79.8%
associate-*r*79.8%
Simplified79.8%
if -7.70000000000000004e93 < a < -5.3999999999999998e-186Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*94.8%
associate-*l*94.7%
Simplified94.7%
+-commutative94.7%
associate-+r-94.7%
associate-*r*94.8%
*-commutative94.8%
associate-*l*94.8%
associate-*l*95.0%
associate-*r*95.0%
Applied egg-rr95.0%
Taylor expanded in y around inf 45.9%
*-commutative45.9%
associate-*l*45.9%
*-commutative45.9%
associate-*l*45.9%
Simplified45.9%
if -5.3999999999999998e-186 < a < 1.85000000000000001e-203 or 2.2499999999999999e-181 < a < 2.4999999999999999e-82Initial program 89.9%
sub-neg89.9%
sub-neg89.9%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in x around inf 50.5%
if 1.85000000000000001e-203 < a < 2.2499999999999999e-181Initial program 68.0%
sub-neg68.0%
sub-neg68.0%
associate-*l*99.5%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in y around inf 35.3%
if 2.4999999999999999e-82 < a Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*96.1%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around inf 59.8%
Final simplification57.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* y z)))))
(if (<= a -7.5e+93)
(* a (* 27.0 b))
(if (<= a -2.75e-188)
t_1
(if (<= a 2.6e-202)
(* x 2.0)
(if (<= a 1.95e-181)
t_1
(if (<= a 5.8e-78) (* 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 t_1 = -9.0 * (t * (y * z));
double tmp;
if (a <= -7.5e+93) {
tmp = a * (27.0 * b);
} else if (a <= -2.75e-188) {
tmp = t_1;
} else if (a <= 2.6e-202) {
tmp = x * 2.0;
} else if (a <= 1.95e-181) {
tmp = t_1;
} else if (a <= 5.8e-78) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (y * z))
if (a <= (-7.5d+93)) then
tmp = a * (27.0d0 * b)
else if (a <= (-2.75d-188)) then
tmp = t_1
else if (a <= 2.6d-202) then
tmp = x * 2.0d0
else if (a <= 1.95d-181) then
tmp = t_1
else if (a <= 5.8d-78) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double tmp;
if (a <= -7.5e+93) {
tmp = a * (27.0 * b);
} else if (a <= -2.75e-188) {
tmp = t_1;
} else if (a <= 2.6e-202) {
tmp = x * 2.0;
} else if (a <= 1.95e-181) {
tmp = t_1;
} else if (a <= 5.8e-78) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (y * z)) tmp = 0 if a <= -7.5e+93: tmp = a * (27.0 * b) elif a <= -2.75e-188: tmp = t_1 elif a <= 2.6e-202: tmp = x * 2.0 elif a <= 1.95e-181: tmp = t_1 elif a <= 5.8e-78: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (a <= -7.5e+93) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= -2.75e-188) tmp = t_1; elseif (a <= 2.6e-202) tmp = Float64(x * 2.0); elseif (a <= 1.95e-181) tmp = t_1; elseif (a <= 5.8e-78) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (y * z));
tmp = 0.0;
if (a <= -7.5e+93)
tmp = a * (27.0 * b);
elseif (a <= -2.75e-188)
tmp = t_1;
elseif (a <= 2.6e-202)
tmp = x * 2.0;
elseif (a <= 1.95e-181)
tmp = t_1;
elseif (a <= 5.8e-78)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.5e+93], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.75e-188], t$95$1, If[LessEqual[a, 2.6e-202], N[(x * 2.0), $MachinePrecision], If[LessEqual[a, 1.95e-181], t$95$1, If[LessEqual[a, 5.8e-78], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;a \leq -7.5 \cdot 10^{+93}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq -2.75 \cdot 10^{-188}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-202}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{-181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-78}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -7.5000000000000002e93Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*95.2%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in a around inf 79.7%
associate-*r*79.8%
*-commutative79.8%
associate-*r*79.8%
Simplified79.8%
if -7.5000000000000002e93 < a < -2.7500000000000001e-188 or 2.60000000000000009e-202 < a < 1.95e-181Initial program 93.5%
sub-neg93.5%
sub-neg93.5%
associate-*l*95.0%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in y around inf 45.4%
if -2.7500000000000001e-188 < a < 2.60000000000000009e-202 or 1.95e-181 < a < 5.8000000000000001e-78Initial program 90.1%
sub-neg90.1%
sub-neg90.1%
associate-*l*95.0%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in x around inf 51.3%
if 5.8000000000000001e-78 < a Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*96.1%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around inf 60.4%
Final simplification58.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 (<= z -5.8e+79) (* y (+ (* -9.0 (* z t)) (+ (* 2.0 (/ x y)) (* (* a 27.0) (/ b y))))) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* 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 <= -5.8e+79) {
tmp = y * ((-9.0 * (z * t)) + ((2.0 * (x / y)) + ((a * 27.0) * (b / y))));
} else {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (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 <= (-5.8d+79)) then
tmp = y * (((-9.0d0) * (z * t)) + ((2.0d0 * (x / y)) + ((a * 27.0d0) * (b / y))))
else
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (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 <= -5.8e+79) {
tmp = y * ((-9.0 * (z * t)) + ((2.0 * (x / y)) + ((a * 27.0) * (b / y))));
} else {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (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 <= -5.8e+79: tmp = y * ((-9.0 * (z * t)) + ((2.0 * (x / y)) + ((a * 27.0) * (b / y)))) else: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (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 <= -5.8e+79) tmp = Float64(y * Float64(Float64(-9.0 * Float64(z * t)) + Float64(Float64(2.0 * Float64(x / y)) + Float64(Float64(a * 27.0) * Float64(b / y))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + 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 <= -5.8e+79)
tmp = y * ((-9.0 * (z * t)) + ((2.0 * (x / y)) + ((a * 27.0) * (b / y))));
else
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (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, -5.8e+79], N[(y * N[(N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * N[(b / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $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 -5.8 \cdot 10^{+79}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right) + \left(2 \cdot \frac{x}{y} + \left(a \cdot 27\right) \cdot \frac{b}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -5.79999999999999984e79Initial program 85.0%
sub-neg85.0%
sub-neg85.0%
associate-*l*91.3%
associate-*l*91.3%
Simplified91.3%
+-commutative91.3%
associate-+r-91.3%
associate-*r*91.3%
*-commutative91.3%
associate-*l*91.3%
associate-*l*91.4%
associate-*r*91.3%
Applied egg-rr91.3%
Taylor expanded in y around inf 81.8%
cancel-sign-sub-inv81.8%
fma-define81.8%
associate-/l*76.7%
metadata-eval76.7%
Simplified76.7%
fma-undefine76.7%
associate-*r*76.7%
Applied egg-rr76.7%
if -5.79999999999999984e79 < z Initial program 95.5%
Final simplification91.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
(let* ((t_1 (+ (* x 2.0) (* 27.0 (* a b)))))
(if (<= t 4e+64)
t_1
(if (<= t 4.5e+107)
(* -9.0 (* y (* z t)))
(if (<= t 1.85e+161) 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 = (x * 2.0) + (27.0 * (a * b));
double tmp;
if (t <= 4e+64) {
tmp = t_1;
} else if (t <= 4.5e+107) {
tmp = -9.0 * (y * (z * t));
} else if (t <= 1.85e+161) {
tmp = t_1;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 2.0d0) + (27.0d0 * (a * b))
if (t <= 4d+64) then
tmp = t_1
else if (t <= 4.5d+107) then
tmp = (-9.0d0) * (y * (z * t))
else if (t <= 1.85d+161) then
tmp = t_1
else
tmp = (-9.0d0) * (t * (y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) + (27.0 * (a * b));
double tmp;
if (t <= 4e+64) {
tmp = t_1;
} else if (t <= 4.5e+107) {
tmp = -9.0 * (y * (z * t));
} else if (t <= 1.85e+161) {
tmp = t_1;
} else {
tmp = -9.0 * (t * (y * z));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) + (27.0 * (a * b)) tmp = 0 if t <= 4e+64: tmp = t_1 elif t <= 4.5e+107: tmp = -9.0 * (y * (z * t)) elif t <= 1.85e+161: tmp = t_1 else: tmp = -9.0 * (t * (y * z)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))) tmp = 0.0 if (t <= 4e+64) tmp = t_1; elseif (t <= 4.5e+107) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (t <= 1.85e+161) tmp = t_1; else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) + (27.0 * (a * b));
tmp = 0.0;
if (t <= 4e+64)
tmp = t_1;
elseif (t <= 4.5e+107)
tmp = -9.0 * (y * (z * t));
elseif (t <= 1.85e+161)
tmp = t_1;
else
tmp = -9.0 * (t * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 4e+64], t$95$1, If[LessEqual[t, 4.5e+107], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.85e+161], t$95$1, N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;t \leq 4 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+107}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{+161}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < 4.00000000000000009e64 or 4.5e107 < t < 1.8499999999999999e161Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*96.6%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in y around 0 74.1%
if 4.00000000000000009e64 < t < 4.5e107Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*84.1%
associate-*l*84.1%
Simplified84.1%
+-commutative84.1%
associate-+r-84.1%
associate-*r*84.1%
*-commutative84.1%
associate-*l*84.1%
associate-*l*83.8%
associate-*r*84.1%
Applied egg-rr84.1%
Taylor expanded in y around inf 83.5%
cancel-sign-sub-inv83.5%
fma-define83.5%
associate-/l*83.8%
metadata-eval83.8%
Simplified83.8%
Taylor expanded in y around inf 83.4%
*-commutative83.4%
associate-*l*67.5%
*-commutative67.5%
Simplified67.5%
if 1.8499999999999999e161 < t Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*84.8%
associate-*l*84.8%
Simplified84.8%
Taylor expanded in y around inf 64.0%
Final simplification73.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.12e+32) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* 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 <= -1.12e+32) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (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 <= (-1.12d+32)) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (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 <= -1.12e+32) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (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 <= -1.12e+32: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (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 <= -1.12e+32) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + 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 <= -1.12e+32)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (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, -1.12e+32], 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[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $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 -1.12 \cdot 10^{+32}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -1.12000000000000007e32Initial program 85.8%
sub-neg85.8%
sub-neg85.8%
associate-*l*91.2%
associate-*l*91.2%
Simplified91.2%
if -1.12000000000000007e32 < z Initial program 95.7%
Final simplification94.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.12e+110) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (- (* 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 (z <= 1.12e+110) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} 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 (z <= 1.12d+110) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
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 (z <= 1.12e+110) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} 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 z <= 1.12e+110: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) 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 (z <= 1.12e+110) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); 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 (z <= 1.12e+110)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
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[z, 1.12e+110], 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[(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}\;z \leq 1.12 \cdot 10^{+110}:\\
\;\;\;\;\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}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 1.1200000000000001e110Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
if 1.1200000000000001e110 < z Initial program 81.6%
sub-neg81.6%
sub-neg81.6%
associate-*l*84.3%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in a around 0 72.5%
Final simplification94.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 (<= a -7.5e+93) (not (<= a 6.5e-117))) (+ (* x 2.0) (* 27.0 (* a b))) (- (* 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 ((a <= -7.5e+93) || !(a <= 6.5e-117)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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 ((a <= (-7.5d+93)) .or. (.not. (a <= 6.5d-117))) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
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 ((a <= -7.5e+93) || !(a <= 6.5e-117)) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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 (a <= -7.5e+93) or not (a <= 6.5e-117): tmp = (x * 2.0) + (27.0 * (a * b)) 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 ((a <= -7.5e+93) || !(a <= 6.5e-117)) 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(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 ((a <= -7.5e+93) || ~((a <= 6.5e-117)))
tmp = (x * 2.0) + (27.0 * (a * b));
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[a, -7.5e+93], N[Not[LessEqual[a, 6.5e-117]], $MachinePrecision]], 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[(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}\;a \leq -7.5 \cdot 10^{+93} \lor \neg \left(a \leq 6.5 \cdot 10^{-117}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if a < -7.5000000000000002e93 or 6.5000000000000001e-117 < a Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*96.0%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in y around 0 81.8%
if -7.5000000000000002e93 < a < 6.5000000000000001e-117Initial program 91.4%
sub-neg91.4%
sub-neg91.4%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 77.8%
Final simplification80.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 (let* ((t_1 (* 27.0 (* a b)))) (if (<= t 1.7e+46) (+ (* x 2.0) t_1) (- 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 (t <= 1.7e+46) {
tmp = (x * 2.0) + t_1;
} 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 (t <= 1.7d+46) then
tmp = (x * 2.0d0) + t_1
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 (t <= 1.7e+46) {
tmp = (x * 2.0) + t_1;
} 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 t <= 1.7e+46: tmp = (x * 2.0) + t_1 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 (t <= 1.7e+46) tmp = Float64(Float64(x * 2.0) + t_1); 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 (t <= 1.7e+46)
tmp = (x * 2.0) + t_1;
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[t, 1.7e+46], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $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}\;t \leq 1.7 \cdot 10^{+46}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if t < 1.6999999999999999e46Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in y around 0 74.8%
if 1.6999999999999999e46 < t Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*85.7%
associate-*l*85.7%
Simplified85.7%
Taylor expanded in x around 0 91.1%
Final simplification76.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 (<= a -3.5e+72) (not (<= a 4e-85))) (* 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 <= -3.5e+72) || !(a <= 4e-85)) {
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 <= (-3.5d+72)) .or. (.not. (a <= 4d-85))) 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 <= -3.5e+72) || !(a <= 4e-85)) {
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 <= -3.5e+72) or not (a <= 4e-85): 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 <= -3.5e+72) || !(a <= 4e-85)) 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 <= -3.5e+72) || ~((a <= 4e-85)))
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, -3.5e+72], N[Not[LessEqual[a, 4e-85]], $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 -3.5 \cdot 10^{+72} \lor \neg \left(a \leq 4 \cdot 10^{-85}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -3.5000000000000001e72 or 3.9999999999999999e-85 < a Initial program 94.5%
sub-neg94.5%
sub-neg94.5%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around inf 63.8%
if -3.5000000000000001e72 < a < 3.9999999999999999e-85Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around inf 46.1%
Final simplification56.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 (<= a -2.4e+72) (* a (* 27.0 b)) (if (<= a 2.8e-80) (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.4e+72) {
tmp = a * (27.0 * b);
} else if (a <= 2.8e-80) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-2.4d+72)) then
tmp = a * (27.0d0 * b)
else if (a <= 2.8d-80) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.4e+72) {
tmp = a * (27.0 * b);
} else if (a <= 2.8e-80) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if a <= -2.4e+72: tmp = a * (27.0 * b) elif a <= 2.8e-80: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.4e+72) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= 2.8e-80) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -2.4e+72)
tmp = a * (27.0 * b);
elseif (a <= 2.8e-80)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.4e+72], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e-80], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+72}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-80}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -2.4000000000000001e72Initial program 94.1%
sub-neg94.1%
sub-neg94.1%
associate-*l*95.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in a around inf 71.1%
associate-*r*71.1%
*-commutative71.1%
associate-*r*71.1%
Simplified71.1%
if -2.4000000000000001e72 < a < 2.79999999999999989e-80Initial program 91.3%
sub-neg91.3%
sub-neg91.3%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around inf 45.3%
if 2.79999999999999989e-80 < a Initial program 94.7%
sub-neg94.7%
sub-neg94.7%
associate-*l*96.1%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around inf 59.8%
Final simplification55.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* 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.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in x around inf 29.8%
Final simplification29.8%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024101
(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)))