
(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 15 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 -4.7e+54) (* y (- (+ (* 2.0 (/ x y)) (* 27.0 (/ (* a b) y))) (* 9.0 (* z t)))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.7e+54) {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * t)));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.7e+54) tmp = Float64(y * Float64(Float64(Float64(2.0 * Float64(x / y)) + Float64(27.0 * Float64(Float64(a * b) / y))) - Float64(9.0 * Float64(z * t)))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.7e+54], N[(y * N[(N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{+54}:\\
\;\;\;\;y \cdot \left(\left(2 \cdot \frac{x}{y} + 27 \cdot \frac{a \cdot b}{y}\right) - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -4.69999999999999993e54Initial program 86.1%
associate-*l*92.8%
associate-*l*92.8%
Simplified92.8%
Taylor expanded in y around inf 79.2%
if -4.69999999999999993e54 < z Initial program 97.9%
+-commutative97.9%
associate-+r-97.9%
*-commutative97.9%
cancel-sign-sub-inv97.9%
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.6%
cancel-sign-sub-inv94.6%
fma-define94.6%
distribute-lft-neg-in94.6%
distribute-rgt-neg-in94.6%
*-commutative94.6%
associate-*r*98.4%
associate-*l*97.8%
neg-mul-197.8%
associate-*r*97.8%
Simplified97.8%
Final simplification93.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 (fma a (* 27.0 b) (+ (* y (* t (* z -9.0))) (* 2.0 x))))
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 fma(a, (27.0 * b), ((y * (t * (z * -9.0))) + (2.0 * x)));
}
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 fma(a, Float64(27.0 * b), Float64(Float64(y * Float64(t * Float64(z * -9.0))) + Float64(2.0 * x))) 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[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x), $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])\\
\\
\mathsf{fma}\left(a, 27 \cdot b, y \cdot \left(t \cdot \left(z \cdot -9\right)\right) + 2 \cdot x\right)
\end{array}
Initial program 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-*r*94.5%
distribute-lft-neg-in94.5%
*-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r-94.5%
associate-*l*94.5%
fma-define94.9%
fma-neg94.9%
associate-*l*96.0%
distribute-rgt-neg-in96.0%
*-commutative96.0%
associate-*l*96.0%
*-commutative96.0%
distribute-lft-neg-in96.0%
associate-*r*95.7%
Simplified95.7%
Taylor expanded in z around 0 96.0%
*-commutative96.0%
associate-*l*96.0%
Simplified96.0%
fma-undefine96.0%
*-commutative96.0%
+-commutative96.0%
*-commutative96.0%
Applied egg-rr96.0%
Final simplification96.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* y (* z t)))))
(if (<= a -1.92e+56)
(* a (* 27.0 b))
(if (<= a -3.8e-16)
t_1
(if (<= a -2.4e-64)
(* 2.0 x)
(if (<= a -3.1e-106)
(* t (* y (* z -9.0)))
(if (<= a 2.3e-297)
(* 2.0 x)
(if (<= a 2.4e-140) t_1 (* 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 t_1 = -9.0 * (y * (z * t));
double tmp;
if (a <= -1.92e+56) {
tmp = a * (27.0 * b);
} else if (a <= -3.8e-16) {
tmp = t_1;
} else if (a <= -2.4e-64) {
tmp = 2.0 * x;
} else if (a <= -3.1e-106) {
tmp = t * (y * (z * -9.0));
} else if (a <= 2.3e-297) {
tmp = 2.0 * x;
} else if (a <= 2.4e-140) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (y * (z * t))
if (a <= (-1.92d+56)) then
tmp = a * (27.0d0 * b)
else if (a <= (-3.8d-16)) then
tmp = t_1
else if (a <= (-2.4d-64)) then
tmp = 2.0d0 * x
else if (a <= (-3.1d-106)) then
tmp = t * (y * (z * (-9.0d0)))
else if (a <= 2.3d-297) then
tmp = 2.0d0 * x
else if (a <= 2.4d-140) then
tmp = t_1
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 t_1 = -9.0 * (y * (z * t));
double tmp;
if (a <= -1.92e+56) {
tmp = a * (27.0 * b);
} else if (a <= -3.8e-16) {
tmp = t_1;
} else if (a <= -2.4e-64) {
tmp = 2.0 * x;
} else if (a <= -3.1e-106) {
tmp = t * (y * (z * -9.0));
} else if (a <= 2.3e-297) {
tmp = 2.0 * x;
} else if (a <= 2.4e-140) {
tmp = t_1;
} 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): t_1 = -9.0 * (y * (z * t)) tmp = 0 if a <= -1.92e+56: tmp = a * (27.0 * b) elif a <= -3.8e-16: tmp = t_1 elif a <= -2.4e-64: tmp = 2.0 * x elif a <= -3.1e-106: tmp = t * (y * (z * -9.0)) elif a <= 2.3e-297: tmp = 2.0 * x elif a <= 2.4e-140: tmp = t_1 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) t_1 = Float64(-9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (a <= -1.92e+56) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= -3.8e-16) tmp = t_1; elseif (a <= -2.4e-64) tmp = Float64(2.0 * x); elseif (a <= -3.1e-106) tmp = Float64(t * Float64(y * Float64(z * -9.0))); elseif (a <= 2.3e-297) tmp = Float64(2.0 * x); elseif (a <= 2.4e-140) tmp = t_1; 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)
t_1 = -9.0 * (y * (z * t));
tmp = 0.0;
if (a <= -1.92e+56)
tmp = a * (27.0 * b);
elseif (a <= -3.8e-16)
tmp = t_1;
elseif (a <= -2.4e-64)
tmp = 2.0 * x;
elseif (a <= -3.1e-106)
tmp = t * (y * (z * -9.0));
elseif (a <= 2.3e-297)
tmp = 2.0 * x;
elseif (a <= 2.4e-140)
tmp = t_1;
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_] := Block[{t$95$1 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.92e+56], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -3.8e-16], t$95$1, If[LessEqual[a, -2.4e-64], N[(2.0 * x), $MachinePrecision], If[LessEqual[a, -3.1e-106], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.3e-297], N[(2.0 * x), $MachinePrecision], If[LessEqual[a, 2.4e-140], t$95$1, 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}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;a \leq -1.92 \cdot 10^{+56}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq -3.8 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-64}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;a \leq -3.1 \cdot 10^{-106}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-297}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -1.9199999999999999e56Initial program 94.7%
+-commutative94.7%
associate-+r-94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-*r*91.1%
distribute-lft-neg-in91.1%
*-commutative91.1%
cancel-sign-sub-inv91.1%
associate-+r-91.1%
associate-*l*91.1%
fma-define92.9%
cancel-sign-sub-inv92.9%
fma-define92.9%
distribute-lft-neg-in92.9%
distribute-rgt-neg-in92.9%
*-commutative92.9%
associate-*r*96.5%
associate-*l*96.4%
neg-mul-196.4%
associate-*r*96.4%
Simplified96.4%
Taylor expanded in t around 0 75.2%
Taylor expanded in a around inf 75.3%
Taylor expanded in x around 0 62.7%
if -1.9199999999999999e56 < a < -3.80000000000000012e-16 or 2.2999999999999999e-297 < a < 2.39999999999999987e-140Initial program 97.8%
+-commutative97.8%
associate-+r-97.8%
*-commutative97.8%
cancel-sign-sub-inv97.8%
associate-*r*93.4%
distribute-lft-neg-in93.4%
*-commutative93.4%
cancel-sign-sub-inv93.4%
associate-+r-93.4%
associate-*l*93.3%
fma-define93.3%
fma-neg93.3%
associate-*l*95.5%
distribute-rgt-neg-in95.5%
*-commutative95.5%
associate-*l*95.5%
*-commutative95.5%
distribute-lft-neg-in95.5%
associate-*r*95.5%
Simplified95.5%
Taylor expanded in z around 0 95.5%
*-commutative95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in y around inf 52.9%
associate-*r*48.5%
*-commutative48.5%
associate-*r*52.7%
Simplified52.7%
if -3.80000000000000012e-16 < a < -2.39999999999999998e-64 or -3.09999999999999985e-106 < a < 2.2999999999999999e-297Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
*-commutative98.1%
cancel-sign-sub-inv98.1%
associate-*r*98.0%
distribute-lft-neg-in98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-+r-98.0%
associate-*l*98.0%
fma-define98.0%
fma-neg98.0%
associate-*l*97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*l*97.9%
*-commutative97.9%
distribute-lft-neg-in97.9%
associate-*r*97.9%
Simplified97.9%
Taylor expanded in z around 0 97.9%
*-commutative97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 62.1%
if -2.39999999999999998e-64 < a < -3.09999999999999985e-106Initial program 99.7%
+-commutative99.7%
associate-+r-99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
associate-*r*90.3%
distribute-lft-neg-in90.3%
*-commutative90.3%
cancel-sign-sub-inv90.3%
associate-+r-90.3%
associate-*l*90.3%
fma-define90.3%
cancel-sign-sub-inv90.3%
fma-define90.3%
distribute-lft-neg-in90.3%
distribute-rgt-neg-in90.3%
*-commutative90.3%
associate-*r*99.7%
associate-*l*99.8%
neg-mul-199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around inf 70.4%
*-commutative70.4%
associate-*r*70.4%
associate-*l*70.6%
Simplified70.6%
if 2.39999999999999987e-140 < a Initial program 92.7%
+-commutative92.7%
associate-+r-92.7%
*-commutative92.7%
cancel-sign-sub-inv92.7%
associate-*r*95.7%
distribute-lft-neg-in95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-+r-95.7%
associate-*l*95.7%
fma-define95.8%
cancel-sign-sub-inv95.8%
fma-define95.8%
distribute-lft-neg-in95.8%
distribute-rgt-neg-in95.8%
*-commutative95.8%
associate-*r*92.7%
associate-*l*91.7%
neg-mul-191.7%
associate-*r*91.7%
Simplified91.7%
Taylor expanded in a around inf 54.8%
Final simplification58.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* y (* z t)))))
(if (<= a -5.6e+57)
(* a (* 27.0 b))
(if (<= a -1.1e-15)
t_1
(if (<= a -2.55e-64)
(* 2.0 x)
(if (<= a -1.2e-105)
t_1
(if (<= a 6.2e-299)
(* 2.0 x)
(if (<= a 2.4e-140) t_1 (* 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 t_1 = -9.0 * (y * (z * t));
double tmp;
if (a <= -5.6e+57) {
tmp = a * (27.0 * b);
} else if (a <= -1.1e-15) {
tmp = t_1;
} else if (a <= -2.55e-64) {
tmp = 2.0 * x;
} else if (a <= -1.2e-105) {
tmp = t_1;
} else if (a <= 6.2e-299) {
tmp = 2.0 * x;
} else if (a <= 2.4e-140) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (y * (z * t))
if (a <= (-5.6d+57)) then
tmp = a * (27.0d0 * b)
else if (a <= (-1.1d-15)) then
tmp = t_1
else if (a <= (-2.55d-64)) then
tmp = 2.0d0 * x
else if (a <= (-1.2d-105)) then
tmp = t_1
else if (a <= 6.2d-299) then
tmp = 2.0d0 * x
else if (a <= 2.4d-140) then
tmp = t_1
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 t_1 = -9.0 * (y * (z * t));
double tmp;
if (a <= -5.6e+57) {
tmp = a * (27.0 * b);
} else if (a <= -1.1e-15) {
tmp = t_1;
} else if (a <= -2.55e-64) {
tmp = 2.0 * x;
} else if (a <= -1.2e-105) {
tmp = t_1;
} else if (a <= 6.2e-299) {
tmp = 2.0 * x;
} else if (a <= 2.4e-140) {
tmp = t_1;
} 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): t_1 = -9.0 * (y * (z * t)) tmp = 0 if a <= -5.6e+57: tmp = a * (27.0 * b) elif a <= -1.1e-15: tmp = t_1 elif a <= -2.55e-64: tmp = 2.0 * x elif a <= -1.2e-105: tmp = t_1 elif a <= 6.2e-299: tmp = 2.0 * x elif a <= 2.4e-140: tmp = t_1 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) t_1 = Float64(-9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (a <= -5.6e+57) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= -1.1e-15) tmp = t_1; elseif (a <= -2.55e-64) tmp = Float64(2.0 * x); elseif (a <= -1.2e-105) tmp = t_1; elseif (a <= 6.2e-299) tmp = Float64(2.0 * x); elseif (a <= 2.4e-140) tmp = t_1; 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)
t_1 = -9.0 * (y * (z * t));
tmp = 0.0;
if (a <= -5.6e+57)
tmp = a * (27.0 * b);
elseif (a <= -1.1e-15)
tmp = t_1;
elseif (a <= -2.55e-64)
tmp = 2.0 * x;
elseif (a <= -1.2e-105)
tmp = t_1;
elseif (a <= 6.2e-299)
tmp = 2.0 * x;
elseif (a <= 2.4e-140)
tmp = t_1;
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_] := Block[{t$95$1 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.6e+57], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.1e-15], t$95$1, If[LessEqual[a, -2.55e-64], N[(2.0 * x), $MachinePrecision], If[LessEqual[a, -1.2e-105], t$95$1, If[LessEqual[a, 6.2e-299], N[(2.0 * x), $MachinePrecision], If[LessEqual[a, 2.4e-140], t$95$1, 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}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;a \leq -5.6 \cdot 10^{+57}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq -1.1 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.55 \cdot 10^{-64}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;a \leq -1.2 \cdot 10^{-105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-299}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -5.59999999999999999e57Initial program 94.7%
+-commutative94.7%
associate-+r-94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-*r*91.1%
distribute-lft-neg-in91.1%
*-commutative91.1%
cancel-sign-sub-inv91.1%
associate-+r-91.1%
associate-*l*91.1%
fma-define92.9%
cancel-sign-sub-inv92.9%
fma-define92.9%
distribute-lft-neg-in92.9%
distribute-rgt-neg-in92.9%
*-commutative92.9%
associate-*r*96.5%
associate-*l*96.4%
neg-mul-196.4%
associate-*r*96.4%
Simplified96.4%
Taylor expanded in t around 0 75.2%
Taylor expanded in a around inf 75.3%
Taylor expanded in x around 0 62.7%
if -5.59999999999999999e57 < a < -1.09999999999999993e-15 or -2.54999999999999992e-64 < a < -1.20000000000000007e-105 or 6.1999999999999999e-299 < a < 2.39999999999999987e-140Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-*r*92.8%
distribute-lft-neg-in92.8%
*-commutative92.8%
cancel-sign-sub-inv92.8%
associate-+r-92.8%
associate-*l*92.8%
fma-define92.8%
fma-neg92.8%
associate-*l*94.6%
distribute-rgt-neg-in94.6%
*-commutative94.6%
associate-*l*94.5%
*-commutative94.5%
distribute-lft-neg-in94.5%
associate-*r*94.5%
Simplified94.5%
Taylor expanded in z around 0 94.5%
*-commutative94.5%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in y around inf 56.1%
associate-*r*50.8%
*-commutative50.8%
associate-*r*54.2%
Simplified54.2%
if -1.09999999999999993e-15 < a < -2.54999999999999992e-64 or -1.20000000000000007e-105 < a < 6.1999999999999999e-299Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
*-commutative98.1%
cancel-sign-sub-inv98.1%
associate-*r*98.0%
distribute-lft-neg-in98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-+r-98.0%
associate-*l*98.0%
fma-define98.0%
fma-neg98.0%
associate-*l*97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*l*97.9%
*-commutative97.9%
distribute-lft-neg-in97.9%
associate-*r*97.9%
Simplified97.9%
Taylor expanded in z around 0 97.9%
*-commutative97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 62.1%
if 2.39999999999999987e-140 < a Initial program 92.7%
+-commutative92.7%
associate-+r-92.7%
*-commutative92.7%
cancel-sign-sub-inv92.7%
associate-*r*95.7%
distribute-lft-neg-in95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-+r-95.7%
associate-*l*95.7%
fma-define95.8%
cancel-sign-sub-inv95.8%
fma-define95.8%
distribute-lft-neg-in95.8%
distribute-rgt-neg-in95.8%
*-commutative95.8%
associate-*r*92.7%
associate-*l*91.7%
neg-mul-191.7%
associate-*r*91.7%
Simplified91.7%
Taylor expanded in a around inf 54.8%
Final simplification57.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 (* -9.0 (* t (* z y)))))
(if (<= a -1e+57)
(* a (* 27.0 b))
(if (<= a -9.5e-17)
t_1
(if (<= a -2.35e-64)
(* 2.0 x)
(if (<= a -2.7e-104)
t_1
(if (<= a 4.3e-297)
(* 2.0 x)
(if (<= a 2.4e-140) t_1 (* 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 t_1 = -9.0 * (t * (z * y));
double tmp;
if (a <= -1e+57) {
tmp = a * (27.0 * b);
} else if (a <= -9.5e-17) {
tmp = t_1;
} else if (a <= -2.35e-64) {
tmp = 2.0 * x;
} else if (a <= -2.7e-104) {
tmp = t_1;
} else if (a <= 4.3e-297) {
tmp = 2.0 * x;
} else if (a <= 2.4e-140) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (z * y))
if (a <= (-1d+57)) then
tmp = a * (27.0d0 * b)
else if (a <= (-9.5d-17)) then
tmp = t_1
else if (a <= (-2.35d-64)) then
tmp = 2.0d0 * x
else if (a <= (-2.7d-104)) then
tmp = t_1
else if (a <= 4.3d-297) then
tmp = 2.0d0 * x
else if (a <= 2.4d-140) then
tmp = t_1
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 t_1 = -9.0 * (t * (z * y));
double tmp;
if (a <= -1e+57) {
tmp = a * (27.0 * b);
} else if (a <= -9.5e-17) {
tmp = t_1;
} else if (a <= -2.35e-64) {
tmp = 2.0 * x;
} else if (a <= -2.7e-104) {
tmp = t_1;
} else if (a <= 4.3e-297) {
tmp = 2.0 * x;
} else if (a <= 2.4e-140) {
tmp = t_1;
} 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): t_1 = -9.0 * (t * (z * y)) tmp = 0 if a <= -1e+57: tmp = a * (27.0 * b) elif a <= -9.5e-17: tmp = t_1 elif a <= -2.35e-64: tmp = 2.0 * x elif a <= -2.7e-104: tmp = t_1 elif a <= 4.3e-297: tmp = 2.0 * x elif a <= 2.4e-140: tmp = t_1 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) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (a <= -1e+57) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= -9.5e-17) tmp = t_1; elseif (a <= -2.35e-64) tmp = Float64(2.0 * x); elseif (a <= -2.7e-104) tmp = t_1; elseif (a <= 4.3e-297) tmp = Float64(2.0 * x); elseif (a <= 2.4e-140) tmp = t_1; 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)
t_1 = -9.0 * (t * (z * y));
tmp = 0.0;
if (a <= -1e+57)
tmp = a * (27.0 * b);
elseif (a <= -9.5e-17)
tmp = t_1;
elseif (a <= -2.35e-64)
tmp = 2.0 * x;
elseif (a <= -2.7e-104)
tmp = t_1;
elseif (a <= 4.3e-297)
tmp = 2.0 * x;
elseif (a <= 2.4e-140)
tmp = t_1;
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_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1e+57], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -9.5e-17], t$95$1, If[LessEqual[a, -2.35e-64], N[(2.0 * x), $MachinePrecision], If[LessEqual[a, -2.7e-104], t$95$1, If[LessEqual[a, 4.3e-297], N[(2.0 * x), $MachinePrecision], If[LessEqual[a, 2.4e-140], t$95$1, 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}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;a \leq -1 \cdot 10^{+57}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq -9.5 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.35 \cdot 10^{-64}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.3 \cdot 10^{-297}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -1.00000000000000005e57Initial program 94.7%
+-commutative94.7%
associate-+r-94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-*r*91.1%
distribute-lft-neg-in91.1%
*-commutative91.1%
cancel-sign-sub-inv91.1%
associate-+r-91.1%
associate-*l*91.1%
fma-define92.9%
cancel-sign-sub-inv92.9%
fma-define92.9%
distribute-lft-neg-in92.9%
distribute-rgt-neg-in92.9%
*-commutative92.9%
associate-*r*96.5%
associate-*l*96.4%
neg-mul-196.4%
associate-*r*96.4%
Simplified96.4%
Taylor expanded in t around 0 75.2%
Taylor expanded in a around inf 75.3%
Taylor expanded in x around 0 62.7%
if -1.00000000000000005e57 < a < -9.50000000000000029e-17 or -2.3499999999999999e-64 < a < -2.6999999999999998e-104 or 4.3000000000000003e-297 < a < 2.39999999999999987e-140Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-*r*92.8%
distribute-lft-neg-in92.8%
*-commutative92.8%
cancel-sign-sub-inv92.8%
associate-+r-92.8%
associate-*l*92.8%
fma-define92.8%
cancel-sign-sub-inv92.8%
fma-define92.8%
distribute-lft-neg-in92.8%
distribute-rgt-neg-in92.8%
*-commutative92.8%
associate-*r*98.1%
associate-*l*98.1%
neg-mul-198.1%
associate-*r*98.1%
Simplified98.1%
Taylor expanded in t around inf 56.1%
if -9.50000000000000029e-17 < a < -2.3499999999999999e-64 or -2.6999999999999998e-104 < a < 4.3000000000000003e-297Initial program 98.1%
+-commutative98.1%
associate-+r-98.1%
*-commutative98.1%
cancel-sign-sub-inv98.1%
associate-*r*98.0%
distribute-lft-neg-in98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-+r-98.0%
associate-*l*98.0%
fma-define98.0%
fma-neg98.0%
associate-*l*97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*l*97.9%
*-commutative97.9%
distribute-lft-neg-in97.9%
associate-*r*97.9%
Simplified97.9%
Taylor expanded in z around 0 97.9%
*-commutative97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in x around inf 62.1%
if 2.39999999999999987e-140 < a Initial program 92.7%
+-commutative92.7%
associate-+r-92.7%
*-commutative92.7%
cancel-sign-sub-inv92.7%
associate-*r*95.7%
distribute-lft-neg-in95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-+r-95.7%
associate-*l*95.7%
fma-define95.8%
cancel-sign-sub-inv95.8%
fma-define95.8%
distribute-lft-neg-in95.8%
distribute-rgt-neg-in95.8%
*-commutative95.8%
associate-*r*92.7%
associate-*l*91.7%
neg-mul-191.7%
associate-*r*91.7%
Simplified91.7%
Taylor expanded in a around inf 54.8%
Final simplification58.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 (* z (* y 9.0))))
(if (<= t_1 2e+231)
(+ (- (* 2.0 x) (* t t_1)) (* b (* 27.0 a)))
(* y (- (+ (* 2.0 (/ x y)) (* 27.0 (/ (* a b) y))) (* 9.0 (* z 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 = z * (y * 9.0);
double tmp;
if (t_1 <= 2e+231) {
tmp = ((2.0 * x) - (t * t_1)) + (b * (27.0 * a));
} else {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / 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.
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 = z * (y * 9.0d0)
if (t_1 <= 2d+231) then
tmp = ((2.0d0 * x) - (t * t_1)) + (b * (27.0d0 * a))
else
tmp = y * (((2.0d0 * (x / y)) + (27.0d0 * ((a * b) / y))) - (9.0d0 * (z * 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 = z * (y * 9.0);
double tmp;
if (t_1 <= 2e+231) {
tmp = ((2.0 * x) - (t * t_1)) + (b * (27.0 * a));
} else {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * 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 = z * (y * 9.0) tmp = 0 if t_1 <= 2e+231: tmp = ((2.0 * x) - (t * t_1)) + (b * (27.0 * a)) else: tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * 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(z * Float64(y * 9.0)) tmp = 0.0 if (t_1 <= 2e+231) tmp = Float64(Float64(Float64(2.0 * x) - Float64(t * t_1)) + Float64(b * Float64(27.0 * a))); else tmp = Float64(y * Float64(Float64(Float64(2.0 * Float64(x / y)) + Float64(27.0 * Float64(Float64(a * b) / y))) - Float64(9.0 * Float64(z * t)))); 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 = z * (y * 9.0);
tmp = 0.0;
if (t_1 <= 2e+231)
tmp = ((2.0 * x) - (t * t_1)) + (b * (27.0 * a));
else
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / 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.
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[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+231], N[(N[(N[(2.0 * x), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\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 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+231}:\\
\;\;\;\;\left(2 \cdot x - t \cdot t\_1\right) + b \cdot \left(27 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\left(2 \cdot \frac{x}{y} + 27 \cdot \frac{a \cdot b}{y}\right) - 9 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 2.0000000000000001e231Initial program 97.6%
if 2.0000000000000001e231 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 80.3%
associate-*l*96.8%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in y around inf 99.9%
Final simplification97.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 (<= a -9.5e+37)
(+ (* y (* t (* z -9.0))) (* a (* 27.0 b)))
(if (<= a 2.4e-140)
(- (* 2.0 x) (* 9.0 (* y (* z t))))
(+ (* 2.0 x) (* 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 <= -9.5e+37) {
tmp = (y * (t * (z * -9.0))) + (a * (27.0 * b));
} else if (a <= 2.4e-140) {
tmp = (2.0 * x) - (9.0 * (y * (z * t)));
} else {
tmp = (2.0 * x) + (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 <= (-9.5d+37)) then
tmp = (y * (t * (z * (-9.0d0)))) + (a * (27.0d0 * b))
else if (a <= 2.4d-140) then
tmp = (2.0d0 * x) - (9.0d0 * (y * (z * t)))
else
tmp = (2.0d0 * x) + (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 <= -9.5e+37) {
tmp = (y * (t * (z * -9.0))) + (a * (27.0 * b));
} else if (a <= 2.4e-140) {
tmp = (2.0 * x) - (9.0 * (y * (z * t)));
} else {
tmp = (2.0 * x) + (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 <= -9.5e+37: tmp = (y * (t * (z * -9.0))) + (a * (27.0 * b)) elif a <= 2.4e-140: tmp = (2.0 * x) - (9.0 * (y * (z * t))) else: tmp = (2.0 * x) + (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 <= -9.5e+37) tmp = Float64(Float64(y * Float64(t * Float64(z * -9.0))) + Float64(a * Float64(27.0 * b))); elseif (a <= 2.4e-140) tmp = Float64(Float64(2.0 * x) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(2.0 * x) + 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 <= -9.5e+37)
tmp = (y * (t * (z * -9.0))) + (a * (27.0 * b));
elseif (a <= 2.4e-140)
tmp = (2.0 * x) - (9.0 * (y * (z * t)));
else
tmp = (2.0 * x) + (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, -9.5e+37], N[(N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.4e-140], N[(N[(2.0 * x), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $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}\;a \leq -9.5 \cdot 10^{+37}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-140}:\\
\;\;\;\;2 \cdot x - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -9.4999999999999995e37Initial program 95.1%
associate-*l*93.4%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in x around 0 83.3%
sub-neg83.3%
distribute-lft-neg-in83.3%
metadata-eval83.3%
*-commutative83.3%
associate-*r*82.1%
*-commutative82.1%
associate-*r*82.1%
associate-*r*81.6%
+-commutative81.6%
*-commutative81.6%
associate-*r*81.7%
*-commutative81.7%
Applied egg-rr81.7%
if -9.4999999999999995e37 < a < 2.39999999999999987e-140Initial program 98.0%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around 0 83.1%
pow183.1%
*-commutative83.1%
associate-*l*81.0%
*-commutative81.0%
Applied egg-rr81.0%
unpow181.0%
Simplified81.0%
if 2.39999999999999987e-140 < a Initial program 92.7%
+-commutative92.7%
associate-+r-92.7%
*-commutative92.7%
cancel-sign-sub-inv92.7%
associate-*r*95.7%
distribute-lft-neg-in95.7%
*-commutative95.7%
cancel-sign-sub-inv95.7%
associate-+r-95.7%
associate-*l*95.7%
fma-define95.8%
cancel-sign-sub-inv95.8%
fma-define95.8%
distribute-lft-neg-in95.8%
distribute-rgt-neg-in95.8%
*-commutative95.8%
associate-*r*92.7%
associate-*l*91.7%
neg-mul-191.7%
associate-*r*91.7%
Simplified91.7%
Taylor expanded in t around 0 76.6%
Final simplification79.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 (<= b -3.3e-16)
(* a (+ (* 27.0 b) (* 2.0 (/ x a))))
(if (<= b 1.65e-35)
(- (* 2.0 x) (* 9.0 (* y (* z t))))
(+ (* 2.0 x) (* 27.0 (* a b))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.3e-16) {
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
} else if (b <= 1.65e-35) {
tmp = (2.0 * x) - (9.0 * (y * (z * t)));
} else {
tmp = (2.0 * x) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-3.3d-16)) then
tmp = a * ((27.0d0 * b) + (2.0d0 * (x / a)))
else if (b <= 1.65d-35) then
tmp = (2.0d0 * x) - (9.0d0 * (y * (z * t)))
else
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.3e-16) {
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
} else if (b <= 1.65e-35) {
tmp = (2.0 * x) - (9.0 * (y * (z * t)));
} else {
tmp = (2.0 * x) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -3.3e-16: tmp = a * ((27.0 * b) + (2.0 * (x / a))) elif b <= 1.65e-35: tmp = (2.0 * x) - (9.0 * (y * (z * t))) else: tmp = (2.0 * x) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.3e-16) tmp = Float64(a * Float64(Float64(27.0 * b) + Float64(2.0 * Float64(x / a)))); elseif (b <= 1.65e-35) tmp = Float64(Float64(2.0 * x) - Float64(9.0 * Float64(y * Float64(z * t)))); else tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -3.3e-16)
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
elseif (b <= 1.65e-35)
tmp = (2.0 * x) - (9.0 * (y * (z * t)));
else
tmp = (2.0 * x) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.3e-16], N[(a * N[(N[(27.0 * b), $MachinePrecision] + N[(2.0 * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.65e-35], N[(N[(2.0 * x), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $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}\;b \leq -3.3 \cdot 10^{-16}:\\
\;\;\;\;a \cdot \left(27 \cdot b + 2 \cdot \frac{x}{a}\right)\\
\mathbf{elif}\;b \leq 1.65 \cdot 10^{-35}:\\
\;\;\;\;2 \cdot x - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -3.29999999999999988e-16Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-*r*93.6%
distribute-lft-neg-in93.6%
*-commutative93.6%
cancel-sign-sub-inv93.6%
associate-+r-93.6%
associate-*l*93.6%
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*98.2%
associate-*l*98.2%
neg-mul-198.2%
associate-*r*98.2%
Simplified98.2%
Taylor expanded in t around 0 70.3%
Taylor expanded in a around inf 68.8%
if -3.29999999999999988e-16 < b < 1.65e-35Initial program 95.8%
associate-*l*96.6%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in a around 0 85.1%
pow185.1%
*-commutative85.1%
associate-*l*85.8%
*-commutative85.8%
Applied egg-rr85.8%
unpow185.8%
Simplified85.8%
if 1.65e-35 < b Initial program 92.2%
+-commutative92.2%
associate-+r-92.2%
*-commutative92.2%
cancel-sign-sub-inv92.2%
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-define94.7%
cancel-sign-sub-inv94.7%
fma-define94.7%
distribute-lft-neg-in94.7%
distribute-rgt-neg-in94.7%
*-commutative94.7%
associate-*r*93.5%
associate-*l*93.5%
neg-mul-193.5%
associate-*r*93.5%
Simplified93.5%
Taylor expanded in t around 0 83.7%
Final simplification81.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= b -2.9e-16)
(* a (+ (* 27.0 b) (* 2.0 (/ x a))))
(if (<= b 2.05e-35)
(+ (* 2.0 x) (* (* t -9.0) (* z y)))
(+ (* 2.0 x) (* 27.0 (* a b))))))assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.9e-16) {
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
} else if (b <= 2.05e-35) {
tmp = (2.0 * x) + ((t * -9.0) * (z * y));
} else {
tmp = (2.0 * x) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-2.9d-16)) then
tmp = a * ((27.0d0 * b) + (2.0d0 * (x / a)))
else if (b <= 2.05d-35) then
tmp = (2.0d0 * x) + ((t * (-9.0d0)) * (z * y))
else
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.9e-16) {
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
} else if (b <= 2.05e-35) {
tmp = (2.0 * x) + ((t * -9.0) * (z * y));
} else {
tmp = (2.0 * x) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -2.9e-16: tmp = a * ((27.0 * b) + (2.0 * (x / a))) elif b <= 2.05e-35: tmp = (2.0 * x) + ((t * -9.0) * (z * y)) else: tmp = (2.0 * x) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.9e-16) tmp = Float64(a * Float64(Float64(27.0 * b) + Float64(2.0 * Float64(x / a)))); elseif (b <= 2.05e-35) tmp = Float64(Float64(2.0 * x) + Float64(Float64(t * -9.0) * Float64(z * y))); else tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -2.9e-16)
tmp = a * ((27.0 * b) + (2.0 * (x / a)));
elseif (b <= 2.05e-35)
tmp = (2.0 * x) + ((t * -9.0) * (z * y));
else
tmp = (2.0 * x) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.9e-16], N[(a * N[(N[(27.0 * b), $MachinePrecision] + N[(2.0 * N[(x / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.05e-35], N[(N[(2.0 * x), $MachinePrecision] + N[(N[(t * -9.0), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $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}\;b \leq -2.9 \cdot 10^{-16}:\\
\;\;\;\;a \cdot \left(27 \cdot b + 2 \cdot \frac{x}{a}\right)\\
\mathbf{elif}\;b \leq 2.05 \cdot 10^{-35}:\\
\;\;\;\;2 \cdot x + \left(t \cdot -9\right) \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -2.8999999999999998e-16Initial program 98.2%
+-commutative98.2%
associate-+r-98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-*r*93.6%
distribute-lft-neg-in93.6%
*-commutative93.6%
cancel-sign-sub-inv93.6%
associate-+r-93.6%
associate-*l*93.6%
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*98.2%
associate-*l*98.2%
neg-mul-198.2%
associate-*r*98.2%
Simplified98.2%
Taylor expanded in t around 0 70.3%
Taylor expanded in a around inf 68.8%
if -2.8999999999999998e-16 < b < 2.05000000000000013e-35Initial program 95.8%
associate-*l*96.6%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in a around 0 85.1%
cancel-sign-sub-inv85.1%
metadata-eval85.1%
associate-*r*85.1%
*-commutative85.1%
*-commutative85.1%
Applied egg-rr85.1%
if 2.05000000000000013e-35 < b Initial program 92.2%
+-commutative92.2%
associate-+r-92.2%
*-commutative92.2%
cancel-sign-sub-inv92.2%
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-define94.7%
cancel-sign-sub-inv94.7%
fma-define94.7%
distribute-lft-neg-in94.7%
distribute-rgt-neg-in94.7%
*-commutative94.7%
associate-*r*93.5%
associate-*l*93.5%
neg-mul-193.5%
associate-*r*93.5%
Simplified93.5%
Taylor expanded in t around 0 83.7%
Final simplification80.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 -2650.0) (* -9.0 (* y (* z t))) (if (<= z 1.02e+44) (+ (* 2.0 x) (* 27.0 (* a b))) (* t (* z (* y -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2650.0) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 1.02e+44) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2650.0d0)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 1.02d+44) then
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
else
tmp = t * (z * (y * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2650.0) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 1.02e+44) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = t * (z * (y * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2650.0: tmp = -9.0 * (y * (z * t)) elif z <= 1.02e+44: tmp = (2.0 * x) + (27.0 * (a * b)) else: tmp = t * (z * (y * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2650.0) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 1.02e+44) tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t * Float64(z * Float64(y * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2650.0)
tmp = -9.0 * (y * (z * t));
elseif (z <= 1.02e+44)
tmp = (2.0 * x) + (27.0 * (a * b));
else
tmp = t * (z * (y * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2650.0], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+44], N[(N[(2.0 * x), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2650:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+44}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -2650Initial program 88.6%
+-commutative88.6%
associate-+r-88.6%
*-commutative88.6%
cancel-sign-sub-inv88.6%
associate-*r*96.8%
distribute-lft-neg-in96.8%
*-commutative96.8%
cancel-sign-sub-inv96.8%
associate-+r-96.8%
associate-*l*96.8%
fma-define96.8%
fma-neg96.8%
associate-*l*94.0%
distribute-rgt-neg-in94.0%
*-commutative94.0%
associate-*l*93.9%
*-commutative93.9%
distribute-lft-neg-in93.9%
associate-*r*94.1%
Simplified94.1%
Taylor expanded in z around 0 93.9%
*-commutative93.9%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in y around inf 50.8%
associate-*r*54.2%
*-commutative54.2%
associate-*r*51.4%
Simplified51.4%
if -2650 < z < 1.01999999999999999e44Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*92.4%
distribute-lft-neg-in92.4%
*-commutative92.4%
cancel-sign-sub-inv92.4%
associate-+r-92.4%
associate-*l*92.4%
fma-define92.4%
cancel-sign-sub-inv92.4%
fma-define92.4%
distribute-lft-neg-in92.4%
distribute-rgt-neg-in92.4%
*-commutative92.4%
associate-*r*99.8%
associate-*l*99.8%
neg-mul-199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 82.1%
if 1.01999999999999999e44 < z Initial program 91.4%
+-commutative91.4%
associate-+r-91.4%
*-commutative91.4%
cancel-sign-sub-inv91.4%
associate-*r*97.6%
distribute-lft-neg-in97.6%
*-commutative97.6%
cancel-sign-sub-inv97.6%
associate-+r-97.6%
associate-*l*97.7%
fma-define99.8%
cancel-sign-sub-inv99.8%
fma-define99.8%
distribute-lft-neg-in99.8%
distribute-rgt-neg-in99.8%
*-commutative99.8%
associate-*r*93.6%
associate-*l*91.5%
neg-mul-191.5%
associate-*r*91.5%
Simplified91.5%
Taylor expanded in t around inf 48.5%
*-commutative48.5%
associate-*r*48.4%
*-commutative48.4%
associate-*l*48.5%
Simplified48.5%
Final simplification67.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 (+ (- (* 2.0 x) (* (* z t) (* y 9.0))) (* a (* 27.0 b))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * x) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((2.0d0 * x) - ((z * t) * (y * 9.0d0))) + (a * (27.0d0 * b))
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((2.0 * x) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return ((2.0 * x) - ((z * t) * (y * 9.0))) + (a * (27.0 * b))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(2.0 * x) - Float64(Float64(z * t) * Float64(y * 9.0))) + Float64(a * Float64(27.0 * b))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((2.0 * x) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(2.0 * x), $MachinePrecision] - N[(N[(z * t), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(2 \cdot x - \left(z \cdot t\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 95.3%
associate-*l*95.6%
associate-*l*95.6%
Simplified95.6%
Final simplification95.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 (+ (+ (* b (* 27.0 a)) (* 2.0 x)) (* z (* y (* t -9.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return ((b * (27.0 * a)) + (2.0 * x)) + (z * (y * (t * -9.0)));
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((b * (27.0d0 * a)) + (2.0d0 * x)) + (z * (y * (t * (-9.0d0))))
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((b * (27.0 * a)) + (2.0 * x)) + (z * (y * (t * -9.0)));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return ((b * (27.0 * a)) + (2.0 * x)) + (z * (y * (t * -9.0)))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(b * Float64(27.0 * a)) + Float64(2.0 * x)) + Float64(z * Float64(y * Float64(t * -9.0)))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((b * (27.0 * a)) + (2.0 * x)) + (z * (y * (t * -9.0)));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(b \cdot \left(27 \cdot a\right) + 2 \cdot x\right) + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)
\end{array}
Initial program 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-*r*94.5%
distribute-lft-neg-in94.5%
*-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r-94.5%
associate-*l*94.5%
fma-define94.9%
fma-neg94.9%
associate-*l*96.0%
distribute-rgt-neg-in96.0%
*-commutative96.0%
associate-*l*96.0%
*-commutative96.0%
distribute-lft-neg-in96.0%
associate-*r*95.7%
Simplified95.7%
Taylor expanded in z around 0 96.0%
*-commutative96.0%
associate-*l*96.0%
Simplified96.0%
fma-undefine96.0%
*-commutative96.0%
+-commutative96.0%
*-commutative96.0%
Applied egg-rr96.0%
fma-undefine95.6%
+-commutative95.6%
associate-+r+95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*95.6%
*-commutative95.6%
associate-*l*94.9%
associate-*r*95.3%
*-commutative95.3%
associate-*r*94.5%
*-commutative94.5%
associate-*r*94.2%
Applied egg-rr94.2%
Final simplification94.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 -6.6e+37) (not (<= a 7.5e-142))) (* 27.0 (* a b)) (* 2.0 x)))
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 <= -6.6e+37) || !(a <= 7.5e-142)) {
tmp = 27.0 * (a * b);
} else {
tmp = 2.0 * x;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= (-6.6d+37)) .or. (.not. (a <= 7.5d-142))) then
tmp = 27.0d0 * (a * b)
else
tmp = 2.0d0 * x
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= -6.6e+37) || !(a <= 7.5e-142)) {
tmp = 27.0 * (a * b);
} else {
tmp = 2.0 * x;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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 <= -6.6e+37) or not (a <= 7.5e-142): tmp = 27.0 * (a * b) else: tmp = 2.0 * x return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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 <= -6.6e+37) || !(a <= 7.5e-142)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(2.0 * x); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 <= -6.6e+37) || ~((a <= 7.5e-142)))
tmp = 27.0 * (a * b);
else
tmp = 2.0 * x;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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, -6.6e+37], N[Not[LessEqual[a, 7.5e-142]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(2.0 * x), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.6 \cdot 10^{+37} \lor \neg \left(a \leq 7.5 \cdot 10^{-142}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x\\
\end{array}
\end{array}
if a < -6.6000000000000002e37 or 7.49999999999999958e-142 < a Initial program 93.7%
+-commutative93.7%
associate-+r-93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-*r*94.2%
distribute-lft-neg-in94.2%
*-commutative94.2%
cancel-sign-sub-inv94.2%
associate-+r-94.2%
associate-*l*94.3%
fma-define94.9%
cancel-sign-sub-inv94.9%
fma-define94.9%
distribute-lft-neg-in94.9%
distribute-rgt-neg-in94.9%
*-commutative94.9%
associate-*r*94.3%
associate-*l*93.7%
neg-mul-193.7%
associate-*r*93.7%
Simplified93.7%
Taylor expanded in a around inf 56.2%
if -6.6000000000000002e37 < a < 7.49999999999999958e-142Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-*r*95.0%
distribute-lft-neg-in95.0%
*-commutative95.0%
cancel-sign-sub-inv95.0%
associate-+r-95.0%
associate-*l*94.9%
fma-define94.9%
fma-neg94.9%
associate-*l*95.9%
distribute-rgt-neg-in95.9%
*-commutative95.9%
associate-*l*95.9%
*-commutative95.9%
distribute-lft-neg-in95.9%
associate-*r*95.9%
Simplified95.9%
Taylor expanded in z around 0 95.9%
*-commutative95.9%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 43.7%
Final simplification51.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 (<= a -5.5e+37) (* a (* 27.0 b)) (if (<= a 1.6e-142) (* 2.0 x) (* 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 <= -5.5e+37) {
tmp = a * (27.0 * b);
} else if (a <= 1.6e-142) {
tmp = 2.0 * x;
} 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 <= (-5.5d+37)) then
tmp = a * (27.0d0 * b)
else if (a <= 1.6d-142) then
tmp = 2.0d0 * x
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 <= -5.5e+37) {
tmp = a * (27.0 * b);
} else if (a <= 1.6e-142) {
tmp = 2.0 * x;
} 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 <= -5.5e+37: tmp = a * (27.0 * b) elif a <= 1.6e-142: tmp = 2.0 * x 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 <= -5.5e+37) tmp = Float64(a * Float64(27.0 * b)); elseif (a <= 1.6e-142) tmp = Float64(2.0 * x); 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 <= -5.5e+37)
tmp = a * (27.0 * b);
elseif (a <= 1.6e-142)
tmp = 2.0 * x;
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, -5.5e+37], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e-142], N[(2.0 * x), $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 -5.5 \cdot 10^{+37}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-142}:\\
\;\;\;\;2 \cdot x\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if a < -5.50000000000000016e37Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
*-commutative95.1%
cancel-sign-sub-inv95.1%
associate-*r*91.8%
distribute-lft-neg-in91.8%
*-commutative91.8%
cancel-sign-sub-inv91.8%
associate-+r-91.8%
associate-*l*91.8%
fma-define93.5%
cancel-sign-sub-inv93.5%
fma-define93.5%
distribute-lft-neg-in93.5%
distribute-rgt-neg-in93.5%
*-commutative93.5%
associate-*r*96.8%
associate-*l*96.7%
neg-mul-196.7%
associate-*r*96.7%
Simplified96.7%
Taylor expanded in t around 0 70.8%
Taylor expanded in a around inf 70.9%
Taylor expanded in x around 0 59.4%
if -5.50000000000000016e37 < a < 1.5999999999999999e-142Initial program 98.0%
+-commutative98.0%
associate-+r-98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-*r*95.0%
distribute-lft-neg-in95.0%
*-commutative95.0%
cancel-sign-sub-inv95.0%
associate-+r-95.0%
associate-*l*94.9%
fma-define94.9%
fma-neg94.9%
associate-*l*95.9%
distribute-rgt-neg-in95.9%
*-commutative95.9%
associate-*l*95.9%
*-commutative95.9%
distribute-lft-neg-in95.9%
associate-*r*95.9%
Simplified95.9%
Taylor expanded in z around 0 95.9%
*-commutative95.9%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 43.7%
if 1.5999999999999999e-142 < a Initial program 92.8%
+-commutative92.8%
associate-+r-92.8%
*-commutative92.8%
cancel-sign-sub-inv92.8%
associate-*r*95.8%
distribute-lft-neg-in95.8%
*-commutative95.8%
cancel-sign-sub-inv95.8%
associate-+r-95.8%
associate-*l*95.8%
fma-define95.8%
cancel-sign-sub-inv95.8%
fma-define95.8%
distribute-lft-neg-in95.8%
distribute-rgt-neg-in95.8%
*-commutative95.8%
associate-*r*92.8%
associate-*l*91.8%
neg-mul-191.8%
associate-*r*91.8%
Simplified91.8%
Taylor expanded in a around inf 54.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 (* 2.0 x))
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 2.0 * x;
}
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 = 2.0d0 * x
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 2.0 * x;
}
[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 2.0 * x
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(2.0 * x) 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 = 2.0 * x;
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[(2.0 * x), $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])\\
\\
2 \cdot x
\end{array}
Initial program 95.3%
+-commutative95.3%
associate-+r-95.3%
*-commutative95.3%
cancel-sign-sub-inv95.3%
associate-*r*94.5%
distribute-lft-neg-in94.5%
*-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r-94.5%
associate-*l*94.5%
fma-define94.9%
fma-neg94.9%
associate-*l*96.0%
distribute-rgt-neg-in96.0%
*-commutative96.0%
associate-*l*96.0%
*-commutative96.0%
distribute-lft-neg-in96.0%
associate-*r*95.7%
Simplified95.7%
Taylor expanded in z around 0 96.0%
*-commutative96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around inf 28.7%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024138
(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)))