
(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 13 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 -2e-273) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e-273) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2e-273) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2e-273], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-273}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -2e-273Initial program 95.1%
Simplified95.6%
if -2e-273 < z Initial program 92.4%
+-commutative92.4%
associate-+r-92.4%
*-commutative92.4%
cancel-sign-sub-inv92.4%
associate-*r*88.5%
distribute-lft-neg-in88.5%
*-commutative88.5%
cancel-sign-sub-inv88.5%
associate-+r-88.5%
associate-*l*87.8%
fma-define91.5%
cancel-sign-sub-inv91.5%
fma-define91.5%
distribute-lft-neg-in91.5%
distribute-rgt-neg-in91.5%
*-commutative91.5%
associate-*r*95.5%
associate-*l*95.5%
neg-mul-195.5%
associate-*r*95.5%
Simplified95.5%
Final simplification95.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -3.7e+42) (* y (- (+ (* 2.0 (/ x y)) (* 27.0 (/ (* a b) y))) (* 9.0 (* z t)))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.7e+42) {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * t)));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.7e+42) tmp = Float64(y * Float64(Float64(Float64(2.0 * Float64(x / y)) + Float64(27.0 * Float64(Float64(a * b) / y))) - Float64(9.0 * Float64(z * t)))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.7e+42], 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[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \left(\left(2 \cdot \frac{x}{y} + 27 \cdot \frac{a \cdot b}{y}\right) - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -3.69999999999999996e42Initial program 89.4%
sub-neg89.4%
sub-neg89.4%
associate-*l*91.1%
associate-*l*90.9%
Simplified90.9%
Taylor expanded in y around inf 78.8%
if -3.69999999999999996e42 < z Initial program 94.9%
+-commutative94.9%
associate-+r-94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-*r*89.5%
distribute-lft-neg-in89.5%
*-commutative89.5%
cancel-sign-sub-inv89.5%
associate-+r-89.5%
associate-*l*89.0%
fma-define91.5%
cancel-sign-sub-inv91.5%
fma-define91.5%
distribute-lft-neg-in91.5%
distribute-rgt-neg-in91.5%
*-commutative91.5%
associate-*r*96.9%
associate-*l*96.9%
neg-mul-196.9%
associate-*r*96.9%
Simplified96.9%
Final simplification93.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 9.0 (* t (* z y)))) (t_2 (* 27.0 (* a b))))
(if (<= z -1.45e-25)
(* y (* x (+ (/ 2.0 y) (* -9.0 (* t (/ z x))))))
(if (<= z 2.7e-139)
(+ (* x 2.0) t_2)
(if (<= z 6.5e-31) (- t_2 t_1) (- (* 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 t_2 = 27.0 * (a * b);
double tmp;
if (z <= -1.45e-25) {
tmp = y * (x * ((2.0 / y) + (-9.0 * (t * (z / x)))));
} else if (z <= 2.7e-139) {
tmp = (x * 2.0) + t_2;
} else if (z <= 6.5e-31) {
tmp = t_2 - t_1;
} else {
tmp = (x * 2.0) - 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) :: t_2
real(8) :: tmp
t_1 = 9.0d0 * (t * (z * y))
t_2 = 27.0d0 * (a * b)
if (z <= (-1.45d-25)) then
tmp = y * (x * ((2.0d0 / y) + ((-9.0d0) * (t * (z / x)))))
else if (z <= 2.7d-139) then
tmp = (x * 2.0d0) + t_2
else if (z <= 6.5d-31) then
tmp = t_2 - t_1
else
tmp = (x * 2.0d0) - 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 t_2 = 27.0 * (a * b);
double tmp;
if (z <= -1.45e-25) {
tmp = y * (x * ((2.0 / y) + (-9.0 * (t * (z / x)))));
} else if (z <= 2.7e-139) {
tmp = (x * 2.0) + t_2;
} else if (z <= 6.5e-31) {
tmp = t_2 - t_1;
} else {
tmp = (x * 2.0) - 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)) t_2 = 27.0 * (a * b) tmp = 0 if z <= -1.45e-25: tmp = y * (x * ((2.0 / y) + (-9.0 * (t * (z / x))))) elif z <= 2.7e-139: tmp = (x * 2.0) + t_2 elif z <= 6.5e-31: tmp = t_2 - t_1 else: tmp = (x * 2.0) - 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))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -1.45e-25) tmp = Float64(y * Float64(x * Float64(Float64(2.0 / y) + Float64(-9.0 * Float64(t * Float64(z / x)))))); elseif (z <= 2.7e-139) tmp = Float64(Float64(x * 2.0) + t_2); elseif (z <= 6.5e-31) tmp = Float64(t_2 - t_1); else tmp = Float64(Float64(x * 2.0) - 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));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -1.45e-25)
tmp = y * (x * ((2.0 / y) + (-9.0 * (t * (z / x)))));
elseif (z <= 2.7e-139)
tmp = (x * 2.0) + t_2;
elseif (z <= 6.5e-31)
tmp = t_2 - t_1;
else
tmp = (x * 2.0) - 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]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e-25], N[(y * N[(x * N[(N[(2.0 / y), $MachinePrecision] + N[(-9.0 * N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-139], N[(N[(x * 2.0), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[z, 6.5e-31], N[(t$95$2 - t$95$1), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{-25}:\\
\;\;\;\;y \cdot \left(x \cdot \left(\frac{2}{y} + -9 \cdot \left(t \cdot \frac{z}{x}\right)\right)\right)\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-139}:\\
\;\;\;\;x \cdot 2 + t\_2\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-31}:\\
\;\;\;\;t\_2 - t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t\_1\\
\end{array}
\end{array}
if z < -1.45e-25Initial program 91.5%
sub-neg91.5%
sub-neg91.5%
associate-*l*92.8%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in y around inf 80.3%
Taylor expanded in x around inf 62.6%
cancel-sign-sub-inv62.6%
fma-define62.6%
associate-/l*61.2%
*-commutative61.2%
associate-*r/61.2%
metadata-eval61.2%
metadata-eval61.2%
associate-/l*59.4%
Simplified59.4%
Taylor expanded in a around 0 59.5%
if -1.45e-25 < z < 2.6999999999999998e-139Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*87.6%
distribute-lft-neg-in87.6%
*-commutative87.6%
cancel-sign-sub-inv87.6%
associate-+r-87.6%
associate-*l*86.6%
fma-define86.6%
cancel-sign-sub-inv86.6%
fma-define86.6%
distribute-lft-neg-in86.6%
distribute-rgt-neg-in86.6%
*-commutative86.6%
associate-*r*98.8%
associate-*l*98.8%
neg-mul-198.8%
associate-*r*98.8%
Simplified98.8%
Taylor expanded in t around 0 83.2%
if 2.6999999999999998e-139 < z < 6.49999999999999967e-31Initial program 95.9%
sub-neg95.9%
sub-neg95.9%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around 0 64.6%
if 6.49999999999999967e-31 < z Initial program 85.6%
sub-neg85.6%
sub-neg85.6%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in a around 0 75.1%
Final simplification73.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 9.0 (* t (* z y)))) (t_2 (* 27.0 (* a b))))
(if (<= z -2.95e+54)
(* -9.0 (* z (* y t)))
(if (<= z 3e-139)
(+ (* x 2.0) t_2)
(if (<= z 1.9e-30) (- t_2 t_1) (- (* 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 t_2 = 27.0 * (a * b);
double tmp;
if (z <= -2.95e+54) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 3e-139) {
tmp = (x * 2.0) + t_2;
} else if (z <= 1.9e-30) {
tmp = t_2 - t_1;
} else {
tmp = (x * 2.0) - 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) :: t_2
real(8) :: tmp
t_1 = 9.0d0 * (t * (z * y))
t_2 = 27.0d0 * (a * b)
if (z <= (-2.95d+54)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 3d-139) then
tmp = (x * 2.0d0) + t_2
else if (z <= 1.9d-30) then
tmp = t_2 - t_1
else
tmp = (x * 2.0d0) - 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 t_2 = 27.0 * (a * b);
double tmp;
if (z <= -2.95e+54) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 3e-139) {
tmp = (x * 2.0) + t_2;
} else if (z <= 1.9e-30) {
tmp = t_2 - t_1;
} else {
tmp = (x * 2.0) - 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)) t_2 = 27.0 * (a * b) tmp = 0 if z <= -2.95e+54: tmp = -9.0 * (z * (y * t)) elif z <= 3e-139: tmp = (x * 2.0) + t_2 elif z <= 1.9e-30: tmp = t_2 - t_1 else: tmp = (x * 2.0) - 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))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -2.95e+54) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 3e-139) tmp = Float64(Float64(x * 2.0) + t_2); elseif (z <= 1.9e-30) tmp = Float64(t_2 - t_1); else tmp = Float64(Float64(x * 2.0) - 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));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -2.95e+54)
tmp = -9.0 * (z * (y * t));
elseif (z <= 3e-139)
tmp = (x * 2.0) + t_2;
elseif (z <= 1.9e-30)
tmp = t_2 - t_1;
else
tmp = (x * 2.0) - 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]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.95e+54], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e-139], N[(N[(x * 2.0), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[z, 1.9e-30], N[(t$95$2 - t$95$1), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -2.95 \cdot 10^{+54}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-139}:\\
\;\;\;\;x \cdot 2 + t\_2\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-30}:\\
\;\;\;\;t\_2 - t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t\_1\\
\end{array}
\end{array}
if z < -2.9499999999999999e54Initial program 89.2%
+-commutative89.2%
associate-+r-89.2%
*-commutative89.2%
cancel-sign-sub-inv89.2%
associate-*r*96.2%
distribute-lft-neg-in96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-+r-96.2%
associate-*l*96.1%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
distribute-lft-neg-in97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*r*90.9%
associate-*l*90.9%
neg-mul-190.9%
associate-*r*90.9%
Simplified90.9%
Taylor expanded in t around inf 47.8%
*-commutative47.8%
associate-*r*47.8%
associate-*l*47.8%
Simplified47.8%
Taylor expanded in t around 0 47.8%
associate-*r*51.1%
Simplified51.1%
if -2.9499999999999999e54 < z < 2.9999999999999999e-139Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*89.2%
distribute-lft-neg-in89.2%
*-commutative89.2%
cancel-sign-sub-inv89.2%
associate-+r-89.2%
associate-*l*88.4%
fma-define88.4%
cancel-sign-sub-inv88.4%
fma-define88.4%
distribute-lft-neg-in88.4%
distribute-rgt-neg-in88.4%
*-commutative88.4%
associate-*r*98.9%
associate-*l*98.9%
neg-mul-198.9%
associate-*r*98.9%
Simplified98.9%
Taylor expanded in t around 0 79.3%
if 2.9999999999999999e-139 < z < 1.9000000000000002e-30Initial program 95.9%
sub-neg95.9%
sub-neg95.9%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around 0 64.6%
if 1.9000000000000002e-30 < z Initial program 85.6%
sub-neg85.6%
sub-neg85.6%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in a around 0 75.1%
Final simplification70.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -950.0)
(* -9.0 (* z (* y t)))
(if (<= z -9e-147)
(* x 2.0)
(if (<= z -1.9e-219)
(* 27.0 (* a b))
(if (<= z 2.7e-142) (* x 2.0) (* t (* y (* z -9.0))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -950.0) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -9e-147) {
tmp = x * 2.0;
} else if (z <= -1.9e-219) {
tmp = 27.0 * (a * b);
} else if (z <= 2.7e-142) {
tmp = x * 2.0;
} 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.
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 <= (-950.0d0)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= (-9d-147)) then
tmp = x * 2.0d0
else if (z <= (-1.9d-219)) then
tmp = 27.0d0 * (a * b)
else if (z <= 2.7d-142) then
tmp = x * 2.0d0
else
tmp = t * (y * (z * (-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 <= -950.0) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -9e-147) {
tmp = x * 2.0;
} else if (z <= -1.9e-219) {
tmp = 27.0 * (a * b);
} else if (z <= 2.7e-142) {
tmp = x * 2.0;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -950.0: tmp = -9.0 * (z * (y * t)) elif z <= -9e-147: tmp = x * 2.0 elif z <= -1.9e-219: tmp = 27.0 * (a * b) elif z <= 2.7e-142: tmp = x * 2.0 else: tmp = t * (y * (z * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -950.0) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= -9e-147) tmp = Float64(x * 2.0); elseif (z <= -1.9e-219) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 2.7e-142) tmp = Float64(x * 2.0); 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])){:}
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 <= -950.0)
tmp = -9.0 * (z * (y * t));
elseif (z <= -9e-147)
tmp = x * 2.0;
elseif (z <= -1.9e-219)
tmp = 27.0 * (a * b);
elseif (z <= 2.7e-142)
tmp = x * 2.0;
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. 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, -950.0], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-147], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.9e-219], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-142], N[(x * 2.0), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -950:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-147}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-219}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-142}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -950Initial program 91.0%
+-commutative91.0%
associate-+r-91.0%
*-commutative91.0%
cancel-sign-sub-inv91.0%
associate-*r*96.9%
distribute-lft-neg-in96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-+r-96.9%
associate-*l*96.7%
fma-define98.3%
cancel-sign-sub-inv98.3%
fma-define98.3%
distribute-lft-neg-in98.3%
distribute-rgt-neg-in98.3%
*-commutative98.3%
associate-*r*92.4%
associate-*l*92.5%
neg-mul-192.5%
associate-*r*92.5%
Simplified92.5%
Taylor expanded in t around inf 49.3%
*-commutative49.3%
associate-*r*49.3%
associate-*l*49.3%
Simplified49.3%
Taylor expanded in t around 0 49.3%
associate-*r*52.0%
Simplified52.0%
if -950 < z < -8.99999999999999946e-147 or -1.90000000000000012e-219 < z < 2.6999999999999998e-142Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*87.8%
distribute-lft-neg-in87.8%
*-commutative87.8%
cancel-sign-sub-inv87.8%
associate-+r-87.8%
associate-*l*86.6%
fma-define86.6%
cancel-sign-sub-inv86.6%
fma-define86.6%
distribute-lft-neg-in86.6%
distribute-rgt-neg-in86.6%
*-commutative86.6%
associate-*r*98.6%
associate-*l*98.6%
neg-mul-198.6%
associate-*r*98.6%
Simplified98.6%
Taylor expanded in t around 0 84.8%
Taylor expanded in x around inf 46.5%
if -8.99999999999999946e-147 < z < -1.90000000000000012e-219Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*89.5%
distribute-lft-neg-in89.5%
*-commutative89.5%
cancel-sign-sub-inv89.5%
associate-+r-89.5%
associate-*l*89.4%
fma-define89.4%
cancel-sign-sub-inv89.4%
fma-define89.4%
distribute-lft-neg-in89.4%
distribute-rgt-neg-in89.4%
*-commutative89.4%
associate-*r*99.7%
associate-*l*99.6%
neg-mul-199.6%
associate-*r*99.6%
Simplified99.6%
Taylor expanded in a around inf 46.6%
if 2.6999999999999998e-142 < z Initial program 88.7%
+-commutative88.7%
associate-+r-88.7%
*-commutative88.7%
cancel-sign-sub-inv88.7%
associate-*r*89.9%
distribute-lft-neg-in89.9%
*-commutative89.9%
cancel-sign-sub-inv89.9%
associate-+r-89.9%
associate-*l*89.9%
fma-define95.6%
cancel-sign-sub-inv95.6%
fma-define95.6%
distribute-lft-neg-in95.6%
distribute-rgt-neg-in95.6%
*-commutative95.6%
associate-*r*94.4%
associate-*l*94.4%
neg-mul-194.4%
associate-*r*94.4%
Simplified94.4%
Taylor expanded in t around inf 48.2%
*-commutative48.2%
associate-*r*48.2%
associate-*l*48.2%
Simplified48.2%
Final simplification48.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4600.0)
(* -9.0 (* z (* y t)))
(if (<= z -3e-147)
(* x 2.0)
(if (<= z -1.18e-220)
(* 27.0 (* a b))
(if (<= z 4.2e-143) (* 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 <= -4600.0) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -3e-147) {
tmp = x * 2.0;
} else if (z <= -1.18e-220) {
tmp = 27.0 * (a * b);
} else if (z <= 4.2e-143) {
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 <= (-4600.0d0)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= (-3d-147)) then
tmp = x * 2.0d0
else if (z <= (-1.18d-220)) then
tmp = 27.0d0 * (a * b)
else if (z <= 4.2d-143) 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 <= -4600.0) {
tmp = -9.0 * (z * (y * t));
} else if (z <= -3e-147) {
tmp = x * 2.0;
} else if (z <= -1.18e-220) {
tmp = 27.0 * (a * b);
} else if (z <= 4.2e-143) {
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 <= -4600.0: tmp = -9.0 * (z * (y * t)) elif z <= -3e-147: tmp = x * 2.0 elif z <= -1.18e-220: tmp = 27.0 * (a * b) elif z <= 4.2e-143: 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 <= -4600.0) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= -3e-147) tmp = Float64(x * 2.0); elseif (z <= -1.18e-220) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 4.2e-143) 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 <= -4600.0)
tmp = -9.0 * (z * (y * t));
elseif (z <= -3e-147)
tmp = x * 2.0;
elseif (z <= -1.18e-220)
tmp = 27.0 * (a * b);
elseif (z <= 4.2e-143)
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, -4600.0], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3e-147], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.18e-220], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e-143], 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 -4600:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-147}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.18 \cdot 10^{-220}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-143}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -4600Initial program 91.0%
+-commutative91.0%
associate-+r-91.0%
*-commutative91.0%
cancel-sign-sub-inv91.0%
associate-*r*96.9%
distribute-lft-neg-in96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-+r-96.9%
associate-*l*96.7%
fma-define98.3%
cancel-sign-sub-inv98.3%
fma-define98.3%
distribute-lft-neg-in98.3%
distribute-rgt-neg-in98.3%
*-commutative98.3%
associate-*r*92.4%
associate-*l*92.5%
neg-mul-192.5%
associate-*r*92.5%
Simplified92.5%
Taylor expanded in t around inf 49.3%
*-commutative49.3%
associate-*r*49.3%
associate-*l*49.3%
Simplified49.3%
Taylor expanded in t around 0 49.3%
associate-*r*52.0%
Simplified52.0%
if -4600 < z < -3.0000000000000002e-147 or -1.1799999999999999e-220 < z < 4.2000000000000002e-143Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*87.8%
distribute-lft-neg-in87.8%
*-commutative87.8%
cancel-sign-sub-inv87.8%
associate-+r-87.8%
associate-*l*86.6%
fma-define86.6%
cancel-sign-sub-inv86.6%
fma-define86.6%
distribute-lft-neg-in86.6%
distribute-rgt-neg-in86.6%
*-commutative86.6%
associate-*r*98.6%
associate-*l*98.6%
neg-mul-198.6%
associate-*r*98.6%
Simplified98.6%
Taylor expanded in t around 0 84.8%
Taylor expanded in x around inf 46.5%
if -3.0000000000000002e-147 < z < -1.1799999999999999e-220Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*89.5%
distribute-lft-neg-in89.5%
*-commutative89.5%
cancel-sign-sub-inv89.5%
associate-+r-89.5%
associate-*l*89.4%
fma-define89.4%
cancel-sign-sub-inv89.4%
fma-define89.4%
distribute-lft-neg-in89.4%
distribute-rgt-neg-in89.4%
*-commutative89.4%
associate-*r*99.7%
associate-*l*99.6%
neg-mul-199.6%
associate-*r*99.6%
Simplified99.6%
Taylor expanded in a around inf 46.6%
if 4.2000000000000002e-143 < z Initial program 88.7%
+-commutative88.7%
associate-+r-88.7%
*-commutative88.7%
cancel-sign-sub-inv88.7%
associate-*r*89.9%
distribute-lft-neg-in89.9%
*-commutative89.9%
cancel-sign-sub-inv89.9%
associate-+r-89.9%
associate-*l*89.9%
fma-define95.6%
cancel-sign-sub-inv95.6%
fma-define95.6%
distribute-lft-neg-in95.6%
distribute-rgt-neg-in95.6%
*-commutative95.6%
associate-*r*94.4%
associate-*l*94.4%
neg-mul-194.4%
associate-*r*94.4%
Simplified94.4%
Taylor expanded in t around inf 48.2%
Final simplification48.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* z y)))))
(if (<= z -12000.0)
t_1
(if (<= z -5.6e-148)
(* x 2.0)
(if (<= z -1.6e-220)
(* 27.0 (* a b))
(if (<= z 1.7e-139) (* 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 <= -12000.0) {
tmp = t_1;
} else if (z <= -5.6e-148) {
tmp = x * 2.0;
} else if (z <= -1.6e-220) {
tmp = 27.0 * (a * b);
} else if (z <= 1.7e-139) {
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 <= (-12000.0d0)) then
tmp = t_1
else if (z <= (-5.6d-148)) then
tmp = x * 2.0d0
else if (z <= (-1.6d-220)) then
tmp = 27.0d0 * (a * b)
else if (z <= 1.7d-139) 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 <= -12000.0) {
tmp = t_1;
} else if (z <= -5.6e-148) {
tmp = x * 2.0;
} else if (z <= -1.6e-220) {
tmp = 27.0 * (a * b);
} else if (z <= 1.7e-139) {
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 <= -12000.0: tmp = t_1 elif z <= -5.6e-148: tmp = x * 2.0 elif z <= -1.6e-220: tmp = 27.0 * (a * b) elif z <= 1.7e-139: 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 <= -12000.0) tmp = t_1; elseif (z <= -5.6e-148) tmp = Float64(x * 2.0); elseif (z <= -1.6e-220) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 1.7e-139) 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 <= -12000.0)
tmp = t_1;
elseif (z <= -5.6e-148)
tmp = x * 2.0;
elseif (z <= -1.6e-220)
tmp = 27.0 * (a * b);
elseif (z <= 1.7e-139)
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, -12000.0], t$95$1, If[LessEqual[z, -5.6e-148], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.6e-220], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-139], 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 -12000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-148}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-220}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-139}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -12000 or 1.69999999999999999e-139 < z Initial program 89.6%
+-commutative89.6%
associate-+r-89.6%
*-commutative89.6%
cancel-sign-sub-inv89.6%
associate-*r*92.9%
distribute-lft-neg-in92.9%
*-commutative92.9%
cancel-sign-sub-inv92.9%
associate-+r-92.9%
associate-*l*92.8%
fma-define96.8%
cancel-sign-sub-inv96.8%
fma-define96.8%
distribute-lft-neg-in96.8%
distribute-rgt-neg-in96.8%
*-commutative96.8%
associate-*r*93.5%
associate-*l*93.6%
neg-mul-193.6%
associate-*r*93.6%
Simplified93.6%
Taylor expanded in t around inf 48.7%
if -12000 < z < -5.6e-148 or -1.60000000000000003e-220 < z < 1.69999999999999999e-139Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*87.8%
distribute-lft-neg-in87.8%
*-commutative87.8%
cancel-sign-sub-inv87.8%
associate-+r-87.8%
associate-*l*86.6%
fma-define86.6%
cancel-sign-sub-inv86.6%
fma-define86.6%
distribute-lft-neg-in86.6%
distribute-rgt-neg-in86.6%
*-commutative86.6%
associate-*r*98.6%
associate-*l*98.6%
neg-mul-198.6%
associate-*r*98.6%
Simplified98.6%
Taylor expanded in t around 0 84.8%
Taylor expanded in x around inf 46.5%
if -5.6e-148 < z < -1.60000000000000003e-220Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*89.5%
distribute-lft-neg-in89.5%
*-commutative89.5%
cancel-sign-sub-inv89.5%
associate-+r-89.5%
associate-*l*89.4%
fma-define89.4%
cancel-sign-sub-inv89.4%
fma-define89.4%
distribute-lft-neg-in89.4%
distribute-rgt-neg-in89.4%
*-commutative89.4%
associate-*r*99.7%
associate-*l*99.6%
neg-mul-199.6%
associate-*r*99.6%
Simplified99.6%
Taylor expanded in a around inf 46.6%
Final simplification47.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 13500000000000.0) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 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 <= 13500000000000.0) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * 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 <= 13500000000000.0d0) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * 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 <= 13500000000000.0) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * 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 <= 13500000000000.0: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * 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 <= 13500000000000.0) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(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 <= 13500000000000.0)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * 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, 13500000000000.0], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(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 13500000000000:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 1.35e13Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*96.4%
associate-*l*95.9%
Simplified95.9%
if 1.35e13 < z Initial program 81.5%
sub-neg81.5%
sub-neg81.5%
associate-*l*89.4%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in a around 0 74.0%
Final simplification91.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.1e+54)
(* -9.0 (* z (* y t)))
(if (<= z 8.5e-144)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e+54) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 8.5e-144) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.1d+54)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 8.5d-144) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.1e+54) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 8.5e-144) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.1e+54: tmp = -9.0 * (z * (y * t)) elif z <= 8.5e-144: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.1e+54) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 8.5e-144) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.1e+54)
tmp = -9.0 * (z * (y * t));
elseif (z <= 8.5e-144)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.1e+54], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-144], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+54}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-144}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -2.09999999999999986e54Initial program 89.2%
+-commutative89.2%
associate-+r-89.2%
*-commutative89.2%
cancel-sign-sub-inv89.2%
associate-*r*96.2%
distribute-lft-neg-in96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-+r-96.2%
associate-*l*96.1%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
distribute-lft-neg-in97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*r*90.9%
associate-*l*90.9%
neg-mul-190.9%
associate-*r*90.9%
Simplified90.9%
Taylor expanded in t around inf 47.8%
*-commutative47.8%
associate-*r*47.8%
associate-*l*47.8%
Simplified47.8%
Taylor expanded in t around 0 47.8%
associate-*r*51.1%
Simplified51.1%
if -2.09999999999999986e54 < z < 8.49999999999999958e-144Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*89.2%
distribute-lft-neg-in89.2%
*-commutative89.2%
cancel-sign-sub-inv89.2%
associate-+r-89.2%
associate-*l*88.4%
fma-define88.4%
cancel-sign-sub-inv88.4%
fma-define88.4%
distribute-lft-neg-in88.4%
distribute-rgt-neg-in88.4%
*-commutative88.4%
associate-*r*98.9%
associate-*l*98.9%
neg-mul-198.9%
associate-*r*98.9%
Simplified98.9%
Taylor expanded in t around 0 79.3%
if 8.49999999999999958e-144 < z Initial program 88.7%
sub-neg88.7%
sub-neg88.7%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around 0 71.5%
Final simplification70.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 -1.5e+54) (* -9.0 (* z (* y t))) (if (<= z 1.65e+89) (+ (* x 2.0) (* 27.0 (* a b))) (* -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.5e+54) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.65e+89) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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 <= (-1.5d+54)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 1.65d+89) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
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 <= -1.5e+54) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 1.65e+89) {
tmp = (x * 2.0) + (27.0 * (a * b));
} 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 <= -1.5e+54: tmp = -9.0 * (z * (y * t)) elif z <= 1.65e+89: tmp = (x * 2.0) + (27.0 * (a * b)) 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 <= -1.5e+54) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 1.65e+89) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); 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 <= -1.5e+54)
tmp = -9.0 * (z * (y * t));
elseif (z <= 1.65e+89)
tmp = (x * 2.0) + (27.0 * (a * b));
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, -1.5e+54], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+89], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $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 -1.5 \cdot 10^{+54}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+89}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.4999999999999999e54Initial program 89.2%
+-commutative89.2%
associate-+r-89.2%
*-commutative89.2%
cancel-sign-sub-inv89.2%
associate-*r*96.2%
distribute-lft-neg-in96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-+r-96.2%
associate-*l*96.1%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
distribute-lft-neg-in97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*r*90.9%
associate-*l*90.9%
neg-mul-190.9%
associate-*r*90.9%
Simplified90.9%
Taylor expanded in t around inf 47.8%
*-commutative47.8%
associate-*r*47.8%
associate-*l*47.8%
Simplified47.8%
Taylor expanded in t around 0 47.8%
associate-*r*51.1%
Simplified51.1%
if -1.4999999999999999e54 < z < 1.64999999999999987e89Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-*r*89.5%
distribute-lft-neg-in89.5%
*-commutative89.5%
cancel-sign-sub-inv89.5%
associate-+r-89.5%
associate-*l*88.9%
fma-define89.5%
cancel-sign-sub-inv89.5%
fma-define89.5%
distribute-lft-neg-in89.5%
distribute-rgt-neg-in89.5%
*-commutative89.5%
associate-*r*98.0%
associate-*l*98.0%
neg-mul-198.0%
associate-*r*98.0%
Simplified98.0%
Taylor expanded in t around 0 73.7%
if 1.64999999999999987e89 < z Initial program 82.2%
+-commutative82.2%
associate-+r-82.2%
*-commutative82.2%
cancel-sign-sub-inv82.2%
associate-*r*89.6%
distribute-lft-neg-in89.6%
*-commutative89.6%
cancel-sign-sub-inv89.6%
associate-+r-89.6%
associate-*l*89.6%
fma-define99.9%
cancel-sign-sub-inv99.9%
fma-define99.9%
distribute-lft-neg-in99.9%
distribute-rgt-neg-in99.9%
*-commutative99.9%
associate-*r*92.5%
associate-*l*92.5%
neg-mul-192.5%
associate-*r*92.5%
Simplified92.5%
Taylor expanded in t around inf 62.8%
Final simplification67.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 (or (<= b -5.2e-59) (not (<= b 3.1e+23))) (* 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 <= -5.2e-59) || !(b <= 3.1e+23)) {
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 <= (-5.2d-59)) .or. (.not. (b <= 3.1d+23))) 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 <= -5.2e-59) || !(b <= 3.1e+23)) {
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 <= -5.2e-59) or not (b <= 3.1e+23): 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 <= -5.2e-59) || !(b <= 3.1e+23)) 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 <= -5.2e-59) || ~((b <= 3.1e+23)))
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, -5.2e-59], N[Not[LessEqual[b, 3.1e+23]], $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 -5.2 \cdot 10^{-59} \lor \neg \left(b \leq 3.1 \cdot 10^{+23}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -5.19999999999999996e-59 or 3.09999999999999971e23 < b Initial program 92.3%
+-commutative92.3%
associate-+r-92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-*r*90.5%
distribute-lft-neg-in90.5%
*-commutative90.5%
cancel-sign-sub-inv90.5%
associate-+r-90.5%
associate-*l*89.8%
fma-define93.9%
cancel-sign-sub-inv93.9%
fma-define93.9%
distribute-lft-neg-in93.9%
distribute-rgt-neg-in93.9%
*-commutative93.9%
associate-*r*95.8%
associate-*l*95.8%
neg-mul-195.8%
associate-*r*95.8%
Simplified95.8%
Taylor expanded in a around inf 46.8%
if -5.19999999999999996e-59 < b < 3.09999999999999971e23Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-*r*91.5%
distribute-lft-neg-in91.5%
*-commutative91.5%
cancel-sign-sub-inv91.5%
associate-+r-91.5%
associate-*l*91.5%
fma-define91.5%
cancel-sign-sub-inv91.5%
fma-define91.5%
distribute-lft-neg-in91.5%
distribute-rgt-neg-in91.5%
*-commutative91.5%
associate-*r*95.5%
associate-*l*95.5%
neg-mul-195.5%
associate-*r*95.5%
Simplified95.5%
Taylor expanded in t around 0 55.2%
Taylor expanded in x around inf 43.7%
Final simplification45.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 (<= b -5.5e-59) (* b (* a 27.0)) (if (<= b 2.7e+23) (* 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 (b <= -5.5e-59) {
tmp = b * (a * 27.0);
} else if (b <= 2.7e+23) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-5.5d-59)) then
tmp = b * (a * 27.0d0)
else if (b <= 2.7d+23) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.5e-59) {
tmp = b * (a * 27.0);
} else if (b <= 2.7e+23) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -5.5e-59: tmp = b * (a * 27.0) elif b <= 2.7e+23: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5.5e-59) tmp = Float64(b * Float64(a * 27.0)); elseif (b <= 2.7e+23) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -5.5e-59)
tmp = b * (a * 27.0);
elseif (b <= 2.7e+23)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5.5e-59], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.7e+23], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{-59}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;b \leq 2.7 \cdot 10^{+23}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -5.50000000000000014e-59Initial program 94.2%
+-commutative94.2%
associate-+r-94.2%
*-commutative94.2%
cancel-sign-sub-inv94.2%
associate-*r*93.1%
distribute-lft-neg-in93.1%
*-commutative93.1%
cancel-sign-sub-inv93.1%
associate-+r-93.1%
associate-*l*93.1%
fma-define97.3%
cancel-sign-sub-inv97.3%
fma-define97.3%
distribute-lft-neg-in97.3%
distribute-rgt-neg-in97.3%
*-commutative97.3%
associate-*r*98.4%
associate-*l*98.4%
neg-mul-198.4%
associate-*r*98.4%
Simplified98.4%
Taylor expanded in t around 0 72.2%
Taylor expanded in x around 0 41.6%
associate-*r*41.6%
*-commutative41.6%
Simplified41.6%
if -5.50000000000000014e-59 < b < 2.6999999999999999e23Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-*r*91.5%
distribute-lft-neg-in91.5%
*-commutative91.5%
cancel-sign-sub-inv91.5%
associate-+r-91.5%
associate-*l*91.5%
fma-define91.5%
cancel-sign-sub-inv91.5%
fma-define91.5%
distribute-lft-neg-in91.5%
distribute-rgt-neg-in91.5%
*-commutative91.5%
associate-*r*95.5%
associate-*l*95.5%
neg-mul-195.5%
associate-*r*95.5%
Simplified95.5%
Taylor expanded in t around 0 55.2%
Taylor expanded in x around inf 43.7%
if 2.6999999999999999e23 < b Initial program 90.4%
+-commutative90.4%
associate-+r-90.4%
*-commutative90.4%
cancel-sign-sub-inv90.4%
associate-*r*87.9%
distribute-lft-neg-in87.9%
*-commutative87.9%
cancel-sign-sub-inv87.9%
associate-+r-87.9%
associate-*l*86.6%
fma-define90.7%
cancel-sign-sub-inv90.7%
fma-define90.7%
distribute-lft-neg-in90.7%
distribute-rgt-neg-in90.7%
*-commutative90.7%
associate-*r*93.1%
associate-*l*93.1%
neg-mul-193.1%
associate-*r*93.1%
Simplified93.1%
Taylor expanded in a around inf 51.9%
Final simplification45.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 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 93.7%
+-commutative93.7%
associate-+r-93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-*r*90.9%
distribute-lft-neg-in90.9%
*-commutative90.9%
cancel-sign-sub-inv90.9%
associate-+r-90.9%
associate-*l*90.5%
fma-define92.9%
cancel-sign-sub-inv92.9%
fma-define92.9%
distribute-lft-neg-in92.9%
distribute-rgt-neg-in92.9%
*-commutative92.9%
associate-*r*95.7%
associate-*l*95.7%
neg-mul-195.7%
associate-*r*95.7%
Simplified95.7%
Taylor expanded in t around 0 64.0%
Taylor expanded in x around inf 33.7%
Final simplification33.7%
(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 2024160
(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)))