
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 3.9e-60) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (* t (- (+ (* 2.0 (/ x t)) (* 27.0 (/ (* a b) t))) (* 9.0 (* z y))))))
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.9e-60) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (z * y)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 3.9e-60) 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(2.0 * Float64(x / t)) + Float64(27.0 * Float64(Float64(a * b) / t))) - Float64(9.0 * Float64(z * y)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 3.9e-60], 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[(2.0 * N[(x / t), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.9 \cdot 10^{-60}:\\
\;\;\;\;\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(2 \cdot \frac{x}{t} + 27 \cdot \frac{a \cdot b}{t}\right) - 9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 3.9000000000000002e-60Initial program 95.9%
+-commutative95.9%
associate-+r-95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-*r*93.7%
distribute-lft-neg-in93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-+r-93.7%
associate-*l*93.7%
fma-define93.7%
fma-neg93.7%
associate-*l*95.4%
distribute-rgt-neg-in95.4%
*-commutative95.4%
associate-*l*95.9%
*-commutative95.9%
distribute-lft-neg-in95.9%
associate-*r*95.9%
Simplified95.9%
if 3.9000000000000002e-60 < z Initial program 93.9%
associate-+l-93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*94.0%
associate-+l-94.0%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in t around inf 87.0%
Final simplification93.0%
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.8e-93) (+ (* y (* z (* t -9.0))) (+ (* 27.0 (* a b)) (* x 2.0))) (* t (- (+ (* 2.0 (/ x t)) (* 27.0 (/ (* a b) t))) (* 9.0 (* z y))))))
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.8e-93) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 1.8d-93) then
tmp = (y * (z * (t * (-9.0d0)))) + ((27.0d0 * (a * b)) + (x * 2.0d0))
else
tmp = t * (((2.0d0 * (x / t)) + (27.0d0 * ((a * b) / t))) - (9.0d0 * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.8e-93) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1.8e-93: tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0)) else: tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.8e-93) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0))); else tmp = Float64(t * Float64(Float64(Float64(2.0 * Float64(x / t)) + Float64(27.0 * Float64(Float64(a * b) / t))) - Float64(9.0 * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1.8e-93)
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
else
tmp = t * (((2.0 * (x / t)) + (27.0 * ((a * b) / t))) - (9.0 * (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.8e-93], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(2.0 * N[(x / t), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.8 \cdot 10^{-93}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(2 \cdot \frac{x}{t} + 27 \cdot \frac{a \cdot b}{t}\right) - 9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 1.8000000000000001e-93Initial program 95.7%
+-commutative95.7%
associate-+r-95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-*r*93.4%
distribute-lft-neg-in93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
associate-+r-93.4%
associate-*l*93.4%
fma-define93.4%
cancel-sign-sub-inv93.4%
fma-define93.4%
distribute-lft-neg-in93.4%
distribute-rgt-neg-in93.4%
*-commutative93.4%
associate-*r*95.7%
associate-*l*95.8%
neg-mul-195.8%
associate-*r*95.8%
Simplified95.8%
fma-undefine95.7%
fma-undefine95.7%
associate-+r+95.7%
*-commutative95.7%
associate-*l*95.7%
*-commutative95.7%
associate-*r*95.7%
*-commutative95.7%
associate-*r*95.7%
*-commutative95.7%
associate-*l*95.7%
Applied egg-rr95.7%
if 1.8000000000000001e-93 < z Initial program 94.5%
associate-+l-94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*94.5%
associate-+l-94.5%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*89.6%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in t around inf 87.2%
Final simplification92.7%
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 -4.9e-60) (not (<= b 0.003))) (- (* 27.0 (* a b)) (* 9.0 (* t (* z y)))) (- (* x 2.0) (* (* y 9.0) (* z t)))))
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 <= -4.9e-60) || !(b <= 0.003)) {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-4.9d-60)) .or. (.not. (b <= 0.003d0))) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * (t * (z * y)))
else
tmp = (x * 2.0d0) - ((y * 9.0d0) * (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.9e-60) || !(b <= 0.003)) {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
} else {
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -4.9e-60) or not (b <= 0.003): tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y))) else: tmp = (x * 2.0) - ((y * 9.0) * (z * t)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.9e-60) || !(b <= 0.003)) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -4.9e-60) || ~((b <= 0.003)))
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
else
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.9e-60], N[Not[LessEqual[b, 0.003]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.9 \cdot 10^{-60} \lor \neg \left(b \leq 0.003\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if b < -4.89999999999999988e-60 or 0.0030000000000000001 < b Initial program 95.0%
associate-+l-95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*95.0%
associate-+l-95.0%
associate-*l*95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*95.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in x around 0 78.2%
if -4.89999999999999988e-60 < b < 0.0030000000000000001Initial program 95.6%
associate-+l-95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*95.7%
associate-+l-95.7%
associate-*l*95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*90.0%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in a around 0 85.8%
pow185.8%
*-commutative85.8%
associate-*l*80.8%
*-commutative80.8%
Applied egg-rr80.8%
unpow180.8%
associate-*r*80.0%
*-commutative80.0%
Simplified80.0%
Final simplification79.0%
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 (<= x -2.35e+60)
(- (* x 2.0) (* (* y 9.0) (* z t)))
(if (<= x 2.3e+94)
(+ (* y (* z (* t -9.0))) (* a (* 27.0 b)))
(+ (* 27.0 (* a b)) (* x 2.0)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.35e+60) {
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
} else if (x <= 2.3e+94) {
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (a * b)) + (x * 2.0);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-2.35d+60)) then
tmp = (x * 2.0d0) - ((y * 9.0d0) * (z * t))
else if (x <= 2.3d+94) then
tmp = (y * (z * (t * (-9.0d0)))) + (a * (27.0d0 * b))
else
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.35e+60) {
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
} else if (x <= 2.3e+94) {
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (a * b)) + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if x <= -2.35e+60: tmp = (x * 2.0) - ((y * 9.0) * (z * t)) elif x <= 2.3e+94: tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b)) else: tmp = (27.0 * (a * b)) + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.35e+60) tmp = Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))); elseif (x <= 2.3e+94) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (x <= -2.35e+60)
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
elseif (x <= 2.3e+94)
tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
else
tmp = (27.0 * (a * b)) + (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.35e+60], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3e+94], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{+60}:\\
\;\;\;\;x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+94}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if x < -2.3499999999999999e60Initial program 96.5%
associate-+l-96.5%
*-commutative96.5%
*-commutative96.5%
associate-*l*96.5%
associate-+l-96.5%
associate-*l*96.5%
*-commutative96.5%
*-commutative96.5%
associate-*l*89.5%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in a around 0 80.2%
pow180.2%
*-commutative80.2%
associate-*l*73.4%
*-commutative73.4%
Applied egg-rr73.4%
unpow173.4%
associate-*r*73.3%
*-commutative73.3%
Simplified73.3%
if -2.3499999999999999e60 < x < 2.3e94Initial program 95.1%
associate-+l-95.1%
*-commutative95.1%
*-commutative95.1%
associate-*l*95.1%
associate-+l-95.1%
associate-*l*95.1%
*-commutative95.1%
*-commutative95.1%
associate-*l*93.9%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in x around 0 87.1%
cancel-sign-sub-inv87.1%
metadata-eval87.1%
*-commutative87.1%
associate-*r*87.6%
+-commutative87.6%
associate-*r*87.1%
*-commutative87.1%
associate-*r*87.0%
associate-*r*86.6%
*-commutative86.6%
associate-*l*86.6%
Applied egg-rr86.6%
if 2.3e94 < x Initial program 94.4%
associate-+l-94.4%
*-commutative94.4%
*-commutative94.4%
associate-*l*94.5%
associate-+l-94.5%
associate-*l*94.4%
*-commutative94.4%
*-commutative94.4%
associate-*l*94.8%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in y around 0 75.0%
Final simplification82.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e-110) (+ (* y (* z (* t -9.0))) (+ (* 27.0 (* a b)) (* x 2.0))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-110) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= 2d-110) then
tmp = (y * (z * (t * (-9.0d0)))) + ((27.0d0 * (a * b)) + (x * 2.0d0))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-110) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 2e-110: tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e-110) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 2e-110)
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2e-110], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-110}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 2.0000000000000001e-110Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-*r*93.7%
distribute-lft-neg-in93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-+r-93.7%
associate-*l*93.7%
fma-define93.7%
cancel-sign-sub-inv93.7%
fma-define93.7%
distribute-lft-neg-in93.7%
distribute-rgt-neg-in93.7%
*-commutative93.7%
associate-*r*95.6%
associate-*l*95.6%
neg-mul-195.6%
associate-*r*95.6%
Simplified95.6%
fma-undefine95.6%
fma-undefine95.6%
associate-+r+95.6%
*-commutative95.6%
associate-*l*95.5%
*-commutative95.5%
associate-*r*95.5%
*-commutative95.5%
associate-*r*95.5%
*-commutative95.5%
associate-*l*95.6%
Applied egg-rr95.6%
if 2.0000000000000001e-110 < z Initial program 94.8%
Final simplification95.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.55e+83) (+ (* y (* z (* t -9.0))) (+ (* 27.0 (* a b)) (* x 2.0))) (- (* x 2.0) (* 9.0 (* t (* z y))))))
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+83) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (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.
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.55d+83) then
tmp = (y * (z * (t * (-9.0d0)))) + ((27.0d0 * (a * b)) + (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;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1.55e+83) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (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]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1.55e+83: tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (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]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1.55e+83) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1.55e+83)
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.55e+83], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(27.0 * N[(a * b), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.55 \cdot 10^{+83}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\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 < 1.54999999999999996e83Initial program 96.0%
+-commutative96.0%
associate-+r-96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-*r*94.1%
distribute-lft-neg-in94.1%
*-commutative94.1%
cancel-sign-sub-inv94.1%
associate-+r-94.1%
associate-*l*94.1%
fma-define94.1%
cancel-sign-sub-inv94.1%
fma-define94.1%
distribute-lft-neg-in94.1%
distribute-rgt-neg-in94.1%
*-commutative94.1%
associate-*r*96.0%
associate-*l*96.1%
neg-mul-196.1%
associate-*r*96.1%
Simplified96.1%
fma-undefine96.1%
fma-undefine96.1%
associate-+r+96.1%
*-commutative96.1%
associate-*l*96.0%
*-commutative96.0%
associate-*r*96.0%
*-commutative96.0%
associate-*r*96.0%
*-commutative96.0%
associate-*l*96.0%
Applied egg-rr96.0%
if 1.54999999999999996e83 < z Initial program 92.2%
associate-+l-92.2%
*-commutative92.2%
*-commutative92.2%
associate-*l*92.3%
associate-+l-92.3%
associate-*l*92.2%
*-commutative92.2%
*-commutative92.2%
associate-*l*83.3%
associate-*l*83.3%
Simplified83.3%
Taylor expanded in a around 0 76.7%
Final simplification92.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.5e-108) (not (<= b 1500000000.0))) (+ (* 27.0 (* a b)) (* x 2.0)) (- (* x 2.0) (* (* y 9.0) (* z t)))))
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 <= -1.5e-108) || !(b <= 1500000000.0)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.5d-108)) .or. (.not. (b <= 1500000000.0d0))) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - ((y * 9.0d0) * (z * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.5e-108) || !(b <= 1500000000.0)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.5e-108) or not (b <= 1500000000.0): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - ((y * 9.0) * (z * t)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.5e-108) || !(b <= 1500000000.0)) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -1.5e-108) || ~((b <= 1500000000.0)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - ((y * 9.0) * (z * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.5e-108], N[Not[LessEqual[b, 1500000000.0]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.5 \cdot 10^{-108} \lor \neg \left(b \leq 1500000000\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\\
\end{array}
\end{array}
if b < -1.49999999999999996e-108 or 1.5e9 < b Initial program 95.1%
associate-+l-95.1%
*-commutative95.1%
*-commutative95.1%
associate-*l*95.2%
associate-+l-95.2%
associate-*l*95.1%
*-commutative95.1%
*-commutative95.1%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in y around 0 73.0%
if -1.49999999999999996e-108 < b < 1.5e9Initial program 95.5%
associate-+l-95.5%
*-commutative95.5%
*-commutative95.5%
associate-*l*95.5%
associate-+l-95.5%
associate-*l*95.5%
*-commutative95.5%
*-commutative95.5%
associate-*l*91.2%
associate-*l*91.2%
Simplified91.2%
Taylor expanded in a around 0 85.1%
pow185.1%
*-commutative85.1%
associate-*l*81.6%
*-commutative81.6%
Applied egg-rr81.6%
unpow181.6%
associate-*r*80.7%
*-commutative80.7%
Simplified80.7%
Final simplification76.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1.9e-176)
(* -9.0 (* z (* y t)))
(if (<= t 1.3e+130)
(+ (* 27.0 (* a b)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))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 (t <= -1.9e-176) {
tmp = -9.0 * (z * (y * t));
} else if (t <= 1.3e+130) {
tmp = (27.0 * (a * b)) + (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.
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 (t <= (-1.9d-176)) then
tmp = (-9.0d0) * (z * (y * t))
else if (t <= 1.3d+130) then
tmp = (27.0d0 * (a * b)) + (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;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.9e-176) {
tmp = -9.0 * (z * (y * t));
} else if (t <= 1.3e+130) {
tmp = (27.0 * (a * b)) + (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]) def code(x, y, z, t, a, b): tmp = 0 if t <= -1.9e-176: tmp = -9.0 * (z * (y * t)) elif t <= 1.3e+130: tmp = (27.0 * (a * b)) + (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]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.9e-176) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (t <= 1.3e+130) tmp = Float64(Float64(27.0 * Float64(a * b)) + 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (t <= -1.9e-176)
tmp = -9.0 * (z * (y * t));
elseif (t <= 1.3e+130)
tmp = (27.0 * (a * b)) + (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.9e-176], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+130], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-176}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+130}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if t < -1.90000000000000006e-176Initial program 97.1%
associate-+l-97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
associate-+l-97.1%
associate-*l*97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*91.9%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in y around inf 41.2%
*-commutative41.2%
associate-*r*40.3%
Simplified40.3%
if -1.90000000000000006e-176 < t < 1.2999999999999999e130Initial program 91.7%
associate-+l-91.7%
*-commutative91.7%
*-commutative91.7%
associate-*l*91.7%
associate-+l-91.7%
associate-*l*91.7%
*-commutative91.7%
*-commutative91.7%
associate-*l*96.1%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in y around 0 69.5%
if 1.2999999999999999e130 < t Initial program 99.8%
associate-+l-99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*88.8%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in a around 0 81.0%
Final simplification58.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -34000000000000.0) (* y (* -9.0 (* z t))) (if (<= z 2.7e+23) (+ (* 27.0 (* a b)) (* x 2.0)) (* -9.0 (* z (* y t))))))
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 <= -34000000000000.0) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 2.7e+23) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = -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.
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 <= (-34000000000000.0d0)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 2.7d+23) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (-9.0d0) * (z * (y * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -34000000000000.0) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 2.7e+23) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = -9.0 * (z * (y * t));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -34000000000000.0: tmp = y * (-9.0 * (z * t)) elif z <= 2.7e+23: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = -9.0 * (z * (y * t)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -34000000000000.0) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 2.7e+23) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -34000000000000.0)
tmp = y * (-9.0 * (z * t));
elseif (z <= 2.7e+23)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = -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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -34000000000000.0], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e+23], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -34000000000000:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+23}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -3.4e13Initial program 87.0%
associate-+l-87.0%
*-commutative87.0%
*-commutative87.0%
associate-*l*87.1%
associate-+l-87.1%
associate-*l*87.0%
*-commutative87.0%
*-commutative87.0%
associate-*l*89.3%
associate-*l*89.3%
Simplified89.3%
Taylor expanded in x around inf 72.4%
Taylor expanded in t around inf 55.6%
associate-*r*55.6%
*-commutative55.6%
*-commutative55.6%
associate-*l*57.7%
associate-*r*57.6%
*-commutative57.6%
associate-*l*57.6%
Simplified57.6%
Taylor expanded in t around 0 57.6%
if -3.4e13 < z < 2.6999999999999999e23Initial program 99.0%
associate-+l-99.0%
*-commutative99.0%
*-commutative99.0%
associate-*l*99.0%
associate-+l-99.0%
associate-*l*99.0%
*-commutative99.0%
*-commutative99.0%
associate-*l*97.5%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in y around 0 79.8%
if 2.6999999999999999e23 < z Initial program 93.7%
associate-+l-93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*93.8%
associate-+l-93.8%
associate-*l*93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*86.7%
associate-*l*86.7%
Simplified86.7%
Taylor expanded in y around inf 60.1%
*-commutative60.1%
associate-*r*64.6%
Simplified64.6%
Final simplification71.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= b -5.3e-42) (* 27.0 (* a b)) (if (<= b 1800000000.0) (* y (* -9.0 (* z t))) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.3e-42) {
tmp = 27.0 * (a * b);
} else if (b <= 1800000000.0) {
tmp = y * (-9.0 * (z * t));
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-5.3d-42)) then
tmp = 27.0d0 * (a * b)
else if (b <= 1800000000.0d0) then
tmp = y * ((-9.0d0) * (z * t))
else
tmp = a * (27.0d0 * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.3e-42) {
tmp = 27.0 * (a * b);
} else if (b <= 1800000000.0) {
tmp = y * (-9.0 * (z * t));
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -5.3e-42: tmp = 27.0 * (a * b) elif b <= 1800000000.0: tmp = y * (-9.0 * (z * t)) else: tmp = a * (27.0 * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5.3e-42) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 1800000000.0) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); else tmp = Float64(a * Float64(27.0 * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -5.3e-42)
tmp = 27.0 * (a * b);
elseif (b <= 1800000000.0)
tmp = y * (-9.0 * (z * t));
else
tmp = a * (27.0 * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5.3e-42], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1800000000.0], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.3 \cdot 10^{-42}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 1800000000:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if b < -5.3e-42Initial program 98.3%
associate-+l-98.3%
*-commutative98.3%
*-commutative98.3%
associate-*l*98.3%
associate-+l-98.3%
associate-*l*98.3%
*-commutative98.3%
*-commutative98.3%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in a around inf 56.8%
if -5.3e-42 < b < 1.8e9Initial program 95.8%
associate-+l-95.8%
*-commutative95.8%
*-commutative95.8%
associate-*l*95.9%
associate-+l-95.9%
associate-*l*95.8%
*-commutative95.8%
*-commutative95.8%
associate-*l*90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in x around inf 90.3%
Taylor expanded in t around inf 53.3%
associate-*r*53.2%
*-commutative53.2%
*-commutative53.2%
associate-*l*51.1%
associate-*r*51.0%
*-commutative51.0%
associate-*l*51.2%
Simplified51.2%
Taylor expanded in t around 0 51.0%
if 1.8e9 < b Initial program 91.3%
associate-+l-91.3%
*-commutative91.3%
*-commutative91.3%
associate-*l*91.3%
associate-+l-91.3%
associate-*l*91.3%
*-commutative91.3%
*-commutative91.3%
associate-*l*95.6%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in a around inf 58.6%
associate-*r*58.6%
*-commutative58.6%
associate-*r*58.6%
Simplified58.6%
Final simplification54.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= b -8.5e-42) (* 27.0 (* a b)) (if (<= b 11500000.0) (* -9.0 (* t (* z y))) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.5e-42) {
tmp = 27.0 * (a * b);
} else if (b <= 11500000.0) {
tmp = -9.0 * (t * (z * y));
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-8.5d-42)) then
tmp = 27.0d0 * (a * b)
else if (b <= 11500000.0d0) then
tmp = (-9.0d0) * (t * (z * y))
else
tmp = a * (27.0d0 * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.5e-42) {
tmp = 27.0 * (a * b);
} else if (b <= 11500000.0) {
tmp = -9.0 * (t * (z * y));
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -8.5e-42: tmp = 27.0 * (a * b) elif b <= 11500000.0: tmp = -9.0 * (t * (z * y)) else: tmp = a * (27.0 * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8.5e-42) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 11500000.0) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); else tmp = Float64(a * Float64(27.0 * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -8.5e-42)
tmp = 27.0 * (a * b);
elseif (b <= 11500000.0)
tmp = -9.0 * (t * (z * y));
else
tmp = a * (27.0 * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.5e-42], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 11500000.0], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.5 \cdot 10^{-42}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 11500000:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if b < -8.4999999999999996e-42Initial program 98.3%
associate-+l-98.3%
*-commutative98.3%
*-commutative98.3%
associate-*l*98.3%
associate-+l-98.3%
associate-*l*98.3%
*-commutative98.3%
*-commutative98.3%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in a around inf 56.8%
if -8.4999999999999996e-42 < b < 1.15e7Initial program 95.8%
associate-+l-95.8%
*-commutative95.8%
*-commutative95.8%
associate-*l*95.9%
associate-+l-95.9%
associate-*l*95.8%
*-commutative95.8%
*-commutative95.8%
associate-*l*90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in y around inf 53.3%
if 1.15e7 < b Initial program 91.3%
associate-+l-91.3%
*-commutative91.3%
*-commutative91.3%
associate-*l*91.3%
associate-+l-91.3%
associate-*l*91.3%
*-commutative91.3%
*-commutative91.3%
associate-*l*95.6%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in a around inf 58.6%
associate-*r*58.6%
*-commutative58.6%
associate-*r*58.6%
Simplified58.6%
Final simplification55.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -7e-42) (not (<= b 0.00023))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -7e-42) || !(b <= 0.00023)) {
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.
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 <= (-7d-42)) .or. (.not. (b <= 0.00023d0))) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -7e-42) || !(b <= 0.00023)) {
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]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -7e-42) or not (b <= 0.00023): 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]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -7e-42) || !(b <= 0.00023)) 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -7e-42) || ~((b <= 0.00023)))
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. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -7e-42], N[Not[LessEqual[b, 0.00023]], $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])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{-42} \lor \neg \left(b \leq 0.00023\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -7.0000000000000004e-42 or 2.3000000000000001e-4 < b Initial program 95.0%
associate-+l-95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*95.0%
associate-+l-95.0%
associate-*l*95.0%
*-commutative95.0%
*-commutative95.0%
associate-*l*95.7%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in a around inf 57.1%
if -7.0000000000000004e-42 < b < 2.3000000000000001e-4Initial program 95.6%
associate-+l-95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*95.8%
associate-+l-95.8%
associate-*l*95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*90.1%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in x around inf 35.4%
Final simplification47.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= b -1.2e-35) (* 27.0 (* a b)) (if (<= b 2e-6) (* x 2.0) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.2e-35) {
tmp = 27.0 * (a * b);
} else if (b <= 2e-6) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.2d-35)) then
tmp = 27.0d0 * (a * b)
else if (b <= 2d-6) then
tmp = x * 2.0d0
else
tmp = a * (27.0d0 * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.2e-35) {
tmp = 27.0 * (a * b);
} else if (b <= 2e-6) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -1.2e-35: tmp = 27.0 * (a * b) elif b <= 2e-6: tmp = x * 2.0 else: tmp = a * (27.0 * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.2e-35) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 2e-6) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(27.0 * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -1.2e-35)
tmp = 27.0 * (a * b);
elseif (b <= 2e-6)
tmp = x * 2.0;
else
tmp = a * (27.0 * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.2e-35], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-6], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{-35}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-6}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if b < -1.2000000000000001e-35Initial program 98.3%
associate-+l-98.3%
*-commutative98.3%
*-commutative98.3%
associate-*l*98.3%
associate-+l-98.3%
associate-*l*98.3%
*-commutative98.3%
*-commutative98.3%
associate-*l*95.6%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in a around inf 57.6%
if -1.2000000000000001e-35 < b < 1.99999999999999991e-6Initial program 95.7%
associate-+l-95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*95.8%
associate-+l-95.8%
associate-*l*95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*90.1%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in x around inf 35.2%
if 1.99999999999999991e-6 < b Initial program 91.6%
associate-+l-91.6%
*-commutative91.6%
*-commutative91.6%
associate-*l*91.6%
associate-+l-91.6%
associate-*l*91.6%
*-commutative91.6%
*-commutative91.6%
associate-*l*95.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in a around inf 57.5%
associate-*r*57.5%
*-commutative57.5%
associate-*r*57.6%
Simplified57.6%
Final simplification47.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
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;
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]) 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]) 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])){:}
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. 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 \cdot 2
\end{array}
Initial program 95.3%
associate-+l-95.3%
*-commutative95.3%
*-commutative95.3%
associate-*l*95.3%
associate-+l-95.3%
associate-*l*95.3%
*-commutative95.3%
*-commutative95.3%
associate-*l*93.1%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around inf 26.8%
Final simplification26.8%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024118
(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)))