
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -1e+16) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (+ (+ (* (* z -9.0) (* y t)) (* x 2.0)) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -1e+16) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -1e+16) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(Float64(Float64(Float64(z * -9.0) * Float64(y * t)) + Float64(x * 2.0)) + Float64(a * Float64(27.0 * b))); 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[N[(y * 9.0), $MachinePrecision], -1e+16], 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[(N[(N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -1 \cdot 10^{+16}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 y #s(literal 9 binary64)) < -1e16Initial program 91.5%
+-commutative91.5%
associate-+r-91.5%
*-commutative91.5%
cancel-sign-sub-inv91.5%
associate-*r*89.7%
distribute-lft-neg-in89.7%
*-commutative89.7%
cancel-sign-sub-inv89.7%
associate-+r-89.7%
associate-*l*89.7%
fma-define89.7%
fma-neg89.7%
associate-*l*98.6%
distribute-rgt-neg-in98.6%
*-commutative98.6%
associate-*l*99.9%
*-commutative99.9%
distribute-lft-neg-in99.9%
associate-*r*99.9%
Simplified99.9%
if -1e16 < (*.f64 y #s(literal 9 binary64)) Initial program 95.9%
associate-+l-95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*95.9%
associate-+l-95.9%
associate-*l*95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*92.4%
associate-*l*92.8%
Simplified92.8%
sub-neg92.8%
associate-*r*96.4%
distribute-lft-neg-in96.4%
distribute-lft-neg-in96.4%
distribute-rgt-neg-in96.4%
metadata-eval96.4%
associate-*r*96.3%
*-commutative96.3%
associate-*l*97.8%
*-commutative97.8%
Applied egg-rr97.8%
Final simplification98.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= t 2e-60) (+ (+ (* (* z -9.0) (* y t)) (* x 2.0)) (* a (* 27.0 b))) (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 (t <= 2e-60) {
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b));
} 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 (t <= 2e-60) tmp = Float64(Float64(Float64(Float64(z * -9.0) * Float64(y * t)) + Float64(x * 2.0)) + Float64(a * Float64(27.0 * b))); 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[t, 2e-60], N[(N[(N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $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}\;t \leq 2 \cdot 10^{-60}:\\
\;\;\;\;\left(\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\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 t < 1.9999999999999999e-60Initial program 92.8%
associate-+l-92.8%
*-commutative92.8%
*-commutative92.8%
associate-*l*93.3%
associate-+l-93.3%
associate-*l*92.8%
*-commutative92.8%
*-commutative92.8%
associate-*l*94.9%
associate-*l*95.4%
Simplified95.4%
sub-neg95.4%
associate-*r*93.3%
distribute-lft-neg-in93.3%
distribute-lft-neg-in93.3%
distribute-rgt-neg-in93.3%
metadata-eval93.3%
associate-*r*93.8%
*-commutative93.8%
associate-*l*97.5%
*-commutative97.5%
Applied egg-rr97.5%
if 1.9999999999999999e-60 < t Initial program 98.7%
+-commutative98.7%
associate-+r-98.7%
*-commutative98.7%
cancel-sign-sub-inv98.7%
associate-*r*91.9%
distribute-lft-neg-in91.9%
*-commutative91.9%
cancel-sign-sub-inv91.9%
associate-+r-91.9%
associate-*l*91.9%
fma-define91.9%
cancel-sign-sub-inv91.9%
fma-define91.9%
distribute-lft-neg-in91.9%
distribute-rgt-neg-in91.9%
*-commutative91.9%
associate-*r*98.6%
associate-*l*98.6%
neg-mul-198.6%
associate-*r*98.6%
Simplified98.6%
Final simplification97.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 (* -9.0 (* t (* y z)))))
(if (<= y -1.02e+185)
t_1
(if (<= y -5.5e+140)
(* 27.0 (* a b))
(if (<= y -5.6e+101)
t_1
(if (<= y -2e+31)
(* x 2.0)
(if (<= y -7000000.0)
(* b (* a 27.0))
(if (<= y 1.25e-150) (* 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 * (y * z));
double tmp;
if (y <= -1.02e+185) {
tmp = t_1;
} else if (y <= -5.5e+140) {
tmp = 27.0 * (a * b);
} else if (y <= -5.6e+101) {
tmp = t_1;
} else if (y <= -2e+31) {
tmp = x * 2.0;
} else if (y <= -7000000.0) {
tmp = b * (a * 27.0);
} else if (y <= 1.25e-150) {
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 * (y * z))
if (y <= (-1.02d+185)) then
tmp = t_1
else if (y <= (-5.5d+140)) then
tmp = 27.0d0 * (a * b)
else if (y <= (-5.6d+101)) then
tmp = t_1
else if (y <= (-2d+31)) then
tmp = x * 2.0d0
else if (y <= (-7000000.0d0)) then
tmp = b * (a * 27.0d0)
else if (y <= 1.25d-150) 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 * (y * z));
double tmp;
if (y <= -1.02e+185) {
tmp = t_1;
} else if (y <= -5.5e+140) {
tmp = 27.0 * (a * b);
} else if (y <= -5.6e+101) {
tmp = t_1;
} else if (y <= -2e+31) {
tmp = x * 2.0;
} else if (y <= -7000000.0) {
tmp = b * (a * 27.0);
} else if (y <= 1.25e-150) {
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 * (y * z)) tmp = 0 if y <= -1.02e+185: tmp = t_1 elif y <= -5.5e+140: tmp = 27.0 * (a * b) elif y <= -5.6e+101: tmp = t_1 elif y <= -2e+31: tmp = x * 2.0 elif y <= -7000000.0: tmp = b * (a * 27.0) elif y <= 1.25e-150: 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(y * z))) tmp = 0.0 if (y <= -1.02e+185) tmp = t_1; elseif (y <= -5.5e+140) tmp = Float64(27.0 * Float64(a * b)); elseif (y <= -5.6e+101) tmp = t_1; elseif (y <= -2e+31) tmp = Float64(x * 2.0); elseif (y <= -7000000.0) tmp = Float64(b * Float64(a * 27.0)); elseif (y <= 1.25e-150) 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 * (y * z));
tmp = 0.0;
if (y <= -1.02e+185)
tmp = t_1;
elseif (y <= -5.5e+140)
tmp = 27.0 * (a * b);
elseif (y <= -5.6e+101)
tmp = t_1;
elseif (y <= -2e+31)
tmp = x * 2.0;
elseif (y <= -7000000.0)
tmp = b * (a * 27.0);
elseif (y <= 1.25e-150)
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[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e+185], t$95$1, If[LessEqual[y, -5.5e+140], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.6e+101], t$95$1, If[LessEqual[y, -2e+31], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -7000000.0], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e-150], 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(y \cdot z\right)\right)\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{+140}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2 \cdot 10^{+31}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -7000000:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-150}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.0200000000000001e185 or -5.5e140 < y < -5.59999999999999962e101 or 1.24999999999999997e-150 < y Initial program 93.4%
associate-+l-93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*94.0%
associate-+l-94.0%
associate-*l*93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*96.6%
associate-*l*96.6%
Simplified96.6%
Taylor expanded in y around inf 52.1%
if -1.0200000000000001e185 < y < -5.5e140Initial program 99.5%
associate-+l-99.5%
*-commutative99.5%
*-commutative99.5%
associate-*l*99.5%
associate-+l-99.5%
associate-*l*99.5%
*-commutative99.5%
*-commutative99.5%
associate-*l*99.5%
associate-*l*100.0%
Simplified100.0%
sub-neg100.0%
associate-*r*100.0%
distribute-lft-neg-in100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 100.0%
if -5.59999999999999962e101 < y < -1.9999999999999999e31 or -7e6 < y < 1.24999999999999997e-150Initial program 97.2%
associate-+l-97.2%
*-commutative97.2%
*-commutative97.2%
associate-*l*97.1%
associate-+l-97.1%
associate-*l*97.2%
*-commutative97.2%
*-commutative97.2%
associate-*l*90.0%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in x around inf 47.4%
if -1.9999999999999999e31 < y < -7e6Initial program 84.3%
associate-+l-84.3%
*-commutative84.3%
*-commutative84.3%
associate-*l*84.3%
associate-+l-84.3%
associate-*l*84.3%
*-commutative84.3%
*-commutative84.3%
associate-*l*99.5%
associate-*l*99.7%
Simplified99.7%
sub-neg99.7%
associate-*r*84.5%
distribute-lft-neg-in84.5%
distribute-lft-neg-in84.5%
distribute-rgt-neg-in84.5%
metadata-eval84.5%
associate-*r*84.5%
*-commutative84.5%
associate-*l*99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 83.3%
*-commutative83.3%
*-commutative83.3%
associate-*r*83.0%
*-commutative83.0%
Simplified83.0%
Final simplification51.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 (* -9.0 (* t (* y z)))))
(if (<= y -2.7e+184)
(* -9.0 (* y (* z t)))
(if (<= y -5.2e+140)
(* 27.0 (* a b))
(if (<= y -4.6e+101)
t_1
(if (<= y -3.2e+31)
(* x 2.0)
(if (<= y -9000000.0)
(* b (* a 27.0))
(if (<= y 1.25e-150) (* 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 * (y * z));
double tmp;
if (y <= -2.7e+184) {
tmp = -9.0 * (y * (z * t));
} else if (y <= -5.2e+140) {
tmp = 27.0 * (a * b);
} else if (y <= -4.6e+101) {
tmp = t_1;
} else if (y <= -3.2e+31) {
tmp = x * 2.0;
} else if (y <= -9000000.0) {
tmp = b * (a * 27.0);
} else if (y <= 1.25e-150) {
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 * (y * z))
if (y <= (-2.7d+184)) then
tmp = (-9.0d0) * (y * (z * t))
else if (y <= (-5.2d+140)) then
tmp = 27.0d0 * (a * b)
else if (y <= (-4.6d+101)) then
tmp = t_1
else if (y <= (-3.2d+31)) then
tmp = x * 2.0d0
else if (y <= (-9000000.0d0)) then
tmp = b * (a * 27.0d0)
else if (y <= 1.25d-150) 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 * (y * z));
double tmp;
if (y <= -2.7e+184) {
tmp = -9.0 * (y * (z * t));
} else if (y <= -5.2e+140) {
tmp = 27.0 * (a * b);
} else if (y <= -4.6e+101) {
tmp = t_1;
} else if (y <= -3.2e+31) {
tmp = x * 2.0;
} else if (y <= -9000000.0) {
tmp = b * (a * 27.0);
} else if (y <= 1.25e-150) {
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 * (y * z)) tmp = 0 if y <= -2.7e+184: tmp = -9.0 * (y * (z * t)) elif y <= -5.2e+140: tmp = 27.0 * (a * b) elif y <= -4.6e+101: tmp = t_1 elif y <= -3.2e+31: tmp = x * 2.0 elif y <= -9000000.0: tmp = b * (a * 27.0) elif y <= 1.25e-150: 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(y * z))) tmp = 0.0 if (y <= -2.7e+184) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (y <= -5.2e+140) tmp = Float64(27.0 * Float64(a * b)); elseif (y <= -4.6e+101) tmp = t_1; elseif (y <= -3.2e+31) tmp = Float64(x * 2.0); elseif (y <= -9000000.0) tmp = Float64(b * Float64(a * 27.0)); elseif (y <= 1.25e-150) 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 * (y * z));
tmp = 0.0;
if (y <= -2.7e+184)
tmp = -9.0 * (y * (z * t));
elseif (y <= -5.2e+140)
tmp = 27.0 * (a * b);
elseif (y <= -4.6e+101)
tmp = t_1;
elseif (y <= -3.2e+31)
tmp = x * 2.0;
elseif (y <= -9000000.0)
tmp = b * (a * 27.0);
elseif (y <= 1.25e-150)
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[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e+184], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e+140], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.6e+101], t$95$1, If[LessEqual[y, -3.2e+31], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -9000000.0], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e-150], 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(y \cdot z\right)\right)\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{+184}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{+140}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{+31}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -9000000:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-150}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.6999999999999999e184Initial program 92.2%
associate-+l-92.2%
*-commutative92.2%
*-commutative92.2%
associate-*l*94.8%
associate-+l-94.8%
associate-*l*92.2%
*-commutative92.2%
*-commutative92.2%
associate-*l*97.4%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in y around inf 70.8%
pow170.8%
*-commutative70.8%
*-commutative70.8%
associate-*l*73.2%
Applied egg-rr73.2%
unpow173.2%
*-commutative73.2%
associate-*l*75.9%
Simplified75.9%
if -2.6999999999999999e184 < y < -5.2000000000000002e140Initial program 99.5%
associate-+l-99.5%
*-commutative99.5%
*-commutative99.5%
associate-*l*99.5%
associate-+l-99.5%
associate-*l*99.5%
*-commutative99.5%
*-commutative99.5%
associate-*l*99.5%
associate-*l*100.0%
Simplified100.0%
sub-neg100.0%
associate-*r*100.0%
distribute-lft-neg-in100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 100.0%
if -5.2000000000000002e140 < y < -4.6000000000000003e101 or 1.24999999999999997e-150 < y Initial program 93.7%
associate-+l-93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*93.7%
associate-+l-93.7%
associate-*l*93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in y around inf 45.8%
if -4.6000000000000003e101 < y < -3.2000000000000001e31 or -9e6 < y < 1.24999999999999997e-150Initial program 97.2%
associate-+l-97.2%
*-commutative97.2%
*-commutative97.2%
associate-*l*97.1%
associate-+l-97.1%
associate-*l*97.2%
*-commutative97.2%
*-commutative97.2%
associate-*l*90.0%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in x around inf 47.4%
if -3.2000000000000001e31 < y < -9e6Initial program 84.3%
associate-+l-84.3%
*-commutative84.3%
*-commutative84.3%
associate-*l*84.3%
associate-+l-84.3%
associate-*l*84.3%
*-commutative84.3%
*-commutative84.3%
associate-*l*99.5%
associate-*l*99.7%
Simplified99.7%
sub-neg99.7%
associate-*r*84.5%
distribute-lft-neg-in84.5%
distribute-lft-neg-in84.5%
distribute-rgt-neg-in84.5%
metadata-eval84.5%
associate-*r*84.5%
*-commutative84.5%
associate-*l*99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 83.3%
*-commutative83.3%
*-commutative83.3%
associate-*r*83.0%
*-commutative83.0%
Simplified83.0%
Final simplification52.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 (<= y -1.3e+184)
(* -9.0 (* y (* z t)))
(if (<= y -2.3e+140)
(* 27.0 (* a b))
(if (<= y -2.9e+102)
(* -9.0 (* t (* y z)))
(if (<= y -6e+31)
(* x 2.0)
(if (<= y -6500000.0)
(* b (* a 27.0))
(if (<= y 1.2e-150) (* 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 (y <= -1.3e+184) {
tmp = -9.0 * (y * (z * t));
} else if (y <= -2.3e+140) {
tmp = 27.0 * (a * b);
} else if (y <= -2.9e+102) {
tmp = -9.0 * (t * (y * z));
} else if (y <= -6e+31) {
tmp = x * 2.0;
} else if (y <= -6500000.0) {
tmp = b * (a * 27.0);
} else if (y <= 1.2e-150) {
tmp = x * 2.0;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= (-1.3d+184)) then
tmp = (-9.0d0) * (y * (z * t))
else if (y <= (-2.3d+140)) then
tmp = 27.0d0 * (a * b)
else if (y <= (-2.9d+102)) then
tmp = (-9.0d0) * (t * (y * z))
else if (y <= (-6d+31)) then
tmp = x * 2.0d0
else if (y <= (-6500000.0d0)) then
tmp = b * (a * 27.0d0)
else if (y <= 1.2d-150) then
tmp = x * 2.0d0
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.3e+184) {
tmp = -9.0 * (y * (z * t));
} else if (y <= -2.3e+140) {
tmp = 27.0 * (a * b);
} else if (y <= -2.9e+102) {
tmp = -9.0 * (t * (y * z));
} else if (y <= -6e+31) {
tmp = x * 2.0;
} else if (y <= -6500000.0) {
tmp = b * (a * 27.0);
} else if (y <= 1.2e-150) {
tmp = x * 2.0;
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -1.3e+184: tmp = -9.0 * (y * (z * t)) elif y <= -2.3e+140: tmp = 27.0 * (a * b) elif y <= -2.9e+102: tmp = -9.0 * (t * (y * z)) elif y <= -6e+31: tmp = x * 2.0 elif y <= -6500000.0: tmp = b * (a * 27.0) elif y <= 1.2e-150: tmp = x * 2.0 else: tmp = t * (y * (z * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.3e+184) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (y <= -2.3e+140) tmp = Float64(27.0 * Float64(a * b)); elseif (y <= -2.9e+102) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (y <= -6e+31) tmp = Float64(x * 2.0); elseif (y <= -6500000.0) tmp = Float64(b * Float64(a * 27.0)); elseif (y <= 1.2e-150) tmp = Float64(x * 2.0); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -1.3e+184)
tmp = -9.0 * (y * (z * t));
elseif (y <= -2.3e+140)
tmp = 27.0 * (a * b);
elseif (y <= -2.9e+102)
tmp = -9.0 * (t * (y * z));
elseif (y <= -6e+31)
tmp = x * 2.0;
elseif (y <= -6500000.0)
tmp = b * (a * 27.0);
elseif (y <= 1.2e-150)
tmp = x * 2.0;
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.3e+184], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.3e+140], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.9e+102], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6e+31], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -6500000.0], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-150], N[(x * 2.0), $MachinePrecision], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+184}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;y \leq -2.3 \cdot 10^{+140}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{+102}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;y \leq -6 \cdot 10^{+31}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -6500000:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-150}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if y < -1.29999999999999997e184Initial program 92.2%
associate-+l-92.2%
*-commutative92.2%
*-commutative92.2%
associate-*l*94.8%
associate-+l-94.8%
associate-*l*92.2%
*-commutative92.2%
*-commutative92.2%
associate-*l*97.4%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in y around inf 70.8%
pow170.8%
*-commutative70.8%
*-commutative70.8%
associate-*l*73.2%
Applied egg-rr73.2%
unpow173.2%
*-commutative73.2%
associate-*l*75.9%
Simplified75.9%
if -1.29999999999999997e184 < y < -2.2999999999999999e140Initial program 99.5%
associate-+l-99.5%
*-commutative99.5%
*-commutative99.5%
associate-*l*99.5%
associate-+l-99.5%
associate-*l*99.5%
*-commutative99.5%
*-commutative99.5%
associate-*l*99.5%
associate-*l*100.0%
Simplified100.0%
sub-neg100.0%
associate-*r*100.0%
distribute-lft-neg-in100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in a around inf 100.0%
if -2.2999999999999999e140 < y < -2.9000000000000002e102Initial program 87.3%
associate-+l-87.3%
*-commutative87.3%
*-commutative87.3%
associate-*l*87.3%
associate-+l-87.3%
associate-*l*87.3%
*-commutative87.3%
*-commutative87.3%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in y around inf 62.9%
if -2.9000000000000002e102 < y < -5.99999999999999978e31 or -6.5e6 < y < 1.2e-150Initial program 97.2%
associate-+l-97.2%
*-commutative97.2%
*-commutative97.2%
associate-*l*97.1%
associate-+l-97.1%
associate-*l*97.2%
*-commutative97.2%
*-commutative97.2%
associate-*l*90.0%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in x around inf 47.4%
if -5.99999999999999978e31 < y < -6.5e6Initial program 84.3%
associate-+l-84.3%
*-commutative84.3%
*-commutative84.3%
associate-*l*84.3%
associate-+l-84.3%
associate-*l*84.3%
*-commutative84.3%
*-commutative84.3%
associate-*l*99.5%
associate-*l*99.7%
Simplified99.7%
sub-neg99.7%
associate-*r*84.5%
distribute-lft-neg-in84.5%
distribute-lft-neg-in84.5%
distribute-rgt-neg-in84.5%
metadata-eval84.5%
associate-*r*84.5%
*-commutative84.5%
associate-*l*99.7%
*-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in a around inf 83.3%
*-commutative83.3%
*-commutative83.3%
associate-*r*83.0%
*-commutative83.0%
Simplified83.0%
if 1.2e-150 < y Initial program 94.2%
associate-+l-94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*94.2%
associate-+l-94.2%
associate-*l*94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*96.1%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around 0 68.3%
Taylor expanded in y around inf 66.6%
Taylor expanded in y around inf 44.4%
associate-*r*44.4%
*-commutative44.4%
associate-*r*44.4%
Simplified44.4%
pow144.4%
*-commutative44.4%
associate-*r*44.4%
*-commutative44.4%
associate-*l*44.4%
Applied egg-rr44.4%
unpow144.4%
*-commutative44.4%
*-commutative44.4%
associate-*l*44.4%
Simplified44.4%
Final simplification52.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
(let* ((t_1 (* 27.0 (* a b))) (t_2 (+ (* x 2.0) t_1)))
(if (<= y -5.8e+177)
(* y (- (* 27.0 (/ (* a b) y)) (* 9.0 (* z t))))
(if (<= y -1.55e+147)
t_2
(if (<= y -3.4e+83)
(- t_1 (* 9.0 (* t (* y z))))
(if (<= y 1.2e-150)
t_2
(+ (* (* z -9.0) (* y t)) (* b (* a 27.0)))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = (x * 2.0) + t_1;
double tmp;
if (y <= -5.8e+177) {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
} else if (y <= -1.55e+147) {
tmp = t_2;
} else if (y <= -3.4e+83) {
tmp = t_1 - (9.0 * (t * (y * z)));
} else if (y <= 1.2e-150) {
tmp = t_2;
} else {
tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = (x * 2.0d0) + t_1
if (y <= (-5.8d+177)) then
tmp = y * ((27.0d0 * ((a * b) / y)) - (9.0d0 * (z * t)))
else if (y <= (-1.55d+147)) then
tmp = t_2
else if (y <= (-3.4d+83)) then
tmp = t_1 - (9.0d0 * (t * (y * z)))
else if (y <= 1.2d-150) then
tmp = t_2
else
tmp = ((z * (-9.0d0)) * (y * t)) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double t_2 = (x * 2.0) + t_1;
double tmp;
if (y <= -5.8e+177) {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
} else if (y <= -1.55e+147) {
tmp = t_2;
} else if (y <= -3.4e+83) {
tmp = t_1 - (9.0 * (t * (y * z)));
} else if (y <= 1.2e-150) {
tmp = t_2;
} else {
tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) t_2 = (x * 2.0) + t_1 tmp = 0 if y <= -5.8e+177: tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t))) elif y <= -1.55e+147: tmp = t_2 elif y <= -3.4e+83: tmp = t_1 - (9.0 * (t * (y * z))) elif y <= 1.2e-150: tmp = t_2 else: tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) t_2 = Float64(Float64(x * 2.0) + t_1) tmp = 0.0 if (y <= -5.8e+177) tmp = Float64(y * Float64(Float64(27.0 * Float64(Float64(a * b) / y)) - Float64(9.0 * Float64(z * t)))); elseif (y <= -1.55e+147) tmp = t_2; elseif (y <= -3.4e+83) tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(y * z)))); elseif (y <= 1.2e-150) tmp = t_2; else tmp = Float64(Float64(Float64(z * -9.0) * Float64(y * t)) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
t_2 = (x * 2.0) + t_1;
tmp = 0.0;
if (y <= -5.8e+177)
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
elseif (y <= -1.55e+147)
tmp = t_2;
elseif (y <= -3.4e+83)
tmp = t_1 - (9.0 * (t * (y * z)));
elseif (y <= 1.2e-150)
tmp = t_2;
else
tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[y, -5.8e+177], N[(y * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.55e+147], t$95$2, If[LessEqual[y, -3.4e+83], N[(t$95$1 - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-150], t$95$2, N[(N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := x \cdot 2 + t\_1\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+177}:\\
\;\;\;\;y \cdot \left(27 \cdot \frac{a \cdot b}{y} - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{+83}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-150}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if y < -5.80000000000000027e177Initial program 92.2%
associate-+l-92.2%
*-commutative92.2%
*-commutative92.2%
associate-*l*94.8%
associate-+l-94.8%
associate-*l*92.2%
*-commutative92.2%
*-commutative92.2%
associate-*l*97.4%
associate-*l*97.4%
Simplified97.4%
Taylor expanded in x around 0 84.1%
Taylor expanded in y around inf 89.2%
if -5.80000000000000027e177 < y < -1.55e147 or -3.3999999999999998e83 < y < 1.2e-150Initial program 96.5%
associate-+l-96.5%
*-commutative96.5%
*-commutative96.5%
associate-*l*96.5%
associate-+l-96.5%
associate-*l*96.5%
*-commutative96.5%
*-commutative96.5%
associate-*l*90.6%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in y around 0 83.8%
if -1.55e147 < y < -3.3999999999999998e83Initial program 89.7%
associate-+l-89.7%
*-commutative89.7%
*-commutative89.7%
associate-*l*89.7%
associate-+l-89.7%
associate-*l*89.7%
*-commutative89.7%
*-commutative89.7%
associate-*l*99.8%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around 0 70.5%
if 1.2e-150 < y Initial program 94.2%
associate-+l-94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*94.2%
associate-+l-94.2%
associate-*l*94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*96.1%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in x around 0 68.3%
cancel-sign-sub-inv68.3%
metadata-eval68.3%
+-commutative68.3%
*-commutative68.3%
associate-*r*70.1%
*-commutative70.1%
associate-*r*70.1%
*-commutative70.1%
*-commutative70.1%
*-commutative70.1%
associate-*l*70.1%
Applied egg-rr70.1%
Final simplification78.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
(let* ((t_1 (* a (* 27.0 b))))
(if (<= (* y 9.0) -1e+16)
(+ t_1 (- (* x 2.0) (* (* y 9.0) (* z t))))
(+ (+ (* (* z -9.0) (* y t)) (* 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 = a * (27.0 * b);
double tmp;
if ((y * 9.0) <= -1e+16) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if ((y * 9.0d0) <= (-1d+16)) then
tmp = t_1 + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = (((z * (-9.0d0)) * (y * t)) + (x * 2.0d0)) + 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 = a * (27.0 * b);
double tmp;
if ((y * 9.0) <= -1e+16) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + 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 = a * (27.0 * b) tmp = 0 if (y * 9.0) <= -1e+16: tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + 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(a * Float64(27.0 * b)) tmp = 0.0 if (Float64(y * 9.0) <= -1e+16) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(Float64(Float64(z * -9.0) * Float64(y * t)) + Float64(x * 2.0)) + 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 = a * (27.0 * b);
tmp = 0.0;
if ((y * 9.0) <= -1e+16)
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * 9.0), $MachinePrecision], -1e+16], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;y \cdot 9 \leq -1 \cdot 10^{+16}:\\
\;\;\;\;t\_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + x \cdot 2\right) + t\_1\\
\end{array}
\end{array}
if (*.f64 y #s(literal 9 binary64)) < -1e16Initial program 91.5%
associate-+l-91.5%
*-commutative91.5%
*-commutative91.5%
associate-*l*92.8%
associate-+l-92.8%
associate-*l*91.5%
*-commutative91.5%
*-commutative91.5%
associate-*l*98.5%
associate-*l*98.5%
Simplified98.5%
if -1e16 < (*.f64 y #s(literal 9 binary64)) Initial program 95.9%
associate-+l-95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*95.9%
associate-+l-95.9%
associate-*l*95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*92.4%
associate-*l*92.8%
Simplified92.8%
sub-neg92.8%
associate-*r*96.4%
distribute-lft-neg-in96.4%
distribute-lft-neg-in96.4%
distribute-rgt-neg-in96.4%
metadata-eval96.4%
associate-*r*96.3%
*-commutative96.3%
associate-*l*97.8%
*-commutative97.8%
Applied egg-rr97.8%
Final simplification98.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 (<= z -3.3e-10) (not (<= z 7600000000.0))) (+ (* (* z -9.0) (* y t)) (* b (* a 27.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 <= -3.3e-10) || !(z <= 7600000000.0)) {
tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.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 <= (-3.3d-10)) .or. (.not. (z <= 7600000000.0d0))) then
tmp = ((z * (-9.0d0)) * (y * t)) + (b * (a * 27.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 <= -3.3e-10) || !(z <= 7600000000.0)) {
tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.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 <= -3.3e-10) or not (z <= 7600000000.0): tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.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 <= -3.3e-10) || !(z <= 7600000000.0)) tmp = Float64(Float64(Float64(z * -9.0) * Float64(y * t)) + Float64(b * Float64(a * 27.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 <= -3.3e-10) || ~((z <= 7600000000.0)))
tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.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, -3.3e-10], N[Not[LessEqual[z, 7600000000.0]], $MachinePrecision]], N[(N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-10} \lor \neg \left(z \leq 7600000000\right):\\
\;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -3.3e-10 or 7.6e9 < z Initial program 92.3%
associate-+l-92.3%
*-commutative92.3%
*-commutative92.3%
associate-*l*92.3%
associate-+l-92.3%
associate-*l*92.3%
*-commutative92.3%
*-commutative92.3%
associate-*l*91.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in x around 0 73.8%
cancel-sign-sub-inv73.8%
metadata-eval73.8%
+-commutative73.8%
*-commutative73.8%
associate-*r*79.9%
*-commutative79.9%
associate-*r*79.9%
*-commutative79.9%
*-commutative79.9%
*-commutative79.9%
associate-*l*79.9%
Applied egg-rr79.9%
if -3.3e-10 < z < 7.6e9Initial program 97.6%
associate-+l-97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*98.3%
associate-+l-98.3%
associate-*l*97.6%
*-commutative97.6%
*-commutative97.6%
associate-*l*97.5%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in y around 0 80.4%
Final simplification80.1%
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 (or (<= x -2.25e+157) (not (<= x 2.3e+15)))
(+ (* x 2.0) t_1)
(- t_1 (* 9.0 (* t (* y z)))))))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 ((x <= -2.25e+157) || !(x <= 2.3e+15)) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - (9.0 * (t * (y * z)));
}
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 ((x <= (-2.25d+157)) .or. (.not. (x <= 2.3d+15))) then
tmp = (x * 2.0d0) + t_1
else
tmp = t_1 - (9.0d0 * (t * (y * z)))
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 ((x <= -2.25e+157) || !(x <= 2.3e+15)) {
tmp = (x * 2.0) + t_1;
} else {
tmp = t_1 - (9.0 * (t * (y * z)));
}
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 (x <= -2.25e+157) or not (x <= 2.3e+15): tmp = (x * 2.0) + t_1 else: tmp = t_1 - (9.0 * (t * (y * z))) 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 ((x <= -2.25e+157) || !(x <= 2.3e+15)) tmp = Float64(Float64(x * 2.0) + t_1); else tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(y * z)))); 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 ((x <= -2.25e+157) || ~((x <= 2.3e+15)))
tmp = (x * 2.0) + t_1;
else
tmp = t_1 - (9.0 * (t * (y * z)));
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[Or[LessEqual[x, -2.25e+157], N[Not[LessEqual[x, 2.3e+15]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - N[(9.0 * N[(t * N[(y * z), $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}\;x \leq -2.25 \cdot 10^{+157} \lor \neg \left(x \leq 2.3 \cdot 10^{+15}\right):\\
\;\;\;\;x \cdot 2 + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if x < -2.24999999999999992e157 or 2.3e15 < x Initial program 90.4%
associate-+l-90.4%
*-commutative90.4%
*-commutative90.4%
associate-*l*91.4%
associate-+l-91.4%
associate-*l*90.4%
*-commutative90.4%
*-commutative90.4%
associate-*l*97.1%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 78.6%
if -2.24999999999999992e157 < x < 2.3e15Initial program 97.4%
associate-+l-97.4%
*-commutative97.4%
*-commutative97.4%
associate-*l*97.4%
associate-+l-97.4%
associate-*l*97.4%
*-commutative97.4%
*-commutative97.4%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in x around 0 84.0%
Final simplification82.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 (<= y -4.5e+249) (* y (- (* 27.0 (/ (* a b) y)) (* 9.0 (* z t)))) (+ (+ (* (* z -9.0) (* y t)) (* x 2.0)) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.5e+249) {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
} else {
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-4.5d+249)) then
tmp = y * ((27.0d0 * ((a * b) / y)) - (9.0d0 * (z * t)))
else
tmp = (((z * (-9.0d0)) * (y * t)) + (x * 2.0d0)) + (a * (27.0d0 * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.5e+249) {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
} else {
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -4.5e+249: tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t))) else: tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.5e+249) tmp = Float64(y * Float64(Float64(27.0 * Float64(Float64(a * b) / y)) - Float64(9.0 * Float64(z * t)))); else tmp = Float64(Float64(Float64(Float64(z * -9.0) * Float64(y * t)) + Float64(x * 2.0)) + Float64(a * Float64(27.0 * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -4.5e+249)
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
else
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.5e+249], N[(y * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+249}:\\
\;\;\;\;y \cdot \left(27 \cdot \frac{a \cdot b}{y} - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if y < -4.4999999999999996e249Initial program 81.6%
associate-+l-81.6%
*-commutative81.6%
*-commutative81.6%
associate-*l*87.6%
associate-+l-87.6%
associate-*l*81.6%
*-commutative81.6%
*-commutative81.6%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in x around 0 87.6%
Taylor expanded in y around inf 99.9%
if -4.4999999999999996e249 < y Initial program 95.6%
associate-+l-95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*95.6%
associate-+l-95.6%
associate-*l*95.6%
*-commutative95.6%
*-commutative95.6%
associate-*l*94.0%
associate-*l*94.4%
Simplified94.4%
sub-neg94.4%
associate-*r*95.9%
distribute-lft-neg-in95.9%
distribute-lft-neg-in95.9%
distribute-rgt-neg-in95.9%
metadata-eval95.9%
associate-*r*95.9%
*-commutative95.9%
associate-*l*97.0%
*-commutative97.0%
Applied egg-rr97.0%
Final simplification97.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 (<= t 7e+33) (+ (+ (* (* z -9.0) (* y t)) (* x 2.0)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* (* y 9.0) z))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 7e+33) {
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= 7d+33) then
tmp = (((z * (-9.0d0)) * (y * t)) + (x * 2.0d0)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * ((y * 9.0d0) * z))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 7e+33) {
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if t <= 7e+33: tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 7e+33) tmp = Float64(Float64(Float64(Float64(z * -9.0) * Float64(y * t)) + Float64(x * 2.0)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(Float64(y * 9.0) * z))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (t <= 7e+33)
tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * ((y * 9.0) * z))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 7e+33], N[(N[(N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7 \cdot 10^{+33}:\\
\;\;\;\;\left(\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(\left(y \cdot 9\right) \cdot z\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if t < 7.0000000000000002e33Initial program 93.1%
associate-+l-93.1%
*-commutative93.1%
*-commutative93.1%
associate-*l*93.6%
associate-+l-93.6%
associate-*l*93.1%
*-commutative93.1%
*-commutative93.1%
associate-*l*95.5%
associate-*l*95.9%
Simplified95.9%
sub-neg95.9%
associate-*r*93.5%
distribute-lft-neg-in93.5%
distribute-lft-neg-in93.5%
distribute-rgt-neg-in93.5%
metadata-eval93.5%
associate-*r*94.0%
*-commutative94.0%
associate-*l*97.3%
*-commutative97.3%
Applied egg-rr97.3%
if 7.0000000000000002e33 < t Initial program 99.9%
Final simplification97.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -3.8e+75) (* z (* -9.0 (* y t))) (if (<= z 6e+102) (+ (* x 2.0) (* 27.0 (* a b))) (* -9.0 (* t (* y z))))))
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+75) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 6e+102) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -9.0 * (t * (y * z));
}
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+75)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= 6d+102) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (-9.0d0) * (t * (y * z))
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+75) {
tmp = z * (-9.0 * (y * t));
} else if (z <= 6e+102) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = -9.0 * (t * (y * z));
}
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+75: tmp = z * (-9.0 * (y * t)) elif z <= 6e+102: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = -9.0 * (t * (y * z)) 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+75) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= 6e+102) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); 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+75)
tmp = z * (-9.0 * (y * t));
elseif (z <= 6e+102)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = -9.0 * (t * (y * z));
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+75], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+102], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $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^{+75}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+102}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -3.8000000000000002e75Initial program 91.5%
associate-+l-91.5%
*-commutative91.5%
*-commutative91.5%
associate-*l*91.4%
associate-+l-91.4%
associate-*l*91.5%
*-commutative91.5%
*-commutative91.5%
associate-*l*84.8%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in x around 0 75.7%
Taylor expanded in z around inf 82.4%
Taylor expanded in a around 0 65.6%
if -3.8000000000000002e75 < z < 5.9999999999999996e102Initial program 98.1%
associate-+l-98.1%
*-commutative98.1%
*-commutative98.1%
associate-*l*98.7%
associate-+l-98.7%
associate-*l*98.1%
*-commutative98.1%
*-commutative98.1%
associate-*l*98.1%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in y around 0 77.7%
if 5.9999999999999996e102 < z Initial program 87.1%
associate-+l-87.1%
*-commutative87.1%
*-commutative87.1%
associate-*l*87.1%
associate-+l-87.1%
associate-*l*87.1%
*-commutative87.1%
*-commutative87.1%
associate-*l*91.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in y around inf 54.0%
Final simplification71.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 -1.2e+104) (not (<= a 3.8e-72))) (* 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 <= -1.2e+104) || !(a <= 3.8e-72)) {
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 <= (-1.2d+104)) .or. (.not. (a <= 3.8d-72))) 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 <= -1.2e+104) || !(a <= 3.8e-72)) {
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 <= -1.2e+104) or not (a <= 3.8e-72): 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 <= -1.2e+104) || !(a <= 3.8e-72)) 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 <= -1.2e+104) || ~((a <= 3.8e-72)))
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, -1.2e+104], N[Not[LessEqual[a, 3.8e-72]], $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 -1.2 \cdot 10^{+104} \lor \neg \left(a \leq 3.8 \cdot 10^{-72}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -1.2e104 or 3.80000000000000002e-72 < a Initial program 98.2%
associate-+l-98.2%
*-commutative98.2%
*-commutative98.2%
associate-*l*98.2%
associate-+l-98.2%
associate-*l*98.2%
*-commutative98.2%
*-commutative98.2%
associate-*l*94.3%
associate-*l*95.0%
Simplified95.0%
sub-neg95.0%
associate-*r*98.9%
distribute-lft-neg-in98.9%
distribute-lft-neg-in98.9%
distribute-rgt-neg-in98.9%
metadata-eval98.9%
associate-*r*98.9%
*-commutative98.9%
associate-*l*94.9%
*-commutative94.9%
Applied egg-rr94.9%
Taylor expanded in a around inf 57.4%
if -1.2e104 < a < 3.80000000000000002e-72Initial program 91.8%
associate-+l-91.8%
*-commutative91.8%
*-commutative91.8%
associate-*l*92.4%
associate-+l-92.4%
associate-*l*91.8%
*-commutative91.8%
*-commutative91.8%
associate-*l*93.7%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in x around inf 49.2%
Final simplification53.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 (* 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.8%
associate-+l-94.8%
*-commutative94.8%
*-commutative94.8%
associate-*l*95.1%
associate-+l-95.1%
associate-*l*94.8%
*-commutative94.8%
*-commutative94.8%
associate-*l*94.0%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in x around inf 32.9%
Final simplification32.9%
(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 2024077
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:alt
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))