
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 5e-195) (+ (- (* 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 <= 5e-195) {
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 <= 5e-195) 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, 5e-195], 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 5 \cdot 10^{-195}:\\
\;\;\;\;\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 < 5.00000000000000009e-195Initial program 93.7%
associate-+l-93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*94.3%
associate-+l-94.3%
associate-*l*93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*93.4%
associate-*l*93.4%
Simplified93.4%
if 5.00000000000000009e-195 < z Initial program 91.0%
+-commutative91.0%
associate-+r-91.0%
*-commutative91.0%
cancel-sign-sub-inv91.0%
associate-*r*98.0%
distribute-lft-neg-in98.0%
*-commutative98.0%
cancel-sign-sub-inv98.0%
associate-+r-98.0%
associate-*l*98.1%
fma-define99.0%
cancel-sign-sub-inv99.0%
fma-define99.0%
distribute-lft-neg-in99.0%
distribute-rgt-neg-in99.0%
*-commutative99.0%
associate-*r*91.9%
associate-*l*91.9%
neg-mul-191.9%
associate-*r*91.9%
Simplified91.9%
Final simplification92.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* 27.0 (* a b)) (* x 2.0))) (t_2 (* -9.0 (* y (* z t)))))
(if (<= z -2.9e-13)
t_2
(if (<= z -7.6e-57)
t_1
(if (<= z -1.5e-75)
t_2
(if (<= z 6e+31) t_1 (* z (* -9.0 (* y t)))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (27.0 * (a * b)) + (x * 2.0);
double t_2 = -9.0 * (y * (z * t));
double tmp;
if (z <= -2.9e-13) {
tmp = t_2;
} else if (z <= -7.6e-57) {
tmp = t_1;
} else if (z <= -1.5e-75) {
tmp = t_2;
} else if (z <= 6e+31) {
tmp = t_1;
} else {
tmp = z * (-9.0 * (y * t));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (27.0d0 * (a * b)) + (x * 2.0d0)
t_2 = (-9.0d0) * (y * (z * t))
if (z <= (-2.9d-13)) then
tmp = t_2
else if (z <= (-7.6d-57)) then
tmp = t_1
else if (z <= (-1.5d-75)) then
tmp = t_2
else if (z <= 6d+31) then
tmp = t_1
else
tmp = z * ((-9.0d0) * (y * t))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (27.0 * (a * b)) + (x * 2.0);
double t_2 = -9.0 * (y * (z * t));
double tmp;
if (z <= -2.9e-13) {
tmp = t_2;
} else if (z <= -7.6e-57) {
tmp = t_1;
} else if (z <= -1.5e-75) {
tmp = t_2;
} else if (z <= 6e+31) {
tmp = t_1;
} else {
tmp = z * (-9.0 * (y * t));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (27.0 * (a * b)) + (x * 2.0) t_2 = -9.0 * (y * (z * t)) tmp = 0 if z <= -2.9e-13: tmp = t_2 elif z <= -7.6e-57: tmp = t_1 elif z <= -1.5e-75: tmp = t_2 elif z <= 6e+31: tmp = t_1 else: tmp = z * (-9.0 * (y * t)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)) t_2 = Float64(-9.0 * Float64(y * Float64(z * t))) tmp = 0.0 if (z <= -2.9e-13) tmp = t_2; elseif (z <= -7.6e-57) tmp = t_1; elseif (z <= -1.5e-75) tmp = t_2; elseif (z <= 6e+31) tmp = t_1; else tmp = Float64(z * Float64(-9.0 * Float64(y * t))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (27.0 * (a * b)) + (x * 2.0);
t_2 = -9.0 * (y * (z * t));
tmp = 0.0;
if (z <= -2.9e-13)
tmp = t_2;
elseif (z <= -7.6e-57)
tmp = t_1;
elseif (z <= -1.5e-75)
tmp = t_2;
elseif (z <= 6e+31)
tmp = t_1;
else
tmp = z * (-9.0 * (y * t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e-13], t$95$2, If[LessEqual[z, -7.6e-57], t$95$1, If[LessEqual[z, -1.5e-75], t$95$2, If[LessEqual[z, 6e+31], t$95$1, N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right) + x \cdot 2\\
t_2 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-13}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-75}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -2.8999999999999998e-13 or -7.5999999999999995e-57 < z < -1.4999999999999999e-75Initial program 89.2%
associate-+l-89.2%
*-commutative89.2%
*-commutative89.2%
associate-*l*89.3%
associate-+l-89.3%
associate-*l*89.2%
*-commutative89.2%
*-commutative89.2%
associate-*l*88.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in a around 0 66.8%
Taylor expanded in z around inf 73.3%
Taylor expanded in x around 0 53.2%
Taylor expanded in z around 0 48.0%
*-commutative48.0%
associate-*l*44.3%
*-commutative44.3%
Simplified44.3%
if -2.8999999999999998e-13 < z < -7.5999999999999995e-57 or -1.4999999999999999e-75 < z < 5.99999999999999978e31Initial program 97.3%
associate-+l-97.3%
*-commutative97.3%
*-commutative97.3%
associate-*l*98.0%
associate-+l-98.0%
associate-*l*97.3%
*-commutative97.3%
*-commutative97.3%
associate-*l*98.2%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in y around 0 82.3%
if 5.99999999999999978e31 < z Initial program 86.1%
associate-+l-86.1%
*-commutative86.1%
*-commutative86.1%
associate-*l*86.1%
associate-+l-86.1%
associate-*l*86.1%
*-commutative86.1%
*-commutative86.1%
associate-*l*91.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in a around 0 70.6%
Taylor expanded in z around inf 75.8%
Taylor expanded in x around 0 56.2%
Final simplification65.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.12e-135)
(* a (* 27.0 b))
(if (<= b 4.4e-217)
(* x 2.0)
(if (<= b 1.1e-130)
(* -9.0 (* y (* z t)))
(if (<= b 1.26e+21) (* x 2.0) (* 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 (b <= -1.12e-135) {
tmp = a * (27.0 * b);
} else if (b <= 4.4e-217) {
tmp = x * 2.0;
} else if (b <= 1.1e-130) {
tmp = -9.0 * (y * (z * t));
} else if (b <= 1.26e+21) {
tmp = x * 2.0;
} else {
tmp = 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 (b <= (-1.12d-135)) then
tmp = a * (27.0d0 * b)
else if (b <= 4.4d-217) then
tmp = x * 2.0d0
else if (b <= 1.1d-130) then
tmp = (-9.0d0) * (y * (z * t))
else if (b <= 1.26d+21) then
tmp = x * 2.0d0
else
tmp = 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 (b <= -1.12e-135) {
tmp = a * (27.0 * b);
} else if (b <= 4.4e-217) {
tmp = x * 2.0;
} else if (b <= 1.1e-130) {
tmp = -9.0 * (y * (z * t));
} else if (b <= 1.26e+21) {
tmp = x * 2.0;
} else {
tmp = 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 b <= -1.12e-135: tmp = a * (27.0 * b) elif b <= 4.4e-217: tmp = x * 2.0 elif b <= 1.1e-130: tmp = -9.0 * (y * (z * t)) elif b <= 1.26e+21: tmp = x * 2.0 else: tmp = 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 (b <= -1.12e-135) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 4.4e-217) tmp = Float64(x * 2.0); elseif (b <= 1.1e-130) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (b <= 1.26e+21) tmp = Float64(x * 2.0); else tmp = 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 (b <= -1.12e-135)
tmp = a * (27.0 * b);
elseif (b <= 4.4e-217)
tmp = x * 2.0;
elseif (b <= 1.1e-130)
tmp = -9.0 * (y * (z * t));
elseif (b <= 1.26e+21)
tmp = x * 2.0;
else
tmp = 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[b, -1.12e-135], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.4e-217], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.1e-130], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.26e+21], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $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 -1.12 \cdot 10^{-135}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{-217}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{-130}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 1.26 \cdot 10^{+21}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if b < -1.12e-135Initial program 88.0%
associate-+l-88.0%
*-commutative88.0%
*-commutative88.0%
associate-*l*89.0%
associate-+l-89.0%
associate-*l*88.0%
*-commutative88.0%
*-commutative88.0%
associate-*l*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around inf 53.6%
associate-*r*53.6%
*-commutative53.6%
associate-*r*53.7%
Simplified53.7%
if -1.12e-135 < b < 4.39999999999999964e-217 or 1.0999999999999999e-130 < b < 1.26e21Initial program 97.8%
associate-+l-97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*97.8%
associate-+l-97.8%
associate-*l*97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*93.1%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 49.5%
if 4.39999999999999964e-217 < b < 1.0999999999999999e-130Initial program 93.1%
associate-+l-93.1%
*-commutative93.1%
*-commutative93.1%
associate-*l*93.3%
associate-+l-93.3%
associate-*l*93.1%
*-commutative93.1%
*-commutative93.1%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in a around 0 86.7%
Taylor expanded in z around inf 87.2%
Taylor expanded in x around 0 61.0%
Taylor expanded in z around 0 61.0%
*-commutative61.0%
associate-*l*54.9%
*-commutative54.9%
Simplified54.9%
if 1.26e21 < b Initial 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*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around inf 64.8%
associate-*r*64.8%
Simplified64.8%
Final simplification54.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 (<= b -1.12e-135)
(* a (* 27.0 b))
(if (<= b 5.2e-214)
(* x 2.0)
(if (<= b 4.5e-130)
(* -9.0 (* t (* z y)))
(if (<= b 5.9e+25) (* x 2.0) (* 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 (b <= -1.12e-135) {
tmp = a * (27.0 * b);
} else if (b <= 5.2e-214) {
tmp = x * 2.0;
} else if (b <= 4.5e-130) {
tmp = -9.0 * (t * (z * y));
} else if (b <= 5.9e+25) {
tmp = x * 2.0;
} else {
tmp = 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 (b <= (-1.12d-135)) then
tmp = a * (27.0d0 * b)
else if (b <= 5.2d-214) then
tmp = x * 2.0d0
else if (b <= 4.5d-130) then
tmp = (-9.0d0) * (t * (z * y))
else if (b <= 5.9d+25) then
tmp = x * 2.0d0
else
tmp = 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 (b <= -1.12e-135) {
tmp = a * (27.0 * b);
} else if (b <= 5.2e-214) {
tmp = x * 2.0;
} else if (b <= 4.5e-130) {
tmp = -9.0 * (t * (z * y));
} else if (b <= 5.9e+25) {
tmp = x * 2.0;
} else {
tmp = 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 b <= -1.12e-135: tmp = a * (27.0 * b) elif b <= 5.2e-214: tmp = x * 2.0 elif b <= 4.5e-130: tmp = -9.0 * (t * (z * y)) elif b <= 5.9e+25: tmp = x * 2.0 else: tmp = 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 (b <= -1.12e-135) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 5.2e-214) tmp = Float64(x * 2.0); elseif (b <= 4.5e-130) tmp = Float64(-9.0 * Float64(t * Float64(z * y))); elseif (b <= 5.9e+25) tmp = Float64(x * 2.0); else tmp = 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 (b <= -1.12e-135)
tmp = a * (27.0 * b);
elseif (b <= 5.2e-214)
tmp = x * 2.0;
elseif (b <= 4.5e-130)
tmp = -9.0 * (t * (z * y));
elseif (b <= 5.9e+25)
tmp = x * 2.0;
else
tmp = 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[b, -1.12e-135], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e-214], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.5e-130], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.9e+25], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $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 -1.12 \cdot 10^{-135}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-214}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-130}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 5.9 \cdot 10^{+25}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if b < -1.12e-135Initial program 88.0%
associate-+l-88.0%
*-commutative88.0%
*-commutative88.0%
associate-*l*89.0%
associate-+l-89.0%
associate-*l*88.0%
*-commutative88.0%
*-commutative88.0%
associate-*l*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around inf 53.6%
associate-*r*53.6%
*-commutative53.6%
associate-*r*53.7%
Simplified53.7%
if -1.12e-135 < b < 5.2e-214 or 4.5e-130 < b < 5.9e25Initial program 97.8%
associate-+l-97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*97.8%
associate-+l-97.8%
associate-*l*97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*93.1%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 49.5%
if 5.2e-214 < b < 4.5e-130Initial program 93.1%
associate-+l-93.1%
*-commutative93.1%
*-commutative93.1%
associate-*l*93.3%
associate-+l-93.3%
associate-*l*93.1%
*-commutative93.1%
*-commutative93.1%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 61.0%
if 5.9e25 < b Initial 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*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around inf 64.8%
associate-*r*64.8%
Simplified64.8%
Final simplification54.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.8e-109) (not (<= b 1.08e+24))) (* b (+ (* -9.0 (/ (* t (* z y)) b)) (* a 27.0))) (+ (* y (* -9.0 (* z t))) (* 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 <= -2.8e-109) || !(b <= 1.08e+24)) {
tmp = b * ((-9.0 * ((t * (z * y)) / b)) + (a * 27.0));
} else {
tmp = (y * (-9.0 * (z * t))) + (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 <= (-2.8d-109)) .or. (.not. (b <= 1.08d+24))) then
tmp = b * (((-9.0d0) * ((t * (z * y)) / b)) + (a * 27.0d0))
else
tmp = (y * ((-9.0d0) * (z * t))) + (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 <= -2.8e-109) || !(b <= 1.08e+24)) {
tmp = b * ((-9.0 * ((t * (z * y)) / b)) + (a * 27.0));
} else {
tmp = (y * (-9.0 * (z * t))) + (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 <= -2.8e-109) or not (b <= 1.08e+24): tmp = b * ((-9.0 * ((t * (z * y)) / b)) + (a * 27.0)) else: tmp = (y * (-9.0 * (z * t))) + (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 <= -2.8e-109) || !(b <= 1.08e+24)) tmp = Float64(b * Float64(Float64(-9.0 * Float64(Float64(t * Float64(z * y)) / b)) + Float64(a * 27.0))); else tmp = Float64(Float64(y * Float64(-9.0 * Float64(z * t))) + 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 <= -2.8e-109) || ~((b <= 1.08e+24)))
tmp = b * ((-9.0 * ((t * (z * y)) / b)) + (a * 27.0));
else
tmp = (y * (-9.0 * (z * t))) + (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, -2.8e-109], N[Not[LessEqual[b, 1.08e+24]], $MachinePrecision]], N[(b * N[(N[(-9.0 * N[(N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] + N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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 -2.8 \cdot 10^{-109} \lor \neg \left(b \leq 1.08 \cdot 10^{+24}\right):\\
\;\;\;\;b \cdot \left(-9 \cdot \frac{t \cdot \left(z \cdot y\right)}{b} + a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right) + x \cdot 2\\
\end{array}
\end{array}
if b < -2.79999999999999979e-109 or 1.0799999999999999e24 < b Initial program 88.7%
+-commutative88.7%
associate-+r-88.7%
*-commutative88.7%
cancel-sign-sub-inv88.7%
associate-*r*93.5%
distribute-lft-neg-in93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
associate-+r-93.5%
associate-*l*93.6%
fma-define94.3%
cancel-sign-sub-inv94.3%
fma-define94.3%
distribute-lft-neg-in94.3%
distribute-rgt-neg-in94.3%
*-commutative94.3%
associate-*r*89.4%
associate-*l*90.1%
neg-mul-190.1%
associate-*r*90.1%
Simplified90.1%
fma-undefine89.4%
fma-undefine89.4%
associate-+r+89.4%
*-commutative89.4%
associate-*l*95.0%
*-commutative95.0%
associate-*r*95.0%
*-commutative95.0%
associate-*r*94.9%
*-commutative94.9%
associate-*l*94.9%
Applied egg-rr94.9%
Taylor expanded in b around inf 89.4%
fma-define89.4%
associate-/l*89.3%
associate-/l*94.1%
+-commutative94.1%
fma-define94.1%
associate-*r/94.1%
*-commutative94.1%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in x around 0 73.2%
if -2.79999999999999979e-109 < b < 1.0799999999999999e24Initial program 97.2%
associate-+l-97.2%
*-commutative97.2%
*-commutative97.2%
associate-*l*97.3%
associate-+l-97.3%
associate-*l*97.2%
*-commutative97.2%
*-commutative97.2%
associate-*l*93.4%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in a around 0 87.5%
cancel-sign-sub-inv87.5%
*-commutative87.5%
metadata-eval87.5%
+-commutative87.5%
associate-*r*87.5%
*-commutative87.5%
*-commutative87.5%
associate-*r*83.6%
Applied egg-rr83.6%
Taylor expanded in z around 0 83.7%
Final simplification77.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.66e-146) (not (<= b 2.5e+23))) (- (* 27.0 (* a b)) (* 9.0 (* t (* z y)))) (+ (* y (* -9.0 (* z t))) (* 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.66e-146) || !(b <= 2.5e+23)) {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
} else {
tmp = (y * (-9.0 * (z * t))) + (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.66d-146)) .or. (.not. (b <= 2.5d+23))) then
tmp = (27.0d0 * (a * b)) - (9.0d0 * (t * (z * y)))
else
tmp = (y * ((-9.0d0) * (z * t))) + (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.66e-146) || !(b <= 2.5e+23)) {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
} else {
tmp = (y * (-9.0 * (z * t))) + (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.66e-146) or not (b <= 2.5e+23): tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y))) else: tmp = (y * (-9.0 * (z * t))) + (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.66e-146) || !(b <= 2.5e+23)) tmp = Float64(Float64(27.0 * Float64(a * b)) - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(y * Float64(-9.0 * Float64(z * t))) + 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.66e-146) || ~((b <= 2.5e+23)))
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
else
tmp = (y * (-9.0 * (z * t))) + (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.66e-146], N[Not[LessEqual[b, 2.5e+23]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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 -1.66 \cdot 10^{-146} \lor \neg \left(b \leq 2.5 \cdot 10^{+23}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right) + x \cdot 2\\
\end{array}
\end{array}
if b < -1.66e-146 or 2.5e23 < b Initial program 88.4%
associate-+l-88.4%
*-commutative88.4%
*-commutative88.4%
associate-*l*89.1%
associate-+l-89.1%
associate-*l*88.4%
*-commutative88.4%
*-commutative88.4%
associate-*l*94.5%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in x around 0 72.9%
if -1.66e-146 < b < 2.5e23Initial program 98.0%
associate-+l-98.0%
*-commutative98.0%
*-commutative98.0%
associate-*l*98.1%
associate-+l-98.1%
associate-*l*98.0%
*-commutative98.0%
*-commutative98.0%
associate-*l*93.1%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in a around 0 88.6%
cancel-sign-sub-inv88.6%
*-commutative88.6%
metadata-eval88.6%
+-commutative88.6%
associate-*r*88.6%
*-commutative88.6%
*-commutative88.6%
associate-*r*83.6%
Applied egg-rr83.6%
Taylor expanded in z around 0 83.6%
Final simplification77.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 2e-196) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* 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 <= 2e-196) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 2d-196) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (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 <= 2e-196) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 2e-196: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 2e-196) tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + 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 <= 2e-196)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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, 2e-196], 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[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $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 2 \cdot 10^{-196}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 2.0000000000000001e-196Initial program 93.7%
associate-+l-93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*94.3%
associate-+l-94.3%
associate-*l*93.7%
*-commutative93.7%
*-commutative93.7%
associate-*l*93.4%
associate-*l*93.4%
Simplified93.4%
if 2.0000000000000001e-196 < z Initial program 91.0%
Final simplification92.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 -5.7e-91) (not (<= b 1.38e+57))) (+ (* 27.0 (* a b)) (* x 2.0)) (+ (* y (* -9.0 (* z t))) (* 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 <= -5.7e-91) || !(b <= 1.38e+57)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (y * (-9.0 * (z * t))) + (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 <= (-5.7d-91)) .or. (.not. (b <= 1.38d+57))) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (y * ((-9.0d0) * (z * t))) + (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 <= -5.7e-91) || !(b <= 1.38e+57)) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (y * (-9.0 * (z * t))) + (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 <= -5.7e-91) or not (b <= 1.38e+57): tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (y * (-9.0 * (z * t))) + (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 <= -5.7e-91) || !(b <= 1.38e+57)) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(y * Float64(-9.0 * Float64(z * t))) + 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 <= -5.7e-91) || ~((b <= 1.38e+57)))
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (y * (-9.0 * (z * t))) + (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, -5.7e-91], N[Not[LessEqual[b, 1.38e+57]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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 -5.7 \cdot 10^{-91} \lor \neg \left(b \leq 1.38 \cdot 10^{+57}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right) + x \cdot 2\\
\end{array}
\end{array}
if b < -5.69999999999999995e-91 or 1.38e57 < b Initial program 89.0%
associate-+l-89.0%
*-commutative89.0%
*-commutative89.0%
associate-*l*89.7%
associate-+l-89.7%
associate-*l*89.0%
*-commutative89.0%
*-commutative89.0%
associate-*l*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in y around 0 78.3%
if -5.69999999999999995e-91 < b < 1.38e57Initial 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*93.4%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in a around 0 84.4%
cancel-sign-sub-inv84.4%
*-commutative84.4%
metadata-eval84.4%
+-commutative84.4%
associate-*r*84.4%
*-commutative84.4%
*-commutative84.4%
associate-*r*80.9%
Applied egg-rr80.9%
Taylor expanded in z around 0 81.0%
Final simplification79.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* y 9.0) (* z 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) - ((y * 9.0) * (z * 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) - ((y * 9.0d0) * (z * 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) - ((y * 9.0) * (z * 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) - ((y * 9.0) * (z * 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(Float64(y * 9.0) * Float64(z * 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) - ((y * 9.0) * (z * 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[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 92.5%
associate-+l-92.5%
*-commutative92.5%
*-commutative92.5%
associate-*l*92.9%
associate-+l-92.9%
associate-*l*92.5%
*-commutative92.5%
*-commutative92.5%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.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 (+ (* y (* z (* t -9.0))) (+ (* 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) {
return (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (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 = (y * (z * (t * (-9.0d0)))) + ((27.0d0 * (a * b)) + (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 (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (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 (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (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(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + 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 = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (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[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right)
\end{array}
Initial program 92.5%
+-commutative92.5%
associate-+r-92.5%
*-commutative92.5%
cancel-sign-sub-inv92.5%
associate-*r*94.9%
distribute-lft-neg-in94.9%
*-commutative94.9%
cancel-sign-sub-inv94.9%
associate-+r-94.9%
associate-*l*94.9%
fma-define95.3%
cancel-sign-sub-inv95.3%
fma-define95.3%
distribute-lft-neg-in95.3%
distribute-rgt-neg-in95.3%
*-commutative95.3%
associate-*r*92.9%
associate-*l*93.3%
neg-mul-193.3%
associate-*r*93.3%
Simplified93.3%
fma-undefine92.9%
fma-undefine92.9%
associate-+r+92.9%
*-commutative92.9%
associate-*l*94.3%
*-commutative94.3%
associate-*r*94.3%
*-commutative94.3%
associate-*r*94.2%
*-commutative94.2%
associate-*l*94.2%
Applied egg-rr94.2%
Final simplification94.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 (or (<= b -1.6e-139) (not (<= b 5.5e+23))) (* a (* 27.0 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-139) || !(b <= 5.5e+23)) {
tmp = a * (27.0 * 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-139)) .or. (.not. (b <= 5.5d+23))) then
tmp = a * (27.0d0 * 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-139) || !(b <= 5.5e+23)) {
tmp = a * (27.0 * 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-139) or not (b <= 5.5e+23): tmp = a * (27.0 * 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-139) || !(b <= 5.5e+23)) tmp = Float64(a * Float64(27.0 * 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-139) || ~((b <= 5.5e+23)))
tmp = a * (27.0 * 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-139], N[Not[LessEqual[b, 5.5e+23]], $MachinePrecision]], N[(a * N[(27.0 * 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^{-139} \lor \neg \left(b \leq 5.5 \cdot 10^{+23}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.6e-139 or 5.50000000000000004e23 < b Initial program 89.0%
associate-+l-89.0%
*-commutative89.0%
*-commutative89.0%
associate-*l*89.6%
associate-+l-89.6%
associate-*l*89.0%
*-commutative89.0%
*-commutative89.0%
associate-*l*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around inf 57.7%
associate-*r*57.7%
*-commutative57.7%
associate-*r*57.8%
Simplified57.8%
if -1.6e-139 < b < 5.50000000000000004e23Initial 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*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around inf 47.5%
Final simplification53.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 (or (<= b -1.7e-139) (not (<= b 2.25e+21))) (* 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.7e-139) || !(b <= 2.25e+21)) {
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.7d-139)) .or. (.not. (b <= 2.25d+21))) 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.7e-139) || !(b <= 2.25e+21)) {
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.7e-139) or not (b <= 2.25e+21): 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.7e-139) || !(b <= 2.25e+21)) 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.7e-139) || ~((b <= 2.25e+21)))
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.7e-139], N[Not[LessEqual[b, 2.25e+21]], $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.7 \cdot 10^{-139} \lor \neg \left(b \leq 2.25 \cdot 10^{+21}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.69999999999999999e-139 or 2.25e21 < b Initial program 89.0%
associate-+l-89.0%
*-commutative89.0%
*-commutative89.0%
associate-*l*89.6%
associate-+l-89.6%
associate-*l*89.0%
*-commutative89.0%
*-commutative89.0%
associate-*l*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around inf 57.7%
if -1.69999999999999999e-139 < b < 2.25e21Initial 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*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around inf 47.5%
Final simplification53.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 -1.05e-135) (* a (* 27.0 b)) (if (<= b 1.45e+21) (* x 2.0) (* 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 (b <= -1.05e-135) {
tmp = a * (27.0 * b);
} else if (b <= 1.45e+21) {
tmp = x * 2.0;
} else {
tmp = 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 (b <= (-1.05d-135)) then
tmp = a * (27.0d0 * b)
else if (b <= 1.45d+21) then
tmp = x * 2.0d0
else
tmp = 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 (b <= -1.05e-135) {
tmp = a * (27.0 * b);
} else if (b <= 1.45e+21) {
tmp = x * 2.0;
} else {
tmp = 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 b <= -1.05e-135: tmp = a * (27.0 * b) elif b <= 1.45e+21: tmp = x * 2.0 else: tmp = 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 (b <= -1.05e-135) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 1.45e+21) tmp = Float64(x * 2.0); else tmp = 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 (b <= -1.05e-135)
tmp = a * (27.0 * b);
elseif (b <= 1.45e+21)
tmp = x * 2.0;
else
tmp = 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[b, -1.05e-135], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.45e+21], N[(x * 2.0), $MachinePrecision], N[(b * N[(a * 27.0), $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 -1.05 \cdot 10^{-135}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{+21}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if b < -1.05e-135Initial program 88.0%
associate-+l-88.0%
*-commutative88.0%
*-commutative88.0%
associate-*l*89.0%
associate-+l-89.0%
associate-*l*88.0%
*-commutative88.0%
*-commutative88.0%
associate-*l*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around inf 53.6%
associate-*r*53.6%
*-commutative53.6%
associate-*r*53.7%
Simplified53.7%
if -1.05e-135 < b < 1.45e21Initial 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*93.2%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in x around inf 47.5%
if 1.45e21 < b Initial 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*94.4%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around inf 64.8%
associate-*r*64.8%
Simplified64.8%
Final simplification53.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 92.5%
associate-+l-92.5%
*-commutative92.5%
*-commutative92.5%
associate-*l*92.9%
associate-+l-92.9%
associate-*l*92.5%
*-commutative92.5%
*-commutative92.5%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in x around inf 31.7%
Final simplification31.7%
(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 2024103
(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)))