
(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 16 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 5.5e-73) (- (+ (* 27.0 (* a 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 <= 5.5e-73) {
tmp = ((27.0 * (a * 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 <= 5.5e-73) tmp = Float64(Float64(Float64(27.0 * Float64(a * b)) + 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, 5.5e-73], 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], 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.5 \cdot 10^{-73}:\\
\;\;\;\;\left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\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 < 5.50000000000000006e-73Initial program 96.0%
associate-+l-96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.0%
associate-+l-96.0%
associate-*l*96.0%
*-commutative96.0%
*-commutative96.0%
associate-*l*96.7%
associate-*l*96.7%
Simplified96.7%
+-commutative96.7%
associate-+r-96.7%
associate-*r*96.7%
*-commutative96.7%
associate-*l*96.7%
associate-*l*96.7%
associate-*r*96.1%
Applied egg-rr96.1%
if 5.50000000000000006e-73 < z Initial program 88.1%
+-commutative88.1%
associate-+r-88.1%
*-commutative88.1%
cancel-sign-sub-inv88.1%
associate-*r*97.4%
distribute-lft-neg-in97.4%
*-commutative97.4%
cancel-sign-sub-inv97.4%
associate-+r-97.4%
associate-*l*97.4%
fma-define98.6%
cancel-sign-sub-inv98.6%
fma-define98.6%
distribute-lft-neg-in98.6%
distribute-rgt-neg-in98.6%
*-commutative98.6%
associate-*r*89.4%
associate-*l*89.3%
neg-mul-189.3%
associate-*r*89.3%
Simplified89.3%
Final simplification94.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* 27.0 b))) (t_2 (* -9.0 (* t (* z y)))))
(if (<= b -5.6e-36)
t_1
(if (<= b -3.8e-135)
(* x 2.0)
(if (<= b -1.6e-145)
t_1
(if (<= b -7.8e-178)
t_2
(if (<= b 2.25e-213)
(* x 2.0)
(if (<= b 3.8e-154)
t_2
(if (<= b 1.5e+24) (* x 2.0) (* b (* 27.0 a)))))))))))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 t_2 = -9.0 * (t * (z * y));
double tmp;
if (b <= -5.6e-36) {
tmp = t_1;
} else if (b <= -3.8e-135) {
tmp = x * 2.0;
} else if (b <= -1.6e-145) {
tmp = t_1;
} else if (b <= -7.8e-178) {
tmp = t_2;
} else if (b <= 2.25e-213) {
tmp = x * 2.0;
} else if (b <= 3.8e-154) {
tmp = t_2;
} else if (b <= 1.5e+24) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
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 = a * (27.0d0 * b)
t_2 = (-9.0d0) * (t * (z * y))
if (b <= (-5.6d-36)) then
tmp = t_1
else if (b <= (-3.8d-135)) then
tmp = x * 2.0d0
else if (b <= (-1.6d-145)) then
tmp = t_1
else if (b <= (-7.8d-178)) then
tmp = t_2
else if (b <= 2.25d-213) then
tmp = x * 2.0d0
else if (b <= 3.8d-154) then
tmp = t_2
else if (b <= 1.5d+24) then
tmp = x * 2.0d0
else
tmp = b * (27.0d0 * a)
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 t_2 = -9.0 * (t * (z * y));
double tmp;
if (b <= -5.6e-36) {
tmp = t_1;
} else if (b <= -3.8e-135) {
tmp = x * 2.0;
} else if (b <= -1.6e-145) {
tmp = t_1;
} else if (b <= -7.8e-178) {
tmp = t_2;
} else if (b <= 2.25e-213) {
tmp = x * 2.0;
} else if (b <= 3.8e-154) {
tmp = t_2;
} else if (b <= 1.5e+24) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
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) t_2 = -9.0 * (t * (z * y)) tmp = 0 if b <= -5.6e-36: tmp = t_1 elif b <= -3.8e-135: tmp = x * 2.0 elif b <= -1.6e-145: tmp = t_1 elif b <= -7.8e-178: tmp = t_2 elif b <= 2.25e-213: tmp = x * 2.0 elif b <= 3.8e-154: tmp = t_2 elif b <= 1.5e+24: tmp = x * 2.0 else: tmp = b * (27.0 * a) 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)) t_2 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (b <= -5.6e-36) tmp = t_1; elseif (b <= -3.8e-135) tmp = Float64(x * 2.0); elseif (b <= -1.6e-145) tmp = t_1; elseif (b <= -7.8e-178) tmp = t_2; elseif (b <= 2.25e-213) tmp = Float64(x * 2.0); elseif (b <= 3.8e-154) tmp = t_2; elseif (b <= 1.5e+24) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(27.0 * a)); 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);
t_2 = -9.0 * (t * (z * y));
tmp = 0.0;
if (b <= -5.6e-36)
tmp = t_1;
elseif (b <= -3.8e-135)
tmp = x * 2.0;
elseif (b <= -1.6e-145)
tmp = t_1;
elseif (b <= -7.8e-178)
tmp = t_2;
elseif (b <= 2.25e-213)
tmp = x * 2.0;
elseif (b <= 3.8e-154)
tmp = t_2;
elseif (b <= 1.5e+24)
tmp = x * 2.0;
else
tmp = b * (27.0 * a);
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]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.6e-36], t$95$1, If[LessEqual[b, -3.8e-135], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, -1.6e-145], t$95$1, If[LessEqual[b, -7.8e-178], t$95$2, If[LessEqual[b, 2.25e-213], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 3.8e-154], t$95$2, If[LessEqual[b, 1.5e+24], N[(x * 2.0), $MachinePrecision], N[(b * N[(27.0 * a), $MachinePrecision]), $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)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;b \leq -5.6 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3.8 \cdot 10^{-135}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq -1.6 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -7.8 \cdot 10^{-178}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{-213}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{-154}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+24}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if b < -5.6000000000000002e-36 or -3.8000000000000003e-135 < b < -1.60000000000000004e-145Initial program 93.5%
associate-+l-93.5%
*-commutative93.5%
*-commutative93.5%
associate-*l*93.4%
associate-+l-93.4%
associate-*l*93.5%
*-commutative93.5%
*-commutative93.5%
associate-*l*98.5%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in a around inf 57.2%
associate-*r*57.2%
*-commutative57.2%
associate-*r*57.2%
Simplified57.2%
if -5.6000000000000002e-36 < b < -3.8000000000000003e-135 or -7.8000000000000005e-178 < b < 2.2500000000000001e-213 or 3.8000000000000001e-154 < b < 1.49999999999999997e24Initial program 94.5%
associate-+l-94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*94.5%
associate-+l-94.5%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*95.6%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in x around inf 50.4%
if -1.60000000000000004e-145 < b < -7.8000000000000005e-178 or 2.2500000000000001e-213 < b < 3.8000000000000001e-154Initial program 85.9%
associate-+l-85.9%
*-commutative85.9%
*-commutative85.9%
associate-*l*86.1%
associate-+l-86.1%
associate-*l*85.9%
*-commutative85.9%
*-commutative85.9%
associate-*l*94.9%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in y around inf 46.6%
if 1.49999999999999997e24 < b Initial program 94.5%
associate-+l-94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*94.5%
associate-+l-94.5%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*92.5%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in a around inf 69.3%
associate-*r*69.3%
Simplified69.3%
Final simplification56.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 (<= t -3.2e-98)
(+ (* x 2.0) (* z (* y (* t -9.0))))
(if (or (<= t 3.9e+46) (and (not (<= t 1.65e+98)) (<= t 4.7e+104)))
(+ (* 27.0 (* a b)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.2e-98) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if ((t <= 3.9e+46) || (!(t <= 1.65e+98) && (t <= 4.7e+104))) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-3.2d-98)) then
tmp = (x * 2.0d0) + (z * (y * (t * (-9.0d0))))
else if ((t <= 3.9d+46) .or. (.not. (t <= 1.65d+98)) .and. (t <= 4.7d+104)) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.2e-98) {
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
} else if ((t <= 3.9e+46) || (!(t <= 1.65e+98) && (t <= 4.7e+104))) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if t <= -3.2e-98: tmp = (x * 2.0) + (z * (y * (t * -9.0))) elif (t <= 3.9e+46) or (not (t <= 1.65e+98) and (t <= 4.7e+104)): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.2e-98) tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(y * Float64(t * -9.0)))); elseif ((t <= 3.9e+46) || (!(t <= 1.65e+98) && (t <= 4.7e+104))) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (t <= -3.2e-98)
tmp = (x * 2.0) + (z * (y * (t * -9.0)));
elseif ((t <= 3.9e+46) || (~((t <= 1.65e+98)) && (t <= 4.7e+104)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.2e-98], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3.9e+46], And[N[Not[LessEqual[t, 1.65e+98]], $MachinePrecision], LessEqual[t, 4.7e+104]]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-98}:\\
\;\;\;\;x \cdot 2 + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;t \leq 3.9 \cdot 10^{+46} \lor \neg \left(t \leq 1.65 \cdot 10^{+98}\right) \land t \leq 4.7 \cdot 10^{+104}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if t < -3.2000000000000001e-98Initial program 97.8%
associate-+l-97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*97.7%
associate-+l-97.7%
associate-*l*97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in a around 0 59.0%
cancel-sign-sub-inv59.0%
*-commutative59.0%
metadata-eval59.0%
+-commutative59.0%
associate-*r*59.0%
associate-*r*57.8%
*-commutative57.8%
Applied egg-rr57.8%
if -3.2000000000000001e-98 < t < 3.89999999999999995e46 or 1.65000000000000014e98 < t < 4.70000000000000017e104Initial program 89.8%
associate-+l-89.8%
*-commutative89.8%
*-commutative89.8%
associate-*l*89.8%
associate-+l-89.8%
associate-*l*89.8%
*-commutative89.8%
*-commutative89.8%
associate-*l*99.0%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in y around 0 77.7%
if 3.89999999999999995e46 < t < 1.65000000000000014e98 or 4.70000000000000017e104 < t Initial program 95.7%
associate-+l-95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*95.7%
associate-+l-95.7%
associate-*l*95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*86.1%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in a around 0 82.9%
Final simplification72.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 -3.2e-98)
(* y (- (* 2.0 (/ x y)) (* 9.0 (* z t))))
(if (or (<= t 1.95e+48) (and (not (<= t 3.1e+98)) (<= t 4.8e+104)))
(+ (* 27.0 (* a b)) (* x 2.0))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.2e-98) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if ((t <= 1.95e+48) || (!(t <= 3.1e+98) && (t <= 4.8e+104))) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-3.2d-98)) then
tmp = y * ((2.0d0 * (x / y)) - (9.0d0 * (z * t)))
else if ((t <= 1.95d+48) .or. (.not. (t <= 3.1d+98)) .and. (t <= 4.8d+104)) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.2e-98) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if ((t <= 1.95e+48) || (!(t <= 3.1e+98) && (t <= 4.8e+104))) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if t <= -3.2e-98: tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t))) elif (t <= 1.95e+48) or (not (t <= 3.1e+98) and (t <= 4.8e+104)): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.2e-98) tmp = Float64(y * Float64(Float64(2.0 * Float64(x / y)) - Float64(9.0 * Float64(z * t)))); elseif ((t <= 1.95e+48) || (!(t <= 3.1e+98) && (t <= 4.8e+104))) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (t <= -3.2e-98)
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
elseif ((t <= 1.95e+48) || (~((t <= 3.1e+98)) && (t <= 4.8e+104)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.2e-98], N[(y * N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1.95e+48], And[N[Not[LessEqual[t, 3.1e+98]], $MachinePrecision], LessEqual[t, 4.8e+104]]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-98}:\\
\;\;\;\;y \cdot \left(2 \cdot \frac{x}{y} - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+48} \lor \neg \left(t \leq 3.1 \cdot 10^{+98}\right) \land t \leq 4.8 \cdot 10^{+104}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if t < -3.2000000000000001e-98Initial program 97.8%
associate-+l-97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*97.7%
associate-+l-97.7%
associate-*l*97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in a around 0 59.0%
Taylor expanded in y around inf 49.0%
if -3.2000000000000001e-98 < t < 1.95e48 or 3.10000000000000019e98 < t < 4.8e104Initial program 89.8%
associate-+l-89.8%
*-commutative89.8%
*-commutative89.8%
associate-*l*89.8%
associate-+l-89.8%
associate-*l*89.8%
*-commutative89.8%
*-commutative89.8%
associate-*l*99.0%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in y around 0 77.7%
if 1.95e48 < t < 3.10000000000000019e98 or 4.8e104 < t Initial program 95.7%
associate-+l-95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*95.7%
associate-+l-95.7%
associate-*l*95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*86.1%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in a around 0 82.9%
Final simplification69.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 (* z (* y 9.0))))
(if (<= t_1 2e+113)
(+ (- (* x 2.0) (* t t_1)) (* b (* 27.0 a)))
(+ (- (* x 2.0) (* 9.0 (* z (* y t)))) (* a (* 27.0 b))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y * 9.0);
double tmp;
if (t_1 <= 2e+113) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (27.0 * a));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (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+113) then
tmp = ((x * 2.0d0) - (t * t_1)) + (b * (27.0d0 * a))
else
tmp = ((x * 2.0d0) - (9.0d0 * (z * (y * t)))) + (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+113) {
tmp = ((x * 2.0) - (t * t_1)) + (b * (27.0 * a));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (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+113: tmp = ((x * 2.0) - (t * t_1)) + (b * (27.0 * a)) else: tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (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+113) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * t_1)) + Float64(b * Float64(27.0 * a))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + 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+113)
tmp = ((x * 2.0) - (t * t_1)) + (b * (27.0 * a));
else
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (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+113], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := z \cdot \left(y \cdot 9\right)\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+113}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot t\_1\right) + b \cdot \left(27 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y 9) z) < 2e113Initial program 94.2%
if 2e113 < (*.f64 (*.f64 y 9) z) Initial program 90.9%
associate-+l-90.9%
*-commutative90.9%
*-commutative90.9%
associate-*l*90.9%
associate-+l-90.9%
associate-*l*90.9%
*-commutative90.9%
*-commutative90.9%
associate-*l*98.1%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 90.9%
associate-*r*99.8%
Simplified99.8%
Final simplification95.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
(let* ((t_1 (* a (* 27.0 b))))
(if (<= (* y 9.0) -5e-69)
(+ t_1 (- (* x 2.0) (* (* y 9.0) (* z t))))
(+ (- (* x 2.0) (* 9.0 (* z (* y t)))) 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) <= -5e-69) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + 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) <= (-5d-69)) then
tmp = t_1 + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = ((x * 2.0d0) - (9.0d0 * (z * (y * t)))) + 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) <= -5e-69) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + 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) <= -5e-69: tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + 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) <= -5e-69) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + 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) <= -5e-69)
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + 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], -5e-69], 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[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $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 -5 \cdot 10^{-69}:\\
\;\;\;\;t\_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + t\_1\\
\end{array}
\end{array}
if (*.f64 y 9) < -5.00000000000000033e-69Initial program 93.3%
associate-+l-93.3%
*-commutative93.3%
*-commutative93.3%
associate-*l*93.3%
associate-+l-93.3%
associate-*l*93.3%
*-commutative93.3%
*-commutative93.3%
associate-*l*97.6%
associate-*l*97.6%
Simplified97.6%
if -5.00000000000000033e-69 < (*.f64 y 9) Initial program 93.7%
associate-+l-93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*93.6%
associate-+l-93.6%
associate-*l*93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*94.8%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in y around 0 93.7%
associate-*r*97.6%
Simplified97.6%
Final simplification97.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -4e-97) (- (+ (* 27.0 (* a b)) (* x 2.0)) (* y (* (* z 9.0) t))) (+ (- (* x 2.0) (* 9.0 (* z (* y t)))) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -4e-97) {
tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * ((z * 9.0) * t));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (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 * 9.0d0) <= (-4d-97)) then
tmp = ((27.0d0 * (a * b)) + (x * 2.0d0)) - (y * ((z * 9.0d0) * t))
else
tmp = ((x * 2.0d0) - (9.0d0 * (z * (y * t)))) + (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 * 9.0) <= -4e-97) {
tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * ((z * 9.0) * t));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (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 * 9.0) <= -4e-97: tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * ((z * 9.0) * t)) else: tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (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) <= -4e-97) tmp = Float64(Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)) - Float64(y * Float64(Float64(z * 9.0) * t))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + 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 * 9.0) <= -4e-97)
tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * ((z * 9.0) * t));
else
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (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[N[(y * 9.0), $MachinePrecision], -4e-97], 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], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -4 \cdot 10^{-97}:\\
\;\;\;\;\left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -4.00000000000000014e-97Initial program 93.8%
associate-+l-93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*93.8%
associate-+l-93.8%
associate-*l*93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*96.8%
associate-*l*96.8%
Simplified96.8%
+-commutative96.8%
associate-+r-96.8%
associate-*r*96.8%
*-commutative96.8%
associate-*l*96.8%
associate-*l*96.8%
associate-*r*96.9%
Applied egg-rr96.9%
if -4.00000000000000014e-97 < (*.f64 y 9) Initial program 93.4%
associate-+l-93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*93.4%
associate-+l-93.4%
associate-*l*93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*95.1%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in y around 0 93.4%
associate-*r*97.5%
Simplified97.5%
Final simplification97.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 (* t (* z y))))
(if (or (<= b -6.5e-45) (not (<= b 2.25e+24)))
(+ (* a (* 27.0 b)) (* -9.0 t_1))
(- (* x 2.0) (* 9.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 = t * (z * y);
double tmp;
if ((b <= -6.5e-45) || !(b <= 2.25e+24)) {
tmp = (a * (27.0 * b)) + (-9.0 * t_1);
} else {
tmp = (x * 2.0) - (9.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 = t * (z * y)
if ((b <= (-6.5d-45)) .or. (.not. (b <= 2.25d+24))) then
tmp = (a * (27.0d0 * b)) + ((-9.0d0) * t_1)
else
tmp = (x * 2.0d0) - (9.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 = t * (z * y);
double tmp;
if ((b <= -6.5e-45) || !(b <= 2.25e+24)) {
tmp = (a * (27.0 * b)) + (-9.0 * t_1);
} else {
tmp = (x * 2.0) - (9.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 = t * (z * y) tmp = 0 if (b <= -6.5e-45) or not (b <= 2.25e+24): tmp = (a * (27.0 * b)) + (-9.0 * t_1) else: tmp = (x * 2.0) - (9.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(t * Float64(z * y)) tmp = 0.0 if ((b <= -6.5e-45) || !(b <= 2.25e+24)) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * t_1)); else tmp = Float64(Float64(x * 2.0) - Float64(9.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 = t * (z * y);
tmp = 0.0;
if ((b <= -6.5e-45) || ~((b <= 2.25e+24)))
tmp = (a * (27.0 * b)) + (-9.0 * t_1);
else
tmp = (x * 2.0) - (9.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[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[b, -6.5e-45], N[Not[LessEqual[b, 2.25e+24]], $MachinePrecision]], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot y\right)\\
\mathbf{if}\;b \leq -6.5 \cdot 10^{-45} \lor \neg \left(b \leq 2.25 \cdot 10^{+24}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot t\_1\\
\end{array}
\end{array}
if b < -6.4999999999999995e-45 or 2.2500000000000001e24 < b Initial program 93.8%
associate-+l-93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*93.8%
associate-+l-93.8%
associate-*l*93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in y around 0 93.9%
associate-*r*96.1%
Simplified96.1%
Taylor expanded in x around 0 77.2%
cancel-sign-sub-inv77.2%
metadata-eval77.2%
associate-*r*77.2%
*-commutative77.2%
associate-*l*77.3%
*-commutative77.3%
Simplified77.3%
if -6.4999999999999995e-45 < b < 2.2500000000000001e24Initial program 93.2%
associate-+l-93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
associate-+l-93.2%
associate-*l*93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in a around 0 83.2%
Final simplification80.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 (* t (* z y))) (t_2 (* 9.0 t_1)))
(if (<= b -2.6e-42)
(+ (* a (* 27.0 b)) (* -9.0 t_1))
(if (<= b 2.9e+24) (- (* x 2.0) t_2) (- (* 27.0 (* a b)) 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 = t * (z * y);
double t_2 = 9.0 * t_1;
double tmp;
if (b <= -2.6e-42) {
tmp = (a * (27.0 * b)) + (-9.0 * t_1);
} else if (b <= 2.9e+24) {
tmp = (x * 2.0) - t_2;
} else {
tmp = (27.0 * (a * b)) - 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 = t * (z * y)
t_2 = 9.0d0 * t_1
if (b <= (-2.6d-42)) then
tmp = (a * (27.0d0 * b)) + ((-9.0d0) * t_1)
else if (b <= 2.9d+24) then
tmp = (x * 2.0d0) - t_2
else
tmp = (27.0d0 * (a * b)) - 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 = t * (z * y);
double t_2 = 9.0 * t_1;
double tmp;
if (b <= -2.6e-42) {
tmp = (a * (27.0 * b)) + (-9.0 * t_1);
} else if (b <= 2.9e+24) {
tmp = (x * 2.0) - t_2;
} else {
tmp = (27.0 * (a * b)) - 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 = t * (z * y) t_2 = 9.0 * t_1 tmp = 0 if b <= -2.6e-42: tmp = (a * (27.0 * b)) + (-9.0 * t_1) elif b <= 2.9e+24: tmp = (x * 2.0) - t_2 else: tmp = (27.0 * (a * b)) - 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(t * Float64(z * y)) t_2 = Float64(9.0 * t_1) tmp = 0.0 if (b <= -2.6e-42) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * t_1)); elseif (b <= 2.9e+24) tmp = Float64(Float64(x * 2.0) - t_2); else tmp = Float64(Float64(27.0 * Float64(a * b)) - 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 = t * (z * y);
t_2 = 9.0 * t_1;
tmp = 0.0;
if (b <= -2.6e-42)
tmp = (a * (27.0 * b)) + (-9.0 * t_1);
elseif (b <= 2.9e+24)
tmp = (x * 2.0) - t_2;
else
tmp = (27.0 * (a * b)) - 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[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * t$95$1), $MachinePrecision]}, If[LessEqual[b, -2.6e-42], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.9e+24], N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot y\right)\\
t_2 := 9 \cdot t\_1\\
\mathbf{if}\;b \leq -2.6 \cdot 10^{-42}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot t\_1\\
\mathbf{elif}\;b \leq 2.9 \cdot 10^{+24}:\\
\;\;\;\;x \cdot 2 - t\_2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t\_2\\
\end{array}
\end{array}
if b < -2.6e-42Initial program 93.4%
associate-+l-93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*93.4%
associate-+l-93.4%
associate-*l*93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*98.5%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in y around 0 93.4%
associate-*r*97.3%
Simplified97.3%
Taylor expanded in x around 0 71.2%
cancel-sign-sub-inv71.2%
metadata-eval71.2%
associate-*r*71.3%
*-commutative71.3%
associate-*l*71.3%
*-commutative71.3%
Simplified71.3%
if -2.6e-42 < b < 2.89999999999999979e24Initial program 93.2%
associate-+l-93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
associate-+l-93.2%
associate-*l*93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in a around 0 83.2%
if 2.89999999999999979e24 < b Initial program 94.5%
associate-+l-94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*94.5%
associate-+l-94.5%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*92.5%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in x around 0 85.5%
Final simplification80.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.25e+58)
(* y (* -9.0 (* z t)))
(if (<= z 6.6e-147)
(+ (* 27.0 (* a b)) (* x 2.0))
(+ (* x 2.0) (* z (* y (* t -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 <= -1.25e+58) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 6.6e-147) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) + (z * (y * (t * -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 (z <= (-1.25d+58)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 6.6d-147) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) + (z * (y * (t * (-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 (z <= -1.25e+58) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 6.6e-147) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) + (z * (y * (t * -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 z <= -1.25e+58: tmp = y * (-9.0 * (z * t)) elif z <= 6.6e-147: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) + (z * (y * (t * -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 <= -1.25e+58) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 6.6e-147) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) + Float64(z * Float64(y * Float64(t * -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 (z <= -1.25e+58)
tmp = y * (-9.0 * (z * t));
elseif (z <= 6.6e-147)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) + (z * (y * (t * -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[z, -1.25e+58], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e-147], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+58}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-147}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.24999999999999996e58Initial program 87.8%
associate-+l-87.8%
*-commutative87.8%
*-commutative87.8%
associate-*l*87.9%
associate-+l-87.9%
associate-*l*87.8%
*-commutative87.8%
*-commutative87.8%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in a around 0 66.8%
Taylor expanded in y around inf 55.3%
Taylor expanded in x around 0 45.1%
if -1.24999999999999996e58 < z < 6.59999999999999975e-147Initial program 99.8%
associate-+l-99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 84.8%
if 6.59999999999999975e-147 < z Initial program 88.8%
associate-+l-88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*88.8%
associate-+l-88.8%
associate-*l*88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around 0 66.6%
cancel-sign-sub-inv66.6%
*-commutative66.6%
metadata-eval66.6%
+-commutative66.6%
associate-*r*66.6%
associate-*r*73.3%
*-commutative73.3%
Applied egg-rr73.3%
Final simplification73.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -4.1e+57) (* y (* -9.0 (* z t))) (if (<= z 7.2e-15) (+ (* 27.0 (* a b)) (* x 2.0)) (* -9.0 (* t (* z y))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.1e+57) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 7.2e-15) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.1d+57)) then
tmp = y * ((-9.0d0) * (z * t))
else if (z <= 7.2d-15) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (-9.0d0) * (t * (z * y))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.1e+57) {
tmp = y * (-9.0 * (z * t));
} else if (z <= 7.2e-15) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -4.1e+57: tmp = y * (-9.0 * (z * t)) elif z <= 7.2e-15: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = -9.0 * (t * (z * y)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.1e+57) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (z <= 7.2e-15) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -4.1e+57)
tmp = y * (-9.0 * (z * t));
elseif (z <= 7.2e-15)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = -9.0 * (t * (z * y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.1e+57], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-15], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+57}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-15}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -4.1e57Initial program 87.8%
associate-+l-87.8%
*-commutative87.8%
*-commutative87.8%
associate-*l*87.9%
associate-+l-87.9%
associate-*l*87.8%
*-commutative87.8%
*-commutative87.8%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in a around 0 66.8%
Taylor expanded in y around inf 55.3%
Taylor expanded in x around 0 45.1%
if -4.1e57 < z < 7.2000000000000002e-15Initial program 98.6%
associate-+l-98.6%
*-commutative98.6%
*-commutative98.6%
associate-*l*98.6%
associate-+l-98.6%
associate-*l*98.6%
*-commutative98.6%
*-commutative98.6%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 81.8%
if 7.2000000000000002e-15 < z Initial program 87.4%
associate-+l-87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*87.3%
associate-+l-87.3%
associate-*l*87.4%
*-commutative87.4%
*-commutative87.4%
associate-*l*92.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in y around inf 51.1%
Final simplification66.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* 9.0 (* z (* y t)))) (* a (* 27.0 b))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (9.0d0 * (z * (y * t)))) + (a * (27.0d0 * b))
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + Float64(a * Float64(27.0 * b))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 93.5%
associate-+l-93.5%
*-commutative93.5%
*-commutative93.5%
associate-*l*93.5%
associate-+l-93.5%
associate-*l*93.5%
*-commutative93.5%
*-commutative93.5%
associate-*l*95.7%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in y around 0 93.5%
associate-*r*96.5%
Simplified96.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 (<= b -1.1e-46) (not (<= b 1.7e+24))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.1e-46) || !(b <= 1.7e+24)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.1d-46)) .or. (.not. (b <= 1.7d+24))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.1e-46) || !(b <= 1.7e+24)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.1e-46) or not (b <= 1.7e+24): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.1e-46) || !(b <= 1.7e+24)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -1.1e-46) || ~((b <= 1.7e+24)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.1e-46], N[Not[LessEqual[b, 1.7e+24]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{-46} \lor \neg \left(b \leq 1.7 \cdot 10^{+24}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.1e-46 or 1.7e24 < b Initial program 93.8%
associate-+l-93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*93.8%
associate-+l-93.8%
associate-*l*93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in a around inf 61.9%
if -1.1e-46 < b < 1.7e24Initial program 93.2%
associate-+l-93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
associate-+l-93.2%
associate-*l*93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 46.5%
Final simplification54.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 (<= b -8.2e-41) (* a (* 27.0 b)) (if (<= b 1.55e+24) (* 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 (b <= -8.2e-41) {
tmp = a * (27.0 * b);
} else if (b <= 1.55e+24) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-8.2d-41)) then
tmp = a * (27.0d0 * b)
else if (b <= 1.55d+24) then
tmp = x * 2.0d0
else
tmp = 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 (b <= -8.2e-41) {
tmp = a * (27.0 * b);
} else if (b <= 1.55e+24) {
tmp = x * 2.0;
} else {
tmp = 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 b <= -8.2e-41: tmp = a * (27.0 * b) elif b <= 1.55e+24: tmp = x * 2.0 else: tmp = 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 (b <= -8.2e-41) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 1.55e+24) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -8.2e-41)
tmp = a * (27.0 * b);
elseif (b <= 1.55e+24)
tmp = x * 2.0;
else
tmp = 27.0 * (a * b);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.2e-41], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.55e+24], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-41}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{+24}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -8.20000000000000028e-41Initial program 93.4%
associate-+l-93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*93.4%
associate-+l-93.4%
associate-*l*93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*98.5%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in a around inf 56.6%
associate-*r*56.6%
*-commutative56.6%
associate-*r*56.6%
Simplified56.6%
if -8.20000000000000028e-41 < b < 1.55000000000000005e24Initial program 93.2%
associate-+l-93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
associate-+l-93.2%
associate-*l*93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 46.5%
if 1.55000000000000005e24 < b Initial program 94.5%
associate-+l-94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*94.5%
associate-+l-94.5%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*92.5%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in a around inf 69.3%
Final simplification54.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 (<= b -6.6e-48) (* a (* 27.0 b)) (if (<= b 2.1e+24) (* x 2.0) (* b (* 27.0 a)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.6e-48) {
tmp = a * (27.0 * b);
} else if (b <= 2.1e+24) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-6.6d-48)) then
tmp = a * (27.0d0 * b)
else if (b <= 2.1d+24) then
tmp = x * 2.0d0
else
tmp = b * (27.0d0 * a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.6e-48) {
tmp = a * (27.0 * b);
} else if (b <= 2.1e+24) {
tmp = x * 2.0;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -6.6e-48: tmp = a * (27.0 * b) elif b <= 2.1e+24: tmp = x * 2.0 else: tmp = b * (27.0 * a) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -6.6e-48) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 2.1e+24) tmp = Float64(x * 2.0); else tmp = Float64(b * Float64(27.0 * a)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -6.6e-48)
tmp = a * (27.0 * b);
elseif (b <= 2.1e+24)
tmp = x * 2.0;
else
tmp = b * (27.0 * a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6.6e-48], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e+24], N[(x * 2.0), $MachinePrecision], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.6 \cdot 10^{-48}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+24}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if b < -6.6000000000000001e-48Initial program 93.4%
associate-+l-93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*93.4%
associate-+l-93.4%
associate-*l*93.4%
*-commutative93.4%
*-commutative93.4%
associate-*l*98.5%
associate-*l*98.5%
Simplified98.5%
Taylor expanded in a around inf 56.6%
associate-*r*56.6%
*-commutative56.6%
associate-*r*56.6%
Simplified56.6%
if -6.6000000000000001e-48 < b < 2.1000000000000001e24Initial program 93.2%
associate-+l-93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*93.2%
associate-+l-93.2%
associate-*l*93.2%
*-commutative93.2%
*-commutative93.2%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 46.5%
if 2.1000000000000001e24 < b Initial program 94.5%
associate-+l-94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*94.5%
associate-+l-94.5%
associate-*l*94.5%
*-commutative94.5%
*-commutative94.5%
associate-*l*92.5%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in a around inf 69.3%
associate-*r*69.3%
Simplified69.3%
Final simplification54.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 93.5%
associate-+l-93.5%
*-commutative93.5%
*-commutative93.5%
associate-*l*93.5%
associate-+l-93.5%
associate-*l*93.5%
*-commutative93.5%
*-commutative93.5%
associate-*l*95.7%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in x around inf 32.5%
Final simplification32.5%
(FPCore (x y z t a b) :precision binary64 (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y < 7.590524218811189d-161) then
tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y < 7.590524218811189e-161) {
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y < 7.590524218811189e-161: tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y < 7.590524218811189e-161) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y < 7.590524218811189e-161) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b)); else tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\
\end{array}
\end{array}
herbie shell --seed 2024096
(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)))