
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1e-63) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1e-63) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.0)))));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1e-63) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.0))))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1e-63], 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[(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 10^{-63}:\\
\;\;\;\;\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}:\\
\;\;\;\;\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 < 1.00000000000000007e-63Initial program 94.7%
Simplified97.7%
if 1.00000000000000007e-63 < z Initial program 89.9%
+-commutative89.9%
associate-+r-89.9%
*-commutative89.9%
cancel-sign-sub-inv89.9%
associate-*r*94.1%
distribute-lft-neg-in94.1%
*-commutative94.1%
cancel-sign-sub-inv94.1%
associate-+r-94.1%
associate-*l*94.2%
fma-define96.5%
cancel-sign-sub-inv96.5%
fma-define96.5%
distribute-lft-neg-in96.5%
distribute-rgt-neg-in96.5%
*-commutative96.5%
associate-*r*92.2%
associate-*l*92.3%
neg-mul-192.3%
associate-*r*92.3%
Simplified92.3%
Final simplification95.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 (<= z 1e-64) (+ (* y (* z (* t -9.0))) (+ (* 27.0 (* a b)) (* x 2.0))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1e-64) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 1e-64) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1e-64], 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], 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 10^{-64}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\right) + x \cdot 2\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 < 9.99999999999999965e-65Initial program 94.7%
+-commutative94.7%
associate-+r-94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-*r*95.9%
distribute-lft-neg-in95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-+r-95.9%
associate-*l*96.0%
fma-define96.6%
cancel-sign-sub-inv96.6%
fma-define96.6%
distribute-lft-neg-in96.6%
distribute-rgt-neg-in96.6%
*-commutative96.6%
associate-*r*95.3%
associate-*l*95.3%
neg-mul-195.3%
associate-*r*95.3%
Simplified95.3%
fma-undefine94.7%
fma-undefine94.7%
associate-+r+94.7%
*-commutative94.7%
associate-*l*97.1%
*-commutative97.1%
associate-*r*97.1%
*-commutative97.1%
associate-*r*97.0%
*-commutative97.0%
associate-*l*97.0%
Applied egg-rr97.0%
if 9.99999999999999965e-65 < z Initial program 89.9%
+-commutative89.9%
associate-+r-89.9%
*-commutative89.9%
cancel-sign-sub-inv89.9%
associate-*r*94.1%
distribute-lft-neg-in94.1%
*-commutative94.1%
cancel-sign-sub-inv94.1%
associate-+r-94.1%
associate-*l*94.2%
fma-define96.5%
cancel-sign-sub-inv96.5%
fma-define96.5%
distribute-lft-neg-in96.5%
distribute-rgt-neg-in96.5%
*-commutative96.5%
associate-*r*92.2%
associate-*l*92.3%
neg-mul-192.3%
associate-*r*92.3%
Simplified92.3%
Final simplification95.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* -9.0 (* t (* z y)))) (t_2 (* b (* a 27.0))))
(if (<= b -2.4e-19)
t_2
(if (<= b -3.3e-298)
t_1
(if (<= b 2.4e-300)
(* x 2.0)
(if (<= b 1.4e-245)
t_1
(if (<= b 3.4e-109) (* x 2.0) (if (<= b 0.0026) t_1 t_2))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double t_2 = b * (a * 27.0);
double tmp;
if (b <= -2.4e-19) {
tmp = t_2;
} else if (b <= -3.3e-298) {
tmp = t_1;
} else if (b <= 2.4e-300) {
tmp = x * 2.0;
} else if (b <= 1.4e-245) {
tmp = t_1;
} else if (b <= 3.4e-109) {
tmp = x * 2.0;
} else if (b <= 0.0026) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-9.0d0) * (t * (z * y))
t_2 = b * (a * 27.0d0)
if (b <= (-2.4d-19)) then
tmp = t_2
else if (b <= (-3.3d-298)) then
tmp = t_1
else if (b <= 2.4d-300) then
tmp = x * 2.0d0
else if (b <= 1.4d-245) then
tmp = t_1
else if (b <= 3.4d-109) then
tmp = x * 2.0d0
else if (b <= 0.0026d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -9.0 * (t * (z * y));
double t_2 = b * (a * 27.0);
double tmp;
if (b <= -2.4e-19) {
tmp = t_2;
} else if (b <= -3.3e-298) {
tmp = t_1;
} else if (b <= 2.4e-300) {
tmp = x * 2.0;
} else if (b <= 1.4e-245) {
tmp = t_1;
} else if (b <= 3.4e-109) {
tmp = x * 2.0;
} else if (b <= 0.0026) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = -9.0 * (t * (z * y)) t_2 = b * (a * 27.0) tmp = 0 if b <= -2.4e-19: tmp = t_2 elif b <= -3.3e-298: tmp = t_1 elif b <= 2.4e-300: tmp = x * 2.0 elif b <= 1.4e-245: tmp = t_1 elif b <= 3.4e-109: tmp = x * 2.0 elif b <= 0.0026: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(-9.0 * Float64(t * Float64(z * y))) t_2 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (b <= -2.4e-19) tmp = t_2; elseif (b <= -3.3e-298) tmp = t_1; elseif (b <= 2.4e-300) tmp = Float64(x * 2.0); elseif (b <= 1.4e-245) tmp = t_1; elseif (b <= 3.4e-109) tmp = Float64(x * 2.0); elseif (b <= 0.0026) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = -9.0 * (t * (z * y));
t_2 = b * (a * 27.0);
tmp = 0.0;
if (b <= -2.4e-19)
tmp = t_2;
elseif (b <= -3.3e-298)
tmp = t_1;
elseif (b <= 2.4e-300)
tmp = x * 2.0;
elseif (b <= 1.4e-245)
tmp = t_1;
elseif (b <= 3.4e-109)
tmp = x * 2.0;
elseif (b <= 0.0026)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.4e-19], t$95$2, If[LessEqual[b, -3.3e-298], t$95$1, If[LessEqual[b, 2.4e-300], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 1.4e-245], t$95$1, If[LessEqual[b, 3.4e-109], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 0.0026], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_2 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;b \leq -2.4 \cdot 10^{-19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -3.3 \cdot 10^{-298}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-300}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{-245}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.4 \cdot 10^{-109}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 0.0026:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -2.40000000000000023e-19 or 0.0025999999999999999 < b Initial program 90.8%
sub-neg90.8%
sub-neg90.8%
associate-*l*93.1%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in a around inf 57.6%
associate-*r*57.5%
Simplified57.5%
if -2.40000000000000023e-19 < b < -3.3000000000000002e-298 or 2.39999999999999999e-300 < b < 1.4000000000000001e-245 or 3.40000000000000012e-109 < b < 0.0025999999999999999Initial program 96.0%
sub-neg96.0%
sub-neg96.0%
associate-*l*95.3%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in y around inf 44.6%
if -3.3000000000000002e-298 < b < 2.39999999999999999e-300 or 1.4000000000000001e-245 < b < 3.40000000000000012e-109Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 44.9%
Final simplification51.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 (* b (* a 27.0))))
(if (<= z -3.3e-21)
(* -9.0 (* z (* y t)))
(if (<= z 2.7e-301)
t_1
(if (<= z 5.1e-225)
(* x 2.0)
(if (<= z 2.1e-173)
t_1
(if (<= z 1.92e+39) (* x 2.0) (* -9.0 (* t (* z y))))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (z <= -3.3e-21) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 2.7e-301) {
tmp = t_1;
} else if (z <= 5.1e-225) {
tmp = x * 2.0;
} else if (z <= 2.1e-173) {
tmp = t_1;
} else if (z <= 1.92e+39) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if (z <= (-3.3d-21)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 2.7d-301) then
tmp = t_1
else if (z <= 5.1d-225) then
tmp = x * 2.0d0
else if (z <= 2.1d-173) then
tmp = t_1
else if (z <= 1.92d+39) then
tmp = x * 2.0d0
else
tmp = (-9.0d0) * (t * (z * y))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a * 27.0);
double tmp;
if (z <= -3.3e-21) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 2.7e-301) {
tmp = t_1;
} else if (z <= 5.1e-225) {
tmp = x * 2.0;
} else if (z <= 2.1e-173) {
tmp = t_1;
} else if (z <= 1.92e+39) {
tmp = x * 2.0;
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = b * (a * 27.0) tmp = 0 if z <= -3.3e-21: tmp = -9.0 * (z * (y * t)) elif z <= 2.7e-301: tmp = t_1 elif z <= 5.1e-225: tmp = x * 2.0 elif z <= 2.1e-173: tmp = t_1 elif z <= 1.92e+39: tmp = x * 2.0 else: tmp = -9.0 * (t * (z * y)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a * 27.0)) tmp = 0.0 if (z <= -3.3e-21) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 2.7e-301) tmp = t_1; elseif (z <= 5.1e-225) tmp = Float64(x * 2.0); elseif (z <= 2.1e-173) tmp = t_1; elseif (z <= 1.92e+39) tmp = Float64(x * 2.0); else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a * 27.0);
tmp = 0.0;
if (z <= -3.3e-21)
tmp = -9.0 * (z * (y * t));
elseif (z <= 2.7e-301)
tmp = t_1;
elseif (z <= 5.1e-225)
tmp = x * 2.0;
elseif (z <= 2.1e-173)
tmp = t_1;
elseif (z <= 1.92e+39)
tmp = x * 2.0;
else
tmp = -9.0 * (t * (z * y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.3e-21], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.7e-301], t$95$1, If[LessEqual[z, 5.1e-225], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.1e-173], t$95$1, If[LessEqual[z, 1.92e+39], N[(x * 2.0), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{-21}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-301}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-225}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.92 \cdot 10^{+39}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -3.30000000000000009e-21Initial program 87.6%
sub-neg87.6%
sub-neg87.6%
associate-*l*92.4%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in y around inf 47.7%
pow147.7%
*-commutative47.7%
associate-*l*47.9%
Applied egg-rr47.9%
unpow147.9%
associate-*r*47.7%
*-commutative47.7%
associate-*l*50.7%
*-commutative50.7%
Simplified50.7%
if -3.30000000000000009e-21 < z < 2.7e-301 or 5.0999999999999999e-225 < z < 2.10000000000000001e-173Initial program 98.4%
sub-neg98.4%
sub-neg98.4%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in a around inf 59.9%
associate-*r*59.9%
Simplified59.9%
if 2.7e-301 < z < 5.0999999999999999e-225 or 2.10000000000000001e-173 < z < 1.92000000000000014e39Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*98.2%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in x around inf 45.5%
if 1.92000000000000014e39 < z Initial program 88.1%
sub-neg88.1%
sub-neg88.1%
associate-*l*86.9%
associate-*l*86.9%
Simplified86.9%
Taylor expanded in y around inf 52.3%
Final simplification52.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* 27.0 (* a b))))
(if (<= b -2.1e-19)
(* b (+ (* 2.0 (/ x b)) (* a 27.0)))
(if (<= b 0.0285)
(- (* x 2.0) (* 9.0 (* z (* y t))))
(if (<= b 4.8e+145) (- t_1 (* 9.0 (* t (* z y)))) (+ t_1 (* 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 t_1 = 27.0 * (a * b);
double tmp;
if (b <= -2.1e-19) {
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
} else if (b <= 0.0285) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if (b <= 4.8e+145) {
tmp = t_1 - (9.0 * (t * (z * y)));
} else {
tmp = t_1 + (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) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (b <= (-2.1d-19)) then
tmp = b * ((2.0d0 * (x / b)) + (a * 27.0d0))
else if (b <= 0.0285d0) then
tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
else if (b <= 4.8d+145) then
tmp = t_1 - (9.0d0 * (t * (z * y)))
else
tmp = t_1 + (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 t_1 = 27.0 * (a * b);
double tmp;
if (b <= -2.1e-19) {
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
} else if (b <= 0.0285) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else if (b <= 4.8e+145) {
tmp = t_1 - (9.0 * (t * (z * y)));
} else {
tmp = t_1 + (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): t_1 = 27.0 * (a * b) tmp = 0 if b <= -2.1e-19: tmp = b * ((2.0 * (x / b)) + (a * 27.0)) elif b <= 0.0285: tmp = (x * 2.0) - (9.0 * (z * (y * t))) elif b <= 4.8e+145: tmp = t_1 - (9.0 * (t * (z * y))) else: tmp = t_1 + (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) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (b <= -2.1e-19) tmp = Float64(b * Float64(Float64(2.0 * Float64(x / b)) + Float64(a * 27.0))); elseif (b <= 0.0285) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))); elseif (b <= 4.8e+145) tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(t_1 + 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)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (b <= -2.1e-19)
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
elseif (b <= 0.0285)
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
elseif (b <= 4.8e+145)
tmp = t_1 - (9.0 * (t * (z * y)));
else
tmp = t_1 + (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_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.1e-19], N[(b * N[(N[(2.0 * N[(x / b), $MachinePrecision]), $MachinePrecision] + N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.0285], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.8e+145], N[(t$95$1 - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + 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}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -2.1 \cdot 10^{-19}:\\
\;\;\;\;b \cdot \left(2 \cdot \frac{x}{b} + a \cdot 27\right)\\
\mathbf{elif}\;b \leq 0.0285:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 4.8 \cdot 10^{+145}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x \cdot 2\\
\end{array}
\end{array}
if b < -2.0999999999999999e-19Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*97.1%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in y around 0 66.7%
Taylor expanded in b around inf 66.7%
if -2.0999999999999999e-19 < b < 0.028500000000000001Initial program 95.4%
sub-neg95.4%
sub-neg95.4%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in a around 0 81.4%
pow143.9%
*-commutative43.9%
associate-*l*43.4%
Applied egg-rr81.6%
unpow143.4%
associate-*r*43.9%
*-commutative43.9%
associate-*l*44.0%
*-commutative44.0%
Simplified82.9%
if 0.028500000000000001 < b < 4.79999999999999984e145Initial program 88.9%
sub-neg88.9%
sub-neg88.9%
associate-*l*92.7%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in x around 0 83.7%
if 4.79999999999999984e145 < b Initial program 86.9%
sub-neg86.9%
sub-neg86.9%
associate-*l*83.9%
associate-*l*84.1%
Simplified84.1%
Taylor expanded in y around 0 90.5%
Final simplification79.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 200000.0) (+ (* y (* z (* t -9.0))) (+ (* 27.0 (* a b)) (* x 2.0))) (* z (- (+ (* 2.0 (/ x z)) (* 27.0 (/ (* a b) 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 tmp;
if (z <= 200000.0) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / 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) :: tmp
if (z <= 200000.0d0) then
tmp = (y * (z * (t * (-9.0d0)))) + ((27.0d0 * (a * b)) + (x * 2.0d0))
else
tmp = z * (((2.0d0 * (x / z)) + (27.0d0 * ((a * b) / 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 tmp;
if (z <= 200000.0) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / 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): tmp = 0 if z <= 200000.0: tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0)) else: tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / 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) tmp = 0.0 if (z <= 200000.0) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0))); else tmp = Float64(z * Float64(Float64(Float64(2.0 * Float64(x / z)) + Float64(27.0 * Float64(Float64(a * b) / 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)
tmp = 0.0;
if (z <= 200000.0)
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
else
tmp = z * (((2.0 * (x / z)) + (27.0 * ((a * b) / 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_] := If[LessEqual[z, 200000.0], 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], N[(z * N[(N[(N[(2.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 200000:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(2 \cdot \frac{x}{z} + 27 \cdot \frac{a \cdot b}{z}\right) - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < 2e5Initial program 95.1%
+-commutative95.1%
associate-+r-95.1%
*-commutative95.1%
cancel-sign-sub-inv95.1%
associate-*r*96.2%
distribute-lft-neg-in96.2%
*-commutative96.2%
cancel-sign-sub-inv96.2%
associate-+r-96.2%
associate-*l*96.3%
fma-define96.8%
cancel-sign-sub-inv96.8%
fma-define96.8%
distribute-lft-neg-in96.8%
distribute-rgt-neg-in96.8%
*-commutative96.8%
associate-*r*95.6%
associate-*l*95.7%
neg-mul-195.7%
associate-*r*95.7%
Simplified95.7%
fma-undefine95.1%
fma-undefine95.1%
associate-+r+95.1%
*-commutative95.1%
associate-*l*97.3%
*-commutative97.3%
associate-*r*97.3%
*-commutative97.3%
associate-*r*97.2%
*-commutative97.2%
associate-*l*97.2%
Applied egg-rr97.2%
if 2e5 < z Initial program 88.1%
sub-neg88.1%
sub-neg88.1%
associate-*l*87.1%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in z around inf 95.8%
Final simplification96.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 (<= z 2.85e+43) (+ (* y (* z (* t -9.0))) (+ (* 27.0 (* a b)) (* x 2.0))) (* z (- (* a (* b (/ 27.0 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 tmp;
if (z <= 2.85e+43) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = z * ((a * (b * (27.0 / 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) :: tmp
if (z <= 2.85d+43) then
tmp = (y * (z * (t * (-9.0d0)))) + ((27.0d0 * (a * b)) + (x * 2.0d0))
else
tmp = z * ((a * (b * (27.0d0 / 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 tmp;
if (z <= 2.85e+43) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = z * ((a * (b * (27.0 / 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): tmp = 0 if z <= 2.85e+43: tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0)) else: tmp = z * ((a * (b * (27.0 / 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) tmp = 0.0 if (z <= 2.85e+43) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0))); else tmp = Float64(z * Float64(Float64(a * Float64(b * Float64(27.0 / 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)
tmp = 0.0;
if (z <= 2.85e+43)
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
else
tmp = z * ((a * (b * (27.0 / 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_] := If[LessEqual[z, 2.85e+43], 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], N[(z * N[(N[(a * N[(b * N[(27.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.85 \cdot 10^{+43}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot \left(b \cdot \frac{27}{z}\right) - 9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < 2.8499999999999999e43Initial program 94.8%
+-commutative94.8%
associate-+r-94.8%
*-commutative94.8%
cancel-sign-sub-inv94.8%
associate-*r*95.9%
distribute-lft-neg-in95.9%
*-commutative95.9%
cancel-sign-sub-inv95.9%
associate-+r-95.9%
associate-*l*95.9%
fma-define96.4%
cancel-sign-sub-inv96.4%
fma-define96.4%
distribute-lft-neg-in96.4%
distribute-rgt-neg-in96.4%
*-commutative96.4%
associate-*r*95.3%
associate-*l*95.3%
neg-mul-195.3%
associate-*r*95.3%
Simplified95.3%
fma-undefine94.8%
fma-undefine94.8%
associate-+r+94.8%
*-commutative94.8%
associate-*l*96.9%
*-commutative96.9%
associate-*r*96.9%
*-commutative96.9%
associate-*r*96.8%
*-commutative96.8%
associate-*l*96.8%
Applied egg-rr96.8%
if 2.8499999999999999e43 < z Initial program 88.1%
sub-neg88.1%
sub-neg88.1%
associate-*l*86.9%
associate-*l*86.9%
Simplified86.9%
Taylor expanded in z around inf 95.3%
Taylor expanded in x around 0 75.0%
associate-*r/76.5%
*-commutative76.5%
associate-*r*76.5%
*-commutative76.5%
associate-*r/76.5%
*-commutative76.5%
associate-/l*76.6%
Simplified76.6%
Final simplification91.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 5e-81) (+ (* y (* z (* t -9.0))) (+ (* 27.0 (* a b)) (* x 2.0))) (+ (* a (* 27.0 b)) (- (* x 2.0) (* 9.0 (* z (* y t)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 5e-81) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 5d-81) then
tmp = (y * (z * (t * (-9.0d0)))) + ((27.0d0 * (a * b)) + (x * 2.0d0))
else
tmp = (a * (27.0d0 * b)) + ((x * 2.0d0) - (9.0d0 * (z * (y * t))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 5e-81) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} else {
tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 5e-81: tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0)) else: tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t)))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 5e-81) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0))); else tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t))))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 5e-81)
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
else
tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 5e-81], 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], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5 \cdot 10^{-81}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if z < 4.99999999999999981e-81Initial program 94.4%
+-commutative94.4%
associate-+r-94.4%
*-commutative94.4%
cancel-sign-sub-inv94.4%
associate-*r*96.9%
distribute-lft-neg-in96.9%
*-commutative96.9%
cancel-sign-sub-inv96.9%
associate-+r-96.9%
associate-*l*96.9%
fma-define97.5%
cancel-sign-sub-inv97.5%
fma-define97.5%
distribute-lft-neg-in97.5%
distribute-rgt-neg-in97.5%
*-commutative97.5%
associate-*r*95.1%
associate-*l*95.1%
neg-mul-195.1%
associate-*r*95.1%
Simplified95.1%
fma-undefine94.4%
fma-undefine94.4%
associate-+r+94.4%
*-commutative94.4%
associate-*l*96.9%
*-commutative96.9%
associate-*r*96.9%
*-commutative96.9%
associate-*r*96.9%
*-commutative96.9%
associate-*l*96.9%
Applied egg-rr96.9%
if 4.99999999999999981e-81 < z Initial program 90.7%
sub-neg90.7%
sub-neg90.7%
associate-*l*89.9%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in y around 0 90.8%
associate-*r*92.8%
Simplified92.8%
Final simplification95.4%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 5e-54) (+ (* y (* z (* t -9.0))) (+ (* 27.0 (* a b)) (* x 2.0))) (+ (- (* 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 <= 5e-54) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} 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 <= 5d-54) then
tmp = (y * (z * (t * (-9.0d0)))) + ((27.0d0 * (a * b)) + (x * 2.0d0))
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 <= 5e-54) {
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
} 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 <= 5e-54: tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0)) 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 <= 5e-54) tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0))); 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 <= 5e-54)
tmp = (y * (z * (t * -9.0))) + ((27.0 * (a * b)) + (x * 2.0));
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, 5e-54], 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], 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 5 \cdot 10^{-54}:\\
\;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + \left(27 \cdot \left(a \cdot b\right) + x \cdot 2\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 < 5.00000000000000015e-54Initial program 94.7%
+-commutative94.7%
associate-+r-94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-*r*96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
cancel-sign-sub-inv96.0%
associate-+r-96.0%
associate-*l*96.0%
fma-define96.6%
cancel-sign-sub-inv96.6%
fma-define96.6%
distribute-lft-neg-in96.6%
distribute-rgt-neg-in96.6%
*-commutative96.6%
associate-*r*95.3%
associate-*l*95.3%
neg-mul-195.3%
associate-*r*95.3%
Simplified95.3%
fma-undefine94.7%
fma-undefine94.7%
associate-+r+94.7%
*-commutative94.7%
associate-*l*97.1%
*-commutative97.1%
associate-*r*97.1%
*-commutative97.1%
associate-*r*97.1%
*-commutative97.1%
associate-*l*97.0%
Applied egg-rr97.0%
if 5.00000000000000015e-54 < z Initial program 89.8%
Final simplification94.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.28e-19)
(* b (+ (* 2.0 (/ x b)) (* a 27.0)))
(if (<= b 0.019)
(- (* x 2.0) (* 9.0 (* t (* z y))))
(+ (* 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.28e-19) {
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
} else if (b <= 0.019) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (27.0 * (a * b)) + (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.28d-19)) then
tmp = b * ((2.0d0 * (x / b)) + (a * 27.0d0))
else if (b <= 0.019d0) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
else
tmp = (27.0d0 * (a * b)) + (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.28e-19) {
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
} else if (b <= 0.019) {
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
} else {
tmp = (27.0 * (a * b)) + (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.28e-19: tmp = b * ((2.0 * (x / b)) + (a * 27.0)) elif b <= 0.019: tmp = (x * 2.0) - (9.0 * (t * (z * y))) else: tmp = (27.0 * (a * b)) + (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.28e-19) tmp = Float64(b * Float64(Float64(2.0 * Float64(x / b)) + Float64(a * 27.0))); elseif (b <= 0.019) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y)))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + 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.28e-19)
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
elseif (b <= 0.019)
tmp = (x * 2.0) - (9.0 * (t * (z * y)));
else
tmp = (27.0 * (a * b)) + (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[LessEqual[b, -1.28e-19], N[(b * N[(N[(2.0 * N[(x / b), $MachinePrecision]), $MachinePrecision] + N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.019], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $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.28 \cdot 10^{-19}:\\
\;\;\;\;b \cdot \left(2 \cdot \frac{x}{b} + a \cdot 27\right)\\
\mathbf{elif}\;b \leq 0.019:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if b < -1.27999999999999988e-19Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*97.1%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in y around 0 66.7%
Taylor expanded in b around inf 66.7%
if -1.27999999999999988e-19 < b < 0.0189999999999999995Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in a around 0 81.3%
if 0.0189999999999999995 < b Initial program 88.1%
sub-neg88.1%
sub-neg88.1%
associate-*l*88.2%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in y around 0 86.6%
Final simplification78.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 -6.7e-23)
(* b (+ (* 2.0 (/ x b)) (* a 27.0)))
(if (<= b 0.00155)
(- (* x 2.0) (* 9.0 (* z (* y t))))
(+ (* 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 <= -6.7e-23) {
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
} else if (b <= 0.00155) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else {
tmp = (27.0 * (a * b)) + (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 <= (-6.7d-23)) then
tmp = b * ((2.0d0 * (x / b)) + (a * 27.0d0))
else if (b <= 0.00155d0) then
tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
else
tmp = (27.0d0 * (a * b)) + (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 <= -6.7e-23) {
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
} else if (b <= 0.00155) {
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
} else {
tmp = (27.0 * (a * b)) + (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 <= -6.7e-23: tmp = b * ((2.0 * (x / b)) + (a * 27.0)) elif b <= 0.00155: tmp = (x * 2.0) - (9.0 * (z * (y * t))) else: tmp = (27.0 * (a * b)) + (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 <= -6.7e-23) tmp = Float64(b * Float64(Float64(2.0 * Float64(x / b)) + Float64(a * 27.0))); elseif (b <= 0.00155) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))); else tmp = Float64(Float64(27.0 * Float64(a * b)) + 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 <= -6.7e-23)
tmp = b * ((2.0 * (x / b)) + (a * 27.0));
elseif (b <= 0.00155)
tmp = (x * 2.0) - (9.0 * (z * (y * t)));
else
tmp = (27.0 * (a * b)) + (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[LessEqual[b, -6.7e-23], N[(b * N[(N[(2.0 * N[(x / b), $MachinePrecision]), $MachinePrecision] + N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.00155], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $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 -6.7 \cdot 10^{-23}:\\
\;\;\;\;b \cdot \left(2 \cdot \frac{x}{b} + a \cdot 27\right)\\
\mathbf{elif}\;b \leq 0.00155:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if b < -6.69999999999999969e-23Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*97.1%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in y around 0 66.7%
Taylor expanded in b around inf 66.7%
if -6.69999999999999969e-23 < b < 0.00154999999999999995Initial program 95.3%
sub-neg95.3%
sub-neg95.3%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in a around 0 81.3%
pow144.3%
*-commutative44.3%
associate-*l*43.7%
Applied egg-rr81.4%
unpow143.7%
associate-*r*44.3%
*-commutative44.3%
associate-*l*44.3%
*-commutative44.3%
Simplified82.8%
if 0.00154999999999999995 < b Initial program 88.1%
sub-neg88.1%
sub-neg88.1%
associate-*l*88.2%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in y around 0 86.6%
Final simplification79.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -7.2e+67) (* -9.0 (* z (* y t))) (if (<= z 5.2e+76) (+ (* 27.0 (* a b)) (* x 2.0)) (* -9.0 (* t (* z y))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.2e+67) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 5.2e+76) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-7.2d+67)) then
tmp = (-9.0d0) * (z * (y * t))
else if (z <= 5.2d+76) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (-9.0d0) * (t * (z * y))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.2e+67) {
tmp = -9.0 * (z * (y * t));
} else if (z <= 5.2e+76) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = -9.0 * (t * (z * y));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -7.2e+67: tmp = -9.0 * (z * (y * t)) elif z <= 5.2e+76: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = -9.0 * (t * (z * y)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.2e+67) tmp = Float64(-9.0 * Float64(z * Float64(y * t))); elseif (z <= 5.2e+76) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(-9.0 * Float64(t * Float64(z * y))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -7.2e+67)
tmp = -9.0 * (z * (y * t));
elseif (z <= 5.2e+76)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = -9.0 * (t * (z * y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.2e+67], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+76], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+67}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+76}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -7.1999999999999998e67Initial program 83.1%
sub-neg83.1%
sub-neg83.1%
associate-*l*89.6%
associate-*l*89.7%
Simplified89.7%
Taylor expanded in y around inf 55.7%
pow155.7%
*-commutative55.7%
associate-*l*56.0%
Applied egg-rr56.0%
unpow156.0%
associate-*r*55.7%
*-commutative55.7%
associate-*l*59.9%
*-commutative59.9%
Simplified59.9%
if -7.1999999999999998e67 < z < 5.1999999999999999e76Initial program 98.5%
sub-neg98.5%
sub-neg98.5%
associate-*l*97.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in y around 0 81.8%
if 5.1999999999999999e76 < z Initial program 86.5%
sub-neg86.5%
sub-neg86.5%
associate-*l*88.4%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in y around inf 55.8%
Final simplification72.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -8e-37) (not (<= a 5.6e-189))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8e-37) || !(a <= 5.6e-189)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-8d-37)) .or. (.not. (a <= 5.6d-189))) then
tmp = 27.0d0 * (a * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -8e-37) || !(a <= 5.6e-189)) {
tmp = 27.0 * (a * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -8e-37) or not (a <= 5.6e-189): tmp = 27.0 * (a * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -8e-37) || !(a <= 5.6e-189)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -8e-37) || ~((a <= 5.6e-189)))
tmp = 27.0 * (a * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -8e-37], N[Not[LessEqual[a, 5.6e-189]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{-37} \lor \neg \left(a \leq 5.6 \cdot 10^{-189}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -8.00000000000000053e-37 or 5.5999999999999999e-189 < a Initial program 92.4%
sub-neg92.4%
sub-neg92.4%
associate-*l*93.6%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in a around inf 50.2%
if -8.00000000000000053e-37 < a < 5.5999999999999999e-189Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 45.9%
Final simplification48.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 (<= a -1.8e-38) (not (<= a 5.6e-189))) (* b (* a 27.0)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.8e-38) || !(a <= 5.6e-189)) {
tmp = b * (a * 27.0);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-1.8d-38)) .or. (.not. (a <= 5.6d-189))) then
tmp = b * (a * 27.0d0)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.8e-38) || !(a <= 5.6e-189)) {
tmp = b * (a * 27.0);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.8e-38) or not (a <= 5.6e-189): tmp = b * (a * 27.0) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.8e-38) || !(a <= 5.6e-189)) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -1.8e-38) || ~((a <= 5.6e-189)))
tmp = b * (a * 27.0);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.8e-38], N[Not[LessEqual[a, 5.6e-189]], $MachinePrecision]], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{-38} \lor \neg \left(a \leq 5.6 \cdot 10^{-189}\right):\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -1.8e-38 or 5.5999999999999999e-189 < a Initial program 92.4%
sub-neg92.4%
sub-neg92.4%
associate-*l*93.6%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in a around inf 50.2%
associate-*r*50.2%
Simplified50.2%
if -1.8e-38 < a < 5.5999999999999999e-189Initial program 94.2%
sub-neg94.2%
sub-neg94.2%
associate-*l*95.5%
associate-*l*95.5%
Simplified95.5%
Taylor expanded in x around inf 45.9%
Final simplification48.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 (* x 2.0))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * 2.0d0
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(x * 2.0) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x * 2.0;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*94.3%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in x around inf 30.0%
Final simplification30.0%
(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 2024095
(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)))