
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -5e-67) (fma a (* 27.0 b) (- (* x 2.0) (* y (* (* z 9.0) 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 <= -5e-67) {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (y * ((z * 9.0) * 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 <= -5e-67) tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(y * Float64(Float64(z * 9.0) * 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, -5e-67], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * 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 -5 \cdot 10^{-67}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -4.9999999999999999e-67Initial program 92.1%
+-commutative92.1%
associate-+r-92.1%
*-commutative92.1%
cancel-sign-sub-inv92.1%
associate-*r*98.2%
distribute-lft-neg-in98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
associate-+r-98.2%
associate-*l*98.2%
fma-def98.2%
cancel-sign-sub-inv98.2%
fma-def98.2%
distribute-lft-neg-in98.2%
distribute-rgt-neg-in98.2%
*-commutative98.2%
associate-*r*92.1%
associate-*l*92.2%
neg-mul-192.2%
associate-*r*92.2%
Simplified92.2%
*-commutative92.2%
associate-*r*95.2%
*-commutative95.2%
associate-*l*95.2%
*-commutative95.2%
associate-*l*95.2%
metadata-eval95.2%
distribute-lft-neg-in95.2%
*-commutative95.2%
distribute-rgt-neg-in95.2%
*-commutative95.2%
fma-neg95.2%
associate-*l*95.2%
associate-*r*95.2%
Applied egg-rr95.2%
if -4.9999999999999999e-67 < z Initial program 95.0%
+-commutative95.0%
associate-+r-95.0%
*-commutative95.0%
cancel-sign-sub-inv95.0%
associate-*r*92.9%
distribute-lft-neg-in92.9%
*-commutative92.9%
cancel-sign-sub-inv92.9%
associate-+r-92.9%
associate-*l*92.9%
fma-def93.9%
cancel-sign-sub-inv93.9%
fma-def93.9%
distribute-lft-neg-in93.9%
distribute-rgt-neg-in93.9%
*-commutative93.9%
associate-*r*96.1%
associate-*l*96.1%
neg-mul-196.1%
associate-*r*96.1%
Simplified96.1%
Final simplification95.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 (* z (* y 9.0))))
(if (<= t_1 1e+104)
(+ (- (* x 2.0) (* t t_1)) (* b (* a 27.0)))
(fma a (* 27.0 b) (- (* x 2.0) (* y (* (* z 9.0) 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 t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 1e+104) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = fma(a, (27.0 * b), ((x * 2.0) - (y * ((z * 9.0) * t))));
}
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(z * Float64(y * 9.0)) tmp = 0.0 if (t_1 <= 1e+104) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * t_1)) + Float64(b * Float64(a * 27.0))); else tmp = fma(a, Float64(27.0 * b), Float64(Float64(x * 2.0) - Float64(y * Float64(Float64(z * 9.0) * t)))); 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_] := Block[{t$95$1 = N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+104], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $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 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t_1 \leq 10^{+104}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t_1\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 1e104Initial program 96.1%
if 1e104 < (*.f64 (*.f64 y 9) z) Initial program 87.1%
+-commutative87.1%
associate-+r-87.1%
*-commutative87.1%
cancel-sign-sub-inv87.1%
associate-*r*94.1%
distribute-lft-neg-in94.1%
*-commutative94.1%
cancel-sign-sub-inv94.1%
associate-+r-94.1%
associate-*l*94.1%
fma-def98.0%
cancel-sign-sub-inv98.0%
fma-def98.0%
distribute-lft-neg-in98.0%
distribute-rgt-neg-in98.0%
*-commutative98.0%
associate-*r*91.0%
associate-*l*91.0%
neg-mul-191.0%
associate-*r*91.0%
Simplified91.0%
*-commutative91.0%
associate-*r*97.9%
*-commutative97.9%
associate-*l*97.9%
*-commutative97.9%
associate-*l*97.9%
metadata-eval97.9%
distribute-lft-neg-in97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
fma-neg97.9%
associate-*l*97.9%
associate-*r*97.9%
Applied egg-rr97.9%
Final simplification96.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 (* z y)))))
(if (<= y -2.5e+165)
t_1
(if (<= y -8e+121)
(* x 2.0)
(if (<= y -1.16e+108)
t_1
(if (<= y -6e+40)
(* x 2.0)
(if (<= y -1.55e-106)
(* b (* a 27.0))
(if (<= y 4.8e-141) (* 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 (y <= -2.5e+165) {
tmp = t_1;
} else if (y <= -8e+121) {
tmp = x * 2.0;
} else if (y <= -1.16e+108) {
tmp = t_1;
} else if (y <= -6e+40) {
tmp = x * 2.0;
} else if (y <= -1.55e-106) {
tmp = b * (a * 27.0);
} else if (y <= 4.8e-141) {
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 (y <= (-2.5d+165)) then
tmp = t_1
else if (y <= (-8d+121)) then
tmp = x * 2.0d0
else if (y <= (-1.16d+108)) then
tmp = t_1
else if (y <= (-6d+40)) then
tmp = x * 2.0d0
else if (y <= (-1.55d-106)) then
tmp = b * (a * 27.0d0)
else if (y <= 4.8d-141) 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 (y <= -2.5e+165) {
tmp = t_1;
} else if (y <= -8e+121) {
tmp = x * 2.0;
} else if (y <= -1.16e+108) {
tmp = t_1;
} else if (y <= -6e+40) {
tmp = x * 2.0;
} else if (y <= -1.55e-106) {
tmp = b * (a * 27.0);
} else if (y <= 4.8e-141) {
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 y <= -2.5e+165: tmp = t_1 elif y <= -8e+121: tmp = x * 2.0 elif y <= -1.16e+108: tmp = t_1 elif y <= -6e+40: tmp = x * 2.0 elif y <= -1.55e-106: tmp = b * (a * 27.0) elif y <= 4.8e-141: 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 (y <= -2.5e+165) tmp = t_1; elseif (y <= -8e+121) tmp = Float64(x * 2.0); elseif (y <= -1.16e+108) tmp = t_1; elseif (y <= -6e+40) tmp = Float64(x * 2.0); elseif (y <= -1.55e-106) tmp = Float64(b * Float64(a * 27.0)); elseif (y <= 4.8e-141) 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 (y <= -2.5e+165)
tmp = t_1;
elseif (y <= -8e+121)
tmp = x * 2.0;
elseif (y <= -1.16e+108)
tmp = t_1;
elseif (y <= -6e+40)
tmp = x * 2.0;
elseif (y <= -1.55e-106)
tmp = b * (a * 27.0);
elseif (y <= 4.8e-141)
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[y, -2.5e+165], t$95$1, If[LessEqual[y, -8e+121], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.16e+108], t$95$1, If[LessEqual[y, -6e+40], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.55e-106], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-141], 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}\;y \leq -2.5 \cdot 10^{+165}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+121}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -1.16 \cdot 10^{+108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6 \cdot 10^{+40}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-106}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-141}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.49999999999999985e165 or -8.0000000000000003e121 < y < -1.15999999999999995e108 or 4.8000000000000002e-141 < y Initial program 90.9%
sub-neg90.9%
sub-neg90.9%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in y around inf 48.7%
if -2.49999999999999985e165 < y < -8.0000000000000003e121 or -1.15999999999999995e108 < y < -6.0000000000000004e40 or -1.54999999999999993e-106 < y < 4.8000000000000002e-141Initial program 98.7%
sub-neg98.7%
sub-neg98.7%
associate-*l*97.8%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in x around inf 47.6%
if -6.0000000000000004e40 < y < -1.54999999999999993e-106Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*96.5%
associate-*l*96.4%
Simplified96.4%
+-commutative96.4%
associate-+r-96.4%
associate-*r*96.5%
*-commutative96.5%
associate-*l*96.5%
associate-*l*96.5%
associate-*r*96.5%
Applied egg-rr96.5%
Taylor expanded in x around 0 51.7%
cancel-sign-sub-inv51.7%
metadata-eval51.7%
fma-def51.7%
*-commutative51.7%
associate-*l*51.6%
Simplified51.6%
Taylor expanded in a around inf 32.1%
associate-*r*32.1%
*-commutative32.1%
Simplified32.1%
Final simplification46.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
(let* ((t_1 (* -9.0 (* y (* z t)))))
(if (<= y -2.5e+165)
t_1
(if (<= y -8e+121)
(* x 2.0)
(if (<= y -1.25e+108)
t_1
(if (<= y -1.5e+40)
(* x 2.0)
(if (<= y -1.3e-106)
(* b (* a 27.0))
(if (<= y 4.8e-141) (* 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 = -9.0 * (y * (z * t));
double tmp;
if (y <= -2.5e+165) {
tmp = t_1;
} else if (y <= -8e+121) {
tmp = x * 2.0;
} else if (y <= -1.25e+108) {
tmp = t_1;
} else if (y <= -1.5e+40) {
tmp = x * 2.0;
} else if (y <= -1.3e-106) {
tmp = b * (a * 27.0);
} else if (y <= 4.8e-141) {
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) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (y * (z * t))
if (y <= (-2.5d+165)) then
tmp = t_1
else if (y <= (-8d+121)) then
tmp = x * 2.0d0
else if (y <= (-1.25d+108)) then
tmp = t_1
else if (y <= (-1.5d+40)) then
tmp = x * 2.0d0
else if (y <= (-1.3d-106)) then
tmp = b * (a * 27.0d0)
else if (y <= 4.8d-141) 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 t_1 = -9.0 * (y * (z * t));
double tmp;
if (y <= -2.5e+165) {
tmp = t_1;
} else if (y <= -8e+121) {
tmp = x * 2.0;
} else if (y <= -1.25e+108) {
tmp = t_1;
} else if (y <= -1.5e+40) {
tmp = x * 2.0;
} else if (y <= -1.3e-106) {
tmp = b * (a * 27.0);
} else if (y <= 4.8e-141) {
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): t_1 = -9.0 * (y * (z * t)) tmp = 0 if y <= -2.5e+165: tmp = t_1 elif y <= -8e+121: tmp = x * 2.0 elif y <= -1.25e+108: tmp = t_1 elif y <= -1.5e+40: tmp = x * 2.0 elif y <= -1.3e-106: tmp = b * (a * 27.0) elif y <= 4.8e-141: 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) t_1 = Float64(-9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (y <= -2.5e+165) tmp = t_1; elseif (y <= -8e+121) tmp = Float64(x * 2.0); elseif (y <= -1.25e+108) tmp = t_1; elseif (y <= -1.5e+40) tmp = Float64(x * 2.0); elseif (y <= -1.3e-106) tmp = Float64(b * Float64(a * 27.0)); elseif (y <= 4.8e-141) 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)
t_1 = -9.0 * (y * (z * t));
tmp = 0.0;
if (y <= -2.5e+165)
tmp = t_1;
elseif (y <= -8e+121)
tmp = x * 2.0;
elseif (y <= -1.25e+108)
tmp = t_1;
elseif (y <= -1.5e+40)
tmp = x * 2.0;
elseif (y <= -1.3e-106)
tmp = b * (a * 27.0);
elseif (y <= 4.8e-141)
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_] := Block[{t$95$1 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.5e+165], t$95$1, If[LessEqual[y, -8e+121], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.25e+108], t$95$1, If[LessEqual[y, -1.5e+40], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.3e-106], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-141], 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}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{+165}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+121}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{+108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{+40}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{-106}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-141}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if y < -2.49999999999999985e165 or -8.0000000000000003e121 < y < -1.24999999999999998e108Initial program 90.7%
+-commutative90.7%
associate-+r-90.7%
*-commutative90.7%
cancel-sign-sub-inv90.7%
associate-*r*88.5%
distribute-lft-neg-in88.5%
*-commutative88.5%
cancel-sign-sub-inv88.5%
associate-+r-88.5%
associate-*l*88.4%
fma-def88.4%
cancel-sign-sub-inv88.4%
fma-def88.4%
distribute-lft-neg-in88.4%
distribute-rgt-neg-in88.4%
*-commutative88.4%
associate-*r*90.7%
associate-*l*90.7%
neg-mul-190.7%
associate-*r*90.7%
Simplified90.7%
*-commutative90.7%
associate-*r*98.7%
*-commutative98.7%
associate-*l*98.6%
*-commutative98.6%
associate-*l*98.6%
metadata-eval98.6%
distribute-lft-neg-in98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
*-commutative98.6%
fma-neg98.6%
associate-*l*98.6%
associate-*r*98.7%
Applied egg-rr98.7%
Taylor expanded in y around inf 59.8%
*-commutative59.8%
associate-*r*65.4%
*-commutative65.4%
Simplified65.4%
if -2.49999999999999985e165 < y < -8.0000000000000003e121 or -1.24999999999999998e108 < y < -1.5000000000000001e40 or -1.3e-106 < y < 4.8000000000000002e-141Initial program 98.7%
sub-neg98.7%
sub-neg98.7%
associate-*l*97.8%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in x around inf 47.6%
if -1.5000000000000001e40 < y < -1.3e-106Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*96.5%
associate-*l*96.4%
Simplified96.4%
+-commutative96.4%
associate-+r-96.4%
associate-*r*96.5%
*-commutative96.5%
associate-*l*96.5%
associate-*l*96.5%
associate-*r*96.5%
Applied egg-rr96.5%
Taylor expanded in x around 0 51.7%
cancel-sign-sub-inv51.7%
metadata-eval51.7%
fma-def51.7%
*-commutative51.7%
associate-*l*51.6%
Simplified51.6%
Taylor expanded in a around inf 32.1%
associate-*r*32.1%
*-commutative32.1%
Simplified32.1%
if 4.8000000000000002e-141 < y Initial program 91.0%
sub-neg91.0%
sub-neg91.0%
associate-*l*95.2%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in y around inf 43.4%
Final simplification47.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* y (* z t)))))
(if (<= y -2.5e+165)
t_1
(if (<= y -8e+121)
(* x 2.0)
(if (<= y -2.05e+108)
t_1
(if (<= y -1.4e+40)
(* x 2.0)
(if (<= y -3.4e-106)
(* b (* a 27.0))
(if (<= y 4.8e-141) (* 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 t_1 = -9.0 * (y * (z * t));
double tmp;
if (y <= -2.5e+165) {
tmp = t_1;
} else if (y <= -8e+121) {
tmp = x * 2.0;
} else if (y <= -2.05e+108) {
tmp = t_1;
} else if (y <= -1.4e+40) {
tmp = x * 2.0;
} else if (y <= -3.4e-106) {
tmp = b * (a * 27.0);
} else if (y <= 4.8e-141) {
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) :: t_1
real(8) :: tmp
t_1 = (-9.0d0) * (y * (z * t))
if (y <= (-2.5d+165)) then
tmp = t_1
else if (y <= (-8d+121)) then
tmp = x * 2.0d0
else if (y <= (-2.05d+108)) then
tmp = t_1
else if (y <= (-1.4d+40)) then
tmp = x * 2.0d0
else if (y <= (-3.4d-106)) then
tmp = b * (a * 27.0d0)
else if (y <= 4.8d-141) 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 t_1 = -9.0 * (y * (z * t));
double tmp;
if (y <= -2.5e+165) {
tmp = t_1;
} else if (y <= -8e+121) {
tmp = x * 2.0;
} else if (y <= -2.05e+108) {
tmp = t_1;
} else if (y <= -1.4e+40) {
tmp = x * 2.0;
} else if (y <= -3.4e-106) {
tmp = b * (a * 27.0);
} else if (y <= 4.8e-141) {
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): t_1 = -9.0 * (y * (z * t)) tmp = 0 if y <= -2.5e+165: tmp = t_1 elif y <= -8e+121: tmp = x * 2.0 elif y <= -2.05e+108: tmp = t_1 elif y <= -1.4e+40: tmp = x * 2.0 elif y <= -3.4e-106: tmp = b * (a * 27.0) elif y <= 4.8e-141: 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) t_1 = Float64(-9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (y <= -2.5e+165) tmp = t_1; elseif (y <= -8e+121) tmp = Float64(x * 2.0); elseif (y <= -2.05e+108) tmp = t_1; elseif (y <= -1.4e+40) tmp = Float64(x * 2.0); elseif (y <= -3.4e-106) tmp = Float64(b * Float64(a * 27.0)); elseif (y <= 4.8e-141) 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)
t_1 = -9.0 * (y * (z * t));
tmp = 0.0;
if (y <= -2.5e+165)
tmp = t_1;
elseif (y <= -8e+121)
tmp = x * 2.0;
elseif (y <= -2.05e+108)
tmp = t_1;
elseif (y <= -1.4e+40)
tmp = x * 2.0;
elseif (y <= -3.4e-106)
tmp = b * (a * 27.0);
elseif (y <= 4.8e-141)
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_] := Block[{t$95$1 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.5e+165], t$95$1, If[LessEqual[y, -8e+121], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -2.05e+108], t$95$1, If[LessEqual[y, -1.4e+40], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -3.4e-106], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-141], 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}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;y \leq -2.5 \cdot 10^{+165}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+121}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{+108}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{+40}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{-106}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-141}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if y < -2.49999999999999985e165 or -8.0000000000000003e121 < y < -2.05e108Initial program 90.7%
+-commutative90.7%
associate-+r-90.7%
*-commutative90.7%
cancel-sign-sub-inv90.7%
associate-*r*88.5%
distribute-lft-neg-in88.5%
*-commutative88.5%
cancel-sign-sub-inv88.5%
associate-+r-88.5%
associate-*l*88.4%
fma-def88.4%
cancel-sign-sub-inv88.4%
fma-def88.4%
distribute-lft-neg-in88.4%
distribute-rgt-neg-in88.4%
*-commutative88.4%
associate-*r*90.7%
associate-*l*90.7%
neg-mul-190.7%
associate-*r*90.7%
Simplified90.7%
*-commutative90.7%
associate-*r*98.7%
*-commutative98.7%
associate-*l*98.6%
*-commutative98.6%
associate-*l*98.6%
metadata-eval98.6%
distribute-lft-neg-in98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
*-commutative98.6%
fma-neg98.6%
associate-*l*98.6%
associate-*r*98.7%
Applied egg-rr98.7%
Taylor expanded in y around inf 59.8%
*-commutative59.8%
associate-*r*65.4%
*-commutative65.4%
Simplified65.4%
if -2.49999999999999985e165 < y < -8.0000000000000003e121 or -2.05e108 < y < -1.4000000000000001e40 or -3.39999999999999982e-106 < y < 4.8000000000000002e-141Initial program 98.7%
sub-neg98.7%
sub-neg98.7%
associate-*l*97.8%
associate-*l*97.8%
Simplified97.8%
Taylor expanded in x around inf 47.6%
if -1.4000000000000001e40 < y < -3.39999999999999982e-106Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*96.5%
associate-*l*96.4%
Simplified96.4%
+-commutative96.4%
associate-+r-96.4%
associate-*r*96.5%
*-commutative96.5%
associate-*l*96.5%
associate-*l*96.5%
associate-*r*96.5%
Applied egg-rr96.5%
Taylor expanded in x around 0 51.7%
cancel-sign-sub-inv51.7%
metadata-eval51.7%
fma-def51.7%
*-commutative51.7%
associate-*l*51.6%
Simplified51.6%
Taylor expanded in a around inf 32.1%
associate-*r*32.1%
*-commutative32.1%
Simplified32.1%
if 4.8000000000000002e-141 < y Initial program 91.0%
sub-neg91.0%
sub-neg91.0%
associate-*l*95.2%
associate-*l*95.2%
Simplified95.2%
+-commutative95.2%
associate-+r-95.2%
associate-*r*95.2%
*-commutative95.2%
associate-*l*95.2%
associate-*l*95.2%
associate-*r*95.2%
Applied egg-rr95.2%
Taylor expanded in y around inf 43.4%
associate-*r*45.5%
Simplified45.5%
Final simplification47.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))) (t_2 (+ t_1 (* x 2.0))))
(if (<= a -4.6e+160)
t_2
(if (<= a -240000000.0)
(- t_1 (* 9.0 (* t (* z y))))
(if (<= a 4.8e-144) (+ (* x 2.0) (* -9.0 (* z (* y t)))) t_2)))))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 = t_1 + (x * 2.0);
double tmp;
if (a <= -4.6e+160) {
tmp = t_2;
} else if (a <= -240000000.0) {
tmp = t_1 - (9.0 * (t * (z * y)));
} else if (a <= 4.8e-144) {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
} else {
tmp = t_2;
}
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 = t_1 + (x * 2.0d0)
if (a <= (-4.6d+160)) then
tmp = t_2
else if (a <= (-240000000.0d0)) then
tmp = t_1 - (9.0d0 * (t * (z * y)))
else if (a <= 4.8d-144) then
tmp = (x * 2.0d0) + ((-9.0d0) * (z * (y * t)))
else
tmp = t_2
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 = t_1 + (x * 2.0);
double tmp;
if (a <= -4.6e+160) {
tmp = t_2;
} else if (a <= -240000000.0) {
tmp = t_1 - (9.0 * (t * (z * y)));
} else if (a <= 4.8e-144) {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
} else {
tmp = t_2;
}
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 = t_1 + (x * 2.0) tmp = 0 if a <= -4.6e+160: tmp = t_2 elif a <= -240000000.0: tmp = t_1 - (9.0 * (t * (z * y))) elif a <= 4.8e-144: tmp = (x * 2.0) + (-9.0 * (z * (y * t))) else: tmp = t_2 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(t_1 + Float64(x * 2.0)) tmp = 0.0 if (a <= -4.6e+160) tmp = t_2; elseif (a <= -240000000.0) tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(z * y)))); elseif (a <= 4.8e-144) tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(z * Float64(y * t)))); else tmp = t_2; 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 = t_1 + (x * 2.0);
tmp = 0.0;
if (a <= -4.6e+160)
tmp = t_2;
elseif (a <= -240000000.0)
tmp = t_1 - (9.0 * (t * (z * y)));
elseif (a <= 4.8e-144)
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
else
tmp = t_2;
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[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.6e+160], t$95$2, If[LessEqual[a, -240000000.0], N[(t$95$1 - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.8e-144], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\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 := t_1 + x \cdot 2\\
\mathbf{if}\;a \leq -4.6 \cdot 10^{+160}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -240000000:\\
\;\;\;\;t_1 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{-144}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -4.59999999999999975e160 or 4.79999999999999988e-144 < a Initial program 92.7%
sub-neg92.7%
sub-neg92.7%
associate-*l*96.6%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in y around 0 74.6%
if -4.59999999999999975e160 < a < -2.4e8Initial program 90.5%
sub-neg90.5%
sub-neg90.5%
associate-*l*93.3%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in x around 0 75.4%
if -2.4e8 < a < 4.79999999999999988e-144Initial program 97.3%
sub-neg97.3%
sub-neg97.3%
associate-*l*98.3%
associate-*l*98.4%
Simplified98.4%
+-commutative98.4%
associate-+r-98.4%
associate-*r*98.3%
*-commutative98.3%
associate-*l*98.4%
associate-*l*98.4%
associate-*r*98.4%
Applied egg-rr98.4%
Taylor expanded in a around 0 87.3%
cancel-sign-sub-inv87.3%
metadata-eval87.3%
associate-*r*86.3%
Simplified86.3%
Final simplification79.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 (* z (* y 9.0))))
(if (<= t_1 2e+190)
(+ (- (* x 2.0) (* t t_1)) (* b (* a 27.0)))
(+ (+ (* y (* z (* t -9.0))) (* 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 t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 2e+190) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = ((y * (z * (t * -9.0))) + (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) :: t_1
real(8) :: tmp
t_1 = z * (y * 9.0d0)
if (t_1 <= 2d+190) then
tmp = ((x * 2.0d0) - (t * t_1)) + (b * (a * 27.0d0))
else
tmp = ((y * (z * (t * (-9.0d0)))) + (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 t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 2e+190) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = ((y * (z * (t * -9.0))) + (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): t_1 = z * (y * 9.0) tmp = 0 if t_1 <= 2e+190: tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0)) else: tmp = ((y * (z * (t * -9.0))) + (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) t_1 = Float64(z * Float64(y * 9.0)) tmp = 0.0 if (t_1 <= 2e+190) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * t_1)) + Float64(b * Float64(a * 27.0))); else tmp = Float64(Float64(Float64(y * Float64(z * Float64(t * -9.0))) + 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)
t_1 = z * (y * 9.0);
tmp = 0.0;
if (t_1 <= 2e+190)
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
else
tmp = ((y * (z * (t * -9.0))) + (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_] := Block[{t$95$1 = N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+190], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $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}
t_1 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t_1 \leq 2 \cdot 10^{+190}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t_1\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 2.0000000000000001e190Initial program 96.0%
if 2.0000000000000001e190 < (*.f64 (*.f64 y 9) z) Initial program 82.3%
sub-neg82.3%
sub-neg82.3%
associate-*l*96.7%
associate-*l*96.8%
Simplified96.8%
sub-neg96.8%
*-commutative96.8%
distribute-rgt-neg-in96.8%
*-commutative96.8%
distribute-lft-neg-in96.8%
metadata-eval96.8%
associate-*l*96.7%
associate-*r*96.7%
*-commutative96.7%
Applied egg-rr96.7%
Final simplification96.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 (* z (* y 9.0))))
(if (<= t_1 1e+190)
(+ (- (* x 2.0) (* t t_1)) (* b (* a 27.0)))
(- (+ (* 27.0 (* a b)) (* x 2.0)) (* y (* (* z 9.0) 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 t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 1e+190) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * ((z * 9.0) * 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) :: t_1
real(8) :: tmp
t_1 = z * (y * 9.0d0)
if (t_1 <= 1d+190) then
tmp = ((x * 2.0d0) - (t * t_1)) + (b * (a * 27.0d0))
else
tmp = ((27.0d0 * (a * b)) + (x * 2.0d0)) - (y * ((z * 9.0d0) * 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 t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 1e+190) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
} else {
tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * ((z * 9.0) * t));
}
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 = z * (y * 9.0) tmp = 0 if t_1 <= 1e+190: tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0)) else: tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * ((z * 9.0) * t)) 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(z * Float64(y * 9.0)) tmp = 0.0 if (t_1 <= 1e+190) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * t_1)) + Float64(b * Float64(a * 27.0))); else tmp = Float64(Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)) - Float64(y * Float64(Float64(z * 9.0) * 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)
t_1 = z * (y * 9.0);
tmp = 0.0;
if (t_1 <= 1e+190)
tmp = ((x * 2.0) - (t * t_1)) + (b * (a * 27.0));
else
tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * ((z * 9.0) * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+190], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $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 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t_1 \leq 10^{+190}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t_1\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 1.0000000000000001e190Initial program 96.0%
if 1.0000000000000001e190 < (*.f64 (*.f64 y 9) z) Initial program 82.3%
sub-neg82.3%
sub-neg82.3%
associate-*l*96.7%
associate-*l*96.8%
Simplified96.8%
+-commutative96.8%
associate-+r-96.8%
associate-*r*96.7%
*-commutative96.7%
associate-*l*96.8%
associate-*l*96.8%
associate-*r*96.8%
Applied egg-rr96.8%
Final simplification96.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 (if (or (<= a -210000000.0) (not (<= a 4.8e-144))) (+ (* 27.0 (* a b)) (* x 2.0)) (+ (* 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 ((a <= -210000000.0) || !(a <= 4.8e-144)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= (-210000000.0d0)) .or. (.not. (a <= 4.8d-144))) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) + ((-9.0d0) * (z * (y * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -210000000.0) || !(a <= 4.8e-144)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) + (-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 (a <= -210000000.0) or not (a <= 4.8e-144): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) + (-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 ((a <= -210000000.0) || !(a <= 4.8e-144)) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(z * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -210000000.0) || ~((a <= 4.8e-144)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -210000000.0], N[Not[LessEqual[a, 4.8e-144]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $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}\;a \leq -210000000 \lor \neg \left(a \leq 4.8 \cdot 10^{-144}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if a < -2.1e8 or 4.79999999999999988e-144 < a Initial program 92.3%
sub-neg92.3%
sub-neg92.3%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in y around 0 72.1%
if -2.1e8 < a < 4.79999999999999988e-144Initial program 97.3%
sub-neg97.3%
sub-neg97.3%
associate-*l*98.3%
associate-*l*98.4%
Simplified98.4%
+-commutative98.4%
associate-+r-98.4%
associate-*r*98.3%
*-commutative98.3%
associate-*l*98.4%
associate-*l*98.4%
associate-*r*98.4%
Applied egg-rr98.4%
Taylor expanded in a around 0 87.3%
cancel-sign-sub-inv87.3%
metadata-eval87.3%
associate-*r*86.3%
Simplified86.3%
Final simplification77.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 (or (<= a -7e+160) (not (<= a 4.8e-144))) (+ (* 27.0 (* a b)) (* x 2.0)) (- (* x 2.0) (* 9.0 (* t (* z y))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7e+160) || !(a <= 4.8e-144)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-7d+160)) .or. (.not. (a <= 4.8d-144))) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7e+160) || !(a <= 4.8e-144)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -7e+160) or not (a <= 4.8e-144): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -7e+160) || !(a <= 4.8e-144)) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -7e+160) || ~((a <= 4.8e-144)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -7e+160], N[Not[LessEqual[a, 4.8e-144]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+160} \lor \neg \left(a \leq 4.8 \cdot 10^{-144}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if a < -7.00000000000000051e160 or 4.79999999999999988e-144 < a Initial program 92.7%
sub-neg92.7%
sub-neg92.7%
associate-*l*96.6%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in y around 0 74.6%
if -7.00000000000000051e160 < a < 4.79999999999999988e-144Initial program 95.7%
sub-neg95.7%
sub-neg95.7%
associate-*l*97.2%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in a around 0 78.0%
Final simplification76.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.95e+27) (* -9.0 (* z (* y t))) (if (<= z 3.5e+21) (+ (* 27.0 (* a b)) (* x 2.0)) (* (* 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.95e+27) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 3.5e+21) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} 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.95d+27)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 3.5d+21) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
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.95e+27) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 3.5e+21) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} 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.95e+27: tmp = -9.0 * (z * (y * t)) elif z <= 3.5e+21: tmp = (27.0 * (a * b)) + (x * 2.0) 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.95e+27) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 3.5e+21) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(t * -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.95e+27)
tmp = -9.0 * (z * (y * t));
elseif (z <= 3.5e+21)
tmp = (27.0 * (a * b)) + (x * 2.0);
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.95e+27], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+21], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(t * -9.0), $MachinePrecision] * N[(z * y), $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.95 \cdot 10^{+27}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+21}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot -9\right) \cdot \left(z \cdot y\right)\\
\end{array}
\end{array}
if z < -1.9499999999999999e27Initial program 88.7%
sub-neg88.7%
sub-neg88.7%
associate-*l*93.0%
associate-*l*93.1%
Simplified93.1%
+-commutative93.1%
associate-+r-93.1%
associate-*r*93.0%
*-commutative93.0%
associate-*l*93.1%
associate-*l*93.2%
associate-*r*93.3%
Applied egg-rr93.3%
Taylor expanded in y around inf 46.9%
associate-*r*53.7%
Simplified53.7%
if -1.9499999999999999e27 < z < 3.5e21Initial program 99.4%
sub-neg99.4%
sub-neg99.4%
associate-*l*99.5%
associate-*l*99.4%
Simplified99.4%
Taylor expanded in y around 0 76.8%
if 3.5e21 < z Initial program 86.9%
sub-neg86.9%
sub-neg86.9%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 50.4%
associate-*r*50.4%
*-commutative50.4%
Simplified50.4%
Final simplification66.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 (+ (+ (* y (* z (* t -9.0))) (* 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) {
return ((y * (z * (t * -9.0))) + (x * 2.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 = ((y * (z * (t * (-9.0d0)))) + (x * 2.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 ((y * (z * (t * -9.0))) + (x * 2.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 ((y * (z * (t * -9.0))) + (x * 2.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(y * Float64(z * Float64(t * -9.0))) + Float64(x * 2.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 = ((y * (z * (t * -9.0))) + (x * 2.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[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $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])\\
\\
\left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
sub-neg96.9%
*-commutative96.9%
distribute-rgt-neg-in96.9%
*-commutative96.9%
distribute-lft-neg-in96.9%
metadata-eval96.9%
associate-*l*96.9%
associate-*r*96.5%
*-commutative96.5%
Applied egg-rr96.5%
Final simplification96.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 (if (or (<= a -1.56e+34) (not (<= a 2.75e-120))) (* 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.56e+34) || !(a <= 2.75e-120)) {
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.56d+34)) .or. (.not. (a <= 2.75d-120))) 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.56e+34) || !(a <= 2.75e-120)) {
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.56e+34) or not (a <= 2.75e-120): 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.56e+34) || !(a <= 2.75e-120)) 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.56e+34) || ~((a <= 2.75e-120)))
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.56e+34], N[Not[LessEqual[a, 2.75e-120]], $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.56 \cdot 10^{+34} \lor \neg \left(a \leq 2.75 \cdot 10^{-120}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -1.5600000000000001e34 or 2.7500000000000001e-120 < a Initial program 92.2%
sub-neg92.2%
sub-neg92.2%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in a around inf 48.1%
if -1.5600000000000001e34 < a < 2.7500000000000001e-120Initial program 96.8%
sub-neg96.8%
sub-neg96.8%
associate-*l*98.5%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in x around inf 44.3%
Final simplification46.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 (<= a -7.5e+33) (* 27.0 (* a b)) (if (<= a 8e-85) (* 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 (a <= -7.5e+33) {
tmp = 27.0 * (a * b);
} else if (a <= 8e-85) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-7.5d+33)) then
tmp = 27.0d0 * (a * b)
else if (a <= 8d-85) then
tmp = x * 2.0d0
else
tmp = a * (27.0d0 * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -7.5e+33) {
tmp = 27.0 * (a * b);
} else if (a <= 8e-85) {
tmp = x * 2.0;
} else {
tmp = a * (27.0 * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if a <= -7.5e+33: tmp = 27.0 * (a * b) elif a <= 8e-85: tmp = x * 2.0 else: tmp = a * (27.0 * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -7.5e+33) tmp = Float64(27.0 * Float64(a * b)); elseif (a <= 8e-85) tmp = Float64(x * 2.0); else tmp = Float64(a * Float64(27.0 * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (a <= -7.5e+33)
tmp = 27.0 * (a * b);
elseif (a <= 8e-85)
tmp = x * 2.0;
else
tmp = a * (27.0 * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -7.5e+33], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8e-85], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{+33}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 8 \cdot 10^{-85}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if a < -7.50000000000000046e33Initial program 93.8%
sub-neg93.8%
sub-neg93.8%
associate-*l*93.6%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in a around inf 57.9%
if -7.50000000000000046e33 < a < 7.9999999999999998e-85Initial program 97.0%
sub-neg97.0%
sub-neg97.0%
associate-*l*98.6%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in x around inf 46.3%
if 7.9999999999999998e-85 < a Initial program 90.6%
sub-neg90.6%
sub-neg90.6%
associate-*l*96.3%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in a around inf 44.4%
associate-*r*44.5%
*-commutative44.5%
associate-*r*44.5%
Simplified44.5%
Final simplification47.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 (* 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.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*96.9%
associate-*l*96.9%
Simplified96.9%
Taylor expanded in x around inf 34.4%
Final simplification34.4%
(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 2024019
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(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)))