
(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 1.55e-47) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (* t (+ (+ (* y (* z -9.0)) (* 27.0 (* a (/ b t)))) (/ (* x 2.0) 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.55e-47) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = t * (((y * (z * -9.0)) + (27.0 * (a * (b / t)))) + ((x * 2.0) / 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.55e-47) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(t * Float64(Float64(Float64(y * Float64(z * -9.0)) + Float64(27.0 * Float64(a * Float64(b / t)))) + Float64(Float64(x * 2.0) / 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.55e-47], 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[(t * N[(N[(N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(a * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] / t), $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.55 \cdot 10^{-47}:\\
\;\;\;\;\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}:\\
\;\;\;\;t \cdot \left(\left(y \cdot \left(z \cdot -9\right) + 27 \cdot \left(a \cdot \frac{b}{t}\right)\right) + \frac{x \cdot 2}{t}\right)\\
\end{array}
\end{array}
if z < 1.5499999999999999e-47Initial program 96.4%
+-commutative96.4%
associate-+r-96.4%
*-commutative96.4%
cancel-sign-sub-inv96.4%
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-define95.1%
fma-neg95.1%
associate-*l*95.6%
distribute-rgt-neg-in95.6%
*-commutative95.6%
associate-*l*95.6%
*-commutative95.6%
distribute-lft-neg-in95.6%
associate-*r*95.7%
Simplified95.7%
if 1.5499999999999999e-47 < z Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*88.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in t around inf 74.3%
cancel-sign-sub-inv74.3%
metadata-eval74.3%
+-commutative74.3%
*-commutative74.3%
associate-*r*74.4%
fma-define74.4%
+-commutative74.4%
fma-define74.4%
associate-/l*75.6%
associate-*r/75.6%
Simplified75.6%
fma-undefine75.6%
fma-undefine75.6%
associate-+r+75.6%
Applied egg-rr75.6%
Final simplification89.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
(let* ((t_1 (+ (* x 2.0) (* 27.0 (* a b)))))
(if (<= z -8e+110)
(* z (* -9.0 (* y t)))
(if (<= z -1.38e-67)
t_1
(if (<= z -1.5e-72)
(* t (* -9.0 (* z y)))
(if (<= z 4.5e-29) t_1 (* -9.0 (* t (* z y)))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) + (27.0 * (a * b));
double tmp;
if (z <= -8e+110) {
tmp = z * (-9.0 * (y * t));
} else if (z <= -1.38e-67) {
tmp = t_1;
} else if (z <= -1.5e-72) {
tmp = t * (-9.0 * (z * y));
} else if (z <= 4.5e-29) {
tmp = t_1;
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * 2.0d0) + (27.0d0 * (a * b))
if (z <= (-8d+110)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= (-1.38d-67)) then
tmp = t_1
else if (z <= (-1.5d-72)) then
tmp = t * ((-9.0d0) * (z * y))
else if (z <= 4.5d-29) then
tmp = t_1
else
tmp = (-9.0d0) * (t * (z * y))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * 2.0) + (27.0 * (a * b));
double tmp;
if (z <= -8e+110) {
tmp = z * (-9.0 * (y * t));
} else if (z <= -1.38e-67) {
tmp = t_1;
} else if (z <= -1.5e-72) {
tmp = t * (-9.0 * (z * y));
} else if (z <= 4.5e-29) {
tmp = t_1;
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (x * 2.0) + (27.0 * (a * b)) tmp = 0 if z <= -8e+110: tmp = z * (-9.0 * (y * t)) elif z <= -1.38e-67: tmp = t_1 elif z <= -1.5e-72: tmp = t * (-9.0 * (z * y)) elif z <= 4.5e-29: tmp = t_1 else: tmp = -9.0 * (t * (z * y)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))) tmp = 0.0 if (z <= -8e+110) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= -1.38e-67) tmp = t_1; elseif (z <= -1.5e-72) tmp = Float64(t * Float64(-9.0 * Float64(z * y))); elseif (z <= 4.5e-29) tmp = t_1; else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (x * 2.0) + (27.0 * (a * b));
tmp = 0.0;
if (z <= -8e+110)
tmp = z * (-9.0 * (y * t));
elseif (z <= -1.38e-67)
tmp = t_1;
elseif (z <= -1.5e-72)
tmp = t * (-9.0 * (z * y));
elseif (z <= 4.5e-29)
tmp = t_1;
else
tmp = -9.0 * (t * (z * y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+110], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.38e-67], t$95$1, If[LessEqual[z, -1.5e-72], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e-29], t$95$1, N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -8 \cdot 10^{+110}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.38 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-72}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -8.0000000000000002e110Initial program 90.7%
sub-neg90.7%
sub-neg90.7%
associate-*l*77.5%
associate-*l*77.5%
Simplified77.5%
Taylor expanded in a around 0 88.5%
Taylor expanded in z around inf 90.5%
Taylor expanded in x around 0 69.6%
if -8.0000000000000002e110 < z < -1.38000000000000006e-67 or -1.5e-72 < z < 4.4999999999999998e-29Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 84.1%
if -1.38000000000000006e-67 < z < -1.5e-72Initial program 99.5%
sub-neg99.5%
sub-neg99.5%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
cancel-sign-sub-inv100.0%
metadata-eval100.0%
+-commutative100.0%
*-commutative100.0%
associate-*r*100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
associate-/l*100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in y around inf 89.4%
if 4.4999999999999998e-29 < z Initial program 91.9%
sub-neg91.9%
sub-neg91.9%
associate-*l*87.8%
associate-*l*87.8%
Simplified87.8%
Taylor expanded in y around inf 44.1%
Final simplification70.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 -5.1e-98)
(* z (* -9.0 (* y t)))
(if (<= z 4.9e-276)
(* a (* 27.0 b))
(if (<= z 8.4e-91)
(* x 2.0)
(if (<= z 1.95e-29) (* b (* a 27.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 <= -5.1e-98) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 4.9e-276) {
tmp = a * (27.0 * b);
} else if (z <= 8.4e-91) {
tmp = x * 2.0;
} else if (z <= 1.95e-29) {
tmp = b * (a * 27.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 <= (-5.1d-98)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= 4.9d-276) then
tmp = a * (27.0d0 * b)
else if (z <= 8.4d-91) then
tmp = x * 2.0d0
else if (z <= 1.95d-29) then
tmp = b * (a * 27.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 <= -5.1e-98) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 4.9e-276) {
tmp = a * (27.0 * b);
} else if (z <= 8.4e-91) {
tmp = x * 2.0;
} else if (z <= 1.95e-29) {
tmp = b * (a * 27.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 <= -5.1e-98: tmp = z * (-9.0 * (y * t)) elif z <= 4.9e-276: tmp = a * (27.0 * b) elif z <= 8.4e-91: tmp = x * 2.0 elif z <= 1.95e-29: tmp = b * (a * 27.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 <= -5.1e-98) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= 4.9e-276) tmp = Float64(a * Float64(27.0 * b)); elseif (z <= 8.4e-91) tmp = Float64(x * 2.0); elseif (z <= 1.95e-29) tmp = Float64(b * Float64(a * 27.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 <= -5.1e-98)
tmp = z * (-9.0 * (y * t));
elseif (z <= 4.9e-276)
tmp = a * (27.0 * b);
elseif (z <= 8.4e-91)
tmp = x * 2.0;
elseif (z <= 1.95e-29)
tmp = b * (a * 27.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, -5.1e-98], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.9e-276], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.4e-91], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.95e-29], N[(b * N[(a * 27.0), $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 -5.1 \cdot 10^{-98}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-276}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{-91}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-29}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -5.10000000000000022e-98Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*88.7%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in a around 0 77.4%
Taylor expanded in z around inf 77.3%
Taylor expanded in x around 0 48.2%
if -5.10000000000000022e-98 < z < 4.89999999999999966e-276Initial program 99.4%
sub-neg99.4%
sub-neg99.4%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 44.6%
associate-*r*44.6%
*-commutative44.6%
associate-*r*44.6%
Simplified44.6%
if 4.89999999999999966e-276 < z < 8.3999999999999997e-91Initial program 99.7%
sub-neg99.7%
sub-neg99.7%
associate-*l*99.6%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in x around inf 49.7%
if 8.3999999999999997e-91 < z < 1.9499999999999999e-29Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 52.9%
associate-*r*52.9%
Simplified52.9%
if 1.9499999999999999e-29 < z Initial program 91.9%
sub-neg91.9%
sub-neg91.9%
associate-*l*87.8%
associate-*l*87.8%
Simplified87.8%
Taylor expanded in y around inf 44.1%
Final simplification46.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 (* y 9.0)) 5e+268) (+ (- (* x 2.0) (* t (* 9.0 (* z y)))) (* b (* a 27.0))) (* z (- (* 2.0 (/ x 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 * (y * 9.0)) <= 5e+268) {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
} else {
tmp = z * ((2.0 * (x / 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 * (y * 9.0d0)) <= 5d+268) then
tmp = ((x * 2.0d0) - (t * (9.0d0 * (z * y)))) + (b * (a * 27.0d0))
else
tmp = z * ((2.0d0 * (x / 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 * (y * 9.0)) <= 5e+268) {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
} else {
tmp = z * ((2.0 * (x / 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 * (y * 9.0)) <= 5e+268: tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0)) else: tmp = z * ((2.0 * (x / z)) - (9.0 * (y * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(z * Float64(y * 9.0)) <= 5e+268) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(z * y)))) + Float64(b * Float64(a * 27.0))); else tmp = Float64(z * Float64(Float64(2.0 * Float64(x / 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 * (y * 9.0)) <= 5e+268)
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
else
tmp = z * ((2.0 * (x / 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[N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision], 5e+268], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(2.0 * N[(x / 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 \cdot \left(y \cdot 9\right) \leq 5 \cdot 10^{+268}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(2 \cdot \frac{x}{z} - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 5.0000000000000002e268Initial program 98.1%
Taylor expanded in y around 0 98.1%
if 5.0000000000000002e268 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 57.2%
sub-neg57.2%
sub-neg57.2%
associate-*l*88.8%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in a around 0 68.4%
Taylor expanded in z around inf 89.1%
Final simplification97.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 1.95e-47) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (* t (+ (+ (* y (* z -9.0)) (* 27.0 (* a (/ b t)))) (/ (* x 2.0) 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.95e-47) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = t * (((y * (z * -9.0)) + (27.0 * (a * (b / t)))) + ((x * 2.0) / 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.95d-47) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = t * (((y * (z * (-9.0d0))) + (27.0d0 * (a * (b / t)))) + ((x * 2.0d0) / 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.95e-47) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = t * (((y * (z * -9.0)) + (27.0 * (a * (b / t)))) + ((x * 2.0) / 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.95e-47: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = t * (((y * (z * -9.0)) + (27.0 * (a * (b / t)))) + ((x * 2.0) / 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.95e-47) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(t * Float64(Float64(Float64(y * Float64(z * -9.0)) + Float64(27.0 * Float64(a * Float64(b / t)))) + Float64(Float64(x * 2.0) / 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.95e-47)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = t * (((y * (z * -9.0)) + (27.0 * (a * (b / t)))) + ((x * 2.0) / 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.95e-47], 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[(t * N[(N[(N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(a * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] / t), $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^{-47}:\\
\;\;\;\;\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}:\\
\;\;\;\;t \cdot \left(\left(y \cdot \left(z \cdot -9\right) + 27 \cdot \left(a \cdot \frac{b}{t}\right)\right) + \frac{x \cdot 2}{t}\right)\\
\end{array}
\end{array}
if z < 1.94999999999999989e-47Initial program 96.4%
sub-neg96.4%
sub-neg96.4%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
if 1.94999999999999989e-47 < z Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*88.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in t around inf 74.3%
cancel-sign-sub-inv74.3%
metadata-eval74.3%
+-commutative74.3%
*-commutative74.3%
associate-*r*74.4%
fma-define74.4%
+-commutative74.4%
fma-define74.4%
associate-/l*75.6%
associate-*r/75.6%
Simplified75.6%
fma-undefine75.6%
fma-undefine75.6%
associate-+r+75.6%
Applied egg-rr75.6%
Final simplification89.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= a -4.7e+66)
(* b (* a 27.0))
(if (<= a -4.2e-139)
(* x 2.0)
(if (<= a -2.8e-304)
(* -9.0 (* t (* z y)))
(if (<= a 2.7e-15) (* x 2.0) (* 27.0 (* a b)))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.7e+66) {
tmp = b * (a * 27.0);
} else if (a <= -4.2e-139) {
tmp = x * 2.0;
} else if (a <= -2.8e-304) {
tmp = -9.0 * (t * (z * y));
} else if (a <= 2.7e-15) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-4.7d+66)) then
tmp = b * (a * 27.0d0)
else if (a <= (-4.2d-139)) then
tmp = x * 2.0d0
else if (a <= (-2.8d-304)) then
tmp = (-9.0d0) * (t * (z * y))
else if (a <= 2.7d-15) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.7e+66) {
tmp = b * (a * 27.0);
} else if (a <= -4.2e-139) {
tmp = x * 2.0;
} else if (a <= -2.8e-304) {
tmp = -9.0 * (t * (z * y));
} else if (a <= 2.7e-15) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if a <= -4.7e+66: tmp = b * (a * 27.0) elif a <= -4.2e-139: tmp = x * 2.0 elif a <= -2.8e-304: tmp = -9.0 * (t * (z * y)) elif a <= 2.7e-15: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.7e+66) tmp = Float64(b * Float64(a * 27.0)); elseif (a <= -4.2e-139) tmp = Float64(x * 2.0); elseif (a <= -2.8e-304) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (a <= 2.7e-15) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -4.7e+66)
tmp = b * (a * 27.0);
elseif (a <= -4.2e-139)
tmp = x * 2.0;
elseif (a <= -2.8e-304)
tmp = -9.0 * (t * (z * y));
elseif (a <= 2.7e-15)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.7e+66], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -4.2e-139], N[(x * 2.0), $MachinePrecision], If[LessEqual[a, -2.8e-304], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e-15], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.7 \cdot 10^{+66}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-139}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{-304}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{-15}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -4.7000000000000002e66Initial program 90.8%
sub-neg90.8%
sub-neg90.8%
associate-*l*90.9%
associate-*l*90.9%
Simplified90.9%
Taylor expanded in a around inf 62.2%
associate-*r*62.2%
Simplified62.2%
if -4.7000000000000002e66 < a < -4.20000000000000016e-139 or -2.7999999999999998e-304 < a < 2.70000000000000009e-15Initial program 97.3%
sub-neg97.3%
sub-neg97.3%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around inf 51.3%
if -4.20000000000000016e-139 < a < -2.7999999999999998e-304Initial program 99.0%
sub-neg99.0%
sub-neg99.0%
associate-*l*87.9%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in y around inf 41.4%
if 2.70000000000000009e-15 < a Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*92.9%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in a around inf 56.0%
Final simplification53.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 4.1e+108) (+ (* a (* 27.0 b)) (+ (* y (* z (* t -9.0))) (* x 2.0))) (- (* 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.1e+108) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} 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 <= 4.1d+108) then
tmp = (a * (27.0d0 * b)) + ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0))
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 <= 4.1e+108) {
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
} 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 <= 4.1e+108: tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0)) 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 <= 4.1e+108) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0))); else tmp = Float64(Float64(x * 2.0) - Float64(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.1e+108)
tmp = (a * (27.0 * b)) + ((y * (z * (t * -9.0))) + (x * 2.0));
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, 4.1e+108], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(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 4.1 \cdot 10^{+108}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 4.0999999999999999e108Initial program 96.4%
sub-neg96.4%
sub-neg96.4%
associate-*l*95.3%
associate-*l*95.2%
Simplified95.2%
sub-neg95.2%
*-commutative95.2%
distribute-rgt-neg-in95.2%
*-commutative95.2%
distribute-lft-neg-in95.2%
metadata-eval95.2%
associate-*l*95.3%
associate-*r*95.2%
*-commutative95.2%
Applied egg-rr95.2%
if 4.0999999999999999e108 < z Initial program 89.4%
sub-neg89.4%
sub-neg89.4%
associate-*l*81.0%
associate-*l*81.0%
Simplified81.0%
Taylor expanded in a around 0 73.0%
Final simplification91.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* 27.0 b))))
(if (<= z 1.2e-28)
(+ t_1 (+ (* y (* z (* t -9.0))) (* x 2.0)))
(+ t_1 (- (* x 2.0) (* 9.0 (* z (* y t))))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if (z <= 1.2e-28) {
tmp = t_1 + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (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) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= 1.2d-28) then
tmp = t_1 + ((y * (z * (t * (-9.0d0)))) + (x * 2.0d0))
else
tmp = t_1 + ((x * 2.0d0) - (9.0d0 * (z * (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 t_1 = a * (27.0 * b);
double tmp;
if (z <= 1.2e-28) {
tmp = t_1 + ((y * (z * (t * -9.0))) + (x * 2.0));
} else {
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (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): t_1 = a * (27.0 * b) tmp = 0 if z <= 1.2e-28: tmp = t_1 + ((y * (z * (t * -9.0))) + (x * 2.0)) else: tmp = t_1 + ((x * 2.0) - (9.0 * (z * (y * t)))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= 1.2e-28) tmp = Float64(t_1 + Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.0))); else tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * 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)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= 1.2e-28)
tmp = t_1 + ((y * (z * (t * -9.0))) + (x * 2.0));
else
tmp = t_1 + ((x * 2.0) - (9.0 * (z * (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_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.2e-28], N[(t$95$1 + N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $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}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq 1.2 \cdot 10^{-28}:\\
\;\;\;\;t\_1 + \left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if z < 1.2000000000000001e-28Initial program 96.5%
sub-neg96.5%
sub-neg96.5%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
sub-neg94.6%
*-commutative94.6%
distribute-rgt-neg-in94.6%
*-commutative94.6%
distribute-lft-neg-in94.6%
metadata-eval94.6%
associate-*l*94.6%
associate-*r*94.6%
*-commutative94.6%
Applied egg-rr94.6%
if 1.2000000000000001e-28 < z Initial program 91.9%
sub-neg91.9%
sub-neg91.9%
associate-*l*87.8%
associate-*l*87.8%
Simplified87.8%
Taylor expanded in y around 0 91.9%
associate-*r*97.0%
Simplified97.0%
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 (or (<= z -4.9e-95) (not (<= z 3.5e-31))) (+ (* x 2.0) (* (* 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 <= -4.9e-95) || !(z <= 3.5e-31)) {
tmp = (x * 2.0) + ((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 <= (-4.9d-95)) .or. (.not. (z <= 3.5d-31))) then
tmp = (x * 2.0d0) + ((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 <= -4.9e-95) || !(z <= 3.5e-31)) {
tmp = (x * 2.0) + ((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 <= -4.9e-95) or not (z <= 3.5e-31): tmp = (x * 2.0) + ((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 <= -4.9e-95) || !(z <= 3.5e-31)) tmp = Float64(Float64(x * 2.0) + Float64(Float64(z * 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 <= -4.9e-95) || ~((z <= 3.5e-31)))
tmp = (x * 2.0) + ((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, -4.9e-95], N[Not[LessEqual[z, 3.5e-31]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 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 -4.9 \cdot 10^{-95} \lor \neg \left(z \leq 3.5 \cdot 10^{-31}\right):\\
\;\;\;\;x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -4.9e-95 or 3.49999999999999985e-31 < z Initial program 92.4%
sub-neg92.4%
sub-neg92.4%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in a around 0 73.2%
sub-neg73.2%
*-commutative73.2%
distribute-rgt-neg-in73.2%
*-commutative73.2%
metadata-eval73.2%
associate-*r*73.2%
associate-*r*69.0%
*-commutative69.0%
+-commutative69.0%
*-commutative69.0%
associate-*r*69.0%
associate-*l*69.0%
Applied egg-rr69.0%
if -4.9e-95 < z < 3.49999999999999985e-31Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 86.7%
Final simplification75.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 -1.15e-90)
(+ (* x 2.0) (* (* z t) (* y -9.0)))
(if (<= z 2.2e-31)
(+ (* 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.15e-90) {
tmp = (x * 2.0) + ((z * t) * (y * -9.0));
} else if (z <= 2.2e-31) {
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.15d-90)) then
tmp = (x * 2.0d0) + ((z * t) * (y * (-9.0d0)))
else if (z <= 2.2d-31) 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.15e-90) {
tmp = (x * 2.0) + ((z * t) * (y * -9.0));
} else if (z <= 2.2e-31) {
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.15e-90: tmp = (x * 2.0) + ((z * t) * (y * -9.0)) elif z <= 2.2e-31: 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.15e-90) tmp = Float64(Float64(x * 2.0) + Float64(Float64(z * t) * Float64(y * -9.0))); elseif (z <= 2.2e-31) 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.15e-90)
tmp = (x * 2.0) + ((z * t) * (y * -9.0));
elseif (z <= 2.2e-31)
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.15e-90], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e-31], 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.15 \cdot 10^{-90}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-31}:\\
\;\;\;\;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.1499999999999999e-90Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*88.4%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in a around 0 76.9%
sub-neg76.9%
*-commutative76.9%
distribute-rgt-neg-in76.9%
*-commutative76.9%
metadata-eval76.9%
associate-*r*76.9%
associate-*r*71.3%
*-commutative71.3%
+-commutative71.3%
*-commutative71.3%
associate-*r*71.3%
associate-*l*71.3%
Applied egg-rr71.3%
if -1.1499999999999999e-90 < z < 2.2000000000000001e-31Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.9%
if 2.2000000000000001e-31 < z Initial program 91.9%
sub-neg91.9%
sub-neg91.9%
associate-*l*87.8%
associate-*l*87.8%
Simplified87.8%
Taylor expanded in a around 0 68.6%
Final simplification76.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 (or (<= a -2.1e+61) (not (<= a 1.75e-15))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.1e+61) || !(a <= 1.75e-15)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2.1d+61)) .or. (.not. (a <= 1.75d-15))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.1e+61) || !(a <= 1.75e-15)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.1e+61) or not (a <= 1.75e-15): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.1e+61) || !(a <= 1.75e-15)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -2.1e+61) || ~((a <= 1.75e-15)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.1e+61], N[Not[LessEqual[a, 1.75e-15]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+61} \lor \neg \left(a \leq 1.75 \cdot 10^{-15}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -2.1000000000000001e61 or 1.75e-15 < a Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in a around inf 58.4%
if -2.1000000000000001e61 < a < 1.75e-15Initial program 97.7%
sub-neg97.7%
sub-neg97.7%
associate-*l*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around inf 51.5%
Final simplification54.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 (<= a -2.2e+61) (* b (* a 27.0)) (if (<= a 1.48e-18) (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.2e+61) {
tmp = b * (a * 27.0);
} else if (a <= 1.48e-18) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-2.2d+61)) then
tmp = b * (a * 27.0d0)
else if (a <= 1.48d-18) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.2e+61) {
tmp = b * (a * 27.0);
} else if (a <= 1.48e-18) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if a <= -2.2e+61: tmp = b * (a * 27.0) elif a <= 1.48e-18: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.2e+61) tmp = Float64(b * Float64(a * 27.0)); elseif (a <= 1.48e-18) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -2.2e+61)
tmp = b * (a * 27.0);
elseif (a <= 1.48e-18)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.2e+61], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.48e-18], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{+61}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;a \leq 1.48 \cdot 10^{-18}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -2.2e61Initial program 90.8%
sub-neg90.8%
sub-neg90.8%
associate-*l*90.9%
associate-*l*90.9%
Simplified90.9%
Taylor expanded in a around inf 62.2%
associate-*r*62.2%
Simplified62.2%
if -2.2e61 < a < 1.48000000000000002e-18Initial program 97.6%
sub-neg97.6%
sub-neg97.6%
associate-*l*93.1%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 51.2%
if 1.48000000000000002e-18 < a Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*93.0%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in a around inf 55.4%
Final simplification54.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 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*92.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in x around inf 35.3%
Final simplification35.3%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024075
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))