
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -4e+58) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (+ (* x 2.0) (+ (* z (* y (* t -9.0))) (* 27.0 (* a b))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -4e+58) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = (x * 2.0) + ((z * (y * (t * -9.0))) + (27.0 * (a * b)));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -4e+58) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(z * Float64(y * Float64(t * -9.0))) + Float64(27.0 * Float64(a * b)))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -4e+58], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(a * b), $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}\;y \cdot 9 \leq -4 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot \left(y \cdot \left(t \cdot -9\right)\right) + 27 \cdot \left(a \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -3.99999999999999978e58Initial program 84.6%
+-commutative84.6%
associate-+r-84.6%
*-commutative84.6%
cancel-sign-sub-inv84.6%
associate-*r*88.1%
distribute-lft-neg-in88.1%
*-commutative88.1%
cancel-sign-sub-inv88.1%
associate-+r-88.1%
associate-*l*88.1%
fma-define89.8%
fma-neg89.8%
associate-*l*98.2%
distribute-rgt-neg-in98.2%
*-commutative98.2%
associate-*l*99.8%
*-commutative99.8%
distribute-lft-neg-in99.8%
associate-*r*99.9%
Simplified99.9%
if -3.99999999999999978e58 < (*.f64 y 9) Initial program 97.3%
+-commutative97.3%
associate-+r-97.3%
*-commutative97.3%
cancel-sign-sub-inv97.3%
associate-*r*96.4%
distribute-lft-neg-in96.4%
*-commutative96.4%
cancel-sign-sub-inv96.4%
associate-+r-96.4%
associate-*l*97.4%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
distribute-lft-neg-in97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*r*98.8%
associate-*l*98.9%
neg-mul-198.9%
associate-*r*98.9%
Simplified98.9%
Applied egg-rr97.4%
Final simplification97.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= t 9.5e+132) (- (+ (* x 2.0) (* 27.0 (* a b))) (* y (* t (* 9.0 z)))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 9.5e+132) {
tmp = ((x * 2.0) + (27.0 * (a * b))) - (y * (t * (9.0 * z)));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 9.5e+132) tmp = Float64(Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))) - Float64(y * Float64(t * Float64(9.0 * z)))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 9.5e+132], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(t * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9.5 \cdot 10^{+132}:\\
\;\;\;\;\left(x \cdot 2 + 27 \cdot \left(a \cdot b\right)\right) - y \cdot \left(t \cdot \left(9 \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if t < 9.5000000000000005e132Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*97.1%
associate-*l*98.0%
Simplified98.0%
+-commutative98.0%
associate-+r-98.0%
associate-*r*97.1%
*-commutative97.1%
associate-*l*98.0%
associate-*l*98.0%
associate-*r*98.0%
Applied egg-rr98.0%
if 9.5000000000000005e132 < t Initial program 94.7%
+-commutative94.7%
associate-+r-94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-*r*85.5%
distribute-lft-neg-in85.5%
*-commutative85.5%
cancel-sign-sub-inv85.5%
associate-+r-85.5%
associate-*l*85.6%
fma-define90.5%
cancel-sign-sub-inv90.5%
fma-define90.5%
distribute-lft-neg-in90.5%
distribute-rgt-neg-in90.5%
*-commutative90.5%
associate-*r*99.7%
associate-*l*99.7%
neg-mul-199.7%
associate-*r*99.7%
Simplified99.7%
Final simplification98.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* y z)))) (t_2 (* 27.0 (* a b))))
(if (<= b -2.05e-126)
t_2
(if (<= b 1.6e-239)
t_1
(if (<= b 6e-104) (* x 2.0) (if (<= b 5.8e+96) 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 * (y * z));
double t_2 = 27.0 * (a * b);
double tmp;
if (b <= -2.05e-126) {
tmp = t_2;
} else if (b <= 1.6e-239) {
tmp = t_1;
} else if (b <= 6e-104) {
tmp = x * 2.0;
} else if (b <= 5.8e+96) {
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 * (y * z))
t_2 = 27.0d0 * (a * b)
if (b <= (-2.05d-126)) then
tmp = t_2
else if (b <= 1.6d-239) then
tmp = t_1
else if (b <= 6d-104) then
tmp = x * 2.0d0
else if (b <= 5.8d+96) 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 * (y * z));
double t_2 = 27.0 * (a * b);
double tmp;
if (b <= -2.05e-126) {
tmp = t_2;
} else if (b <= 1.6e-239) {
tmp = t_1;
} else if (b <= 6e-104) {
tmp = x * 2.0;
} else if (b <= 5.8e+96) {
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 * (y * z)) t_2 = 27.0 * (a * b) tmp = 0 if b <= -2.05e-126: tmp = t_2 elif b <= 1.6e-239: tmp = t_1 elif b <= 6e-104: tmp = x * 2.0 elif b <= 5.8e+96: 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(y * z))) t_2 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -2.05e-126) tmp = t_2; elseif (b <= 1.6e-239) tmp = t_1; elseif (b <= 6e-104) tmp = Float64(x * 2.0); elseif (b <= 5.8e+96) 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 * (y * z));
t_2 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -2.05e-126)
tmp = t_2;
elseif (b <= 1.6e-239)
tmp = t_1;
elseif (b <= 6e-104)
tmp = x * 2.0;
elseif (b <= 5.8e+96)
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[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.05e-126], t$95$2, If[LessEqual[b, 1.6e-239], t$95$1, If[LessEqual[b, 6e-104], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 5.8e+96], 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(y \cdot z\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -2.05 \cdot 10^{-126}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{-239}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-104}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -2.0499999999999999e-126 or 5.79999999999999955e96 < b Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*94.7%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in a around inf 57.9%
if -2.0499999999999999e-126 < b < 1.6e-239 or 6.0000000000000005e-104 < b < 5.79999999999999955e96Initial program 93.9%
sub-neg93.9%
sub-neg93.9%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in y around inf 41.4%
if 1.6e-239 < b < 6.0000000000000005e-104Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*93.0%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 65.8%
Final simplification52.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.15e-126)
t_1
(if (<= b 4.5e-240)
(* -9.0 (* z (* y t)))
(if (<= b 3.7e-104)
(* x 2.0)
(if (<= b 5.6e+96) (* -9.0 (* t (* y z))) 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.15e-126) {
tmp = t_1;
} else if (b <= 4.5e-240) {
tmp = -9.0 * (z * (y * t));
} else if (b <= 3.7e-104) {
tmp = x * 2.0;
} else if (b <= 5.6e+96) {
tmp = -9.0 * (t * (y * z));
} 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.15d-126)) then
tmp = t_1
else if (b <= 4.5d-240) then
tmp = (-9.0d0) * (z * (y * t))
else if (b <= 3.7d-104) then
tmp = x * 2.0d0
else if (b <= 5.6d+96) then
tmp = (-9.0d0) * (t * (y * z))
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.15e-126) {
tmp = t_1;
} else if (b <= 4.5e-240) {
tmp = -9.0 * (z * (y * t));
} else if (b <= 3.7e-104) {
tmp = x * 2.0;
} else if (b <= 5.6e+96) {
tmp = -9.0 * (t * (y * z));
} 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.15e-126: tmp = t_1 elif b <= 4.5e-240: tmp = -9.0 * (z * (y * t)) elif b <= 3.7e-104: tmp = x * 2.0 elif b <= 5.6e+96: tmp = -9.0 * (t * (y * z)) 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.15e-126) tmp = t_1; elseif (b <= 4.5e-240) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (b <= 3.7e-104) tmp = Float64(x * 2.0); elseif (b <= 5.6e+96) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); 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.15e-126)
tmp = t_1;
elseif (b <= 4.5e-240)
tmp = -9.0 * (z * (y * t));
elseif (b <= 3.7e-104)
tmp = x * 2.0;
elseif (b <= 5.6e+96)
tmp = -9.0 * (t * (y * z));
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.15e-126], t$95$1, If[LessEqual[b, 4.5e-240], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.7e-104], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 5.6e+96], N[(-9.0 * N[(t * N[(y * z), $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.15 \cdot 10^{-126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{-240}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{-104}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+96}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.15000000000000016e-126 or 5.59999999999999999e96 < b Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*94.7%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in a around inf 57.9%
if -2.15000000000000016e-126 < b < 4.5000000000000001e-240Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*98.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in y around inf 47.6%
pow147.6%
*-commutative47.6%
*-commutative47.6%
associate-*l*49.4%
Applied egg-rr49.4%
unpow149.4%
*-commutative49.4%
Simplified49.4%
if 4.5000000000000001e-240 < b < 3.6999999999999999e-104Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*93.0%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 65.8%
if 3.6999999999999999e-104 < b < 5.59999999999999999e96Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around inf 33.5%
Final simplification53.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= b -6.5e-125)
t_1
(if (<= b 4.2e-240)
(* -9.0 (* z (* y t)))
(if (<= b 2.2e-104)
(* x 2.0)
(if (<= b 5.6e+96) (* t (* z (* y -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 <= -6.5e-125) {
tmp = t_1;
} else if (b <= 4.2e-240) {
tmp = -9.0 * (z * (y * t));
} else if (b <= 2.2e-104) {
tmp = x * 2.0;
} else if (b <= 5.6e+96) {
tmp = t * (z * (y * -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 <= (-6.5d-125)) then
tmp = t_1
else if (b <= 4.2d-240) then
tmp = (-9.0d0) * (z * (y * t))
else if (b <= 2.2d-104) then
tmp = x * 2.0d0
else if (b <= 5.6d+96) then
tmp = t * (z * (y * (-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 <= -6.5e-125) {
tmp = t_1;
} else if (b <= 4.2e-240) {
tmp = -9.0 * (z * (y * t));
} else if (b <= 2.2e-104) {
tmp = x * 2.0;
} else if (b <= 5.6e+96) {
tmp = t * (z * (y * -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 <= -6.5e-125: tmp = t_1 elif b <= 4.2e-240: tmp = -9.0 * (z * (y * t)) elif b <= 2.2e-104: tmp = x * 2.0 elif b <= 5.6e+96: tmp = t * (z * (y * -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 <= -6.5e-125) tmp = t_1; elseif (b <= 4.2e-240) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (b <= 2.2e-104) tmp = Float64(x * 2.0); elseif (b <= 5.6e+96) tmp = Float64(t * Float64(z * Float64(y * -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 <= -6.5e-125)
tmp = t_1;
elseif (b <= 4.2e-240)
tmp = -9.0 * (z * (y * t));
elseif (b <= 2.2e-104)
tmp = x * 2.0;
elseif (b <= 5.6e+96)
tmp = t * (z * (y * -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, -6.5e-125], t$95$1, If[LessEqual[b, 4.2e-240], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.2e-104], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 5.6e+96], N[(t * N[(z * N[(y * -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 -6.5 \cdot 10^{-125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.2 \cdot 10^{-240}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{-104}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+96}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.4999999999999999e-125 or 5.59999999999999999e96 < b Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*94.7%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in a around inf 57.9%
if -6.4999999999999999e-125 < b < 4.19999999999999987e-240Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*98.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in y around inf 47.6%
pow147.6%
*-commutative47.6%
*-commutative47.6%
associate-*l*49.4%
Applied egg-rr49.4%
unpow149.4%
*-commutative49.4%
Simplified49.4%
if 4.19999999999999987e-240 < b < 2.20000000000000012e-104Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*93.0%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 65.8%
if 2.20000000000000012e-104 < b < 5.59999999999999999e96Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around inf 33.5%
*-commutative33.5%
associate-*l*33.5%
associate-*r*33.6%
Simplified33.6%
Taylor expanded in y around 0 33.5%
associate-*r*33.4%
*-commutative33.4%
*-commutative33.4%
Simplified33.4%
Final simplification53.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= b -6.2e-125)
t_1
(if (<= b 6.4e-240)
(* z (* 9.0 (* y (- t))))
(if (<= b 2.6e-104)
(* x 2.0)
(if (<= b 4.9e+98) (* t (* z (* y -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 <= -6.2e-125) {
tmp = t_1;
} else if (b <= 6.4e-240) {
tmp = z * (9.0 * (y * -t));
} else if (b <= 2.6e-104) {
tmp = x * 2.0;
} else if (b <= 4.9e+98) {
tmp = t * (z * (y * -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 <= (-6.2d-125)) then
tmp = t_1
else if (b <= 6.4d-240) then
tmp = z * (9.0d0 * (y * -t))
else if (b <= 2.6d-104) then
tmp = x * 2.0d0
else if (b <= 4.9d+98) then
tmp = t * (z * (y * (-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 <= -6.2e-125) {
tmp = t_1;
} else if (b <= 6.4e-240) {
tmp = z * (9.0 * (y * -t));
} else if (b <= 2.6e-104) {
tmp = x * 2.0;
} else if (b <= 4.9e+98) {
tmp = t * (z * (y * -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 <= -6.2e-125: tmp = t_1 elif b <= 6.4e-240: tmp = z * (9.0 * (y * -t)) elif b <= 2.6e-104: tmp = x * 2.0 elif b <= 4.9e+98: tmp = t * (z * (y * -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 <= -6.2e-125) tmp = t_1; elseif (b <= 6.4e-240) tmp = Float64(z * Float64(9.0 * Float64(y * Float64(-t)))); elseif (b <= 2.6e-104) tmp = Float64(x * 2.0); elseif (b <= 4.9e+98) tmp = Float64(t * Float64(z * Float64(y * -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 <= -6.2e-125)
tmp = t_1;
elseif (b <= 6.4e-240)
tmp = z * (9.0 * (y * -t));
elseif (b <= 2.6e-104)
tmp = x * 2.0;
elseif (b <= 4.9e+98)
tmp = t * (z * (y * -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, -6.2e-125], t$95$1, If[LessEqual[b, 6.4e-240], N[(z * N[(9.0 * N[(y * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.6e-104], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4.9e+98], N[(t * N[(z * N[(y * -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 -6.2 \cdot 10^{-125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.4 \cdot 10^{-240}:\\
\;\;\;\;z \cdot \left(9 \cdot \left(y \cdot \left(-t\right)\right)\right)\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-104}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4.9 \cdot 10^{+98}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.20000000000000026e-125 or 4.89999999999999979e98 < b Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*94.7%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in a around inf 57.9%
if -6.20000000000000026e-125 < b < 6.3999999999999998e-240Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*98.1%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in y around inf 47.6%
associate-*r*47.6%
*-commutative47.6%
Simplified47.6%
*-commutative47.6%
associate-*r*47.6%
metadata-eval47.6%
distribute-lft-neg-in47.6%
*-commutative47.6%
associate-*l*47.6%
associate-*r*47.6%
*-commutative47.6%
*-commutative47.6%
*-commutative47.6%
*-commutative47.6%
associate-*r*47.6%
associate-*l*47.6%
*-commutative47.6%
*-commutative47.6%
*-commutative47.6%
associate-*l*49.4%
Applied egg-rr49.4%
Taylor expanded in z around 0 47.6%
associate-*r*49.4%
*-commutative49.4%
*-commutative49.4%
associate-*r*49.3%
Simplified49.3%
if 6.3999999999999998e-240 < b < 2.60000000000000003e-104Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*93.0%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 65.8%
if 2.60000000000000003e-104 < b < 4.89999999999999979e98Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in y around inf 33.5%
*-commutative33.5%
associate-*l*33.5%
associate-*r*33.6%
Simplified33.6%
Taylor expanded in y around 0 33.5%
associate-*r*33.4%
*-commutative33.4%
*-commutative33.4%
Simplified33.4%
Final simplification52.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= (* x 2.0) -5e+26)
(+ (* x 2.0) t_1)
(if (<= (* x 2.0) 5e+21)
(- t_1 (* 9.0 (* t (* y z))))
(+ (* x 2.0) (* a (* 27.0 b)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if ((x * 2.0) <= -5e+26) {
tmp = (x * 2.0) + t_1;
} else if ((x * 2.0) <= 5e+21) {
tmp = t_1 - (9.0 * (t * (y * z)));
} else {
tmp = (x * 2.0) + (a * (27.0 * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if ((x * 2.0d0) <= (-5d+26)) then
tmp = (x * 2.0d0) + t_1
else if ((x * 2.0d0) <= 5d+21) then
tmp = t_1 - (9.0d0 * (t * (y * z)))
else
tmp = (x * 2.0d0) + (a * (27.0d0 * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if ((x * 2.0) <= -5e+26) {
tmp = (x * 2.0) + t_1;
} else if ((x * 2.0) <= 5e+21) {
tmp = t_1 - (9.0 * (t * (y * z)));
} else {
tmp = (x * 2.0) + (a * (27.0 * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if (x * 2.0) <= -5e+26: tmp = (x * 2.0) + t_1 elif (x * 2.0) <= 5e+21: tmp = t_1 - (9.0 * (t * (y * z))) else: tmp = (x * 2.0) + (a * (27.0 * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (Float64(x * 2.0) <= -5e+26) tmp = Float64(Float64(x * 2.0) + t_1); elseif (Float64(x * 2.0) <= 5e+21) tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(y * z)))); else tmp = Float64(Float64(x * 2.0) + Float64(a * Float64(27.0 * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if ((x * 2.0) <= -5e+26)
tmp = (x * 2.0) + t_1;
elseif ((x * 2.0) <= 5e+21)
tmp = t_1 - (9.0 * (t * (y * z)));
else
tmp = (x * 2.0) + (a * (27.0 * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * 2.0), $MachinePrecision], -5e+26], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(x * 2.0), $MachinePrecision], 5e+21], N[(t$95$1 - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \cdot 2 \leq -5 \cdot 10^{+26}:\\
\;\;\;\;x \cdot 2 + t\_1\\
\mathbf{elif}\;x \cdot 2 \leq 5 \cdot 10^{+21}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 x 2) < -5.0000000000000001e26Initial program 93.7%
sub-neg93.7%
sub-neg93.7%
associate-*l*94.0%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in y around 0 81.5%
if -5.0000000000000001e26 < (*.f64 x 2) < 5e21Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*94.4%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in x around 0 86.9%
if 5e21 < (*.f64 x 2) Initial program 95.9%
+-commutative95.9%
associate-+r-95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-*r*94.2%
distribute-lft-neg-in94.2%
*-commutative94.2%
cancel-sign-sub-inv94.2%
associate-+r-94.2%
associate-*l*94.3%
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*96.0%
associate-*l*97.8%
neg-mul-197.8%
associate-*r*97.8%
Simplified97.8%
Applied egg-rr96.2%
Taylor expanded in z around 0 79.1%
associate-*r*79.1%
*-commutative79.1%
associate-*l*79.2%
Simplified79.2%
Final simplification84.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (* y 9.0) -2e+57) (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))) (+ (* x 2.0) (+ (* z (* y (* t -9.0))) (* 27.0 (* a b))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -2e+57) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = (x * 2.0) + ((z * (y * (t * -9.0))) + (27.0 * (a * b)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y * 9.0d0) <= (-2d+57)) then
tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
else
tmp = (x * 2.0d0) + ((z * (y * (t * (-9.0d0)))) + (27.0d0 * (a * b)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y * 9.0) <= -2e+57) {
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
} else {
tmp = (x * 2.0) + ((z * (y * (t * -9.0))) + (27.0 * (a * b)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (y * 9.0) <= -2e+57: tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b)) else: tmp = (x * 2.0) + ((z * (y * (t * -9.0))) + (27.0 * (a * b))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y * 9.0) <= -2e+57) 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(x * 2.0) + Float64(Float64(z * Float64(y * Float64(t * -9.0))) + Float64(27.0 * Float64(a * b)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((y * 9.0) <= -2e+57)
tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
else
tmp = (x * 2.0) + ((z * (y * (t * -9.0))) + (27.0 * (a * b)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y * 9.0), $MachinePrecision], -2e+57], 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[(x * 2.0), $MachinePrecision] + N[(N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(a * b), $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}\;y \cdot 9 \leq -2 \cdot 10^{+57}:\\
\;\;\;\;\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}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot \left(y \cdot \left(t \cdot -9\right)\right) + 27 \cdot \left(a \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -2.0000000000000001e57Initial program 84.9%
sub-neg84.9%
sub-neg84.9%
associate-*l*96.4%
associate-*l*96.5%
Simplified96.5%
if -2.0000000000000001e57 < (*.f64 y 9) Initial program 97.3%
+-commutative97.3%
associate-+r-97.3%
*-commutative97.3%
cancel-sign-sub-inv97.3%
associate-*r*96.3%
distribute-lft-neg-in96.3%
*-commutative96.3%
cancel-sign-sub-inv96.3%
associate-+r-96.3%
associate-*l*97.4%
fma-define97.9%
cancel-sign-sub-inv97.9%
fma-define97.9%
distribute-lft-neg-in97.9%
distribute-rgt-neg-in97.9%
*-commutative97.9%
associate-*r*98.8%
associate-*l*98.9%
neg-mul-198.9%
associate-*r*98.9%
Simplified98.9%
Applied egg-rr97.4%
Final simplification97.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= (* y 9.0) -4e+102)
(- (+ (* x 2.0) t_1) (* y (* t (* 9.0 z))))
(+ (* x 2.0) (+ (* z (* y (* t -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 ((y * 9.0) <= -4e+102) {
tmp = ((x * 2.0) + t_1) - (y * (t * (9.0 * z)));
} else {
tmp = (x * 2.0) + ((z * (y * (t * -9.0))) + t_1);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if ((y * 9.0d0) <= (-4d+102)) then
tmp = ((x * 2.0d0) + t_1) - (y * (t * (9.0d0 * z)))
else
tmp = (x * 2.0d0) + ((z * (y * (t * (-9.0d0)))) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 27.0 * (a * b);
double tmp;
if ((y * 9.0) <= -4e+102) {
tmp = ((x * 2.0) + t_1) - (y * (t * (9.0 * z)));
} else {
tmp = (x * 2.0) + ((z * (y * (t * -9.0))) + t_1);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = 27.0 * (a * b) tmp = 0 if (y * 9.0) <= -4e+102: tmp = ((x * 2.0) + t_1) - (y * (t * (9.0 * z))) else: tmp = (x * 2.0) + ((z * (y * (t * -9.0))) + t_1) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (Float64(y * 9.0) <= -4e+102) tmp = Float64(Float64(Float64(x * 2.0) + t_1) - Float64(y * Float64(t * Float64(9.0 * z)))); else tmp = Float64(Float64(x * 2.0) + Float64(Float64(z * Float64(y * Float64(t * -9.0))) + t_1)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if ((y * 9.0) <= -4e+102)
tmp = ((x * 2.0) + t_1) - (y * (t * (9.0 * z)));
else
tmp = (x * 2.0) + ((z * (y * (t * -9.0))) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * 9.0), $MachinePrecision], -4e+102], N[(N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * N[(t * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;y \cdot 9 \leq -4 \cdot 10^{+102}:\\
\;\;\;\;\left(x \cdot 2 + t\_1\right) - y \cdot \left(t \cdot \left(9 \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + \left(z \cdot \left(y \cdot \left(t \cdot -9\right)\right) + t\_1\right)\\
\end{array}
\end{array}
if (*.f64 y 9) < -3.99999999999999991e102Initial program 81.8%
sub-neg81.8%
sub-neg81.8%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
+-commutative95.7%
associate-+r-95.7%
associate-*r*95.7%
*-commutative95.7%
associate-*l*95.7%
associate-*l*97.7%
associate-*r*97.7%
Applied egg-rr97.7%
if -3.99999999999999991e102 < (*.f64 y 9) Initial program 97.4%
+-commutative97.4%
associate-+r-97.4%
*-commutative97.4%
cancel-sign-sub-inv97.4%
associate-*r*96.5%
distribute-lft-neg-in96.5%
*-commutative96.5%
cancel-sign-sub-inv96.5%
associate-+r-96.5%
associate-*l*97.5%
fma-define98.0%
cancel-sign-sub-inv98.0%
fma-define98.0%
distribute-lft-neg-in98.0%
distribute-rgt-neg-in98.0%
*-commutative98.0%
associate-*r*98.9%
associate-*l*98.9%
neg-mul-198.9%
associate-*r*98.9%
Simplified98.9%
Applied egg-rr97.5%
Final simplification97.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 (+ (* x 2.0) (+ (* z (* y (* t -9.0))) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return (x * 2.0) + ((z * (y * (t * -9.0))) + (27.0 * (a * 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) + ((z * (y * (t * (-9.0d0)))) + (27.0d0 * (a * 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) + ((z * (y * (t * -9.0))) + (27.0 * (a * 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) + ((z * (y * (t * -9.0))) + (27.0 * (a * 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(x * 2.0) + Float64(Float64(z * Float64(y * Float64(t * -9.0))) + Float64(27.0 * Float64(a * 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) + ((z * (y * (t * -9.0))) + (27.0 * (a * 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[(x * 2.0), $MachinePrecision] + N[(N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2 + \left(z \cdot \left(y \cdot \left(t \cdot -9\right)\right) + 27 \cdot \left(a \cdot b\right)\right)
\end{array}
Initial program 94.5%
+-commutative94.5%
associate-+r-94.5%
*-commutative94.5%
cancel-sign-sub-inv94.5%
associate-*r*94.5%
distribute-lft-neg-in94.5%
*-commutative94.5%
cancel-sign-sub-inv94.5%
associate-+r-94.5%
associate-*l*95.3%
fma-define96.1%
cancel-sign-sub-inv96.1%
fma-define96.1%
distribute-lft-neg-in96.1%
distribute-rgt-neg-in96.1%
*-commutative96.1%
associate-*r*96.1%
associate-*l*96.5%
neg-mul-196.5%
associate-*r*96.5%
Simplified96.5%
Applied egg-rr95.7%
Final simplification95.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= y -1.35e+156) (- (* x 2.0) (* 9.0 (* t (* y z)))) (+ (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.35e+156) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.35d+156)) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.35e+156) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -1.35e+156: tmp = (x * 2.0) - (9.0 * (t * (y * z))) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.35e+156) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -1.35e+156)
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.35e+156], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+156}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -1.35e156Initial program 79.7%
sub-neg79.7%
sub-neg79.7%
associate-*l*94.7%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in a around 0 77.7%
if -1.35e156 < y Initial program 97.1%
sub-neg97.1%
sub-neg97.1%
associate-*l*94.6%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in y around 0 73.1%
Final simplification73.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.2e-115) (not (<= b 6e+96))) (* 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 <= -2.2e-115) || !(b <= 6e+96)) {
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 <= (-2.2d-115)) .or. (.not. (b <= 6d+96))) 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 <= -2.2e-115) || !(b <= 6e+96)) {
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 <= -2.2e-115) or not (b <= 6e+96): 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 <= -2.2e-115) || !(b <= 6e+96)) 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 <= -2.2e-115) || ~((b <= 6e+96)))
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, -2.2e-115], N[Not[LessEqual[b, 6e+96]], $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 -2.2 \cdot 10^{-115} \lor \neg \left(b \leq 6 \cdot 10^{+96}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -2.1999999999999999e-115 or 6.0000000000000001e96 < b Initial program 95.8%
sub-neg95.8%
sub-neg95.8%
associate-*l*95.3%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around inf 58.4%
if -2.1999999999999999e-115 < b < 6.0000000000000001e96Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*93.9%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in x around inf 43.7%
Final simplification51.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= y -5e+166) (* t (* z (* y -9.0))) (+ (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5e+166) {
tmp = t * (z * (y * -9.0));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-5d+166)) then
tmp = t * (z * (y * (-9.0d0)))
else
tmp = (x * 2.0d0) + (27.0d0 * (a * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5e+166) {
tmp = t * (z * (y * -9.0));
} else {
tmp = (x * 2.0) + (27.0 * (a * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if y <= -5e+166: tmp = t * (z * (y * -9.0)) else: tmp = (x * 2.0) + (27.0 * (a * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5e+166) tmp = Float64(t * Float64(z * Float64(y * -9.0))); else tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= -5e+166)
tmp = t * (z * (y * -9.0));
else
tmp = (x * 2.0) + (27.0 * (a * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5e+166], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+166}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -5.0000000000000002e166Initial program 78.0%
sub-neg78.0%
sub-neg78.0%
associate-*l*94.2%
associate-*l*94.2%
Simplified94.2%
Taylor expanded in y around inf 61.3%
*-commutative61.3%
associate-*l*61.3%
associate-*r*61.3%
Simplified61.3%
Taylor expanded in y around 0 61.3%
associate-*r*61.3%
*-commutative61.3%
*-commutative61.3%
Simplified61.3%
if -5.0000000000000002e166 < y Initial program 97.1%
sub-neg97.1%
sub-neg97.1%
associate-*l*94.6%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in y around 0 72.2%
Final simplification70.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 94.5%
sub-neg94.5%
sub-neg94.5%
associate-*l*94.6%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in x around inf 30.2%
Final simplification30.2%
(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 2024043
(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)))