
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -5e+172) (* y (- (+ (* 2.0 (/ x y)) (* 27.0 (/ (* a b) y))) (* 9.0 (* t z)))) (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);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -5e+172) {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (t * z)));
} 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]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -5e+172) tmp = Float64(y * Float64(Float64(Float64(2.0 * Float64(x / y)) + Float64(27.0 * Float64(Float64(a * b) / y))) - Float64(9.0 * Float64(t * z)))); 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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -5e+172], N[(y * N[(N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * z), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -5 \cdot 10^{+172}:\\
\;\;\;\;y \cdot \left(\left(2 \cdot \frac{x}{y} + 27 \cdot \frac{a \cdot b}{y}\right) - 9 \cdot \left(t \cdot z\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 (*.f64 y #s(literal 9 binary64)) < -5.0000000000000001e172Initial program 71.5%
associate-+l-71.5%
*-commutative71.5%
*-commutative71.5%
associate-*l*71.6%
associate-+l-71.6%
associate-*l*71.5%
*-commutative71.5%
*-commutative71.5%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in y around inf 97.1%
if -5.0000000000000001e172 < (*.f64 y #s(literal 9 binary64)) Initial program 93.7%
+-commutative93.7%
associate-+r-93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-*r*93.3%
distribute-lft-neg-in93.3%
*-commutative93.3%
cancel-sign-sub-inv93.3%
associate-+r-93.3%
associate-*l*93.7%
fma-define94.2%
cancel-sign-sub-inv94.2%
fma-define94.2%
*-commutative94.2%
distribute-rgt-neg-in94.2%
distribute-lft-neg-out94.2%
associate-*r*94.5%
associate-*l*94.5%
Simplified94.5%
Final simplification94.9%
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 (* t (* z -9.0))) (* b (* 27.0 a)))))
(if (<= z -2.5e-40)
t_1
(if (<= z 5.2e-58)
(+ (* 2.0 x) (* 27.0 (* a b)))
(if (<= z 350000000.0) t_1 (- (* 2.0 x) (* 9.0 (* t (* y z)))))))))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 * (t * (z * -9.0))) + (b * (27.0 * a));
double tmp;
if (z <= -2.5e-40) {
tmp = t_1;
} else if (z <= 5.2e-58) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else if (z <= 350000000.0) {
tmp = t_1;
} else {
tmp = (2.0 * x) - (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.
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 = (y * (t * (z * (-9.0d0)))) + (b * (27.0d0 * a))
if (z <= (-2.5d-40)) then
tmp = t_1
else if (z <= 5.2d-58) then
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
else if (z <= 350000000.0d0) then
tmp = t_1
else
tmp = (2.0d0 * x) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y * (t * (z * -9.0))) + (b * (27.0 * a));
double tmp;
if (z <= -2.5e-40) {
tmp = t_1;
} else if (z <= 5.2e-58) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else if (z <= 350000000.0) {
tmp = t_1;
} else {
tmp = (2.0 * x) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (y * (t * (z * -9.0))) + (b * (27.0 * a)) tmp = 0 if z <= -2.5e-40: tmp = t_1 elif z <= 5.2e-58: tmp = (2.0 * x) + (27.0 * (a * b)) elif z <= 350000000.0: tmp = t_1 else: tmp = (2.0 * x) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(y * Float64(t * Float64(z * -9.0))) + Float64(b * Float64(27.0 * a))) tmp = 0.0 if (z <= -2.5e-40) tmp = t_1; elseif (z <= 5.2e-58) tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); elseif (z <= 350000000.0) tmp = t_1; else tmp = Float64(Float64(2.0 * x) - 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (y * (t * (z * -9.0))) + (b * (27.0 * a));
tmp = 0.0;
if (z <= -2.5e-40)
tmp = t_1;
elseif (z <= 5.2e-58)
tmp = (2.0 * x) + (27.0 * (a * b));
elseif (z <= 350000000.0)
tmp = t_1;
else
tmp = (2.0 * x) - (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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e-40], t$95$1, If[LessEqual[z, 5.2e-58], N[(N[(2.0 * x), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 350000000.0], t$95$1, N[(N[(2.0 * x), $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])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(t \cdot \left(z \cdot -9\right)\right) + b \cdot \left(27 \cdot a\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-58}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 350000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -2.49999999999999982e-40 or 5.20000000000000013e-58 < z < 3.5e8Initial program 88.1%
associate-+l-88.1%
*-commutative88.1%
*-commutative88.1%
associate-*l*88.1%
associate-+l-88.1%
associate-*l*88.1%
*-commutative88.1%
*-commutative88.1%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in x around 0 71.2%
sub-neg71.2%
+-commutative71.2%
distribute-lft-neg-in71.2%
metadata-eval71.2%
*-commutative71.2%
associate-*r*76.0%
associate-*l*76.0%
*-commutative76.0%
*-commutative76.0%
associate-*l*75.9%
associate-*r*75.9%
*-commutative75.9%
Applied egg-rr75.9%
if -2.49999999999999982e-40 < z < 5.20000000000000013e-58Initial program 97.7%
associate-+l-97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.7%
associate-+l-97.7%
associate-*l*97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in y around 0 82.5%
if 3.5e8 < z Initial program 84.5%
associate-+l-84.5%
*-commutative84.5%
*-commutative84.5%
associate-*l*84.5%
associate-+l-84.5%
associate-*l*84.5%
*-commutative84.5%
*-commutative84.5%
associate-*l*92.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in a around 0 66.5%
Final simplification75.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -5e+172) (* y (- (+ (* 2.0 (/ x y)) (* 27.0 (/ (* a b) y))) (* 9.0 (* t z)))) (+ (- (* 2.0 x) (* t (* (* y 9.0) z))) (* b (* 27.0 a)))))
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) <= -5e+172) {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (t * z)));
} else {
tmp = ((2.0 * x) - (t * ((y * 9.0) * z))) + (b * (27.0 * a));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y * 9.0d0) <= (-5d+172)) then
tmp = y * (((2.0d0 * (x / y)) + (27.0d0 * ((a * b) / y))) - (9.0d0 * (t * z)))
else
tmp = ((2.0d0 * x) - (t * ((y * 9.0d0) * z))) + (b * (27.0d0 * a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -5e+172) {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (t * z)));
} else {
tmp = ((2.0 * x) - (t * ((y * 9.0) * z))) + (b * (27.0 * a));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (y * 9.0) <= -5e+172: tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (t * z))) else: tmp = ((2.0 * x) - (t * ((y * 9.0) * z))) + (b * (27.0 * a)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -5e+172) tmp = Float64(y * Float64(Float64(Float64(2.0 * Float64(x / y)) + Float64(27.0 * Float64(Float64(a * b) / y))) - Float64(9.0 * Float64(t * z)))); else tmp = Float64(Float64(Float64(2.0 * x) - Float64(t * Float64(Float64(y * 9.0) * z))) + Float64(b * Float64(27.0 * a))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((y * 9.0) <= -5e+172)
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (t * z)));
else
tmp = ((2.0 * x) - (t * ((y * 9.0) * z))) + (b * (27.0 * a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -5e+172], N[(y * N[(N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * x), $MachinePrecision] - N[(t * N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -5 \cdot 10^{+172}:\\
\;\;\;\;y \cdot \left(\left(2 \cdot \frac{x}{y} + 27 \cdot \frac{a \cdot b}{y}\right) - 9 \cdot \left(t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot x - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if (*.f64 y #s(literal 9 binary64)) < -5.0000000000000001e172Initial program 71.5%
associate-+l-71.5%
*-commutative71.5%
*-commutative71.5%
associate-*l*71.6%
associate-+l-71.6%
associate-*l*71.5%
*-commutative71.5%
*-commutative71.5%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in y around inf 97.1%
if -5.0000000000000001e172 < (*.f64 y #s(literal 9 binary64)) Initial program 93.7%
Final simplification94.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* y z)))))
(if (<= z -3.1e-40)
t_1
(if (<= z -8.5e-242)
(* 2.0 x)
(if (<= z -1.5e-293)
(* b (* 27.0 a))
(if (<= z 1e-58) (* 2.0 x) t_1))))))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 (z <= -3.1e-40) {
tmp = t_1;
} else if (z <= -8.5e-242) {
tmp = 2.0 * x;
} else if (z <= -1.5e-293) {
tmp = b * (27.0 * a);
} else if (z <= 1e-58) {
tmp = 2.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (y * z))
if (z <= (-3.1d-40)) then
tmp = t_1
else if (z <= (-8.5d-242)) then
tmp = 2.0d0 * x
else if (z <= (-1.5d-293)) then
tmp = b * (27.0d0 * a)
else if (z <= 1d-58) then
tmp = 2.0d0 * x
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (y * z));
double tmp;
if (z <= -3.1e-40) {
tmp = t_1;
} else if (z <= -8.5e-242) {
tmp = 2.0 * x;
} else if (z <= -1.5e-293) {
tmp = b * (27.0 * a);
} else if (z <= 1e-58) {
tmp = 2.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (y * z)) tmp = 0 if z <= -3.1e-40: tmp = t_1 elif z <= -8.5e-242: tmp = 2.0 * x elif z <= -1.5e-293: tmp = b * (27.0 * a) elif z <= 1e-58: tmp = 2.0 * x else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (z <= -3.1e-40) tmp = t_1; elseif (z <= -8.5e-242) tmp = Float64(2.0 * x); elseif (z <= -1.5e-293) tmp = Float64(b * Float64(27.0 * a)); elseif (z <= 1e-58) tmp = Float64(2.0 * x); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (y * z));
tmp = 0.0;
if (z <= -3.1e-40)
tmp = t_1;
elseif (z <= -8.5e-242)
tmp = 2.0 * x;
elseif (z <= -1.5e-293)
tmp = b * (27.0 * a);
elseif (z <= 1e-58)
tmp = 2.0 * x;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e-40], t$95$1, If[LessEqual[z, -8.5e-242], N[(2.0 * x), $MachinePrecision], If[LessEqual[z, -1.5e-293], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-58], N[(2.0 * x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-242}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-293}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\mathbf{elif}\;z \leq 10^{-58}:\\
\;\;\;\;2 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.10000000000000011e-40 or 1e-58 < z Initial program 86.6%
associate-+l-86.6%
*-commutative86.6%
*-commutative86.6%
associate-*l*86.6%
associate-+l-86.6%
associate-*l*86.6%
*-commutative86.6%
*-commutative86.6%
associate-*l*93.4%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in y around inf 45.3%
if -3.10000000000000011e-40 < z < -8.4999999999999997e-242 or -1.5000000000000001e-293 < z < 1e-58Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.6%
associate-+l-97.6%
associate-*l*97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.7%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in x around inf 51.5%
if -8.4999999999999997e-242 < z < -1.5000000000000001e-293Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-+l-100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 75.1%
associate-*r*75.8%
Simplified75.8%
Final simplification47.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (* -9.0 (* y z)))))
(if (<= z -5e-40)
t_1
(if (<= z -1.16e-241)
(* 2.0 x)
(if (<= z -1.9e-291)
(* b (* 27.0 a))
(if (<= z 3.4e-58) (* 2.0 x) t_1))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (-9.0 * (y * z));
double tmp;
if (z <= -5e-40) {
tmp = t_1;
} else if (z <= -1.16e-241) {
tmp = 2.0 * x;
} else if (z <= -1.9e-291) {
tmp = b * (27.0 * a);
} else if (z <= 3.4e-58) {
tmp = 2.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * ((-9.0d0) * (y * z))
if (z <= (-5d-40)) then
tmp = t_1
else if (z <= (-1.16d-241)) then
tmp = 2.0d0 * x
else if (z <= (-1.9d-291)) then
tmp = b * (27.0d0 * a)
else if (z <= 3.4d-58) then
tmp = 2.0d0 * x
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (-9.0 * (y * z));
double tmp;
if (z <= -5e-40) {
tmp = t_1;
} else if (z <= -1.16e-241) {
tmp = 2.0 * x;
} else if (z <= -1.9e-291) {
tmp = b * (27.0 * a);
} else if (z <= 3.4e-58) {
tmp = 2.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = t * (-9.0 * (y * z)) tmp = 0 if z <= -5e-40: tmp = t_1 elif z <= -1.16e-241: tmp = 2.0 * x elif z <= -1.9e-291: tmp = b * (27.0 * a) elif z <= 3.4e-58: tmp = 2.0 * x else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(-9.0 * Float64(y * z))) tmp = 0.0 if (z <= -5e-40) tmp = t_1; elseif (z <= -1.16e-241) tmp = Float64(2.0 * x); elseif (z <= -1.9e-291) tmp = Float64(b * Float64(27.0 * a)); elseif (z <= 3.4e-58) tmp = Float64(2.0 * x); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (-9.0 * (y * z));
tmp = 0.0;
if (z <= -5e-40)
tmp = t_1;
elseif (z <= -1.16e-241)
tmp = 2.0 * x;
elseif (z <= -1.9e-291)
tmp = b * (27.0 * a);
elseif (z <= 3.4e-58)
tmp = 2.0 * x;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(-9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e-40], t$95$1, If[LessEqual[z, -1.16e-241], N[(2.0 * x), $MachinePrecision], If[LessEqual[z, -1.9e-291], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e-58], N[(2.0 * x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-9 \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{-241}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-291}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-58}:\\
\;\;\;\;2 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.99999999999999965e-40 or 3.39999999999999973e-58 < z Initial program 86.6%
Taylor expanded in y around 0 86.6%
Taylor expanded in y around inf 45.3%
*-commutative45.3%
associate-*l*45.3%
associate-*l*45.3%
Simplified45.3%
Taylor expanded in y around 0 45.3%
if -4.99999999999999965e-40 < z < -1.16e-241 or -1.8999999999999999e-291 < z < 3.39999999999999973e-58Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.6%
associate-+l-97.6%
associate-*l*97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.7%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in x around inf 51.5%
if -1.16e-241 < z < -1.8999999999999999e-291Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-+l-100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 75.1%
associate-*r*75.8%
Simplified75.8%
Final simplification47.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (* y (* z -9.0)))))
(if (<= z -2.8e-40)
t_1
(if (<= z -4.8e-242)
(* 2.0 x)
(if (<= z -1.12e-290)
(* b (* 27.0 a))
(if (<= z 1.85e-58) (* 2.0 x) t_1))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (y * (z * -9.0));
double tmp;
if (z <= -2.8e-40) {
tmp = t_1;
} else if (z <= -4.8e-242) {
tmp = 2.0 * x;
} else if (z <= -1.12e-290) {
tmp = b * (27.0 * a);
} else if (z <= 1.85e-58) {
tmp = 2.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t * (y * (z * (-9.0d0)))
if (z <= (-2.8d-40)) then
tmp = t_1
else if (z <= (-4.8d-242)) then
tmp = 2.0d0 * x
else if (z <= (-1.12d-290)) then
tmp = b * (27.0d0 * a)
else if (z <= 1.85d-58) then
tmp = 2.0d0 * x
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (y * (z * -9.0));
double tmp;
if (z <= -2.8e-40) {
tmp = t_1;
} else if (z <= -4.8e-242) {
tmp = 2.0 * x;
} else if (z <= -1.12e-290) {
tmp = b * (27.0 * a);
} else if (z <= 1.85e-58) {
tmp = 2.0 * x;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = t * (y * (z * -9.0)) tmp = 0 if z <= -2.8e-40: tmp = t_1 elif z <= -4.8e-242: tmp = 2.0 * x elif z <= -1.12e-290: tmp = b * (27.0 * a) elif z <= 1.85e-58: tmp = 2.0 * x else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(y * Float64(z * -9.0))) tmp = 0.0 if (z <= -2.8e-40) tmp = t_1; elseif (z <= -4.8e-242) tmp = Float64(2.0 * x); elseif (z <= -1.12e-290) tmp = Float64(b * Float64(27.0 * a)); elseif (z <= 1.85e-58) tmp = Float64(2.0 * x); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = t * (y * (z * -9.0));
tmp = 0.0;
if (z <= -2.8e-40)
tmp = t_1;
elseif (z <= -4.8e-242)
tmp = 2.0 * x;
elseif (z <= -1.12e-290)
tmp = b * (27.0 * a);
elseif (z <= 1.85e-58)
tmp = 2.0 * x;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e-40], t$95$1, If[LessEqual[z, -4.8e-242], N[(2.0 * x), $MachinePrecision], If[LessEqual[z, -1.12e-290], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e-58], N[(2.0 * x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-242}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;z \leq -1.12 \cdot 10^{-290}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-58}:\\
\;\;\;\;2 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8e-40 or 1.8500000000000001e-58 < z Initial program 86.6%
Taylor expanded in y around 0 86.6%
Taylor expanded in y around inf 45.3%
*-commutative45.3%
associate-*l*45.3%
associate-*l*45.3%
Simplified45.3%
if -2.8e-40 < z < -4.8000000000000002e-242 or -1.12e-290 < z < 1.8500000000000001e-58Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.6%
associate-+l-97.6%
associate-*l*97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.7%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in x around inf 51.5%
if -4.8000000000000002e-242 < z < -1.12e-290Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-+l-100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 75.1%
associate-*r*75.8%
Simplified75.8%
Final simplification47.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3.4e-40)
(* y (* (* t z) -9.0))
(if (<= z -1.16e-241)
(* 2.0 x)
(if (<= z -3e-291)
(* b (* 27.0 a))
(if (<= z 4.6e-58) (* 2.0 x) (* t (* y (* z -9.0))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.4e-40) {
tmp = y * ((t * z) * -9.0);
} else if (z <= -1.16e-241) {
tmp = 2.0 * x;
} else if (z <= -3e-291) {
tmp = b * (27.0 * a);
} else if (z <= 4.6e-58) {
tmp = 2.0 * x;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.4d-40)) then
tmp = y * ((t * z) * (-9.0d0))
else if (z <= (-1.16d-241)) then
tmp = 2.0d0 * x
else if (z <= (-3d-291)) then
tmp = b * (27.0d0 * a)
else if (z <= 4.6d-58) then
tmp = 2.0d0 * x
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.4e-40) {
tmp = y * ((t * z) * -9.0);
} else if (z <= -1.16e-241) {
tmp = 2.0 * x;
} else if (z <= -3e-291) {
tmp = b * (27.0 * a);
} else if (z <= 4.6e-58) {
tmp = 2.0 * x;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3.4e-40: tmp = y * ((t * z) * -9.0) elif z <= -1.16e-241: tmp = 2.0 * x elif z <= -3e-291: tmp = b * (27.0 * a) elif z <= 4.6e-58: tmp = 2.0 * x else: tmp = t * (y * (z * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.4e-40) tmp = Float64(y * Float64(Float64(t * z) * -9.0)); elseif (z <= -1.16e-241) tmp = Float64(2.0 * x); elseif (z <= -3e-291) tmp = Float64(b * Float64(27.0 * a)); elseif (z <= 4.6e-58) tmp = Float64(2.0 * x); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -3.4e-40)
tmp = y * ((t * z) * -9.0);
elseif (z <= -1.16e-241)
tmp = 2.0 * x;
elseif (z <= -3e-291)
tmp = b * (27.0 * a);
elseif (z <= 4.6e-58)
tmp = 2.0 * x;
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.4e-40], N[(y * N[(N[(t * z), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.16e-241], N[(2.0 * x), $MachinePrecision], If[LessEqual[z, -3e-291], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e-58], N[(2.0 * x), $MachinePrecision], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-40}:\\
\;\;\;\;y \cdot \left(\left(t \cdot z\right) \cdot -9\right)\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{-241}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-291}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-58}:\\
\;\;\;\;2 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -3.39999999999999984e-40Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*84.7%
associate-+l-84.7%
associate-*l*84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*92.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in y around inf 79.6%
Taylor expanded in y around inf 45.9%
if -3.39999999999999984e-40 < z < -1.16e-241 or -3.0000000000000001e-291 < z < 4.5999999999999998e-58Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.6%
associate-+l-97.6%
associate-*l*97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.7%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in x around inf 51.5%
if -1.16e-241 < z < -3.0000000000000001e-291Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-+l-100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 75.1%
associate-*r*75.8%
Simplified75.8%
if 4.5999999999999998e-58 < z Initial program 88.2%
Taylor expanded in y around 0 88.2%
Taylor expanded in y around inf 51.4%
*-commutative51.4%
associate-*l*51.4%
associate-*l*51.4%
Simplified51.4%
Final simplification50.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.5e-40)
(* y (* z (* t -9.0)))
(if (<= z -1e-241)
(* 2.0 x)
(if (<= z -1.75e-292)
(* b (* 27.0 a))
(if (<= z 7e-59) (* 2.0 x) (* t (* y (* z -9.0))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.5e-40) {
tmp = y * (z * (t * -9.0));
} else if (z <= -1e-241) {
tmp = 2.0 * x;
} else if (z <= -1.75e-292) {
tmp = b * (27.0 * a);
} else if (z <= 7e-59) {
tmp = 2.0 * x;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.5d-40)) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= (-1d-241)) then
tmp = 2.0d0 * x
else if (z <= (-1.75d-292)) then
tmp = b * (27.0d0 * a)
else if (z <= 7d-59) then
tmp = 2.0d0 * x
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.5e-40) {
tmp = y * (z * (t * -9.0));
} else if (z <= -1e-241) {
tmp = 2.0 * x;
} else if (z <= -1.75e-292) {
tmp = b * (27.0 * a);
} else if (z <= 7e-59) {
tmp = 2.0 * x;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.5e-40: tmp = y * (z * (t * -9.0)) elif z <= -1e-241: tmp = 2.0 * x elif z <= -1.75e-292: tmp = b * (27.0 * a) elif z <= 7e-59: tmp = 2.0 * x else: tmp = t * (y * (z * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.5e-40) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= -1e-241) tmp = Float64(2.0 * x); elseif (z <= -1.75e-292) tmp = Float64(b * Float64(27.0 * a)); elseif (z <= 7e-59) tmp = Float64(2.0 * x); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.5e-40)
tmp = y * (z * (t * -9.0));
elseif (z <= -1e-241)
tmp = 2.0 * x;
elseif (z <= -1.75e-292)
tmp = b * (27.0 * a);
elseif (z <= 7e-59)
tmp = 2.0 * x;
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.5e-40], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1e-241], N[(2.0 * x), $MachinePrecision], If[LessEqual[z, -1.75e-292], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-59], N[(2.0 * x), $MachinePrecision], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-40}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-241}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-292}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-59}:\\
\;\;\;\;2 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -2.49999999999999982e-40Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*84.7%
associate-+l-84.7%
associate-*l*84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*92.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in y around inf 79.6%
Taylor expanded in y around inf 45.9%
*-commutative45.9%
*-commutative45.9%
associate-*r*45.9%
*-commutative45.9%
Simplified45.9%
if -2.49999999999999982e-40 < z < -9.9999999999999997e-242 or -1.75e-292 < z < 7.0000000000000002e-59Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.6%
associate-+l-97.6%
associate-*l*97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.7%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in x around inf 51.5%
if -9.9999999999999997e-242 < z < -1.75e-292Initial program 100.0%
associate-+l-100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-+l-100.0%
associate-*l*100.0%
*-commutative100.0%
*-commutative100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 75.1%
associate-*r*75.8%
Simplified75.8%
if 7.0000000000000002e-59 < z Initial program 88.2%
Taylor expanded in y around 0 88.2%
Taylor expanded in y around inf 51.4%
*-commutative51.4%
associate-*l*51.4%
associate-*l*51.4%
Simplified51.4%
Final simplification50.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* (* y 9.0) z) 2e+285) (+ (- (* 2.0 x) (* t (* 9.0 (* y z)))) (* b (* 27.0 a))) (* y (- (* 27.0 (/ (* a b) y)) (* 9.0 (* t z))))))
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+285) {
tmp = ((2.0 * x) - (t * (9.0 * (y * z)))) + (b * (27.0 * a));
} else {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (t * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((y * 9.0d0) * z) <= 2d+285) then
tmp = ((2.0d0 * x) - (t * (9.0d0 * (y * z)))) + (b * (27.0d0 * a))
else
tmp = y * ((27.0d0 * ((a * b) / y)) - (9.0d0 * (t * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * 9.0) * z) <= 2e+285) {
tmp = ((2.0 * x) - (t * (9.0 * (y * z)))) + (b * (27.0 * a));
} else {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (t * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if ((y * 9.0) * z) <= 2e+285: tmp = ((2.0 * x) - (t * (9.0 * (y * z)))) + (b * (27.0 * a)) else: tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (t * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * 9.0) * z) <= 2e+285) tmp = Float64(Float64(Float64(2.0 * x) - Float64(t * Float64(9.0 * Float64(y * z)))) + Float64(b * Float64(27.0 * a))); else tmp = Float64(y * Float64(Float64(27.0 * Float64(Float64(a * b) / y)) - Float64(9.0 * Float64(t * z)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (((y * 9.0) * z) <= 2e+285)
tmp = ((2.0 * x) - (t * (9.0 * (y * z)))) + (b * (27.0 * a));
else
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (t * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], 2e+285], N[(N[(N[(2.0 * x), $MachinePrecision] - N[(t * N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 2 \cdot 10^{+285}:\\
\;\;\;\;\left(2 \cdot x - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(27 \cdot \frac{a \cdot b}{y} - 9 \cdot \left(t \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 2e285Initial program 94.8%
Taylor expanded in y around 0 94.8%
if 2e285 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 50.6%
associate-+l-50.6%
*-commutative50.6%
*-commutative50.6%
associate-*l*50.6%
associate-+l-50.6%
associate-*l*50.6%
*-commutative50.6%
*-commutative50.6%
associate-*l*95.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in y around inf 95.7%
Taylor expanded in x around 0 92.0%
Final simplification94.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -2.5e-40)
(+ (* y (* t (* z -9.0))) (* b (* 27.0 a)))
(if (<= z 7.6e-59) (+ (* 2.0 x) t_1) (- t_1 (* 9.0 (* t (* y z))))))))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 <= -2.5e-40) {
tmp = (y * (t * (z * -9.0))) + (b * (27.0 * a));
} else if (z <= 7.6e-59) {
tmp = (2.0 * x) + 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.
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 <= (-2.5d-40)) then
tmp = (y * (t * (z * (-9.0d0)))) + (b * (27.0d0 * a))
else if (z <= 7.6d-59) then
tmp = (2.0d0 * x) + 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;
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 <= -2.5e-40) {
tmp = (y * (t * (z * -9.0))) + (b * (27.0 * a));
} else if (z <= 7.6e-59) {
tmp = (2.0 * x) + 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]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -2.5e-40: tmp = (y * (t * (z * -9.0))) + (b * (27.0 * a)) elif z <= 7.6e-59: tmp = (2.0 * x) + 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]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -2.5e-40) tmp = Float64(Float64(y * Float64(t * Float64(z * -9.0))) + Float64(b * Float64(27.0 * a))); elseif (z <= 7.6e-59) tmp = Float64(Float64(2.0 * x) + 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -2.5e-40)
tmp = (y * (t * (z * -9.0))) + (b * (27.0 * a));
elseif (z <= 7.6e-59)
tmp = (2.0 * x) + 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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e-40], N[(N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.6e-59], N[(N[(2.0 * x), $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])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{-40}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right) + b \cdot \left(27 \cdot a\right)\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-59}:\\
\;\;\;\;2 \cdot x + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -2.49999999999999982e-40Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*84.7%
associate-+l-84.7%
associate-*l*84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*92.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in x around 0 65.6%
sub-neg65.6%
+-commutative65.6%
distribute-lft-neg-in65.6%
metadata-eval65.6%
*-commutative65.6%
associate-*r*71.7%
associate-*l*71.7%
*-commutative71.7%
*-commutative71.7%
associate-*l*71.7%
associate-*r*71.7%
*-commutative71.7%
Applied egg-rr71.7%
if -2.49999999999999982e-40 < z < 7.59999999999999966e-59Initial program 97.7%
associate-+l-97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.7%
associate-+l-97.7%
associate-*l*97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in y around 0 82.5%
if 7.59999999999999966e-59 < z Initial program 88.2%
associate-+l-88.2%
*-commutative88.2%
*-commutative88.2%
associate-*l*88.2%
associate-+l-88.2%
associate-*l*88.2%
*-commutative88.2%
*-commutative88.2%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in x around 0 71.2%
Final simplification75.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -3.15e-40)
(* y (- (* 27.0 (/ (* a b) y)) (* 9.0 (* t z))))
(if (<= z 7e-59) (+ (* 2.0 x) t_1) (- t_1 (* 9.0 (* t (* y z))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -3.15e-40) {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (t * z)));
} else if (z <= 7e-59) {
tmp = (2.0 * x) + 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.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-3.15d-40)) then
tmp = y * ((27.0d0 * ((a * b) / y)) - (9.0d0 * (t * z)))
else if (z <= 7d-59) then
tmp = (2.0d0 * x) + 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;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -3.15e-40) {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (t * z)));
} else if (z <= 7e-59) {
tmp = (2.0 * x) + 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]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -3.15e-40: tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (t * z))) elif z <= 7e-59: tmp = (2.0 * x) + 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]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -3.15e-40) tmp = Float64(y * Float64(Float64(27.0 * Float64(Float64(a * b) / y)) - Float64(9.0 * Float64(t * z)))); elseif (z <= 7e-59) tmp = Float64(Float64(2.0 * x) + 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -3.15e-40)
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (t * z)));
elseif (z <= 7e-59)
tmp = (2.0 * x) + 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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.15e-40], N[(y * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-59], N[(N[(2.0 * x), $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])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -3.15 \cdot 10^{-40}:\\
\;\;\;\;y \cdot \left(27 \cdot \frac{a \cdot b}{y} - 9 \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-59}:\\
\;\;\;\;2 \cdot x + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -3.1500000000000001e-40Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*84.7%
associate-+l-84.7%
associate-*l*84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*92.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in y around inf 79.6%
Taylor expanded in x around 0 67.0%
if -3.1500000000000001e-40 < z < 7.0000000000000002e-59Initial program 97.7%
associate-+l-97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.7%
associate-+l-97.7%
associate-*l*97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in y around 0 82.5%
if 7.0000000000000002e-59 < z Initial program 88.2%
associate-+l-88.2%
*-commutative88.2%
*-commutative88.2%
associate-*l*88.2%
associate-+l-88.2%
associate-*l*88.2%
*-commutative88.2%
*-commutative88.2%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in x around 0 71.2%
Final simplification73.9%
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 220000000000.0) (+ (+ (* 2.0 x) (* y (* z (* t -9.0)))) (* a (* 27.0 b))) (- (* 2.0 x) (* 9.0 (* t (* y z))))))
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 <= 220000000000.0) {
tmp = ((2.0 * x) + (y * (z * (t * -9.0)))) + (a * (27.0 * b));
} else {
tmp = (2.0 * x) - (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.
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 <= 220000000000.0d0) then
tmp = ((2.0d0 * x) + (y * (z * (t * (-9.0d0))))) + (a * (27.0d0 * b))
else
tmp = (2.0d0 * x) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 220000000000.0) {
tmp = ((2.0 * x) + (y * (z * (t * -9.0)))) + (a * (27.0 * b));
} else {
tmp = (2.0 * x) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 220000000000.0: tmp = ((2.0 * x) + (y * (z * (t * -9.0)))) + (a * (27.0 * b)) else: tmp = (2.0 * x) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 220000000000.0) tmp = Float64(Float64(Float64(2.0 * x) + Float64(y * Float64(z * Float64(t * -9.0)))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(2.0 * x) - 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 220000000000.0)
tmp = ((2.0 * x) + (y * (z * (t * -9.0)))) + (a * (27.0 * b));
else
tmp = (2.0 * x) - (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 220000000000.0], N[(N[(N[(2.0 * x), $MachinePrecision] + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 220000000000:\\
\;\;\;\;\left(2 \cdot x + y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < 2.2e11Initial program 92.7%
associate-+l-92.7%
*-commutative92.7%
*-commutative92.7%
associate-*l*92.7%
associate-+l-92.7%
associate-*l*92.7%
*-commutative92.7%
*-commutative92.7%
associate-*l*95.7%
associate-*l*96.1%
Simplified96.1%
sub-neg96.1%
*-commutative96.1%
distribute-rgt-neg-in96.1%
*-commutative96.1%
distribute-lft-neg-in96.1%
metadata-eval96.1%
associate-*l*96.1%
associate-*r*95.6%
*-commutative95.6%
Applied egg-rr95.6%
if 2.2e11 < z Initial program 84.5%
associate-+l-84.5%
*-commutative84.5%
*-commutative84.5%
associate-*l*84.5%
associate-+l-84.5%
associate-*l*84.5%
*-commutative84.5%
*-commutative84.5%
associate-*l*92.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in a around 0 66.5%
Final simplification87.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4e-40)
(* y (* z (* t -9.0)))
(if (<= z 1.85e-72)
(+ (* 2.0 x) (* 27.0 (* a b)))
(- (* 2.0 x) (* 9.0 (* t (* y z)))))))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 <= -4e-40) {
tmp = y * (z * (t * -9.0));
} else if (z <= 1.85e-72) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = (2.0 * x) - (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.
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 <= (-4d-40)) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= 1.85d-72) then
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
else
tmp = (2.0d0 * x) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4e-40) {
tmp = y * (z * (t * -9.0));
} else if (z <= 1.85e-72) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = (2.0 * x) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -4e-40: tmp = y * (z * (t * -9.0)) elif z <= 1.85e-72: tmp = (2.0 * x) + (27.0 * (a * b)) else: tmp = (2.0 * x) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4e-40) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= 1.85e-72) tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(2.0 * x) - 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -4e-40)
tmp = y * (z * (t * -9.0));
elseif (z <= 1.85e-72)
tmp = (2.0 * x) + (27.0 * (a * b));
else
tmp = (2.0 * x) - (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4e-40], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e-72], N[(N[(2.0 * x), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-40}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-72}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -3.9999999999999997e-40Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*84.7%
associate-+l-84.7%
associate-*l*84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*92.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in y around inf 79.6%
Taylor expanded in y around inf 45.9%
*-commutative45.9%
*-commutative45.9%
associate-*r*45.9%
*-commutative45.9%
Simplified45.9%
if -3.9999999999999997e-40 < z < 1.8499999999999999e-72Initial program 97.7%
associate-+l-97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.7%
associate-+l-97.7%
associate-*l*97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.7%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in y around 0 82.3%
if 1.8499999999999999e-72 < z Initial program 88.3%
associate-+l-88.3%
*-commutative88.3%
*-commutative88.3%
associate-*l*88.3%
associate-+l-88.3%
associate-*l*88.3%
*-commutative88.3%
*-commutative88.3%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around 0 68.8%
Final simplification66.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.6e-40)
(* y (+ (* 2.0 (/ x y)) (* z (* t -9.0))))
(if (<= z 1.02e-69)
(+ (* 2.0 x) (* 27.0 (* a b)))
(- (* 2.0 x) (* 9.0 (* t (* y z)))))))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 <= -4.6e-40) {
tmp = y * ((2.0 * (x / y)) + (z * (t * -9.0)));
} else if (z <= 1.02e-69) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = (2.0 * x) - (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.
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 <= (-4.6d-40)) then
tmp = y * ((2.0d0 * (x / y)) + (z * (t * (-9.0d0))))
else if (z <= 1.02d-69) then
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
else
tmp = (2.0d0 * x) - (9.0d0 * (t * (y * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.6e-40) {
tmp = y * ((2.0 * (x / y)) + (z * (t * -9.0)));
} else if (z <= 1.02e-69) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = (2.0 * x) - (9.0 * (t * (y * z)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -4.6e-40: tmp = y * ((2.0 * (x / y)) + (z * (t * -9.0))) elif z <= 1.02e-69: tmp = (2.0 * x) + (27.0 * (a * b)) else: tmp = (2.0 * x) - (9.0 * (t * (y * z))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.6e-40) tmp = Float64(y * Float64(Float64(2.0 * Float64(x / y)) + Float64(z * Float64(t * -9.0)))); elseif (z <= 1.02e-69) tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(2.0 * x) - 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -4.6e-40)
tmp = y * ((2.0 * (x / y)) + (z * (t * -9.0)));
elseif (z <= 1.02e-69)
tmp = (2.0 * x) + (27.0 * (a * b));
else
tmp = (2.0 * x) - (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.6e-40], N[(y * N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e-69], N[(N[(2.0 * x), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-40}:\\
\;\;\;\;y \cdot \left(2 \cdot \frac{x}{y} + z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-69}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -4.6e-40Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*84.7%
associate-+l-84.7%
associate-*l*84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*92.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in a around 0 55.9%
Taylor expanded in y around inf 60.3%
cancel-sign-sub-inv60.3%
metadata-eval60.3%
associate-*r*60.3%
Simplified60.3%
if -4.6e-40 < z < 1.02000000000000005e-69Initial program 97.7%
associate-+l-97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.7%
associate-+l-97.7%
associate-*l*97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.7%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in y around 0 82.3%
if 1.02000000000000005e-69 < z Initial program 88.3%
associate-+l-88.3%
*-commutative88.3%
*-commutative88.3%
associate-*l*88.3%
associate-+l-88.3%
associate-*l*88.3%
*-commutative88.3%
*-commutative88.3%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around 0 68.8%
Final simplification70.9%
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 -4.6e-40) (* y (* z (* t -9.0))) (if (<= z 9.5e-58) (+ (* 2.0 x) (* 27.0 (* a b))) (* t (* y (* z -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.6e-40) {
tmp = y * (z * (t * -9.0));
} else if (z <= 9.5e-58) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.6d-40)) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= 9.5d-58) then
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.6e-40) {
tmp = y * (z * (t * -9.0));
} else if (z <= 9.5e-58) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -4.6e-40: tmp = y * (z * (t * -9.0)) elif z <= 9.5e-58: tmp = (2.0 * x) + (27.0 * (a * b)) else: tmp = t * (y * (z * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.6e-40) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= 9.5e-58) tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -4.6e-40)
tmp = y * (z * (t * -9.0));
elseif (z <= 9.5e-58)
tmp = (2.0 * x) + (27.0 * (a * b));
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.6e-40], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-58], N[(N[(2.0 * x), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-40}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-58}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -4.6e-40Initial program 84.7%
associate-+l-84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*84.7%
associate-+l-84.7%
associate-*l*84.7%
*-commutative84.7%
*-commutative84.7%
associate-*l*92.1%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in y around inf 79.6%
Taylor expanded in y around inf 45.9%
*-commutative45.9%
*-commutative45.9%
associate-*r*45.9%
*-commutative45.9%
Simplified45.9%
if -4.6e-40 < z < 9.4999999999999994e-58Initial program 97.7%
associate-+l-97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.7%
associate-+l-97.7%
associate-*l*97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.8%
associate-*l*98.8%
Simplified98.8%
Taylor expanded in y around 0 82.5%
if 9.4999999999999994e-58 < z Initial program 88.2%
Taylor expanded in y around 0 88.2%
Taylor expanded in y around inf 51.4%
*-commutative51.4%
associate-*l*51.4%
associate-*l*51.4%
Simplified51.4%
Final simplification60.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -4e+125) (not (<= a 1.5e-100))) (* 27.0 (* a b)) (* 2.0 x)))
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 <= -4e+125) || !(a <= 1.5e-100)) {
tmp = 27.0 * (a * b);
} else {
tmp = 2.0 * x;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-4d+125)) .or. (.not. (a <= 1.5d-100))) then
tmp = 27.0d0 * (a * b)
else
tmp = 2.0d0 * x
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4e+125) || !(a <= 1.5e-100)) {
tmp = 27.0 * (a * b);
} else {
tmp = 2.0 * x;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -4e+125) or not (a <= 1.5e-100): tmp = 27.0 * (a * b) else: tmp = 2.0 * x return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4e+125) || !(a <= 1.5e-100)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(2.0 * x); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -4e+125) || ~((a <= 1.5e-100)))
tmp = 27.0 * (a * b);
else
tmp = 2.0 * x;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4e+125], N[Not[LessEqual[a, 1.5e-100]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(2.0 * x), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{+125} \lor \neg \left(a \leq 1.5 \cdot 10^{-100}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x\\
\end{array}
\end{array}
if a < -3.9999999999999997e125 or 1.5e-100 < a Initial program 85.9%
associate-+l-85.9%
*-commutative85.9%
*-commutative85.9%
associate-*l*85.9%
associate-+l-85.9%
associate-*l*85.9%
*-commutative85.9%
*-commutative85.9%
associate-*l*92.2%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around inf 44.0%
if -3.9999999999999997e125 < a < 1.5e-100Initial program 94.3%
associate-+l-94.3%
*-commutative94.3%
*-commutative94.3%
associate-*l*94.3%
associate-+l-94.3%
associate-*l*94.3%
*-commutative94.3%
*-commutative94.3%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x around inf 39.4%
Final simplification41.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.1e+126) (not (<= a 2.1e-108))) (* a (* 27.0 b)) (* 2.0 x)))
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.1e+126) || !(a <= 2.1e-108)) {
tmp = a * (27.0 * b);
} else {
tmp = 2.0 * x;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.1d+126)) .or. (.not. (a <= 2.1d-108))) then
tmp = a * (27.0d0 * b)
else
tmp = 2.0d0 * x
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.1e+126) || !(a <= 2.1e-108)) {
tmp = a * (27.0 * b);
} else {
tmp = 2.0 * x;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.1e+126) or not (a <= 2.1e-108): tmp = a * (27.0 * b) else: tmp = 2.0 * x return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.1e+126) || !(a <= 2.1e-108)) tmp = Float64(a * Float64(27.0 * b)); else tmp = Float64(2.0 * x); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -1.1e+126) || ~((a <= 2.1e-108)))
tmp = a * (27.0 * b);
else
tmp = 2.0 * x;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.1e+126], N[Not[LessEqual[a, 2.1e-108]], $MachinePrecision]], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], N[(2.0 * x), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{+126} \lor \neg \left(a \leq 2.1 \cdot 10^{-108}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x\\
\end{array}
\end{array}
if a < -1.09999999999999999e126 or 2.0999999999999999e-108 < a Initial program 86.0%
associate-+l-86.0%
*-commutative86.0%
*-commutative86.0%
associate-*l*86.0%
associate-+l-86.0%
associate-*l*86.0%
*-commutative86.0%
*-commutative86.0%
associate-*l*92.3%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around inf 44.4%
associate-*r*44.5%
*-commutative44.5%
associate-*r*44.4%
Simplified44.4%
if -1.09999999999999999e126 < a < 2.0999999999999999e-108Initial program 94.3%
associate-+l-94.3%
*-commutative94.3%
*-commutative94.3%
associate-*l*94.3%
associate-+l-94.3%
associate-*l*94.3%
*-commutative94.3%
*-commutative94.3%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x around inf 39.7%
Final simplification41.9%
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.8e+125) (* b (* 27.0 a)) (if (<= a 3.5e-108) (* 2.0 x) (* a (* 27.0 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.8e+125) {
tmp = b * (27.0 * a);
} else if (a <= 3.5e-108) {
tmp = 2.0 * x;
} 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.
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.8d+125)) then
tmp = b * (27.0d0 * a)
else if (a <= 3.5d-108) then
tmp = 2.0d0 * x
else
tmp = a * (27.0d0 * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.8e+125) {
tmp = b * (27.0 * a);
} else if (a <= 3.5e-108) {
tmp = 2.0 * x;
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if a <= -1.8e+125: tmp = b * (27.0 * a) elif a <= 3.5e-108: tmp = 2.0 * x else: tmp = a * (27.0 * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.8e+125) tmp = Float64(b * Float64(27.0 * a)); elseif (a <= 3.5e-108) tmp = Float64(2.0 * x); 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -1.8e+125)
tmp = b * (27.0 * a);
elseif (a <= 3.5e-108)
tmp = 2.0 * x;
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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.8e+125], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e-108], N[(2.0 * x), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+125}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-108}:\\
\;\;\;\;2 \cdot x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if a < -1.8000000000000002e125Initial program 81.3%
associate-+l-81.3%
*-commutative81.3%
*-commutative81.3%
associate-*l*81.2%
associate-+l-81.2%
associate-*l*81.3%
*-commutative81.3%
*-commutative81.3%
associate-*l*88.8%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in a around inf 56.7%
associate-*r*56.7%
Simplified56.7%
if -1.8000000000000002e125 < a < 3.4999999999999999e-108Initial program 94.3%
associate-+l-94.3%
*-commutative94.3%
*-commutative94.3%
associate-*l*94.3%
associate-+l-94.3%
associate-*l*94.3%
*-commutative94.3%
*-commutative94.3%
associate-*l*97.1%
associate-*l*97.1%
Simplified97.1%
Taylor expanded in x around inf 39.7%
if 3.4999999999999999e-108 < a Initial program 88.1%
associate-+l-88.1%
*-commutative88.1%
*-commutative88.1%
associate-*l*88.2%
associate-+l-88.2%
associate-*l*88.1%
*-commutative88.1%
*-commutative88.1%
associate-*l*93.8%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in a around inf 39.0%
associate-*r*39.1%
*-commutative39.1%
associate-*r*39.1%
Simplified39.1%
Final simplification41.9%
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 (* 2.0 x))
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 2.0 * x;
}
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 = 2.0d0 * x
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return 2.0 * x;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return 2.0 * x
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(2.0 * x) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = 2.0 * x;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(2.0 * x), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
2 \cdot x
\end{array}
Initial program 90.5%
associate-+l-90.5%
*-commutative90.5%
*-commutative90.5%
associate-*l*90.5%
associate-+l-90.5%
associate-*l*90.5%
*-commutative90.5%
*-commutative90.5%
associate-*l*94.9%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in x around inf 31.3%
Final simplification31.3%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024115
(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)))