
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.85e-22) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (* z (- (+ (* 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 (z <= 1.85e-22) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = z * (((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 (z <= 1.85e-22) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(z * Float64(Float64(Float64(2.0 * Float64(x / z)) + Float64(27.0 * Float64(Float64(a * 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[z, 1.85e-22], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(N[(2.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / z), $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}\;z \leq 1.85 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(2 \cdot \frac{x}{z} + 27 \cdot \frac{a \cdot b}{z}\right) - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < 1.85e-22Initial program 97.3%
+-commutative97.3%
associate-+r-97.3%
*-commutative97.3%
cancel-sign-sub-inv97.3%
associate-*r*95.2%
distribute-lft-neg-in95.2%
*-commutative95.2%
cancel-sign-sub-inv95.2%
associate-+r-95.2%
associate-*l*95.1%
fma-define96.2%
fmm-def96.2%
associate-*l*96.7%
distribute-rgt-neg-in96.7%
*-commutative96.7%
associate-*l*96.7%
*-commutative96.7%
distribute-lft-neg-in96.7%
associate-*r*96.7%
Simplified96.7%
if 1.85e-22 < z Initial program 94.5%
sub-neg94.5%
sub-neg94.5%
associate-*l*89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in z around inf 98.4%
Final simplification97.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.95e+17)
(* z (* t (* y -9.0)))
(if (or (<= z -3.2e-89) (not (<= z 1.05e+27)))
(- (* x 2.0) (* 9.0 (* t (* z y))))
(+ (* x 2.0) (* 27.0 (* a b))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.95e+17) {
tmp = z * (t * (y * -9.0));
} else if ((z <= -3.2e-89) || !(z <= 1.05e+27)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.95d+17)) then
tmp = z * (t * (y * (-9.0d0)))
else if ((z <= (-3.2d-89)) .or. (.not. (z <= 1.05d+27))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.95e+17) {
tmp = z * (t * (y * -9.0));
} else if ((z <= -3.2e-89) || !(z <= 1.05e+27)) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.95e+17: tmp = z * (t * (y * -9.0)) elif (z <= -3.2e-89) or not (z <= 1.05e+27): tmp = (x * 2.0) - (9.0 * (t * (z * y))) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.95e+17) tmp = Float64(z * Float64(t * Float64(y * -9.0))); elseif ((z <= -3.2e-89) || !(z <= 1.05e+27)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.95e+17)
tmp = z * (t * (y * -9.0));
elseif ((z <= -3.2e-89) || ~((z <= 1.05e+27)))
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.95e+17], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -3.2e-89], N[Not[LessEqual[z, 1.05e+27]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+17}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-89} \lor \neg \left(z \leq 1.05 \cdot 10^{+27}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -1.95e17Initial program 92.4%
sub-neg92.4%
sub-neg92.4%
associate-*l*89.1%
associate-*l*89.0%
Simplified89.0%
Taylor expanded in y around inf 74.2%
Taylor expanded in a around 0 65.2%
Taylor expanded in z around inf 79.3%
Taylor expanded in t around inf 67.5%
*-commutative67.5%
*-commutative67.5%
*-commutative67.5%
associate-*r*67.5%
Simplified67.5%
if -1.95e17 < z < -3.19999999999999998e-89 or 1.04999999999999997e27 < z Initial program 95.0%
sub-neg95.0%
sub-neg95.0%
associate-*l*90.2%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in a around 0 72.9%
if -3.19999999999999998e-89 < z < 1.04999999999999997e27Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
associate-*r*94.8%
distribute-lft-neg-in94.8%
*-commutative94.8%
cancel-sign-sub-inv94.8%
associate-+r-94.8%
associate-*l*94.8%
fma-define94.8%
fmm-def94.8%
associate-*l*99.0%
distribute-rgt-neg-in99.0%
*-commutative99.0%
associate-*l*99.0%
*-commutative99.0%
distribute-lft-neg-in99.0%
associate-*r*99.0%
Simplified99.0%
Taylor expanded in y around 0 86.6%
Final simplification77.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.85e-22) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (* z (- (+ (* 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 (z <= 1.85e-22) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / z))) - (9.0 * (y * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 1.85d-22) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = z * (((2.0d0 * (x / z)) + (27.0d0 * ((a * b) / z))) - (9.0d0 * (y * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.85e-22) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = z * (((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]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1.85e-22: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = z * (((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 (z <= 1.85e-22) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(z * Float64(Float64(Float64(2.0 * Float64(x / z)) + Float64(27.0 * Float64(Float64(a * b) / z))) - Float64(9.0 * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1.85e-22)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / z))) - (9.0 * (y * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.85e-22], 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[(z * N[(N[(N[(2.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / z), $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}\;z \leq 1.85 \cdot 10^{-22}:\\
\;\;\;\;\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}:\\
\;\;\;\;z \cdot \left(\left(2 \cdot \frac{x}{z} + 27 \cdot \frac{a \cdot b}{z}\right) - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < 1.85e-22Initial program 97.3%
sub-neg97.3%
sub-neg97.3%
associate-*l*95.6%
associate-*l*95.6%
Simplified95.6%
if 1.85e-22 < z Initial program 94.5%
sub-neg94.5%
sub-neg94.5%
associate-*l*89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in z around inf 98.4%
Final simplification96.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3.2e-89)
(* y (- (* 2.0 (/ x y)) (* 9.0 (* z t))))
(if (<= z 1.75e-68)
(+ (* x 2.0) (* 27.0 (* a b)))
(* 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 (z <= -3.2e-89) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if (z <= 1.75e-68) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = z * ((27.0 * ((a * b) / z)) - (9.0 * (y * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.2d-89)) then
tmp = y * ((2.0d0 * (x / y)) - (9.0d0 * (z * t)))
else if (z <= 1.75d-68) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = z * ((27.0d0 * ((a * b) / z)) - (9.0d0 * (y * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.2e-89) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if (z <= 1.75e-68) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = 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]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3.2e-89: tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t))) elif z <= 1.75e-68: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = 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 (z <= -3.2e-89) tmp = Float64(y * Float64(Float64(2.0 * Float64(x / y)) - Float64(9.0 * Float64(z * t)))); elseif (z <= 1.75e-68) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(z * Float64(Float64(27.0 * Float64(Float64(a * b) / z)) - Float64(9.0 * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -3.2e-89)
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
elseif (z <= 1.75e-68)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = z * ((27.0 * ((a * b) / z)) - (9.0 * (y * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.2e-89], N[(y * N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-68], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / z), $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}\;z \leq -3.2 \cdot 10^{-89}:\\
\;\;\;\;y \cdot \left(2 \cdot \frac{x}{y} - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-68}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(27 \cdot \frac{a \cdot b}{z} - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -3.19999999999999998e-89Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around inf 78.5%
Taylor expanded in a around 0 65.8%
if -3.19999999999999998e-89 < z < 1.75000000000000006e-68Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
associate-*r*93.2%
distribute-lft-neg-in93.2%
*-commutative93.2%
cancel-sign-sub-inv93.2%
associate-+r-93.2%
associate-*l*93.2%
fma-define93.2%
fmm-def93.2%
associate-*l*98.8%
distribute-rgt-neg-in98.8%
*-commutative98.8%
associate-*l*98.8%
*-commutative98.8%
distribute-lft-neg-in98.8%
associate-*r*98.7%
Simplified98.7%
Taylor expanded in y around 0 93.5%
if 1.75000000000000006e-68 < z Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in x around 0 74.8%
Taylor expanded in z around inf 78.1%
Final simplification79.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 (* 27.0 (* a b))))
(if (<= z -6.8e-87)
(* y (- (* 2.0 (/ x y)) (* 9.0 (* z t))))
(if (<= z 5.4e-69) (+ (* x 2.0) t_1) (- t_1 (* 9.0 (* t (* z y))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -6.8e-87) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if (z <= 5.4e-69) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-6.8d-87)) then
tmp = y * ((2.0d0 * (x / y)) - (9.0d0 * (z * t)))
else if (z <= 5.4d-69) then
tmp = (x * 2.0d0) + t_1
else
tmp = t_1 - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -6.8e-87) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if (z <= 5.4e-69) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -6.8e-87: tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t))) elif z <= 5.4e-69: tmp = (x * 2.0) + t_1 else: tmp = t_1 - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -6.8e-87) tmp = Float64(y * Float64(Float64(2.0 * Float64(x / y)) - Float64(9.0 * Float64(z * t)))); elseif (z <= 5.4e-69) tmp = Float64(Float64(x * 2.0) + t_1); else tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -6.8e-87)
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
elseif (z <= 5.4e-69)
tmp = (x * 2.0) + t_1;
else
tmp = t_1 - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.8e-87], N[(y * N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e-69], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{-87}:\\
\;\;\;\;y \cdot \left(2 \cdot \frac{x}{y} - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-69}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -6.7999999999999997e-87Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around inf 78.5%
Taylor expanded in a around 0 65.8%
if -6.7999999999999997e-87 < z < 5.3999999999999995e-69Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
associate-*r*93.2%
distribute-lft-neg-in93.2%
*-commutative93.2%
cancel-sign-sub-inv93.2%
associate-+r-93.2%
associate-*l*93.2%
fma-define93.2%
fmm-def93.2%
associate-*l*98.8%
distribute-rgt-neg-in98.8%
*-commutative98.8%
associate-*l*98.8%
*-commutative98.8%
distribute-lft-neg-in98.8%
associate-*r*98.7%
Simplified98.7%
Taylor expanded in y around 0 93.5%
if 5.3999999999999995e-69 < z Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in x around 0 74.8%
Final simplification78.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.9e-87)
(* y (* z (* t -9.0)))
(if (<= z -2.75e-276)
(* a (* 27.0 b))
(if (<= z 3.7e-69) (* x 2.0) (* z (* t (* y -9.0)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.9e-87) {
tmp = y * (z * (t * -9.0));
} else if (z <= -2.75e-276) {
tmp = a * (27.0 * b);
} else if (z <= 3.7e-69) {
tmp = x * 2.0;
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.9d-87)) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= (-2.75d-276)) then
tmp = a * (27.0d0 * b)
else if (z <= 3.7d-69) then
tmp = x * 2.0d0
else
tmp = z * (t * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.9e-87) {
tmp = y * (z * (t * -9.0));
} else if (z <= -2.75e-276) {
tmp = a * (27.0 * b);
} else if (z <= 3.7e-69) {
tmp = x * 2.0;
} else {
tmp = z * (t * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.9e-87: tmp = y * (z * (t * -9.0)) elif z <= -2.75e-276: tmp = a * (27.0 * b) elif z <= 3.7e-69: tmp = x * 2.0 else: tmp = z * (t * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.9e-87) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= -2.75e-276) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 3.7e-69) tmp = Float64(x * 2.0); else tmp = Float64(z * Float64(t * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.9e-87)
tmp = y * (z * (t * -9.0));
elseif (z <= -2.75e-276)
tmp = a * (27.0 * b);
elseif (z <= 3.7e-69)
tmp = x * 2.0;
else
tmp = z * (t * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.9e-87], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.75e-276], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e-69], N[(x * 2.0), $MachinePrecision], N[(z * N[(t * N[(y * -9.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 -2.9 \cdot 10^{-87}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -2.75 \cdot 10^{-276}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-69}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -2.8999999999999999e-87Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around inf 78.5%
Taylor expanded in a around 0 65.8%
Taylor expanded in x around 0 57.6%
metadata-eval57.6%
distribute-lft-neg-in57.6%
associate-*r*57.6%
*-commutative57.6%
distribute-rgt-neg-in57.6%
distribute-lft-neg-in57.6%
metadata-eval57.6%
Simplified57.6%
if -2.8999999999999999e-87 < z < -2.74999999999999986e-276Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*96.9%
distribute-lft-neg-in96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-+r-96.9%
associate-*l*97.1%
fma-define97.1%
fmm-def97.1%
associate-*l*97.1%
distribute-rgt-neg-in97.1%
*-commutative97.1%
associate-*l*97.1%
*-commutative97.1%
distribute-lft-neg-in97.1%
associate-*r*97.1%
Simplified97.1%
Taylor expanded in y around 0 91.3%
Taylor expanded in x around 0 48.5%
associate-*r*48.5%
*-commutative48.5%
associate-*r*48.6%
Simplified48.6%
if -2.74999999999999986e-276 < z < 3.7000000000000002e-69Initial program 100.0%
+-commutative100.0%
associate-+r-100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
associate-*r*90.8%
distribute-lft-neg-in90.8%
*-commutative90.8%
cancel-sign-sub-inv90.8%
associate-+r-90.8%
associate-*l*90.7%
fma-define90.7%
fmm-def90.7%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-lft-neg-in99.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in y around 0 95.0%
Taylor expanded in x around inf 47.3%
if 3.7000000000000002e-69 < z Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around inf 80.7%
Taylor expanded in a around 0 62.4%
Taylor expanded in z around inf 73.6%
Taylor expanded in t around inf 52.7%
*-commutative52.7%
*-commutative52.7%
*-commutative52.7%
associate-*r*52.7%
Simplified52.7%
Final simplification52.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.2e-89)
(* y (* z (* t -9.0)))
(if (<= z -4.4e-276)
(* a (* 27.0 b))
(if (<= z 1.15e-73) (* x 2.0) (* -9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e-89) {
tmp = y * (z * (t * -9.0));
} else if (z <= -4.4e-276) {
tmp = a * (27.0 * b);
} else if (z <= 1.15e-73) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.2d-89)) then
tmp = y * (z * (t * (-9.0d0)))
else if (z <= (-4.4d-276)) then
tmp = a * (27.0d0 * b)
else if (z <= 1.15d-73) then
tmp = x * 2.0d0
else
tmp = (-9.0d0) * (t * (z * y))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e-89) {
tmp = y * (z * (t * -9.0));
} else if (z <= -4.4e-276) {
tmp = a * (27.0 * b);
} else if (z <= 1.15e-73) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -4.2e-89: tmp = y * (z * (t * -9.0)) elif z <= -4.4e-276: tmp = a * (27.0 * b) elif z <= 1.15e-73: tmp = x * 2.0 else: tmp = -9.0 * (t * (z * y)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.2e-89) tmp = Float64(y * Float64(z * Float64(t * -9.0))); elseif (z <= -4.4e-276) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 1.15e-73) tmp = Float64(x * 2.0); else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -4.2e-89)
tmp = y * (z * (t * -9.0));
elseif (z <= -4.4e-276)
tmp = a * (27.0 * b);
elseif (z <= 1.15e-73)
tmp = x * 2.0;
else
tmp = -9.0 * (t * (z * y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e-89], N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.4e-276], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-73], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-89}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{-276}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-73}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -4.2000000000000002e-89Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around inf 78.5%
Taylor expanded in a around 0 65.8%
Taylor expanded in x around 0 57.6%
metadata-eval57.6%
distribute-lft-neg-in57.6%
associate-*r*57.6%
*-commutative57.6%
distribute-rgt-neg-in57.6%
distribute-lft-neg-in57.6%
metadata-eval57.6%
Simplified57.6%
if -4.2000000000000002e-89 < z < -4.39999999999999961e-276Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*96.9%
distribute-lft-neg-in96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-+r-96.9%
associate-*l*97.1%
fma-define97.1%
fmm-def97.1%
associate-*l*97.1%
distribute-rgt-neg-in97.1%
*-commutative97.1%
associate-*l*97.1%
*-commutative97.1%
distribute-lft-neg-in97.1%
associate-*r*97.1%
Simplified97.1%
Taylor expanded in y around 0 91.3%
Taylor expanded in x around 0 48.5%
associate-*r*48.5%
*-commutative48.5%
associate-*r*48.6%
Simplified48.6%
if -4.39999999999999961e-276 < z < 1.14999999999999994e-73Initial program 100.0%
+-commutative100.0%
associate-+r-100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
associate-*r*90.7%
distribute-lft-neg-in90.7%
*-commutative90.7%
cancel-sign-sub-inv90.7%
associate-+r-90.7%
associate-*l*90.6%
fma-define90.6%
fmm-def90.6%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-lft-neg-in99.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in y around 0 94.9%
Taylor expanded in x around inf 48.2%
if 1.14999999999999994e-73 < z Initial program 95.4%
+-commutative95.4%
associate-+r-95.4%
*-commutative95.4%
cancel-sign-sub-inv95.4%
associate-*r*98.6%
distribute-lft-neg-in98.6%
*-commutative98.6%
cancel-sign-sub-inv98.6%
associate-+r-98.6%
associate-*l*98.6%
fma-define99.7%
fmm-def99.7%
associate-*l*92.0%
distribute-rgt-neg-in92.0%
*-commutative92.0%
associate-*l*92.1%
*-commutative92.1%
distribute-lft-neg-in92.1%
associate-*r*92.1%
Simplified92.1%
Taylor expanded in y around inf 48.9%
Final simplification51.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.6e-87)
(* y (* -9.0 (* z t)))
(if (<= z -1.45e-274)
(* a (* 27.0 b))
(if (<= z 7e-68) (* x 2.0) (* -9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.6e-87) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -1.45e-274) {
tmp = a * (27.0 * b);
} else if (z <= 7e-68) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.6d-87)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= (-1.45d-274)) then
tmp = a * (27.0d0 * b)
else if (z <= 7d-68) then
tmp = x * 2.0d0
else
tmp = (-9.0d0) * (t * (z * y))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.6e-87) {
tmp = y * (-9.0 * (z * t));
} else if (z <= -1.45e-274) {
tmp = a * (27.0 * b);
} else if (z <= 7e-68) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.6e-87: tmp = y * (-9.0 * (z * t)) elif z <= -1.45e-274: tmp = a * (27.0 * b) elif z <= 7e-68: tmp = x * 2.0 else: tmp = -9.0 * (t * (z * y)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.6e-87) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= -1.45e-274) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 7e-68) tmp = Float64(x * 2.0); else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.6e-87)
tmp = y * (-9.0 * (z * t));
elseif (z <= -1.45e-274)
tmp = a * (27.0 * b);
elseif (z <= 7e-68)
tmp = x * 2.0;
else
tmp = -9.0 * (t * (z * y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.6e-87], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.45e-274], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-68], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-87}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-274}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-68}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -2.60000000000000002e-87Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around inf 78.5%
Taylor expanded in a around 0 65.8%
Taylor expanded in x around 0 57.6%
if -2.60000000000000002e-87 < z < -1.44999999999999988e-274Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*96.9%
distribute-lft-neg-in96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-+r-96.9%
associate-*l*97.1%
fma-define97.1%
fmm-def97.1%
associate-*l*97.1%
distribute-rgt-neg-in97.1%
*-commutative97.1%
associate-*l*97.1%
*-commutative97.1%
distribute-lft-neg-in97.1%
associate-*r*97.1%
Simplified97.1%
Taylor expanded in y around 0 91.3%
Taylor expanded in x around 0 48.5%
associate-*r*48.5%
*-commutative48.5%
associate-*r*48.6%
Simplified48.6%
if -1.44999999999999988e-274 < z < 7.00000000000000026e-68Initial program 100.0%
+-commutative100.0%
associate-+r-100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
associate-*r*90.8%
distribute-lft-neg-in90.8%
*-commutative90.8%
cancel-sign-sub-inv90.8%
associate-+r-90.8%
associate-*l*90.7%
fma-define90.7%
fmm-def90.7%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-lft-neg-in99.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in y around 0 95.0%
Taylor expanded in x around inf 47.3%
if 7.00000000000000026e-68 < z Initial program 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-*r*98.5%
distribute-lft-neg-in98.5%
*-commutative98.5%
cancel-sign-sub-inv98.5%
associate-+r-98.5%
associate-*l*98.6%
fma-define99.8%
fmm-def99.8%
associate-*l*92.0%
distribute-rgt-neg-in92.0%
*-commutative92.0%
associate-*l*92.0%
*-commutative92.0%
distribute-lft-neg-in92.0%
associate-*r*92.1%
Simplified92.1%
Taylor expanded in y around inf 49.4%
Final simplification51.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* z y)))))
(if (<= z -6.6e-87)
t_1
(if (<= z -6.2e-276)
(* a (* 27.0 b))
(if (<= z 1.1e-67) (* x 2.0) t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (z <= -6.6e-87) {
tmp = t_1;
} else if (z <= -6.2e-276) {
tmp = a * (27.0 * b);
} else if (z <= 1.1e-67) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (z * y))
if (z <= (-6.6d-87)) then
tmp = t_1
else if (z <= (-6.2d-276)) then
tmp = a * (27.0d0 * b)
else if (z <= 1.1d-67) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (z <= -6.6e-87) {
tmp = t_1;
} else if (z <= -6.2e-276) {
tmp = a * (27.0 * b);
} else if (z <= 1.1e-67) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (z * y)) tmp = 0 if z <= -6.6e-87: tmp = t_1 elif z <= -6.2e-276: tmp = a * (27.0 * b) elif z <= 1.1e-67: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (z <= -6.6e-87) tmp = t_1; elseif (z <= -6.2e-276) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 1.1e-67) tmp = Float64(x * 2.0); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (z * y));
tmp = 0.0;
if (z <= -6.6e-87)
tmp = t_1;
elseif (z <= -6.2e-276)
tmp = a * (27.0 * b);
elseif (z <= 1.1e-67)
tmp = x * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e-87], t$95$1, If[LessEqual[z, -6.2e-276], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-67], N[(x * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{-87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-276}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-67}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.6000000000000001e-87 or 1.1000000000000001e-67 < z Initial program 94.8%
+-commutative94.8%
associate-+r-94.8%
*-commutative94.8%
cancel-sign-sub-inv94.8%
associate-*r*97.5%
distribute-lft-neg-in97.5%
*-commutative97.5%
cancel-sign-sub-inv97.5%
associate-+r-97.5%
associate-*l*97.5%
fma-define99.2%
fmm-def99.2%
associate-*l*93.1%
distribute-rgt-neg-in93.1%
*-commutative93.1%
associate-*l*93.1%
*-commutative93.1%
distribute-lft-neg-in93.1%
associate-*r*93.1%
Simplified93.1%
Taylor expanded in y around inf 54.1%
if -6.6000000000000001e-87 < z < -6.19999999999999978e-276Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*96.9%
distribute-lft-neg-in96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-+r-96.9%
associate-*l*97.1%
fma-define97.1%
fmm-def97.1%
associate-*l*97.1%
distribute-rgt-neg-in97.1%
*-commutative97.1%
associate-*l*97.1%
*-commutative97.1%
distribute-lft-neg-in97.1%
associate-*r*97.1%
Simplified97.1%
Taylor expanded in y around 0 91.3%
Taylor expanded in x around 0 48.5%
associate-*r*48.5%
*-commutative48.5%
associate-*r*48.6%
Simplified48.6%
if -6.19999999999999978e-276 < z < 1.1000000000000001e-67Initial program 100.0%
+-commutative100.0%
associate-+r-100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
associate-*r*90.8%
distribute-lft-neg-in90.8%
*-commutative90.8%
cancel-sign-sub-inv90.8%
associate-+r-90.8%
associate-*l*90.7%
fma-define90.7%
fmm-def90.7%
associate-*l*99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-lft-neg-in99.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in y around 0 95.0%
Taylor expanded in x around inf 47.3%
Final simplification52.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 0.2) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 0.2) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 0.2d0) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 0.2) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 0.2: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 0.2) 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(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 0.2)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 0.2], 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[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.2:\\
\;\;\;\;\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 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 0.20000000000000001Initial program 97.4%
sub-neg97.4%
sub-neg97.4%
associate-*l*95.8%
associate-*l*95.8%
Simplified95.8%
if 0.20000000000000001 < z Initial program 93.9%
Final simplification95.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.05e-86)
(* y (- (* 2.0 (/ x y)) (* 9.0 (* z t))))
(if (<= z 9e+19)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.05e-86) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if (z <= 9e+19) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.05d-86)) then
tmp = y * ((2.0d0 * (x / y)) - (9.0d0 * (z * t)))
else if (z <= 9d+19) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.05e-86) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if (z <= 9e+19) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.05e-86: tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t))) elif z <= 9e+19: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.05e-86) tmp = Float64(y * Float64(Float64(2.0 * Float64(x / y)) - Float64(9.0 * Float64(z * t)))); elseif (z <= 9e+19) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.05e-86)
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
elseif (z <= 9e+19)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.05e-86], N[(y * N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+19], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-86}:\\
\;\;\;\;y \cdot \left(2 \cdot \frac{x}{y} - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+19}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.05e-86Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around inf 78.5%
Taylor expanded in a around 0 65.8%
if -1.05e-86 < z < 9e19Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
associate-*r*94.8%
distribute-lft-neg-in94.8%
*-commutative94.8%
cancel-sign-sub-inv94.8%
associate-+r-94.8%
associate-*l*94.8%
fma-define94.8%
fmm-def94.8%
associate-*l*99.0%
distribute-rgt-neg-in99.0%
*-commutative99.0%
associate-*l*99.0%
*-commutative99.0%
distribute-lft-neg-in99.0%
associate-*r*99.0%
Simplified99.0%
Taylor expanded in y around 0 87.3%
if 9e19 < z Initial program 93.3%
sub-neg93.3%
sub-neg93.3%
associate-*l*86.8%
associate-*l*86.9%
Simplified86.9%
Taylor expanded in a around 0 73.7%
Final simplification77.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -60000.0) (not (<= z 7.5e+61))) (* z (* t (* y -9.0))) (+ (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -60000.0) || !(z <= 7.5e+61)) {
tmp = z * (t * (y * -9.0));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-60000.0d0)) .or. (.not. (z <= 7.5d+61))) then
tmp = z * (t * (y * (-9.0d0)))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -60000.0) || !(z <= 7.5e+61)) {
tmp = z * (t * (y * -9.0));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -60000.0) or not (z <= 7.5e+61): tmp = z * (t * (y * -9.0)) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -60000.0) || !(z <= 7.5e+61)) tmp = Float64(z * Float64(t * Float64(y * -9.0))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -60000.0) || ~((z <= 7.5e+61)))
tmp = z * (t * (y * -9.0));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -60000.0], N[Not[LessEqual[z, 7.5e+61]], $MachinePrecision]], N[(z * N[(t * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -60000 \lor \neg \left(z \leq 7.5 \cdot 10^{+61}\right):\\
\;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -6e4 or 7.5e61 < z Initial program 92.4%
sub-neg92.4%
sub-neg92.4%
associate-*l*87.3%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in y around inf 74.2%
Taylor expanded in a around 0 64.7%
Taylor expanded in z around inf 79.8%
Taylor expanded in t around inf 65.6%
*-commutative65.6%
*-commutative65.6%
*-commutative65.6%
associate-*r*65.7%
Simplified65.7%
if -6e4 < z < 7.5e61Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*95.1%
distribute-lft-neg-in95.1%
*-commutative95.1%
cancel-sign-sub-inv95.1%
associate-+r-95.1%
associate-*l*95.1%
fma-define95.1%
fmm-def95.1%
associate-*l*99.1%
distribute-rgt-neg-in99.1%
*-commutative99.1%
associate-*l*99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
associate-*r*99.2%
Simplified99.2%
Taylor expanded in y around 0 82.3%
Final simplification74.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (+ (* a (* 27.0 b)) (* x 2.0)) (* y (* t (* z -9.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return ((a * (27.0 * b)) + (x * 2.0)) + (y * (t * (z * -9.0)));
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((a * (27.0d0 * b)) + (x * 2.0d0)) + (y * (t * (z * (-9.0d0))))
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((a * (27.0 * b)) + (x * 2.0)) + (y * (t * (z * -9.0)));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return ((a * (27.0 * b)) + (x * 2.0)) + (y * (t * (z * -9.0)))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(a * Float64(27.0 * b)) + Float64(x * 2.0)) + Float64(y * Float64(t * Float64(z * -9.0)))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((a * (27.0 * b)) + (x * 2.0)) + (y * (t * (z * -9.0)));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * N[(t * N[(z * -9.0), $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])\\
\\
\left(a \cdot \left(27 \cdot b\right) + x \cdot 2\right) + y \cdot \left(t \cdot \left(z \cdot -9\right)\right)
\end{array}
Initial program 96.5%
+-commutative96.5%
associate-+r-96.5%
*-commutative96.5%
cancel-sign-sub-inv96.5%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define97.2%
fmm-def97.2%
associate-*l*95.0%
distribute-rgt-neg-in95.0%
*-commutative95.0%
associate-*l*95.0%
*-commutative95.0%
distribute-lft-neg-in95.0%
associate-*r*95.0%
Simplified95.0%
fma-undefine93.8%
fma-undefine93.8%
associate-+r+93.8%
associate-*r*93.8%
*-commutative93.8%
associate-*l*93.9%
Applied egg-rr93.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 (<= b -9e-29) (not (<= b 3.8))) (* a (* 27.0 b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9e-29) || !(b <= 3.8)) {
tmp = a * (27.0 * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-9d-29)) .or. (.not. (b <= 3.8d0))) then
tmp = a * (27.0d0 * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9e-29) || !(b <= 3.8)) {
tmp = a * (27.0 * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -9e-29) or not (b <= 3.8): tmp = a * (27.0 * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -9e-29) || !(b <= 3.8)) tmp = Float64(a * Float64(27.0 * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -9e-29) || ~((b <= 3.8)))
tmp = a * (27.0 * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9e-29], N[Not[LessEqual[b, 3.8]], $MachinePrecision]], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{-29} \lor \neg \left(b \leq 3.8\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -8.9999999999999996e-29 or 3.7999999999999998 < b Initial program 96.2%
+-commutative96.2%
associate-+r-96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-*r*94.0%
distribute-lft-neg-in94.0%
*-commutative94.0%
cancel-sign-sub-inv94.0%
associate-+r-94.0%
associate-*l*94.0%
fma-define96.2%
fmm-def96.2%
associate-*l*94.1%
distribute-rgt-neg-in94.1%
*-commutative94.1%
associate-*l*94.1%
*-commutative94.1%
distribute-lft-neg-in94.1%
associate-*r*94.1%
Simplified94.1%
Taylor expanded in y around 0 64.5%
Taylor expanded in x around 0 52.0%
associate-*r*52.0%
*-commutative52.0%
associate-*r*52.0%
Simplified52.0%
if -8.9999999999999996e-29 < b < 3.7999999999999998Initial program 96.9%
+-commutative96.9%
associate-+r-96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-*r*98.2%
distribute-lft-neg-in98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-+r-98.2%
associate-*l*98.2%
fma-define98.2%
fmm-def98.2%
associate-*l*95.9%
distribute-rgt-neg-in95.9%
*-commutative95.9%
associate-*l*95.9%
*-commutative95.9%
distribute-lft-neg-in95.9%
associate-*r*95.9%
Simplified95.9%
Taylor expanded in y around 0 60.7%
Taylor expanded in x around inf 45.8%
Final simplification49.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.3e-29) (not (<= b 9.5))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.3e-29) || !(b <= 9.5)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-3.3d-29)) .or. (.not. (b <= 9.5d0))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.3e-29) || !(b <= 9.5)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.3e-29) or not (b <= 9.5): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.3e-29) || !(b <= 9.5)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -3.3e-29) || ~((b <= 9.5)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.3e-29], N[Not[LessEqual[b, 9.5]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.3 \cdot 10^{-29} \lor \neg \left(b \leq 9.5\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -3.30000000000000028e-29 or 9.5 < b Initial program 96.2%
+-commutative96.2%
associate-+r-96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-*r*94.0%
distribute-lft-neg-in94.0%
*-commutative94.0%
cancel-sign-sub-inv94.0%
associate-+r-94.0%
associate-*l*94.0%
fma-define96.2%
fmm-def96.2%
associate-*l*94.1%
distribute-rgt-neg-in94.1%
*-commutative94.1%
associate-*l*94.1%
*-commutative94.1%
distribute-lft-neg-in94.1%
associate-*r*94.1%
Simplified94.1%
Taylor expanded in a around inf 52.0%
if -3.30000000000000028e-29 < b < 9.5Initial program 96.9%
+-commutative96.9%
associate-+r-96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-*r*98.2%
distribute-lft-neg-in98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-+r-98.2%
associate-*l*98.2%
fma-define98.2%
fmm-def98.2%
associate-*l*95.9%
distribute-rgt-neg-in95.9%
*-commutative95.9%
associate-*l*95.9%
*-commutative95.9%
distribute-lft-neg-in95.9%
associate-*r*95.9%
Simplified95.9%
Taylor expanded in y around 0 60.7%
Taylor expanded in x around inf 45.8%
Final simplification49.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 (* 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 96.5%
+-commutative96.5%
associate-+r-96.5%
*-commutative96.5%
cancel-sign-sub-inv96.5%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define97.2%
fmm-def97.2%
associate-*l*95.0%
distribute-rgt-neg-in95.0%
*-commutative95.0%
associate-*l*95.0%
*-commutative95.0%
distribute-lft-neg-in95.0%
associate-*r*95.0%
Simplified95.0%
Taylor expanded in y around 0 62.7%
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 2024172
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(! :herbie-platform default (if (< y 7590524218811189/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b))))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))