
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e-117) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 2e-117) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 2e-117) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 2e-117], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-117}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < 2.00000000000000006e-117Initial program 95.6%
Simplified98.1%
if 2.00000000000000006e-117 < z Initial program 92.3%
+-commutative92.3%
associate-+r-92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
distribute-lft-neg-in96.0%
distribute-rgt-neg-in96.0%
*-commutative96.0%
associate-*r*92.3%
associate-*l*92.2%
neg-mul-192.2%
associate-*r*92.2%
Simplified92.2%
Final simplification96.4%
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 4e-98) (- (+ (* b (* a 27.0)) (* x 2.0)) (* 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);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 4e-98) {
tmp = ((b * (a * 27.0)) + (x * 2.0)) - (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]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 4e-98) tmp = Float64(Float64(Float64(b * Float64(a * 27.0)) + Float64(x * 2.0)) - Float64(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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 4e-98], N[(N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * 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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4 \cdot 10^{-98}:\\
\;\;\;\;\left(b \cdot \left(a \cdot 27\right) + x \cdot 2\right) - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < 3.99999999999999976e-98Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-*r*95.6%
distribute-lft-neg-in95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-+r-95.6%
associate-*l*95.6%
fma-define96.1%
cancel-sign-sub-inv96.1%
fma-define96.1%
distribute-lft-neg-in96.1%
distribute-rgt-neg-in96.1%
*-commutative96.1%
associate-*r*96.1%
associate-*l*96.1%
neg-mul-196.1%
associate-*r*96.1%
Simplified96.1%
fma-undefine95.6%
fma-undefine95.6%
associate-+r+95.6%
*-commutative95.6%
associate-*l*97.6%
*-commutative97.6%
associate-*r*97.6%
*-commutative97.6%
*-commutative97.6%
associate-*r*97.6%
associate-*l*97.6%
metadata-eval97.6%
distribute-lft-neg-in97.6%
*-commutative97.6%
distribute-rgt-neg-in97.6%
*-commutative97.6%
associate-+r+97.6%
sub-neg97.6%
Applied egg-rr97.6%
if 3.99999999999999976e-98 < z Initial program 92.2%
+-commutative92.2%
associate-+r-92.2%
*-commutative92.2%
cancel-sign-sub-inv92.2%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
distribute-lft-neg-in96.0%
distribute-rgt-neg-in96.0%
*-commutative96.0%
associate-*r*92.2%
associate-*l*92.1%
neg-mul-192.1%
associate-*r*92.1%
Simplified92.1%
Final simplification96.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
(let* ((t_1 (* b (* a 27.0))))
(if (<= z -2.9e+25)
(+ t_1 (* y (* -9.0 (* z t))))
(if (<= z 1.9e-112)
(+ (* x 2.0) (* 27.0 (* a b)))
(if (<= z 1.65e-8)
(+ t_1 (* y (* t (* z -9.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 t_1 = b * (a * 27.0);
double tmp;
if (z <= -2.9e+25) {
tmp = t_1 + (y * (-9.0 * (z * t)));
} else if (z <= 1.9e-112) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (z <= 1.65e-8) {
tmp = t_1 + (y * (t * (z * -9.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) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if (z <= (-2.9d+25)) then
tmp = t_1 + (y * ((-9.0d0) * (z * t)))
else if (z <= 1.9d-112) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else if (z <= 1.65d-8) then
tmp = t_1 + (y * (t * (z * (-9.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 t_1 = b * (a * 27.0);
double tmp;
if (z <= -2.9e+25) {
tmp = t_1 + (y * (-9.0 * (z * t)));
} else if (z <= 1.9e-112) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (z <= 1.65e-8) {
tmp = t_1 + (y * (t * (z * -9.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): t_1 = b * (a * 27.0) tmp = 0 if z <= -2.9e+25: tmp = t_1 + (y * (-9.0 * (z * t))) elif z <= 1.9e-112: tmp = (x * 2.0) + (27.0 * (a * b)) elif z <= 1.65e-8: tmp = t_1 + (y * (t * (z * -9.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) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (z <= -2.9e+25) tmp = Float64(t_1 + Float64(y * Float64(-9.0 * Float64(z * t)))); elseif (z <= 1.9e-112) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); elseif (z <= 1.65e-8) tmp = Float64(t_1 + Float64(y * Float64(t * Float64(z * -9.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)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (z <= -2.9e+25)
tmp = t_1 + (y * (-9.0 * (z * t)));
elseif (z <= 1.9e-112)
tmp = (x * 2.0) + (27.0 * (a * b));
elseif (z <= 1.65e-8)
tmp = t_1 + (y * (t * (z * -9.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_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+25], N[(t$95$1 + N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-112], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-8], N[(t$95$1 + N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $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}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+25}:\\
\;\;\;\;t\_1 + y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-112}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-8}:\\
\;\;\;\;t\_1 + y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -2.8999999999999999e25Initial program 89.7%
sub-neg89.7%
sub-neg89.7%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around 0 76.6%
sub-neg76.6%
+-commutative76.6%
*-commutative76.6%
distribute-rgt-neg-in76.6%
metadata-eval76.6%
associate-*r*76.6%
associate-*r*76.6%
*-commutative76.6%
associate-*l*79.1%
associate-*r*79.2%
*-commutative79.2%
*-commutative79.2%
Applied egg-rr79.2%
Taylor expanded in z around 0 79.2%
if -2.8999999999999999e25 < z < 1.89999999999999997e-112Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-+r-94.4%
associate-*l*94.4%
fma-define94.4%
cancel-sign-sub-inv94.4%
fma-define94.4%
distribute-lft-neg-in94.4%
distribute-rgt-neg-in94.4%
*-commutative94.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 81.3%
if 1.89999999999999997e-112 < z < 1.64999999999999989e-8Initial program 99.6%
sub-neg99.6%
sub-neg99.6%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around 0 82.9%
sub-neg82.9%
+-commutative82.9%
*-commutative82.9%
distribute-rgt-neg-in82.9%
metadata-eval82.9%
associate-*r*82.9%
associate-*r*82.9%
*-commutative82.9%
associate-*l*83.0%
associate-*r*83.3%
*-commutative83.3%
*-commutative83.3%
Applied egg-rr83.3%
if 1.64999999999999989e-8 < z Initial program 90.9%
sub-neg90.9%
sub-neg90.9%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in a around 0 80.0%
Final simplification80.5%
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 (+ (* b (* a 27.0)) (* y (* -9.0 (* z t))))))
(if (<= z -3.7e+25)
t_1
(if (<= z 1.8e-112)
(+ (* x 2.0) (* 27.0 (* a b)))
(if (<= z 4.3e+18) t_1 (- (* 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 t_1 = (b * (a * 27.0)) + (y * (-9.0 * (z * t)));
double tmp;
if (z <= -3.7e+25) {
tmp = t_1;
} else if (z <= 1.8e-112) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (z <= 4.3e+18) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (b * (a * 27.0d0)) + (y * ((-9.0d0) * (z * t)))
if (z <= (-3.7d+25)) then
tmp = t_1
else if (z <= 1.8d-112) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else if (z <= 4.3d+18) then
tmp = t_1
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 t_1 = (b * (a * 27.0)) + (y * (-9.0 * (z * t)));
double tmp;
if (z <= -3.7e+25) {
tmp = t_1;
} else if (z <= 1.8e-112) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else if (z <= 4.3e+18) {
tmp = t_1;
} 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): t_1 = (b * (a * 27.0)) + (y * (-9.0 * (z * t))) tmp = 0 if z <= -3.7e+25: tmp = t_1 elif z <= 1.8e-112: tmp = (x * 2.0) + (27.0 * (a * b)) elif z <= 4.3e+18: tmp = t_1 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) t_1 = Float64(Float64(b * Float64(a * 27.0)) + Float64(y * Float64(-9.0 * Float64(z * t)))) tmp = 0.0 if (z <= -3.7e+25) tmp = t_1; elseif (z <= 1.8e-112) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); elseif (z <= 4.3e+18) tmp = t_1; 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)
t_1 = (b * (a * 27.0)) + (y * (-9.0 * (z * t)));
tmp = 0.0;
if (z <= -3.7e+25)
tmp = t_1;
elseif (z <= 1.8e-112)
tmp = (x * 2.0) + (27.0 * (a * b));
elseif (z <= 4.3e+18)
tmp = t_1;
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_] := Block[{t$95$1 = N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+25], t$95$1, If[LessEqual[z, 1.8e-112], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e+18], t$95$1, 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}
t_1 := b \cdot \left(a \cdot 27\right) + y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -3.6999999999999999e25 or 1.8e-112 < z < 4.3e18Initial program 91.5%
sub-neg91.5%
sub-neg91.5%
associate-*l*95.6%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in x around 0 78.5%
sub-neg78.5%
+-commutative78.5%
*-commutative78.5%
distribute-rgt-neg-in78.5%
metadata-eval78.5%
associate-*r*78.5%
associate-*r*78.5%
*-commutative78.5%
associate-*l*80.6%
associate-*r*80.6%
*-commutative80.6%
*-commutative80.6%
Applied egg-rr80.6%
Taylor expanded in z around 0 80.7%
if -3.6999999999999999e25 < z < 1.8e-112Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-+r-94.4%
associate-*l*94.4%
fma-define94.4%
cancel-sign-sub-inv94.4%
fma-define94.4%
distribute-lft-neg-in94.4%
distribute-rgt-neg-in94.4%
*-commutative94.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 81.3%
if 4.3e18 < z Initial program 90.3%
sub-neg90.3%
sub-neg90.3%
associate-*l*90.2%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in a around 0 80.3%
Final simplification80.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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= z -3.8e+25)
(+ (* b (* a 27.0)) (* y (* -9.0 (* z t))))
(if (<= z 1.8e-112) (+ (* x 2.0) t_1) (- t_1 (* 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 t_1 = 27.0 * (a * b);
double tmp;
if (z <= -3.8e+25) {
tmp = (b * (a * 27.0)) + (y * (-9.0 * (z * t)));
} else if (z <= 1.8e-112) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (z <= (-3.8d+25)) then
tmp = (b * (a * 27.0d0)) + (y * ((-9.0d0) * (z * t)))
else if (z <= 1.8d-112) then
tmp = (x * 2.0d0) + t_1
else
tmp = t_1 - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if (z <= -3.8e+25) {
tmp = (b * (a * 27.0)) + (y * (-9.0 * (z * t)));
} else if (z <= 1.8e-112) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if z <= -3.8e+25: tmp = (b * (a * 27.0)) + (y * (-9.0 * (z * t))) elif z <= 1.8e-112: tmp = (x * 2.0) + t_1 else: tmp = t_1 - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (z <= -3.8e+25) tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(y * Float64(-9.0 * Float64(z * t)))); elseif (z <= 1.8e-112) tmp = Float64(Float64(x * 2.0) + t_1); else tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (z <= -3.8e+25)
tmp = (b * (a * 27.0)) + (y * (-9.0 * (z * t)));
elseif (z <= 1.8e-112)
tmp = (x * 2.0) + t_1;
else
tmp = t_1 - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+25], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-112], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+25}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -3.8e25Initial program 89.7%
sub-neg89.7%
sub-neg89.7%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around 0 76.6%
sub-neg76.6%
+-commutative76.6%
*-commutative76.6%
distribute-rgt-neg-in76.6%
metadata-eval76.6%
associate-*r*76.6%
associate-*r*76.6%
*-commutative76.6%
associate-*l*79.1%
associate-*r*79.2%
*-commutative79.2%
*-commutative79.2%
Applied egg-rr79.2%
Taylor expanded in z around 0 79.2%
if -3.8e25 < z < 1.8e-112Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-+r-94.4%
associate-*l*94.4%
fma-define94.4%
cancel-sign-sub-inv94.4%
fma-define94.4%
distribute-lft-neg-in94.4%
distribute-rgt-neg-in94.4%
*-commutative94.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 81.3%
if 1.8e-112 < z Initial program 92.3%
sub-neg92.3%
sub-neg92.3%
associate-*l*92.2%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in x around 0 68.2%
Final simplification76.8%
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.1e+25)
(* y (* t (* z (- 9.0))))
(if (<= z 2.3e-253)
(* b (* a 27.0))
(if (<= z 2.05e-125) (* 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 <= -3.1e+25) {
tmp = y * (t * (z * -9.0));
} else if (z <= 2.3e-253) {
tmp = b * (a * 27.0);
} else if (z <= 2.05e-125) {
tmp = 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 <= (-3.1d+25)) then
tmp = y * (t * (z * -9.0d0))
else if (z <= 2.3d-253) then
tmp = b * (a * 27.0d0)
else if (z <= 2.05d-125) then
tmp = 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 <= -3.1e+25) {
tmp = y * (t * (z * -9.0));
} else if (z <= 2.3e-253) {
tmp = b * (a * 27.0);
} else if (z <= 2.05e-125) {
tmp = 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 <= -3.1e+25: tmp = y * (t * (z * -9.0)) elif z <= 2.3e-253: tmp = b * (a * 27.0) elif z <= 2.05e-125: tmp = 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 <= -3.1e+25) tmp = Float64(y * Float64(t * Float64(z * Float64(-9.0)))); elseif (z <= 2.3e-253) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 2.05e-125) tmp = 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 <= -3.1e+25)
tmp = y * (t * (z * -9.0));
elseif (z <= 2.3e-253)
tmp = b * (a * 27.0);
elseif (z <= 2.05e-125)
tmp = 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, -3.1e+25], N[(y * N[(t * N[(z * (-9.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-253], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e-125], N[(x * 2.0), $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 -3.1 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot \left(-9\right)\right)\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-253}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-125}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -3.0999999999999998e25Initial program 89.7%
+-commutative89.7%
associate-+r-89.7%
*-commutative89.7%
cancel-sign-sub-inv89.7%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.2%
fma-define98.5%
cancel-sign-sub-inv98.5%
fma-define98.5%
distribute-lft-neg-in98.5%
distribute-rgt-neg-in98.5%
*-commutative98.5%
associate-*r*91.0%
associate-*l*91.0%
neg-mul-191.0%
associate-*r*91.0%
Simplified91.0%
Taylor expanded in t around inf 46.1%
*-commutative46.1%
associate-*r*46.1%
associate-*l*46.1%
Simplified46.1%
associate-*r*46.1%
associate-*r*46.1%
metadata-eval46.1%
distribute-rgt-neg-in46.1%
*-commutative46.1%
associate-*l*48.1%
associate-*r*48.2%
*-commutative48.2%
associate-*r*48.2%
*-commutative48.2%
Applied egg-rr48.2%
if -3.0999999999999998e25 < z < 2.3e-253Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-+r-92.3%
associate-*l*92.3%
fma-define92.3%
cancel-sign-sub-inv92.3%
fma-define92.3%
distribute-lft-neg-in92.3%
distribute-rgt-neg-in92.3%
*-commutative92.3%
associate-*r*99.8%
associate-*l*99.8%
neg-mul-199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 79.4%
Taylor expanded in b around inf 69.3%
Taylor expanded in x around 0 40.5%
if 2.3e-253 < z < 2.0499999999999999e-125Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.8%
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*99.7%
associate-*l*99.7%
neg-mul-199.7%
associate-*r*99.7%
Simplified99.7%
Taylor expanded in t around 0 86.4%
Taylor expanded in x around inf 57.0%
if 2.0499999999999999e-125 < z Initial program 92.3%
+-commutative92.3%
associate-+r-92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
distribute-lft-neg-in96.0%
distribute-rgt-neg-in96.0%
*-commutative96.0%
associate-*r*92.3%
associate-*l*92.2%
neg-mul-192.2%
associate-*r*92.2%
Simplified92.2%
Taylor expanded in t around inf 54.2%
*-commutative54.2%
associate-*r*54.2%
*-commutative54.2%
associate-*l*54.3%
Simplified54.3%
Taylor expanded in t around 0 54.2%
associate-*r*54.7%
*-commutative54.7%
Simplified54.7%
Final simplification48.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.9e+25)
(* -9.0 (* y (* z t)))
(if (<= z 5.2e-251)
(* b (* a 27.0))
(if (<= z 1.75e-124) (* 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 <= -2.9e+25) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 5.2e-251) {
tmp = b * (a * 27.0);
} else if (z <= 1.75e-124) {
tmp = 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 <= (-2.9d+25)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 5.2d-251) then
tmp = b * (a * 27.0d0)
else if (z <= 1.75d-124) then
tmp = 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 <= -2.9e+25) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 5.2e-251) {
tmp = b * (a * 27.0);
} else if (z <= 1.75e-124) {
tmp = 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 <= -2.9e+25: tmp = -9.0 * (y * (z * t)) elif z <= 5.2e-251: tmp = b * (a * 27.0) elif z <= 1.75e-124: tmp = 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 <= -2.9e+25) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 5.2e-251) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 1.75e-124) tmp = 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 <= -2.9e+25)
tmp = -9.0 * (y * (z * t));
elseif (z <= 5.2e-251)
tmp = b * (a * 27.0);
elseif (z <= 1.75e-124)
tmp = 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, -2.9e+25], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e-251], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-124], N[(x * 2.0), $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 -2.9 \cdot 10^{+25}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-251}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-124}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -2.8999999999999999e25Initial program 89.7%
+-commutative89.7%
associate-+r-89.7%
*-commutative89.7%
cancel-sign-sub-inv89.7%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.2%
fma-define98.5%
cancel-sign-sub-inv98.5%
fma-define98.5%
distribute-lft-neg-in98.5%
distribute-rgt-neg-in98.5%
*-commutative98.5%
associate-*r*91.0%
associate-*l*91.0%
neg-mul-191.0%
associate-*r*91.0%
Simplified91.0%
Taylor expanded in t around inf 46.1%
*-commutative46.1%
associate-*r*46.1%
*-commutative46.1%
associate-*l*46.1%
Simplified46.1%
Taylor expanded in t around 0 46.1%
associate-*r*49.9%
*-commutative49.9%
Simplified49.9%
Taylor expanded in z around 0 46.1%
*-commutative46.1%
associate-*r*48.1%
*-commutative48.1%
Simplified48.1%
if -2.8999999999999999e25 < z < 5.1999999999999998e-251Initial 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 79.7%
Taylor expanded in b around inf 69.7%
Taylor expanded in x around 0 41.3%
if 5.1999999999999998e-251 < z < 1.7499999999999999e-124Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.8%
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*99.8%
associate-*l*99.8%
neg-mul-199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 85.9%
Taylor expanded in x around inf 59.1%
if 1.7499999999999999e-124 < z Initial program 92.3%
+-commutative92.3%
associate-+r-92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
distribute-lft-neg-in96.0%
distribute-rgt-neg-in96.0%
*-commutative96.0%
associate-*r*92.3%
associate-*l*92.2%
neg-mul-192.2%
associate-*r*92.2%
Simplified92.2%
Taylor expanded in t around inf 54.2%
*-commutative54.2%
associate-*r*54.2%
*-commutative54.2%
associate-*l*54.3%
Simplified54.3%
Taylor expanded in t around 0 54.2%
associate-*r*54.7%
*-commutative54.7%
Simplified54.7%
Final simplification49.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 -3.6e+25)
(* -9.0 (* y (* z t)))
(if (<= z 6.6e-253)
(* b (* a 27.0))
(if (<= z 1.8e-112) (* 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 <= -3.6e+25) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 6.6e-253) {
tmp = b * (a * 27.0);
} else if (z <= 1.8e-112) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.6d+25)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 6.6d-253) then
tmp = b * (a * 27.0d0)
else if (z <= 1.8d-112) then
tmp = x * 2.0d0
else
tmp = (-9.0d0) * (t * (z * y))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.6e+25) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 6.6e-253) {
tmp = b * (a * 27.0);
} else if (z <= 1.8e-112) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3.6e+25: tmp = -9.0 * (y * (z * t)) elif z <= 6.6e-253: tmp = b * (a * 27.0) elif z <= 1.8e-112: tmp = x * 2.0 else: tmp = -9.0 * (t * (z * y)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.6e+25) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 6.6e-253) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 1.8e-112) tmp = Float64(x * 2.0); else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -3.6e+25)
tmp = -9.0 * (y * (z * t));
elseif (z <= 6.6e-253)
tmp = b * (a * 27.0);
elseif (z <= 1.8e-112)
tmp = x * 2.0;
else
tmp = -9.0 * (t * (z * y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.6e+25], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e-253], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-112], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+25}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-253}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -3.60000000000000015e25Initial program 89.7%
+-commutative89.7%
associate-+r-89.7%
*-commutative89.7%
cancel-sign-sub-inv89.7%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.2%
fma-define98.5%
cancel-sign-sub-inv98.5%
fma-define98.5%
distribute-lft-neg-in98.5%
distribute-rgt-neg-in98.5%
*-commutative98.5%
associate-*r*91.0%
associate-*l*91.0%
neg-mul-191.0%
associate-*r*91.0%
Simplified91.0%
Taylor expanded in t around inf 46.1%
*-commutative46.1%
associate-*r*46.1%
*-commutative46.1%
associate-*l*46.1%
Simplified46.1%
Taylor expanded in t around 0 46.1%
associate-*r*49.9%
*-commutative49.9%
Simplified49.9%
Taylor expanded in z around 0 46.1%
*-commutative46.1%
associate-*r*48.1%
*-commutative48.1%
Simplified48.1%
if -3.60000000000000015e25 < z < 6.6000000000000002e-253Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*92.3%
distribute-lft-neg-in92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-+r-92.3%
associate-*l*92.3%
fma-define92.3%
cancel-sign-sub-inv92.3%
fma-define92.3%
distribute-lft-neg-in92.3%
distribute-rgt-neg-in92.3%
*-commutative92.3%
associate-*r*99.8%
associate-*l*99.8%
neg-mul-199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 79.4%
Taylor expanded in b around inf 69.3%
Taylor expanded in x around 0 40.5%
if 6.6000000000000002e-253 < z < 1.8e-112Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.8%
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*99.7%
associate-*l*99.7%
neg-mul-199.7%
associate-*r*99.7%
Simplified99.7%
Taylor expanded in t around 0 86.4%
Taylor expanded in x around inf 57.0%
if 1.8e-112 < z Initial program 92.3%
+-commutative92.3%
associate-+r-92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
distribute-lft-neg-in96.0%
distribute-rgt-neg-in96.0%
*-commutative96.0%
associate-*r*92.3%
associate-*l*92.2%
neg-mul-192.2%
associate-*r*92.2%
Simplified92.2%
Taylor expanded in t around inf 54.2%
Final simplification48.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
(let* ((t_1 (* -9.0 (* t (* z y)))))
(if (<= z -2.9e+25)
t_1
(if (<= z 6.8e-251)
(* b (* a 27.0))
(if (<= z 1.4e-112) (* x 2.0) t_1)))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (z <= -2.9e+25) {
tmp = t_1;
} else if (z <= 6.8e-251) {
tmp = b * (a * 27.0);
} else if (z <= 1.4e-112) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (t * (z * y))
if (z <= (-2.9d+25)) then
tmp = t_1
else if (z <= 6.8d-251) then
tmp = b * (a * 27.0d0)
else if (z <= 1.4d-112) then
tmp = x * 2.0d0
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double tmp;
if (z <= -2.9e+25) {
tmp = t_1;
} else if (z <= 6.8e-251) {
tmp = b * (a * 27.0);
} else if (z <= 1.4e-112) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (z * y)) tmp = 0 if z <= -2.9e+25: tmp = t_1 elif z <= 6.8e-251: tmp = b * (a * 27.0) elif z <= 1.4e-112: tmp = x * 2.0 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (z <= -2.9e+25) tmp = t_1; elseif (z <= 6.8e-251) tmp = Float64(b * Float64(a * 27.0)); elseif (z <= 1.4e-112) tmp = Float64(x * 2.0); else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (z * y));
tmp = 0.0;
if (z <= -2.9e+25)
tmp = t_1;
elseif (z <= 6.8e-251)
tmp = b * (a * 27.0);
elseif (z <= 1.4e-112)
tmp = x * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+25], t$95$1, If[LessEqual[z, 6.8e-251], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-112], N[(x * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-251}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-112}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.8999999999999999e25 or 1.40000000000000011e-112 < z Initial program 91.0%
+-commutative91.0%
associate-+r-91.0%
*-commutative91.0%
cancel-sign-sub-inv91.0%
associate-*r*96.6%
distribute-lft-neg-in96.6%
*-commutative96.6%
cancel-sign-sub-inv96.6%
associate-+r-96.6%
associate-*l*96.6%
fma-define97.3%
cancel-sign-sub-inv97.3%
fma-define97.3%
distribute-lft-neg-in97.3%
distribute-rgt-neg-in97.3%
*-commutative97.3%
associate-*r*91.7%
associate-*l*91.6%
neg-mul-191.6%
associate-*r*91.6%
Simplified91.6%
Taylor expanded in t around inf 50.2%
if -2.8999999999999999e25 < z < 6.80000000000000034e-251Initial 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 79.7%
Taylor expanded in b around inf 69.7%
Taylor expanded in x around 0 41.3%
if 6.80000000000000034e-251 < z < 1.40000000000000011e-112Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*99.8%
distribute-lft-neg-in99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-+r-99.8%
associate-*l*99.8%
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*99.8%
associate-*l*99.8%
neg-mul-199.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in t around 0 85.9%
Taylor expanded in x around inf 59.1%
Final simplification48.5%
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 (* b (* a 27.0))))
(if (<= z 1e-97)
(- (+ t_1 (* x 2.0)) (* y (* 9.0 (* z t))))
(+ t_1 (- (* x 2.0) (* t (* z (* y 9.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 t_1 = b * (a * 27.0);
double tmp;
if (z <= 1e-97) {
tmp = (t_1 + (x * 2.0)) - (y * (9.0 * (z * t)));
} else {
tmp = t_1 + ((x * 2.0) - (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.
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 = b * (a * 27.0d0)
if (z <= 1d-97) then
tmp = (t_1 + (x * 2.0d0)) - (y * (9.0d0 * (z * t)))
else
tmp = t_1 + ((x * 2.0d0) - (t * (z * (y * 9.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 t_1 = b * (a * 27.0);
double tmp;
if (z <= 1e-97) {
tmp = (t_1 + (x * 2.0)) - (y * (9.0 * (z * t)));
} else {
tmp = t_1 + ((x * 2.0) - (t * (z * (y * 9.0))));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if z <= 1e-97: tmp = (t_1 + (x * 2.0)) - (y * (9.0 * (z * t))) else: tmp = t_1 + ((x * 2.0) - (t * (z * (y * 9.0)))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (z <= 1e-97) tmp = Float64(Float64(t_1 + Float64(x * 2.0)) - Float64(y * Float64(9.0 * Float64(z * t)))); else tmp = Float64(t_1 + Float64(Float64(x * 2.0) - 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (z <= 1e-97)
tmp = (t_1 + (x * 2.0)) - (y * (9.0 * (z * t)));
else
tmp = t_1 + ((x * 2.0) - (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.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1e-97], N[(N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq 10^{-97}:\\
\;\;\;\;\left(t\_1 + x \cdot 2\right) - y \cdot \left(9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if z < 1.00000000000000004e-97Initial program 95.6%
+-commutative95.6%
associate-+r-95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-*r*95.6%
distribute-lft-neg-in95.6%
*-commutative95.6%
cancel-sign-sub-inv95.6%
associate-+r-95.6%
associate-*l*95.6%
fma-define96.1%
cancel-sign-sub-inv96.1%
fma-define96.1%
distribute-lft-neg-in96.1%
distribute-rgt-neg-in96.1%
*-commutative96.1%
associate-*r*96.1%
associate-*l*96.1%
neg-mul-196.1%
associate-*r*96.1%
Simplified96.1%
fma-undefine95.6%
fma-undefine95.6%
associate-+r+95.6%
*-commutative95.6%
associate-*l*97.6%
*-commutative97.6%
associate-*r*97.6%
*-commutative97.6%
*-commutative97.6%
associate-*r*97.6%
associate-*l*97.6%
metadata-eval97.6%
distribute-lft-neg-in97.6%
*-commutative97.6%
distribute-rgt-neg-in97.6%
*-commutative97.6%
associate-+r+97.6%
sub-neg97.6%
Applied egg-rr97.6%
if 1.00000000000000004e-97 < z Initial program 92.2%
Final simplification96.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 (<= t 2e+137) (+ (- (* x 2.0) (* (* z t) (* y 9.0))) (* a (* 27.0 b))) (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* z (* y 9.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 (t <= 2e+137) {
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (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.
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 <= 2d+137) then
tmp = ((x * 2.0d0) - ((z * t) * (y * 9.0d0))) + (a * (27.0d0 * b))
else
tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (z * (y * 9.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 (t <= 2e+137) {
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
} else {
tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (y * 9.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 t <= 2e+137: tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b)) else: tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (y * 9.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 (t <= 2e+137) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(z * t) * Float64(y * 9.0))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - 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])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (t <= 2e+137)
tmp = ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
else
tmp = (b * (a * 27.0)) + ((x * 2.0) - (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. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 2e+137], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(z * t), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $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 2 \cdot 10^{+137}:\\
\;\;\;\;\left(x \cdot 2 - \left(z \cdot t\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right)\\
\end{array}
\end{array}
if t < 2.0000000000000001e137Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*97.6%
associate-*l*97.6%
Simplified97.6%
if 2.0000000000000001e137 < t Initial program 96.6%
Final simplification97.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.6e+25) (not (<= z 2.65e-112))) (+ (* y (* -9.0 (* z t))) (* x 2.0)) (+ (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.6e+25) || !(z <= 2.65e-112)) {
tmp = (y * (-9.0 * (z * t))) + (x * 2.0);
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-5.6d+25)) .or. (.not. (z <= 2.65d-112))) then
tmp = (y * ((-9.0d0) * (z * t))) + (x * 2.0d0)
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.6e+25) || !(z <= 2.65e-112)) {
tmp = (y * (-9.0 * (z * t))) + (x * 2.0);
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.6e+25) or not (z <= 2.65e-112): tmp = (y * (-9.0 * (z * t))) + (x * 2.0) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.6e+25) || !(z <= 2.65e-112)) tmp = Float64(Float64(y * Float64(-9.0 * Float64(z * t))) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -5.6e+25) || ~((z <= 2.65e-112)))
tmp = (y * (-9.0 * (z * t))) + (x * 2.0);
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.6e+25], N[Not[LessEqual[z, 2.65e-112]], $MachinePrecision]], N[(N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+25} \lor \neg \left(z \leq 2.65 \cdot 10^{-112}\right):\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -5.6000000000000003e25 or 2.6500000000000002e-112 < z Initial program 91.0%
sub-neg91.0%
sub-neg91.0%
associate-*l*93.5%
associate-*l*93.5%
Simplified93.5%
Taylor expanded in a around 0 68.9%
sub-neg68.9%
+-commutative68.9%
*-commutative68.9%
distribute-rgt-neg-in68.9%
*-commutative68.9%
associate-*r*70.5%
metadata-eval70.5%
associate-*r*70.6%
*-commutative70.6%
associate-*r*70.6%
associate-*r*70.6%
*-commutative70.6%
*-commutative70.6%
associate-*l*70.6%
*-commutative70.6%
Applied egg-rr70.6%
Taylor expanded in z around 0 70.6%
if -5.6000000000000003e25 < z < 2.6500000000000002e-112Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-+r-94.4%
associate-*l*94.4%
fma-define94.4%
cancel-sign-sub-inv94.4%
fma-define94.4%
distribute-lft-neg-in94.4%
distribute-rgt-neg-in94.4%
*-commutative94.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 81.3%
Final simplification75.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 -3.8e+25)
(+ (* y (* -9.0 (* z t))) (* x 2.0))
(if (<= z 1.8e-112)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.8e+25) {
tmp = (y * (-9.0 * (z * t))) + (x * 2.0);
} else if (z <= 1.8e-112) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-3.8d+25)) then
tmp = (y * ((-9.0d0) * (z * t))) + (x * 2.0d0)
else if (z <= 1.8d-112) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.8e+25) {
tmp = (y * (-9.0 * (z * t))) + (x * 2.0);
} else if (z <= 1.8e-112) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -3.8e+25: tmp = (y * (-9.0 * (z * t))) + (x * 2.0) elif z <= 1.8e-112: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.8e+25) tmp = Float64(Float64(y * Float64(-9.0 * Float64(z * t))) + Float64(x * 2.0)); elseif (z <= 1.8e-112) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -3.8e+25)
tmp = (y * (-9.0 * (z * t))) + (x * 2.0);
elseif (z <= 1.8e-112)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.8e+25], N[(N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-112], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right) + x \cdot 2\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -3.8e25Initial program 89.7%
sub-neg89.7%
sub-neg89.7%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 59.6%
sub-neg59.6%
+-commutative59.6%
*-commutative59.6%
distribute-rgt-neg-in59.6%
*-commutative59.6%
associate-*r*64.2%
metadata-eval64.2%
associate-*r*64.2%
*-commutative64.2%
associate-*r*64.3%
associate-*r*64.3%
*-commutative64.3%
*-commutative64.3%
associate-*l*64.3%
*-commutative64.3%
Applied egg-rr64.3%
Taylor expanded in z around 0 64.3%
if -3.8e25 < z < 1.8e-112Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-+r-94.4%
associate-*l*94.4%
fma-define94.4%
cancel-sign-sub-inv94.4%
fma-define94.4%
distribute-lft-neg-in94.4%
distribute-rgt-neg-in94.4%
*-commutative94.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 81.3%
if 1.8e-112 < z Initial program 92.3%
sub-neg92.3%
sub-neg92.3%
associate-*l*92.2%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in a around 0 78.1%
Final simplification75.4%
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.08e+33)
(* y (* t (* z (- 9.0))))
(if (<= z 2.65e-112)
(+ (* x 2.0) (* 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.08e+33) {
tmp = y * (t * (z * -9.0));
} else if (z <= 2.65e-112) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = 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.08d+33)) then
tmp = y * (t * (z * -9.0d0))
else if (z <= 2.65d-112) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = 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.08e+33) {
tmp = y * (t * (z * -9.0));
} else if (z <= 2.65e-112) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = 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.08e+33: tmp = y * (t * (z * -9.0)) elif z <= 2.65e-112: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = 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.08e+33) tmp = Float64(y * Float64(t * Float64(z * Float64(-9.0)))); elseif (z <= 2.65e-112) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(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.08e+33)
tmp = y * (t * (z * -9.0));
elseif (z <= 2.65e-112)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = 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.08e+33], N[(y * N[(t * N[(z * (-9.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.65e-112], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(-9.0 * N[(z * y), $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.08 \cdot 10^{+33}:\\
\;\;\;\;y \cdot \left(t \cdot \left(z \cdot \left(-9\right)\right)\right)\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-112}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.08000000000000005e33Initial program 89.6%
+-commutative89.6%
associate-+r-89.6%
*-commutative89.6%
cancel-sign-sub-inv89.6%
associate-*r*97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-+r-97.2%
associate-*l*97.1%
fma-define98.5%
cancel-sign-sub-inv98.5%
fma-define98.5%
distribute-lft-neg-in98.5%
distribute-rgt-neg-in98.5%
*-commutative98.5%
associate-*r*90.9%
associate-*l*90.9%
neg-mul-190.9%
associate-*r*90.9%
Simplified90.9%
Taylor expanded in t around inf 45.4%
*-commutative45.4%
associate-*r*45.4%
associate-*l*45.4%
Simplified45.4%
associate-*r*45.4%
associate-*r*45.4%
metadata-eval45.4%
distribute-rgt-neg-in45.4%
*-commutative45.4%
associate-*l*47.4%
associate-*r*47.5%
*-commutative47.5%
associate-*r*47.5%
*-commutative47.5%
Applied egg-rr47.5%
if -1.08000000000000005e33 < z < 2.6500000000000002e-112Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
associate-*r*94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-+r-94.4%
associate-*l*94.4%
fma-define94.4%
cancel-sign-sub-inv94.4%
fma-define94.4%
distribute-lft-neg-in94.4%
distribute-rgt-neg-in94.4%
*-commutative94.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 80.5%
if 2.6500000000000002e-112 < z Initial program 92.3%
+-commutative92.3%
associate-+r-92.3%
*-commutative92.3%
cancel-sign-sub-inv92.3%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.0%
cancel-sign-sub-inv96.0%
fma-define96.0%
distribute-lft-neg-in96.0%
distribute-rgt-neg-in96.0%
*-commutative96.0%
associate-*r*92.3%
associate-*l*92.2%
neg-mul-192.2%
associate-*r*92.2%
Simplified92.2%
Taylor expanded in t around inf 54.2%
*-commutative54.2%
associate-*r*54.2%
associate-*l*54.2%
Simplified54.2%
Taylor expanded in y around 0 54.2%
Final simplification63.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 (+ (- (* x 2.0) (* (* z t) (* y 9.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) {
return ((x * 2.0) - ((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.
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) - ((z * t) * (y * 9.0d0))) + (a * (27.0d0 * b))
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) - ((z * t) * (y * 9.0))) + (a * (27.0 * b));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return ((x * 2.0) - ((z * t) * (y * 9.0))) + (a * (27.0 * b))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(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])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - ((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. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $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])\\
\\
\left(x \cdot 2 - \left(z \cdot t\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 94.6%
sub-neg94.6%
sub-neg94.6%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Final simplification96.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 (or (<= a -2.3e+101) (not (<= a 1.3e-44))) (* 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 ((a <= -2.3e+101) || !(a <= 1.3e-44)) {
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 ((a <= (-2.3d+101)) .or. (.not. (a <= 1.3d-44))) 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 ((a <= -2.3e+101) || !(a <= 1.3e-44)) {
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 (a <= -2.3e+101) or not (a <= 1.3e-44): 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 ((a <= -2.3e+101) || !(a <= 1.3e-44)) 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 ((a <= -2.3e+101) || ~((a <= 1.3e-44)))
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[a, -2.3e+101], N[Not[LessEqual[a, 1.3e-44]], $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}\;a \leq -2.3 \cdot 10^{+101} \lor \neg \left(a \leq 1.3 \cdot 10^{-44}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -2.3000000000000001e101 or 1.2999999999999999e-44 < a Initial program 91.4%
+-commutative91.4%
associate-+r-91.4%
*-commutative91.4%
cancel-sign-sub-inv91.4%
associate-*r*94.7%
distribute-lft-neg-in94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-+r-94.7%
associate-*l*94.7%
fma-define95.6%
cancel-sign-sub-inv95.6%
fma-define95.6%
distribute-lft-neg-in95.6%
distribute-rgt-neg-in95.6%
*-commutative95.6%
associate-*r*92.3%
associate-*l*92.3%
neg-mul-192.3%
associate-*r*92.3%
Simplified92.3%
Taylor expanded in a around inf 56.1%
if -2.3000000000000001e101 < a < 1.2999999999999999e-44Initial program 97.2%
+-commutative97.2%
associate-+r-97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
associate-*r*96.5%
distribute-lft-neg-in96.5%
*-commutative96.5%
cancel-sign-sub-inv96.5%
associate-+r-96.5%
associate-*l*96.5%
fma-define96.5%
cancel-sign-sub-inv96.5%
fma-define96.5%
distribute-lft-neg-in96.5%
distribute-rgt-neg-in96.5%
*-commutative96.5%
associate-*r*97.2%
associate-*l*97.2%
neg-mul-197.2%
associate-*r*97.2%
Simplified97.2%
Taylor expanded in t around 0 53.7%
Taylor expanded in x around inf 38.9%
Final simplification46.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 (* 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 94.6%
+-commutative94.6%
associate-+r-94.6%
*-commutative94.6%
cancel-sign-sub-inv94.6%
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-define96.1%
cancel-sign-sub-inv96.1%
fma-define96.1%
distribute-lft-neg-in96.1%
distribute-rgt-neg-in96.1%
*-commutative96.1%
associate-*r*95.0%
associate-*l*95.0%
neg-mul-195.0%
associate-*r*95.0%
Simplified95.0%
Taylor expanded in t around 0 64.1%
Taylor expanded in x around inf 31.5%
Final simplification31.5%
(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 2024179
(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)))