
(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 13 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 -1e-135) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1e-135) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1e-135) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1e-135], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{-135}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -1e-135Initial program 90.5%
associate-+l-90.5%
*-commutative90.5%
*-commutative90.5%
associate-*l*90.5%
associate-+l-90.5%
associate-*l*90.5%
*-commutative90.5%
*-commutative90.5%
associate-*l*94.5%
associate-*l*94.5%
Simplified94.5%
if -1e-135 < z Initial program 92.0%
+-commutative92.0%
associate-+r-92.0%
*-commutative92.0%
cancel-sign-sub-inv92.0%
associate-*r*95.1%
distribute-lft-neg-in95.1%
*-commutative95.1%
cancel-sign-sub-inv95.1%
associate-+r-95.1%
associate-*l*95.2%
fma-define95.7%
cancel-sign-sub-inv95.7%
fma-define95.7%
distribute-lft-neg-in95.7%
distribute-rgt-neg-in95.7%
*-commutative95.7%
associate-*r*92.6%
associate-*l*92.6%
neg-mul-192.6%
associate-*r*92.6%
Simplified92.6%
Final simplification93.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 (* t (* z y)))) (t_2 (* 27.0 (* a b))))
(if (<= b -1.8e-81)
t_2
(if (<= b 1.9e-209)
(* x 2.0)
(if (<= b 2.15e-161)
t_1
(if (<= b 3.8e-12)
(* x 2.0)
(if (<= b 4.5e+18)
t_2
(if (<= b 2.7e+20) (* x 2.0) (if (<= b 1.45e+156) t_1 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 = -9.0 * (t * (z * y));
double t_2 = 27.0 * (a * b);
double tmp;
if (b <= -1.8e-81) {
tmp = t_2;
} else if (b <= 1.9e-209) {
tmp = x * 2.0;
} else if (b <= 2.15e-161) {
tmp = t_1;
} else if (b <= 3.8e-12) {
tmp = x * 2.0;
} else if (b <= 4.5e+18) {
tmp = t_2;
} else if (b <= 2.7e+20) {
tmp = x * 2.0;
} else if (b <= 1.45e+156) {
tmp = t_1;
} 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 = (-9.0d0) * (t * (z * y))
t_2 = 27.0d0 * (a * b)
if (b <= (-1.8d-81)) then
tmp = t_2
else if (b <= 1.9d-209) then
tmp = x * 2.0d0
else if (b <= 2.15d-161) then
tmp = t_1
else if (b <= 3.8d-12) then
tmp = x * 2.0d0
else if (b <= 4.5d+18) then
tmp = t_2
else if (b <= 2.7d+20) then
tmp = x * 2.0d0
else if (b <= 1.45d+156) then
tmp = t_1
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 = -9.0 * (t * (z * y));
double t_2 = 27.0 * (a * b);
double tmp;
if (b <= -1.8e-81) {
tmp = t_2;
} else if (b <= 1.9e-209) {
tmp = x * 2.0;
} else if (b <= 2.15e-161) {
tmp = t_1;
} else if (b <= 3.8e-12) {
tmp = x * 2.0;
} else if (b <= 4.5e+18) {
tmp = t_2;
} else if (b <= 2.7e+20) {
tmp = x * 2.0;
} else if (b <= 1.45e+156) {
tmp = t_1;
} 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 = -9.0 * (t * (z * y)) t_2 = 27.0 * (a * b) tmp = 0 if b <= -1.8e-81: tmp = t_2 elif b <= 1.9e-209: tmp = x * 2.0 elif b <= 2.15e-161: tmp = t_1 elif b <= 3.8e-12: tmp = x * 2.0 elif b <= 4.5e+18: tmp = t_2 elif b <= 2.7e+20: tmp = x * 2.0 elif b <= 1.45e+156: tmp = t_1 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(-9.0 * Float64(t * Float64(z * y))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -1.8e-81) tmp = t_2; elseif (b <= 1.9e-209) tmp = Float64(x * 2.0); elseif (b <= 2.15e-161) tmp = t_1; elseif (b <= 3.8e-12) tmp = Float64(x * 2.0); elseif (b <= 4.5e+18) tmp = t_2; elseif (b <= 2.7e+20) tmp = Float64(x * 2.0); elseif (b <= 1.45e+156) tmp = t_1; 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 = -9.0 * (t * (z * y));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -1.8e-81)
tmp = t_2;
elseif (b <= 1.9e-209)
tmp = x * 2.0;
elseif (b <= 2.15e-161)
tmp = t_1;
elseif (b <= 3.8e-12)
tmp = x * 2.0;
elseif (b <= 4.5e+18)
tmp = t_2;
elseif (b <= 2.7e+20)
tmp = x * 2.0;
elseif (b <= 1.45e+156)
tmp = t_1;
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[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.8e-81], t$95$2, If[LessEqual[b, 1.9e-209], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.15e-161], t$95$1, If[LessEqual[b, 3.8e-12], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.5e+18], t$95$2, If[LessEqual[b, 2.7e+20], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.45e+156], t$95$1, 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 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -1.8 \cdot 10^{-81}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{-209}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 2.15 \cdot 10^{-161}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{-12}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 2.7 \cdot 10^{+20}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.7999999999999999e-81 or 3.79999999999999996e-12 < b < 4.5e18 or 1.45000000000000005e156 < b Initial program 93.9%
associate-+l-93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
associate-+l-93.9%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 55.1%
if -1.7999999999999999e-81 < b < 1.8999999999999999e-209 or 2.14999999999999983e-161 < b < 3.79999999999999996e-12 or 4.5e18 < b < 2.7e20Initial program 88.8%
associate-+l-88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*88.9%
associate-+l-88.9%
associate-*l*88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in x around inf 52.2%
if 1.8999999999999999e-209 < b < 2.14999999999999983e-161 or 2.7e20 < b < 1.45000000000000005e156Initial program 90.7%
associate-+l-90.7%
*-commutative90.7%
*-commutative90.7%
associate-*l*90.7%
associate-+l-90.7%
associate-*l*90.7%
*-commutative90.7%
*-commutative90.7%
associate-*l*93.6%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in y around inf 54.5%
Final simplification54.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 (* 27.0 (* a b))))
(if (<= b -6e-82)
t_1
(if (<= b 1.7e-209)
(* x 2.0)
(if (<= b 6.2e-161)
(* -9.0 (* t (* z y)))
(if (<= b 5.7e-9)
(* x 2.0)
(if (<= b 4.5e+18)
t_1
(if (<= b 1.1e+19)
(* x 2.0)
(if (<= b 2.1e+157) (* -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 = 27.0 * (a * b);
double tmp;
if (b <= -6e-82) {
tmp = t_1;
} else if (b <= 1.7e-209) {
tmp = x * 2.0;
} else if (b <= 6.2e-161) {
tmp = -9.0 * (t * (z * y));
} else if (b <= 5.7e-9) {
tmp = x * 2.0;
} else if (b <= 4.5e+18) {
tmp = t_1;
} else if (b <= 1.1e+19) {
tmp = x * 2.0;
} else if (b <= 2.1e+157) {
tmp = -9.0 * (z * (y * t));
} 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 = 27.0d0 * (a * b)
if (b <= (-6d-82)) then
tmp = t_1
else if (b <= 1.7d-209) then
tmp = x * 2.0d0
else if (b <= 6.2d-161) then
tmp = (-9.0d0) * (t * (z * y))
else if (b <= 5.7d-9) then
tmp = x * 2.0d0
else if (b <= 4.5d+18) then
tmp = t_1
else if (b <= 1.1d+19) then
tmp = x * 2.0d0
else if (b <= 2.1d+157) then
tmp = (-9.0d0) * (z * (y * t))
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 = 27.0 * (a * b);
double tmp;
if (b <= -6e-82) {
tmp = t_1;
} else if (b <= 1.7e-209) {
tmp = x * 2.0;
} else if (b <= 6.2e-161) {
tmp = -9.0 * (t * (z * y));
} else if (b <= 5.7e-9) {
tmp = x * 2.0;
} else if (b <= 4.5e+18) {
tmp = t_1;
} else if (b <= 1.1e+19) {
tmp = x * 2.0;
} else if (b <= 2.1e+157) {
tmp = -9.0 * (z * (y * t));
} 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 = 27.0 * (a * b) tmp = 0 if b <= -6e-82: tmp = t_1 elif b <= 1.7e-209: tmp = x * 2.0 elif b <= 6.2e-161: tmp = -9.0 * (t * (z * y)) elif b <= 5.7e-9: tmp = x * 2.0 elif b <= 4.5e+18: tmp = t_1 elif b <= 1.1e+19: tmp = x * 2.0 elif b <= 2.1e+157: tmp = -9.0 * (z * (y * t)) 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(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -6e-82) tmp = t_1; elseif (b <= 1.7e-209) tmp = Float64(x * 2.0); elseif (b <= 6.2e-161) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (b <= 5.7e-9) tmp = Float64(x * 2.0); elseif (b <= 4.5e+18) tmp = t_1; elseif (b <= 1.1e+19) tmp = Float64(x * 2.0); elseif (b <= 2.1e+157) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); 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 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -6e-82)
tmp = t_1;
elseif (b <= 1.7e-209)
tmp = x * 2.0;
elseif (b <= 6.2e-161)
tmp = -9.0 * (t * (z * y));
elseif (b <= 5.7e-9)
tmp = x * 2.0;
elseif (b <= 4.5e+18)
tmp = t_1;
elseif (b <= 1.1e+19)
tmp = x * 2.0;
elseif (b <= 2.1e+157)
tmp = -9.0 * (z * (y * t));
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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6e-82], t$95$1, If[LessEqual[b, 1.7e-209], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 6.2e-161], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.7e-9], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.5e+18], t$95$1, If[LessEqual[b, 1.1e+19], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.1e+157], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $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 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -6 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.7 \cdot 10^{-209}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{-161}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 5.7 \cdot 10^{-9}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{+19}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+157}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.9999999999999998e-82 or 5.6999999999999998e-9 < b < 4.5e18 or 2.1e157 < b Initial program 93.9%
associate-+l-93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
associate-+l-93.9%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 55.1%
if -5.9999999999999998e-82 < b < 1.69999999999999994e-209 or 6.1999999999999997e-161 < b < 5.6999999999999998e-9 or 4.5e18 < b < 1.1e19Initial program 88.8%
associate-+l-88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*88.9%
associate-+l-88.9%
associate-*l*88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in x around inf 52.2%
if 1.69999999999999994e-209 < b < 6.1999999999999997e-161Initial program 91.7%
associate-+l-91.7%
*-commutative91.7%
*-commutative91.7%
associate-*l*91.6%
associate-+l-91.6%
associate-*l*91.7%
*-commutative91.7%
*-commutative91.7%
associate-*l*91.6%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around inf 67.8%
if 1.1e19 < b < 2.1e157Initial program 90.1%
Taylor expanded in y around 0 90.1%
Taylor expanded in y around inf 46.5%
*-commutative46.5%
associate-*l*46.5%
associate-*l*46.6%
Simplified46.6%
Taylor expanded in t around 0 46.5%
associate-*r*51.5%
*-commutative51.5%
Simplified51.5%
Final simplification54.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 (* t (* -9.0 (* z y)))) (t_2 (* 27.0 (* a b))))
(if (<= b -1.3e-81)
t_2
(if (<= b 2e-209)
(* x 2.0)
(if (<= b 4.6e-163)
t_1
(if (<= b 6.1e-12)
(* x 2.0)
(if (<= b 6.4e+18)
t_2
(if (<= b 2e+20) (* x 2.0) (if (<= b 3.4e+154) t_1 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 * (-9.0 * (z * y));
double t_2 = 27.0 * (a * b);
double tmp;
if (b <= -1.3e-81) {
tmp = t_2;
} else if (b <= 2e-209) {
tmp = x * 2.0;
} else if (b <= 4.6e-163) {
tmp = t_1;
} else if (b <= 6.1e-12) {
tmp = x * 2.0;
} else if (b <= 6.4e+18) {
tmp = t_2;
} else if (b <= 2e+20) {
tmp = x * 2.0;
} else if (b <= 3.4e+154) {
tmp = t_1;
} 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 = t * ((-9.0d0) * (z * y))
t_2 = 27.0d0 * (a * b)
if (b <= (-1.3d-81)) then
tmp = t_2
else if (b <= 2d-209) then
tmp = x * 2.0d0
else if (b <= 4.6d-163) then
tmp = t_1
else if (b <= 6.1d-12) then
tmp = x * 2.0d0
else if (b <= 6.4d+18) then
tmp = t_2
else if (b <= 2d+20) then
tmp = x * 2.0d0
else if (b <= 3.4d+154) then
tmp = t_1
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 = t * (-9.0 * (z * y));
double t_2 = 27.0 * (a * b);
double tmp;
if (b <= -1.3e-81) {
tmp = t_2;
} else if (b <= 2e-209) {
tmp = x * 2.0;
} else if (b <= 4.6e-163) {
tmp = t_1;
} else if (b <= 6.1e-12) {
tmp = x * 2.0;
} else if (b <= 6.4e+18) {
tmp = t_2;
} else if (b <= 2e+20) {
tmp = x * 2.0;
} else if (b <= 3.4e+154) {
tmp = t_1;
} 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 = t * (-9.0 * (z * y)) t_2 = 27.0 * (a * b) tmp = 0 if b <= -1.3e-81: tmp = t_2 elif b <= 2e-209: tmp = x * 2.0 elif b <= 4.6e-163: tmp = t_1 elif b <= 6.1e-12: tmp = x * 2.0 elif b <= 6.4e+18: tmp = t_2 elif b <= 2e+20: tmp = x * 2.0 elif b <= 3.4e+154: tmp = t_1 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(t * Float64(-9.0 * Float64(z * y))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -1.3e-81) tmp = t_2; elseif (b <= 2e-209) tmp = Float64(x * 2.0); elseif (b <= 4.6e-163) tmp = t_1; elseif (b <= 6.1e-12) tmp = Float64(x * 2.0); elseif (b <= 6.4e+18) tmp = t_2; elseif (b <= 2e+20) tmp = Float64(x * 2.0); elseif (b <= 3.4e+154) tmp = t_1; 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 = t * (-9.0 * (z * y));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -1.3e-81)
tmp = t_2;
elseif (b <= 2e-209)
tmp = x * 2.0;
elseif (b <= 4.6e-163)
tmp = t_1;
elseif (b <= 6.1e-12)
tmp = x * 2.0;
elseif (b <= 6.4e+18)
tmp = t_2;
elseif (b <= 2e+20)
tmp = x * 2.0;
elseif (b <= 3.4e+154)
tmp = t_1;
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[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.3e-81], t$95$2, If[LessEqual[b, 2e-209], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.6e-163], t$95$1, If[LessEqual[b, 6.1e-12], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 6.4e+18], t$95$2, If[LessEqual[b, 2e+20], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 3.4e+154], t$95$1, 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 := t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -1.3 \cdot 10^{-81}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-209}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4.6 \cdot 10^{-163}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.1 \cdot 10^{-12}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 6.4 \cdot 10^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 2 \cdot 10^{+20}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 3.4 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.2999999999999999e-81 or 6.1000000000000003e-12 < b < 6.4e18 or 3.39999999999999974e154 < b Initial program 93.9%
associate-+l-93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
associate-+l-93.9%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 55.1%
if -1.2999999999999999e-81 < b < 2.0000000000000001e-209 or 4.5999999999999999e-163 < b < 6.1000000000000003e-12 or 6.4e18 < b < 2e20Initial program 89.0%
associate-+l-89.0%
*-commutative89.0%
*-commutative89.0%
associate-*l*89.0%
associate-+l-89.0%
associate-*l*89.0%
*-commutative89.0%
*-commutative89.0%
associate-*l*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in x around inf 51.7%
if 2.0000000000000001e-209 < b < 4.5999999999999999e-163 or 2e20 < b < 3.39999999999999974e154Initial program 90.4%
Taylor expanded in y around 0 90.4%
Taylor expanded in y around inf 53.0%
*-commutative53.0%
associate-*l*53.2%
associate-*l*53.2%
Simplified53.2%
Taylor expanded in y around 0 53.2%
Final simplification53.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
(let* ((t_1 (* 27.0 (* a b))))
(if (<= b -2.6e-81)
t_1
(if (<= b 2e-209)
(* x 2.0)
(if (<= b 1.9e-161)
(* t (* -9.0 (* z y)))
(if (<= b 7e-10)
(* x 2.0)
(if (<= b 6.4e+18)
t_1
(if (<= b 1.4e+20)
(* x 2.0)
(if (<= b 3.5e+154) (* t (* y (* z -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 = 27.0 * (a * b);
double tmp;
if (b <= -2.6e-81) {
tmp = t_1;
} else if (b <= 2e-209) {
tmp = x * 2.0;
} else if (b <= 1.9e-161) {
tmp = t * (-9.0 * (z * y));
} else if (b <= 7e-10) {
tmp = x * 2.0;
} else if (b <= 6.4e+18) {
tmp = t_1;
} else if (b <= 1.4e+20) {
tmp = x * 2.0;
} else if (b <= 3.5e+154) {
tmp = t * (y * (z * -9.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 = 27.0d0 * (a * b)
if (b <= (-2.6d-81)) then
tmp = t_1
else if (b <= 2d-209) then
tmp = x * 2.0d0
else if (b <= 1.9d-161) then
tmp = t * ((-9.0d0) * (z * y))
else if (b <= 7d-10) then
tmp = x * 2.0d0
else if (b <= 6.4d+18) then
tmp = t_1
else if (b <= 1.4d+20) then
tmp = x * 2.0d0
else if (b <= 3.5d+154) then
tmp = t * (y * (z * (-9.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 = 27.0 * (a * b);
double tmp;
if (b <= -2.6e-81) {
tmp = t_1;
} else if (b <= 2e-209) {
tmp = x * 2.0;
} else if (b <= 1.9e-161) {
tmp = t * (-9.0 * (z * y));
} else if (b <= 7e-10) {
tmp = x * 2.0;
} else if (b <= 6.4e+18) {
tmp = t_1;
} else if (b <= 1.4e+20) {
tmp = x * 2.0;
} else if (b <= 3.5e+154) {
tmp = t * (y * (z * -9.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 = 27.0 * (a * b) tmp = 0 if b <= -2.6e-81: tmp = t_1 elif b <= 2e-209: tmp = x * 2.0 elif b <= 1.9e-161: tmp = t * (-9.0 * (z * y)) elif b <= 7e-10: tmp = x * 2.0 elif b <= 6.4e+18: tmp = t_1 elif b <= 1.4e+20: tmp = x * 2.0 elif b <= 3.5e+154: tmp = t * (y * (z * -9.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(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -2.6e-81) tmp = t_1; elseif (b <= 2e-209) tmp = Float64(x * 2.0); elseif (b <= 1.9e-161) tmp = Float64(t * Float64(-9.0 * Float64(z * y))); elseif (b <= 7e-10) tmp = Float64(x * 2.0); elseif (b <= 6.4e+18) tmp = t_1; elseif (b <= 1.4e+20) tmp = Float64(x * 2.0); elseif (b <= 3.5e+154) tmp = Float64(t * Float64(y * Float64(z * -9.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 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -2.6e-81)
tmp = t_1;
elseif (b <= 2e-209)
tmp = x * 2.0;
elseif (b <= 1.9e-161)
tmp = t * (-9.0 * (z * y));
elseif (b <= 7e-10)
tmp = x * 2.0;
elseif (b <= 6.4e+18)
tmp = t_1;
elseif (b <= 1.4e+20)
tmp = x * 2.0;
elseif (b <= 3.5e+154)
tmp = t * (y * (z * -9.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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.6e-81], t$95$1, If[LessEqual[b, 2e-209], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.9e-161], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e-10], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 6.4e+18], t$95$1, If[LessEqual[b, 1.4e+20], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 3.5e+154], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $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 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -2.6 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-209}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{-161}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 7 \cdot 10^{-10}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 6.4 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{+20}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{+154}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.5999999999999999e-81 or 6.99999999999999961e-10 < b < 6.4e18 or 3.5000000000000002e154 < b Initial program 93.9%
associate-+l-93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
associate-+l-93.9%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 55.1%
if -2.5999999999999999e-81 < b < 2.0000000000000001e-209 or 1.9000000000000001e-161 < b < 6.99999999999999961e-10 or 6.4e18 < b < 1.4e20Initial program 88.8%
associate-+l-88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*88.9%
associate-+l-88.9%
associate-*l*88.8%
*-commutative88.8%
*-commutative88.8%
associate-*l*94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in x around inf 52.2%
if 2.0000000000000001e-209 < b < 1.9000000000000001e-161Initial program 91.7%
Taylor expanded in y around 0 91.7%
Taylor expanded in y around inf 67.8%
*-commutative67.8%
associate-*l*68.1%
associate-*l*67.9%
Simplified67.9%
Taylor expanded in y around 0 68.1%
if 1.4e20 < b < 3.5000000000000002e154Initial program 90.1%
Taylor expanded in y around 0 90.1%
Taylor expanded in y around inf 46.5%
*-commutative46.5%
associate-*l*46.5%
associate-*l*46.6%
Simplified46.6%
Final simplification54.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 (* 27.0 (* a b))))
(if (<= b -3e-81)
t_1
(if (<= b 2e-209)
(* x 2.0)
(if (<= b 4.8e-165)
(* y (* -9.0 (* z t)))
(if (<= b 0.00034)
(* x 2.0)
(if (<= b 5.8e+18)
t_1
(if (<= b 7.2e+19)
(* x 2.0)
(if (<= b 3.6e+154) (* t (* y (* z -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 = 27.0 * (a * b);
double tmp;
if (b <= -3e-81) {
tmp = t_1;
} else if (b <= 2e-209) {
tmp = x * 2.0;
} else if (b <= 4.8e-165) {
tmp = y * (-9.0 * (z * t));
} else if (b <= 0.00034) {
tmp = x * 2.0;
} else if (b <= 5.8e+18) {
tmp = t_1;
} else if (b <= 7.2e+19) {
tmp = x * 2.0;
} else if (b <= 3.6e+154) {
tmp = t * (y * (z * -9.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 = 27.0d0 * (a * b)
if (b <= (-3d-81)) then
tmp = t_1
else if (b <= 2d-209) then
tmp = x * 2.0d0
else if (b <= 4.8d-165) then
tmp = y * ((-9.0d0) * (z * t))
else if (b <= 0.00034d0) then
tmp = x * 2.0d0
else if (b <= 5.8d+18) then
tmp = t_1
else if (b <= 7.2d+19) then
tmp = x * 2.0d0
else if (b <= 3.6d+154) then
tmp = t * (y * (z * (-9.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 = 27.0 * (a * b);
double tmp;
if (b <= -3e-81) {
tmp = t_1;
} else if (b <= 2e-209) {
tmp = x * 2.0;
} else if (b <= 4.8e-165) {
tmp = y * (-9.0 * (z * t));
} else if (b <= 0.00034) {
tmp = x * 2.0;
} else if (b <= 5.8e+18) {
tmp = t_1;
} else if (b <= 7.2e+19) {
tmp = x * 2.0;
} else if (b <= 3.6e+154) {
tmp = t * (y * (z * -9.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 = 27.0 * (a * b) tmp = 0 if b <= -3e-81: tmp = t_1 elif b <= 2e-209: tmp = x * 2.0 elif b <= 4.8e-165: tmp = y * (-9.0 * (z * t)) elif b <= 0.00034: tmp = x * 2.0 elif b <= 5.8e+18: tmp = t_1 elif b <= 7.2e+19: tmp = x * 2.0 elif b <= 3.6e+154: tmp = t * (y * (z * -9.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(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -3e-81) tmp = t_1; elseif (b <= 2e-209) tmp = Float64(x * 2.0); elseif (b <= 4.8e-165) tmp = Float64(y * Float64(-9.0 * Float64(z * t))); elseif (b <= 0.00034) tmp = Float64(x * 2.0); elseif (b <= 5.8e+18) tmp = t_1; elseif (b <= 7.2e+19) tmp = Float64(x * 2.0); elseif (b <= 3.6e+154) tmp = Float64(t * Float64(y * Float64(z * -9.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 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -3e-81)
tmp = t_1;
elseif (b <= 2e-209)
tmp = x * 2.0;
elseif (b <= 4.8e-165)
tmp = y * (-9.0 * (z * t));
elseif (b <= 0.00034)
tmp = x * 2.0;
elseif (b <= 5.8e+18)
tmp = t_1;
elseif (b <= 7.2e+19)
tmp = x * 2.0;
elseif (b <= 3.6e+154)
tmp = t * (y * (z * -9.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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3e-81], t$95$1, If[LessEqual[b, 2e-209], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.8e-165], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.00034], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 5.8e+18], t$95$1, If[LessEqual[b, 7.2e+19], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 3.6e+154], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $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 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -3 \cdot 10^{-81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-209}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4.8 \cdot 10^{-165}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 0.00034:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 7.2 \cdot 10^{+19}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{+154}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.9999999999999999e-81 or 3.4e-4 < b < 5.8e18 or 3.6000000000000001e154 < b Initial program 93.9%
associate-+l-93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*93.9%
associate-+l-93.9%
associate-*l*93.9%
*-commutative93.9%
*-commutative93.9%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 55.1%
if -2.9999999999999999e-81 < b < 2.0000000000000001e-209 or 4.8000000000000004e-165 < b < 3.4e-4 or 5.8e18 < b < 7.2e19Initial program 89.0%
associate-+l-89.0%
*-commutative89.0%
*-commutative89.0%
associate-*l*89.0%
associate-+l-89.0%
associate-*l*89.0%
*-commutative89.0%
*-commutative89.0%
associate-*l*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in x around inf 51.7%
if 2.0000000000000001e-209 < b < 4.8000000000000004e-165Initial program 90.9%
associate-+l-90.9%
*-commutative90.9%
*-commutative90.9%
associate-*l*90.8%
associate-+l-90.8%
associate-*l*90.9%
*-commutative90.9%
*-commutative90.9%
associate-*l*90.9%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in a around 0 82.4%
Taylor expanded in y around inf 82.6%
Taylor expanded in x around 0 65.3%
if 7.2e19 < b < 3.6000000000000001e154Initial program 90.1%
Taylor expanded in y around 0 90.1%
Taylor expanded in y around inf 46.5%
*-commutative46.5%
associate-*l*46.5%
associate-*l*46.6%
Simplified46.6%
Final simplification53.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 (<= z -1e+28) (+ (* a (* 27.0 b)) (- (* x 2.0) (* 9.0 (* z (* y t))))) (+ (- (* x 2.0) (* t (* 9.0 (* z y)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1e+28) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1d+28)) then
tmp = (a * (27.0d0 * b)) + ((x * 2.0d0) - (9.0d0 * (z * (y * t))))
else
tmp = ((x * 2.0d0) - (t * (9.0d0 * (z * y)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1e+28) {
tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
} else {
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1e+28: tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t)))) else: tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1e+28) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t))))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(z * y)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1e+28)
tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
else
tmp = ((x * 2.0) - (t * (9.0 * (z * y)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1e+28], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+28}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < -9.99999999999999958e27Initial program 84.5%
associate-+l-84.5%
*-commutative84.5%
*-commutative84.5%
associate-*l*84.5%
associate-+l-84.5%
associate-*l*84.5%
*-commutative84.5%
*-commutative84.5%
associate-*l*91.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in y around 0 84.5%
associate-*r*97.5%
Simplified97.5%
if -9.99999999999999958e27 < z Initial program 93.1%
Taylor expanded in y around 0 93.1%
Final simplification93.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -9.5e+76)
(* -9.0 (* z (* y t)))
(if (<= z 2.2e-153)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.5e+76) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 2.2e-153) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-9.5d+76)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 2.2d-153) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.5e+76) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 2.2e-153) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -9.5e+76: tmp = -9.0 * (z * (y * t)) elif z <= 2.2e-153: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -9.5e+76) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 2.2e-153) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -9.5e+76)
tmp = -9.0 * (z * (y * t));
elseif (z <= 2.2e-153)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -9.5e+76], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e-153], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+76}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-153}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -9.5000000000000003e76Initial program 83.8%
Taylor expanded in y around 0 83.8%
Taylor expanded in y around inf 49.2%
*-commutative49.2%
associate-*l*49.2%
associate-*l*49.2%
Simplified49.2%
Taylor expanded in t around 0 49.2%
associate-*r*51.6%
*-commutative51.6%
Simplified51.6%
if -9.5000000000000003e76 < z < 2.20000000000000001e-153Initial program 98.9%
associate-+l-98.9%
*-commutative98.9%
*-commutative98.9%
associate-*l*98.9%
associate-+l-98.9%
associate-*l*98.9%
*-commutative98.9%
*-commutative98.9%
associate-*l*98.7%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in y around 0 87.5%
if 2.20000000000000001e-153 < z Initial program 86.5%
associate-+l-86.5%
*-commutative86.5%
*-commutative86.5%
associate-*l*86.5%
associate-+l-86.5%
associate-*l*86.5%
*-commutative86.5%
*-commutative86.5%
associate-*l*92.6%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in a around 0 64.8%
Final simplification73.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.9e-18)
(* y (- (* 2.0 (/ x y)) (* 9.0 (* z t))))
(if (<= z 9.2e-152)
(+ (* x 2.0) (* 27.0 (* a b)))
(- (* x 2.0) (* 9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e-18) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if (z <= 9.2e-152) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.9d-18)) then
tmp = y * ((2.0d0 * (x / y)) - (9.0d0 * (z * t)))
else if (z <= 9.2d-152) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e-18) {
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
} else if (z <= 9.2e-152) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -1.9e-18: tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t))) elif z <= 9.2e-152: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = (x * 2.0) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.9e-18) tmp = Float64(y * Float64(Float64(2.0 * Float64(x / y)) - Float64(9.0 * Float64(z * t)))); elseif (z <= 9.2e-152) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -1.9e-18)
tmp = y * ((2.0 * (x / y)) - (9.0 * (z * t)));
elseif (z <= 9.2e-152)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.9e-18], N[(y * N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e-152], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-18}:\\
\;\;\;\;y \cdot \left(2 \cdot \frac{x}{y} - 9 \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-152}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.8999999999999999e-18Initial program 86.3%
associate-+l-86.3%
*-commutative86.3%
*-commutative86.3%
associate-*l*86.3%
associate-+l-86.3%
associate-*l*86.3%
*-commutative86.3%
*-commutative86.3%
associate-*l*92.1%
associate-*l*92.1%
Simplified92.1%
Taylor expanded in a around 0 62.9%
Taylor expanded in y around inf 60.9%
if -1.8999999999999999e-18 < z < 9.2000000000000005e-152Initial 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*98.6%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in y around 0 88.7%
if 9.2000000000000005e-152 < z Initial program 86.5%
associate-+l-86.5%
*-commutative86.5%
*-commutative86.5%
associate-*l*86.5%
associate-+l-86.5%
associate-*l*86.5%
*-commutative86.5%
*-commutative86.5%
associate-*l*92.6%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in a around 0 64.8%
Final simplification73.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 (<= z -2.9e+79) (* -9.0 (* z (* y t))) (if (<= z 4.9e+17) (+ (* x 2.0) (* 27.0 (* a b))) (* 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 <= -2.9e+79) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 4.9e+17) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.9d+79)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 4.9d+17) then
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
else
tmp = t * (y * (z * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.9e+79) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 4.9e+17) {
tmp = (x * 2.0) + (27.0 * (a * b));
} else {
tmp = t * (y * (z * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -2.9e+79: tmp = -9.0 * (z * (y * t)) elif z <= 4.9e+17: tmp = (x * 2.0) + (27.0 * (a * b)) else: tmp = t * (y * (z * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.9e+79) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 4.9e+17) tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); else tmp = Float64(t * Float64(y * Float64(z * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -2.9e+79)
tmp = -9.0 * (z * (y * t));
elseif (z <= 4.9e+17)
tmp = (x * 2.0) + (27.0 * (a * b));
else
tmp = t * (y * (z * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.9e+79], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.9e+17], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+79}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{+17}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -2.89999999999999992e79Initial program 85.2%
Taylor expanded in y around 0 85.2%
Taylor expanded in y around inf 53.4%
*-commutative53.4%
associate-*l*53.4%
associate-*l*53.4%
Simplified53.4%
Taylor expanded in t around 0 53.4%
associate-*r*56.0%
*-commutative56.0%
Simplified56.0%
if -2.89999999999999992e79 < z < 4.9e17Initial program 97.2%
associate-+l-97.2%
*-commutative97.2%
*-commutative97.2%
associate-*l*97.2%
associate-+l-97.2%
associate-*l*97.2%
*-commutative97.2%
*-commutative97.2%
associate-*l*98.4%
associate-*l*98.4%
Simplified98.4%
Taylor expanded in y around 0 84.0%
if 4.9e17 < z Initial program 83.2%
Taylor expanded in y around 0 83.2%
Taylor expanded in y around inf 42.3%
*-commutative42.3%
associate-*l*42.4%
associate-*l*42.4%
Simplified42.4%
Final simplification68.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 (+ (* a (* 27.0 b)) (- (* 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) {
return (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
}
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 = (a * (27.0d0 * b)) + ((x * 2.0d0) - (9.0d0 * (z * (y * t))))
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 (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t))))) 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 = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)
\end{array}
Initial program 91.6%
associate-+l-91.6%
*-commutative91.6%
*-commutative91.6%
associate-*l*91.6%
associate-+l-91.6%
associate-*l*91.6%
*-commutative91.6%
*-commutative91.6%
associate-*l*94.8%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in y around 0 91.6%
associate-*r*96.4%
Simplified96.4%
Final simplification96.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.6e-81) (not (<= b 1.85e-8))) (* 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.6e-81) || !(b <= 1.85e-8)) {
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.6d-81)) .or. (.not. (b <= 1.85d-8))) 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.6e-81) || !(b <= 1.85e-8)) {
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.6e-81) or not (b <= 1.85e-8): 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.6e-81) || !(b <= 1.85e-8)) 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.6e-81) || ~((b <= 1.85e-8)))
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.6e-81], N[Not[LessEqual[b, 1.85e-8]], $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.6 \cdot 10^{-81} \lor \neg \left(b \leq 1.85 \cdot 10^{-8}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.6e-81 or 1.85e-8 < b 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.4%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 51.7%
if -1.6e-81 < b < 1.85e-8Initial program 89.1%
associate-+l-89.1%
*-commutative89.1%
*-commutative89.1%
associate-*l*89.1%
associate-+l-89.1%
associate-*l*89.1%
*-commutative89.1%
*-commutative89.1%
associate-*l*94.0%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in x around inf 47.9%
Final simplification50.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 (* 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 91.6%
associate-+l-91.6%
*-commutative91.6%
*-commutative91.6%
associate-*l*91.6%
associate-+l-91.6%
associate-*l*91.6%
*-commutative91.6%
*-commutative91.6%
associate-*l*94.8%
associate-*l*94.8%
Simplified94.8%
Taylor expanded in x around inf 34.3%
Final simplification34.3%
(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 2024055
(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)))