
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -2.15e-95) (* y (- (+ (* 2.0 (/ x y)) (* 27.0 (/ (* a b) y))) (* 9.0 (* z t)))) (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.15e-95) {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * t)));
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.15e-95) tmp = Float64(y * Float64(Float64(Float64(2.0 * Float64(x / y)) + Float64(27.0 * Float64(Float64(a * b) / y))) - Float64(9.0 * Float64(z * t)))); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0))))); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.15e-95], N[(y * N[(N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $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 -2.15 \cdot 10^{-95}:\\
\;\;\;\;y \cdot \left(\left(2 \cdot \frac{x}{y} + 27 \cdot \frac{a \cdot b}{y}\right) - 9 \cdot \left(z \cdot t\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 < -2.14999999999999999e-95Initial program 94.2%
associate-+l-94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*93.1%
associate-+l-93.1%
associate-*l*94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*90.1%
associate-*l*89.0%
Simplified89.0%
Taylor expanded in y around inf 65.4%
if -2.14999999999999999e-95 < z Initial program 96.4%
+-commutative96.4%
associate-+r-96.4%
*-commutative96.4%
cancel-sign-sub-inv96.4%
associate-*r*94.7%
distribute-lft-neg-in94.7%
*-commutative94.7%
cancel-sign-sub-inv94.7%
associate-+r-94.7%
associate-*l*94.8%
fma-define95.4%
cancel-sign-sub-inv95.4%
fma-define95.4%
distribute-lft-neg-in95.4%
distribute-rgt-neg-in95.4%
*-commutative95.4%
associate-*r*97.0%
associate-*l*97.1%
neg-mul-197.1%
associate-*r*97.1%
Simplified97.1%
Final simplification86.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 (* 27.0 a))))
(if (<= t -1.3e-104)
(* -9.0 (* y (* z t)))
(if (<= t 3.1e-260)
t_1
(if (<= t 1.72e-230)
(* 2.0 x)
(if (<= t 2.3e-37)
t_1
(if (<= t 1.2e+52)
(* 2.0 x)
(if (<= t 4e+81) (* 27.0 (* a b)) (* -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 * (27.0 * a);
double tmp;
if (t <= -1.3e-104) {
tmp = -9.0 * (y * (z * t));
} else if (t <= 3.1e-260) {
tmp = t_1;
} else if (t <= 1.72e-230) {
tmp = 2.0 * x;
} else if (t <= 2.3e-37) {
tmp = t_1;
} else if (t <= 1.2e+52) {
tmp = 2.0 * x;
} else if (t <= 4e+81) {
tmp = 27.0 * (a * b);
} 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 * (27.0d0 * a)
if (t <= (-1.3d-104)) then
tmp = (-9.0d0) * (y * (z * t))
else if (t <= 3.1d-260) then
tmp = t_1
else if (t <= 1.72d-230) then
tmp = 2.0d0 * x
else if (t <= 2.3d-37) then
tmp = t_1
else if (t <= 1.2d+52) then
tmp = 2.0d0 * x
else if (t <= 4d+81) then
tmp = 27.0d0 * (a * b)
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 * (27.0 * a);
double tmp;
if (t <= -1.3e-104) {
tmp = -9.0 * (y * (z * t));
} else if (t <= 3.1e-260) {
tmp = t_1;
} else if (t <= 1.72e-230) {
tmp = 2.0 * x;
} else if (t <= 2.3e-37) {
tmp = t_1;
} else if (t <= 1.2e+52) {
tmp = 2.0 * x;
} else if (t <= 4e+81) {
tmp = 27.0 * (a * b);
} 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 * (27.0 * a) tmp = 0 if t <= -1.3e-104: tmp = -9.0 * (y * (z * t)) elif t <= 3.1e-260: tmp = t_1 elif t <= 1.72e-230: tmp = 2.0 * x elif t <= 2.3e-37: tmp = t_1 elif t <= 1.2e+52: tmp = 2.0 * x elif t <= 4e+81: tmp = 27.0 * (a * b) 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(27.0 * a)) tmp = 0.0 if (t <= -1.3e-104) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (t <= 3.1e-260) tmp = t_1; elseif (t <= 1.72e-230) tmp = Float64(2.0 * x); elseif (t <= 2.3e-37) tmp = t_1; elseif (t <= 1.2e+52) tmp = Float64(2.0 * x); elseif (t <= 4e+81) tmp = Float64(27.0 * Float64(a * b)); 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 * (27.0 * a);
tmp = 0.0;
if (t <= -1.3e-104)
tmp = -9.0 * (y * (z * t));
elseif (t <= 3.1e-260)
tmp = t_1;
elseif (t <= 1.72e-230)
tmp = 2.0 * x;
elseif (t <= 2.3e-37)
tmp = t_1;
elseif (t <= 1.2e+52)
tmp = 2.0 * x;
elseif (t <= 4e+81)
tmp = 27.0 * (a * b);
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[(27.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.3e-104], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e-260], t$95$1, If[LessEqual[t, 1.72e-230], N[(2.0 * x), $MachinePrecision], If[LessEqual[t, 2.3e-37], t$95$1, If[LessEqual[t, 1.2e+52], N[(2.0 * x), $MachinePrecision], If[LessEqual[t, 4e+81], N[(27.0 * N[(a * b), $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}
t_1 := b \cdot \left(27 \cdot a\right)\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{-104}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-260}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.72 \cdot 10^{-230}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+52}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+81}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if t < -1.30000000000000001e-104Initial program 97.8%
associate-+l-97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*97.8%
associate-+l-97.8%
associate-*l*97.8%
*-commutative97.8%
*-commutative97.8%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in x around inf 84.9%
Taylor expanded in t around inf 46.7%
associate-*r*43.8%
*-commutative43.8%
associate-*r*44.7%
Simplified44.7%
if -1.30000000000000001e-104 < t < 3.09999999999999983e-260 or 1.71999999999999999e-230 < t < 2.3e-37Initial program 94.0%
associate-+l-94.0%
*-commutative94.0%
*-commutative94.0%
associate-*l*94.0%
associate-+l-94.0%
associate-*l*94.0%
*-commutative94.0%
*-commutative94.0%
associate-*l*98.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in a around inf 50.5%
associate-*r*50.4%
Simplified50.4%
if 3.09999999999999983e-260 < t < 1.71999999999999999e-230 or 2.3e-37 < t < 1.2e52Initial program 95.9%
associate-+l-95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*92.2%
associate-+l-92.2%
associate-*l*95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 45.7%
if 1.2e52 < t < 3.99999999999999969e81Initial program 99.6%
associate-+l-99.6%
*-commutative99.6%
*-commutative99.6%
associate-*l*99.6%
associate-+l-99.6%
associate-*l*99.6%
*-commutative99.6%
*-commutative99.6%
associate-*l*99.6%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 51.8%
if 3.99999999999999969e81 < t Initial program 94.0%
associate-+l-94.0%
*-commutative94.0%
*-commutative94.0%
associate-*l*93.8%
associate-+l-93.8%
associate-*l*94.0%
*-commutative94.0%
*-commutative94.0%
associate-*l*74.8%
associate-*l*74.8%
Simplified74.8%
Taylor expanded in y around inf 79.5%
Final simplification51.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
(let* ((t_1 (* b (* 27.0 a))) (t_2 (* -9.0 (* t (* z y)))))
(if (<= t -2.4e-100)
t_2
(if (<= t 4.1e-260)
t_1
(if (<= t 1.56e-229)
(* 2.0 x)
(if (<= t 3.5e-37)
t_1
(if (<= t 1.7e+52)
(* 2.0 x)
(if (<= t 5.8e+81) (* 27.0 (* a b)) t_2))))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (27.0 * a);
double t_2 = -9.0 * (t * (z * y));
double tmp;
if (t <= -2.4e-100) {
tmp = t_2;
} else if (t <= 4.1e-260) {
tmp = t_1;
} else if (t <= 1.56e-229) {
tmp = 2.0 * x;
} else if (t <= 3.5e-37) {
tmp = t_1;
} else if (t <= 1.7e+52) {
tmp = 2.0 * x;
} else if (t <= 5.8e+81) {
tmp = 27.0 * (a * b);
} 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 = b * (27.0d0 * a)
t_2 = (-9.0d0) * (t * (z * y))
if (t <= (-2.4d-100)) then
tmp = t_2
else if (t <= 4.1d-260) then
tmp = t_1
else if (t <= 1.56d-229) then
tmp = 2.0d0 * x
else if (t <= 3.5d-37) then
tmp = t_1
else if (t <= 1.7d+52) then
tmp = 2.0d0 * x
else if (t <= 5.8d+81) then
tmp = 27.0d0 * (a * b)
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 = b * (27.0 * a);
double t_2 = -9.0 * (t * (z * y));
double tmp;
if (t <= -2.4e-100) {
tmp = t_2;
} else if (t <= 4.1e-260) {
tmp = t_1;
} else if (t <= 1.56e-229) {
tmp = 2.0 * x;
} else if (t <= 3.5e-37) {
tmp = t_1;
} else if (t <= 1.7e+52) {
tmp = 2.0 * x;
} else if (t <= 5.8e+81) {
tmp = 27.0 * (a * b);
} 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 = b * (27.0 * a) t_2 = -9.0 * (t * (z * y)) tmp = 0 if t <= -2.4e-100: tmp = t_2 elif t <= 4.1e-260: tmp = t_1 elif t <= 1.56e-229: tmp = 2.0 * x elif t <= 3.5e-37: tmp = t_1 elif t <= 1.7e+52: tmp = 2.0 * x elif t <= 5.8e+81: tmp = 27.0 * (a * b) 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(b * Float64(27.0 * a)) t_2 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (t <= -2.4e-100) tmp = t_2; elseif (t <= 4.1e-260) tmp = t_1; elseif (t <= 1.56e-229) tmp = Float64(2.0 * x); elseif (t <= 3.5e-37) tmp = t_1; elseif (t <= 1.7e+52) tmp = Float64(2.0 * x); elseif (t <= 5.8e+81) tmp = Float64(27.0 * Float64(a * b)); 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 = b * (27.0 * a);
t_2 = -9.0 * (t * (z * y));
tmp = 0.0;
if (t <= -2.4e-100)
tmp = t_2;
elseif (t <= 4.1e-260)
tmp = t_1;
elseif (t <= 1.56e-229)
tmp = 2.0 * x;
elseif (t <= 3.5e-37)
tmp = t_1;
elseif (t <= 1.7e+52)
tmp = 2.0 * x;
elseif (t <= 5.8e+81)
tmp = 27.0 * (a * b);
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[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e-100], t$95$2, If[LessEqual[t, 4.1e-260], t$95$1, If[LessEqual[t, 1.56e-229], N[(2.0 * x), $MachinePrecision], If[LessEqual[t, 3.5e-37], t$95$1, If[LessEqual[t, 1.7e+52], N[(2.0 * x), $MachinePrecision], If[LessEqual[t, 5.8e+81], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], 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 := b \cdot \left(27 \cdot a\right)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{-100}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 4.1 \cdot 10^{-260}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.56 \cdot 10^{-229}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+52}:\\
\;\;\;\;2 \cdot x\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+81}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.4000000000000003e-100 or 5.7999999999999999e81 < t Initial program 96.7%
associate-+l-96.7%
*-commutative96.7%
*-commutative96.7%
associate-*l*96.7%
associate-+l-96.7%
associate-*l*96.7%
*-commutative96.7%
*-commutative96.7%
associate-*l*89.5%
associate-*l*89.5%
Simplified89.5%
Taylor expanded in y around inf 55.7%
if -2.4000000000000003e-100 < t < 4.09999999999999997e-260 or 1.5600000000000001e-229 < t < 3.5000000000000001e-37Initial program 94.1%
associate-+l-94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*94.1%
associate-+l-94.1%
associate-*l*94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*98.9%
associate-*l*98.0%
Simplified98.0%
Taylor expanded in a around inf 51.0%
associate-*r*50.9%
Simplified50.9%
if 4.09999999999999997e-260 < t < 1.5600000000000001e-229 or 3.5000000000000001e-37 < t < 1.7e52Initial program 95.9%
associate-+l-95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*92.2%
associate-+l-92.2%
associate-*l*95.9%
*-commutative95.9%
*-commutative95.9%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 45.7%
if 1.7e52 < t < 5.7999999999999999e81Initial program 99.6%
associate-+l-99.6%
*-commutative99.6%
*-commutative99.6%
associate-*l*99.6%
associate-+l-99.6%
associate-*l*99.6%
*-commutative99.6%
*-commutative99.6%
associate-*l*99.6%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 51.8%
Final simplification52.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 (<= z -1.2e+75)
(not (or (<= z -2.7e+15) (and (not (<= z -1.9e-64)) (<= z 1.5e-91)))))
(+ (* 2.0 x) (* z (* -9.0 (* y t))))
(+ (* 2.0 x) (* 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 ((z <= -1.2e+75) || !((z <= -2.7e+15) || (!(z <= -1.9e-64) && (z <= 1.5e-91)))) {
tmp = (2.0 * x) + (z * (-9.0 * (y * t)));
} else {
tmp = (2.0 * x) + (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 ((z <= (-1.2d+75)) .or. (.not. (z <= (-2.7d+15)) .or. (.not. (z <= (-1.9d-64))) .and. (z <= 1.5d-91))) then
tmp = (2.0d0 * x) + (z * ((-9.0d0) * (y * t)))
else
tmp = (2.0d0 * x) + (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 ((z <= -1.2e+75) || !((z <= -2.7e+15) || (!(z <= -1.9e-64) && (z <= 1.5e-91)))) {
tmp = (2.0 * x) + (z * (-9.0 * (y * t)));
} else {
tmp = (2.0 * x) + (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 (z <= -1.2e+75) or not ((z <= -2.7e+15) or (not (z <= -1.9e-64) and (z <= 1.5e-91))): tmp = (2.0 * x) + (z * (-9.0 * (y * t))) else: tmp = (2.0 * x) + (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 ((z <= -1.2e+75) || !((z <= -2.7e+15) || (!(z <= -1.9e-64) && (z <= 1.5e-91)))) tmp = Float64(Float64(2.0 * x) + Float64(z * Float64(-9.0 * Float64(y * t)))); else tmp = Float64(Float64(2.0 * x) + 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 ((z <= -1.2e+75) || ~(((z <= -2.7e+15) || (~((z <= -1.9e-64)) && (z <= 1.5e-91)))))
tmp = (2.0 * x) + (z * (-9.0 * (y * t)));
else
tmp = (2.0 * x) + (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[Or[LessEqual[z, -1.2e+75], N[Not[Or[LessEqual[z, -2.7e+15], And[N[Not[LessEqual[z, -1.9e-64]], $MachinePrecision], LessEqual[z, 1.5e-91]]]], $MachinePrecision]], N[(N[(2.0 * x), $MachinePrecision] + N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $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}\;z \leq -1.2 \cdot 10^{+75} \lor \neg \left(z \leq -2.7 \cdot 10^{+15} \lor \neg \left(z \leq -1.9 \cdot 10^{-64}\right) \land z \leq 1.5 \cdot 10^{-91}\right):\\
\;\;\;\;2 \cdot x + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -1.2e75 or -2.7e15 < z < -1.9000000000000001e-64 or 1.5000000000000001e-91 < z Initial program 92.7%
associate-+l-92.7%
*-commutative92.7%
*-commutative92.7%
associate-*l*92.1%
associate-+l-92.1%
associate-*l*92.7%
*-commutative92.7%
*-commutative92.7%
associate-*l*90.4%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in a around 0 73.4%
cancel-sign-sub-inv73.4%
*-commutative73.4%
associate-*r*75.9%
associate-*r*75.9%
distribute-lft-neg-in75.9%
*-commutative75.9%
distribute-rgt-neg-in75.9%
*-commutative75.9%
metadata-eval75.9%
Applied egg-rr75.9%
if -1.2e75 < z < -2.7e15 or -1.9000000000000001e-64 < z < 1.5000000000000001e-91Initial program 99.8%
associate-+l-99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 87.2%
Final simplification80.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 (* y 9.0)) 4e+223) (+ (- (* 2.0 x) (* t (* y (* z 9.0)))) (* b (* 27.0 a))) (* y (- (+ (* 2.0 (/ x y)) (* 27.0 (/ (* a b) y))) (* 9.0 (* z 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 * (y * 9.0)) <= 4e+223) {
tmp = ((2.0 * x) - (t * (y * (z * 9.0)))) + (b * (27.0 * a));
} else {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * 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 * (y * 9.0d0)) <= 4d+223) then
tmp = ((2.0d0 * x) - (t * (y * (z * 9.0d0)))) + (b * (27.0d0 * a))
else
tmp = y * (((2.0d0 * (x / y)) + (27.0d0 * ((a * b) / y))) - (9.0d0 * (z * 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 * (y * 9.0)) <= 4e+223) {
tmp = ((2.0 * x) - (t * (y * (z * 9.0)))) + (b * (27.0 * a));
} else {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * 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 * (y * 9.0)) <= 4e+223: tmp = ((2.0 * x) - (t * (y * (z * 9.0)))) + (b * (27.0 * a)) else: tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * 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 (Float64(z * Float64(y * 9.0)) <= 4e+223) tmp = Float64(Float64(Float64(2.0 * x) - Float64(t * Float64(y * Float64(z * 9.0)))) + Float64(b * Float64(27.0 * a))); else tmp = Float64(y * Float64(Float64(Float64(2.0 * Float64(x / y)) + Float64(27.0 * Float64(Float64(a * b) / y))) - Float64(9.0 * Float64(z * 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 * (y * 9.0)) <= 4e+223)
tmp = ((2.0 * x) - (t * (y * (z * 9.0)))) + (b * (27.0 * a));
else
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * 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[N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision], 4e+223], N[(N[(N[(2.0 * x), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * 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 \cdot \left(y \cdot 9\right) \leq 4 \cdot 10^{+223}:\\
\;\;\;\;\left(2 \cdot x - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\left(2 \cdot \frac{x}{y} + 27 \cdot \frac{a \cdot b}{y}\right) - 9 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 4.00000000000000019e223Initial program 97.6%
Taylor expanded in y around 0 97.6%
pow197.6%
associate-*r*97.6%
Applied egg-rr97.6%
unpow197.6%
*-commutative97.6%
associate-*l*97.6%
Simplified97.6%
if 4.00000000000000019e223 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 82.2%
associate-+l-82.2%
*-commutative82.2%
*-commutative82.2%
associate-*l*79.3%
associate-+l-79.3%
associate-*l*82.2%
*-commutative82.2%
*-commutative82.2%
associate-*l*96.6%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in y around inf 96.8%
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 (if (<= (* z (* y 9.0)) 1e+275) (+ (- (* 2.0 x) (* t (* 9.0 (* z y)))) (* b (* 27.0 a))) (+ (+ (* y (* z (* t -9.0))) (* 2.0 x)) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z * (y * 9.0)) <= 1e+275) {
tmp = ((2.0 * x) - (t * (9.0 * (z * y)))) + (b * (27.0 * a));
} else {
tmp = ((y * (z * (t * -9.0))) + (2.0 * x)) + (a * (27.0 * b));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z * (y * 9.0d0)) <= 1d+275) then
tmp = ((2.0d0 * x) - (t * (9.0d0 * (z * y)))) + (b * (27.0d0 * a))
else
tmp = ((y * (z * (t * (-9.0d0)))) + (2.0d0 * x)) + (a * (27.0d0 * b))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z * (y * 9.0)) <= 1e+275) {
tmp = ((2.0 * x) - (t * (9.0 * (z * y)))) + (b * (27.0 * a));
} else {
tmp = ((y * (z * (t * -9.0))) + (2.0 * x)) + (a * (27.0 * b));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (z * (y * 9.0)) <= 1e+275: tmp = ((2.0 * x) - (t * (9.0 * (z * y)))) + (b * (27.0 * a)) else: tmp = ((y * (z * (t * -9.0))) + (2.0 * x)) + (a * (27.0 * b)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(z * Float64(y * 9.0)) <= 1e+275) tmp = Float64(Float64(Float64(2.0 * x) - Float64(t * Float64(9.0 * Float64(z * y)))) + Float64(b * Float64(27.0 * a))); else tmp = Float64(Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(2.0 * x)) + Float64(a * Float64(27.0 * b))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z * (y * 9.0)) <= 1e+275)
tmp = ((2.0 * x) - (t * (9.0 * (z * y)))) + (b * (27.0 * a));
else
tmp = ((y * (z * (t * -9.0))) + (2.0 * x)) + (a * (27.0 * b));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision], 1e+275], N[(N[(N[(2.0 * x), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot \left(y \cdot 9\right) \leq 10^{+275}:\\
\;\;\;\;\left(2 \cdot x - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + 2 \cdot x\right) + a \cdot \left(27 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 9.9999999999999996e274Initial program 97.7%
Taylor expanded in y around 0 97.7%
if 9.9999999999999996e274 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 75.4%
associate-+l-75.4%
*-commutative75.4%
*-commutative75.4%
associate-*l*75.4%
associate-+l-75.4%
associate-*l*75.4%
*-commutative75.4%
*-commutative75.4%
associate-*l*95.4%
associate-*l*95.4%
Simplified95.4%
sub-neg95.4%
*-commutative95.4%
distribute-rgt-neg-in95.4%
*-commutative95.4%
distribute-lft-neg-in95.4%
metadata-eval95.4%
associate-*l*95.6%
associate-*r*95.6%
*-commutative95.6%
Applied egg-rr95.6%
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 (if (<= z 2e+96) (+ (+ (* y (* z (* t -9.0))) (* 2.0 x)) (* a (* 27.0 b))) (* t (+ (* -9.0 (* z y)) (* 2.0 (/ x 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 <= 2e+96) {
tmp = ((y * (z * (t * -9.0))) + (2.0 * x)) + (a * (27.0 * b));
} else {
tmp = t * ((-9.0 * (z * y)) + (2.0 * (x / 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 <= 2d+96) then
tmp = ((y * (z * (t * (-9.0d0)))) + (2.0d0 * x)) + (a * (27.0d0 * b))
else
tmp = t * (((-9.0d0) * (z * y)) + (2.0d0 * (x / 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 <= 2e+96) {
tmp = ((y * (z * (t * -9.0))) + (2.0 * x)) + (a * (27.0 * b));
} else {
tmp = t * ((-9.0 * (z * y)) + (2.0 * (x / 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 <= 2e+96: tmp = ((y * (z * (t * -9.0))) + (2.0 * x)) + (a * (27.0 * b)) else: tmp = t * ((-9.0 * (z * y)) + (2.0 * (x / 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 <= 2e+96) tmp = Float64(Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(2.0 * x)) + Float64(a * Float64(27.0 * b))); else tmp = Float64(t * Float64(Float64(-9.0 * Float64(z * y)) + Float64(2.0 * Float64(x / 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 <= 2e+96)
tmp = ((y * (z * (t * -9.0))) + (2.0 * x)) + (a * (27.0 * b));
else
tmp = t * ((-9.0 * (z * y)) + (2.0 * (x / 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, 2e+96], N[(N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x / 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 \cdot 10^{+96}:\\
\;\;\;\;\left(y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + 2 \cdot x\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right) + 2 \cdot \frac{x}{t}\right)\\
\end{array}
\end{array}
if z < 2.0000000000000001e96Initial program 97.4%
associate-+l-97.4%
*-commutative97.4%
*-commutative97.4%
associate-*l*97.0%
associate-+l-97.0%
associate-*l*97.4%
*-commutative97.4%
*-commutative97.4%
associate-*l*95.4%
associate-*l*94.9%
Simplified94.9%
sub-neg94.9%
*-commutative94.9%
distribute-rgt-neg-in94.9%
*-commutative94.9%
distribute-lft-neg-in94.9%
metadata-eval94.9%
associate-*l*95.0%
associate-*r*95.0%
*-commutative95.0%
Applied egg-rr95.0%
if 2.0000000000000001e96 < z Initial program 87.6%
associate-+l-87.6%
*-commutative87.6%
*-commutative87.6%
associate-*l*87.6%
associate-+l-87.6%
associate-*l*87.6%
*-commutative87.6%
*-commutative87.6%
associate-*l*89.6%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in a around 0 81.2%
cancel-sign-sub-inv81.2%
*-commutative81.2%
associate-*r*91.4%
associate-*r*91.4%
distribute-lft-neg-in91.4%
*-commutative91.4%
distribute-rgt-neg-in91.4%
*-commutative91.4%
metadata-eval91.4%
Applied egg-rr91.4%
Taylor expanded in x around inf 77.2%
*-commutative77.2%
associate-/l*77.3%
Simplified77.3%
Taylor expanded in t around inf 71.1%
Final simplification90.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 (<= z -4.8e-96)
(* y (+ (* 27.0 (/ (* a b) y)) (* (* z t) -9.0)))
(if (<= z 2.1e-90)
(+ (* 2.0 x) (* 27.0 (* a b)))
(+ (* 2.0 x) (* 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 <= -4.8e-96) {
tmp = y * ((27.0 * ((a * b) / y)) + ((z * t) * -9.0));
} else if (z <= 2.1e-90) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = (2.0 * x) + (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 <= (-4.8d-96)) then
tmp = y * ((27.0d0 * ((a * b) / y)) + ((z * t) * (-9.0d0)))
else if (z <= 2.1d-90) then
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
else
tmp = (2.0d0 * x) + (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 <= -4.8e-96) {
tmp = y * ((27.0 * ((a * b) / y)) + ((z * t) * -9.0));
} else if (z <= 2.1e-90) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = (2.0 * x) + (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 <= -4.8e-96: tmp = y * ((27.0 * ((a * b) / y)) + ((z * t) * -9.0)) elif z <= 2.1e-90: tmp = (2.0 * x) + (27.0 * (a * b)) else: tmp = (2.0 * x) + (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 <= -4.8e-96) tmp = Float64(y * Float64(Float64(27.0 * Float64(Float64(a * b) / y)) + Float64(Float64(z * t) * -9.0))); elseif (z <= 2.1e-90) tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(2.0 * x) + Float64(z * Float64(-9.0 * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -4.8e-96)
tmp = y * ((27.0 * ((a * b) / y)) + ((z * t) * -9.0));
elseif (z <= 2.1e-90)
tmp = (2.0 * x) + (27.0 * (a * b));
else
tmp = (2.0 * x) + (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, -4.8e-96], N[(y * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-90], N[(N[(2.0 * x), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $MachinePrecision] + N[(z * 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 -4.8 \cdot 10^{-96}:\\
\;\;\;\;y \cdot \left(27 \cdot \frac{a \cdot b}{y} + \left(z \cdot t\right) \cdot -9\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-90}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -4.80000000000000038e-96Initial program 94.2%
associate-+l-94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*93.1%
associate-+l-93.1%
associate-*l*94.2%
*-commutative94.2%
*-commutative94.2%
associate-*l*90.1%
associate-*l*89.0%
Simplified89.0%
Taylor expanded in z around inf 93.2%
Taylor expanded in x around 0 71.5%
*-commutative71.5%
*-commutative71.5%
associate-*l*71.5%
Simplified71.5%
Taylor expanded in y around inf 56.1%
if -4.80000000000000038e-96 < z < 2.0999999999999999e-90Initial program 99.8%
associate-+l-99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.6%
if 2.0999999999999999e-90 < z Initial program 92.8%
associate-+l-92.8%
*-commutative92.8%
*-commutative92.8%
associate-*l*92.7%
associate-+l-92.7%
associate-*l*92.8%
*-commutative92.8%
*-commutative92.8%
associate-*l*93.0%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in a around 0 75.8%
cancel-sign-sub-inv75.8%
*-commutative75.8%
associate-*r*81.7%
associate-*r*81.6%
distribute-lft-neg-in81.6%
*-commutative81.6%
distribute-rgt-neg-in81.6%
*-commutative81.6%
metadata-eval81.6%
Applied egg-rr81.6%
Final simplification74.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 -3.3e-91)
(+ (* a (* 27.0 b)) (* z (* y (* t -9.0))))
(if (<= z 1.8e-88)
(+ (* 2.0 x) (* 27.0 (* a b)))
(+ (* 2.0 x) (* 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 <= -3.3e-91) {
tmp = (a * (27.0 * b)) + (z * (y * (t * -9.0)));
} else if (z <= 1.8e-88) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = (2.0 * x) + (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 <= (-3.3d-91)) then
tmp = (a * (27.0d0 * b)) + (z * (y * (t * (-9.0d0))))
else if (z <= 1.8d-88) then
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
else
tmp = (2.0d0 * x) + (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 <= -3.3e-91) {
tmp = (a * (27.0 * b)) + (z * (y * (t * -9.0)));
} else if (z <= 1.8e-88) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = (2.0 * x) + (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 <= -3.3e-91: tmp = (a * (27.0 * b)) + (z * (y * (t * -9.0))) elif z <= 1.8e-88: tmp = (2.0 * x) + (27.0 * (a * b)) else: tmp = (2.0 * x) + (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 <= -3.3e-91) tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(z * Float64(y * Float64(t * -9.0)))); elseif (z <= 1.8e-88) tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(2.0 * x) + Float64(z * Float64(-9.0 * Float64(y * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -3.3e-91)
tmp = (a * (27.0 * b)) + (z * (y * (t * -9.0)));
elseif (z <= 1.8e-88)
tmp = (2.0 * x) + (27.0 * (a * b));
else
tmp = (2.0 * x) + (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, -3.3e-91], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-88], N[(N[(2.0 * x), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $MachinePrecision] + N[(z * 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 -3.3 \cdot 10^{-91}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-88}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\end{array}
\end{array}
if z < -3.30000000000000011e-91Initial program 94.1%
associate-+l-94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*93.0%
associate-+l-93.0%
associate-*l*94.1%
*-commutative94.1%
*-commutative94.1%
associate-*l*89.9%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in z around inf 94.1%
Taylor expanded in x around 0 73.1%
*-commutative73.1%
*-commutative73.1%
associate-*l*73.1%
Simplified73.1%
if -3.30000000000000011e-91 < z < 1.8e-88Initial program 99.8%
associate-+l-99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-+l-99.8%
associate-*l*99.8%
*-commutative99.8%
*-commutative99.8%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.9%
if 1.8e-88 < z Initial program 92.8%
associate-+l-92.8%
*-commutative92.8%
*-commutative92.8%
associate-*l*92.7%
associate-+l-92.7%
associate-*l*92.8%
*-commutative92.8%
*-commutative92.8%
associate-*l*93.0%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in a around 0 75.8%
cancel-sign-sub-inv75.8%
*-commutative75.8%
associate-*r*81.7%
associate-*r*81.6%
distribute-lft-neg-in81.6%
*-commutative81.6%
distribute-rgt-neg-in81.6%
*-commutative81.6%
metadata-eval81.6%
Applied egg-rr81.6%
Final simplification80.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(if (<= t -2.4e-100)
(* -9.0 (* y (* z t)))
(if (<= t 1.15e-36)
(+ (* 2.0 x) (* 27.0 (* a b)))
(- (* 2.0 x) (* 9.0 (* t (* z y)))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.4e-100) {
tmp = -9.0 * (y * (z * t));
} else if (t <= 1.15e-36) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = (2.0 * x) - (9.0 * (t * (z * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.4d-100)) then
tmp = (-9.0d0) * (y * (z * t))
else if (t <= 1.15d-36) then
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
else
tmp = (2.0d0 * x) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.4e-100) {
tmp = -9.0 * (y * (z * t));
} else if (t <= 1.15e-36) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = (2.0 * x) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if t <= -2.4e-100: tmp = -9.0 * (y * (z * t)) elif t <= 1.15e-36: tmp = (2.0 * x) + (27.0 * (a * b)) else: tmp = (2.0 * x) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.4e-100) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (t <= 1.15e-36) tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); else tmp = Float64(Float64(2.0 * x) - Float64(9.0 * Float64(t * Float64(z * y)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (t <= -2.4e-100)
tmp = -9.0 * (y * (z * t));
elseif (t <= 1.15e-36)
tmp = (2.0 * x) + (27.0 * (a * b));
else
tmp = (2.0 * x) - (9.0 * (t * (z * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.4e-100], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-36], N[(N[(2.0 * x), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * x), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-100}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-36}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if t < -2.4000000000000003e-100Initial program 97.7%
associate-+l-97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*97.8%
associate-+l-97.8%
associate-*l*97.7%
*-commutative97.7%
*-commutative97.7%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in x around inf 84.7%
Taylor expanded in t around inf 47.1%
associate-*r*44.2%
*-commutative44.2%
associate-*r*45.2%
Simplified45.2%
if -2.4000000000000003e-100 < t < 1.14999999999999998e-36Initial program 93.6%
associate-+l-93.6%
*-commutative93.6%
*-commutative93.6%
associate-*l*93.7%
associate-+l-93.7%
associate-*l*93.6%
*-commutative93.6%
*-commutative93.6%
associate-*l*99.0%
associate-*l*98.2%
Simplified98.2%
Taylor expanded in y around 0 86.5%
if 1.14999999999999998e-36 < t Initial program 96.2%
associate-+l-96.2%
*-commutative96.2%
*-commutative96.2%
associate-*l*94.3%
associate-+l-94.3%
associate-*l*96.2%
*-commutative96.2%
*-commutative96.2%
associate-*l*84.1%
associate-*l*84.1%
Simplified84.1%
Taylor expanded in a around 0 91.0%
Final simplification72.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -6.4e+91) (* -9.0 (* y (* z t))) (if (<= z 4.8e+25) (+ (* 2.0 x) (* 27.0 (* a b))) (* z (* y (* t -9.0))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6.4e+91) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 4.8e+25) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = z * (y * (t * -9.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-6.4d+91)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 4.8d+25) then
tmp = (2.0d0 * x) + (27.0d0 * (a * b))
else
tmp = z * (y * (t * (-9.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6.4e+91) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 4.8e+25) {
tmp = (2.0 * x) + (27.0 * (a * b));
} else {
tmp = z * (y * (t * -9.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= -6.4e+91: tmp = -9.0 * (y * (z * t)) elif z <= 4.8e+25: tmp = (2.0 * x) + (27.0 * (a * b)) else: tmp = z * (y * (t * -9.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -6.4e+91) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 4.8e+25) tmp = Float64(Float64(2.0 * x) + Float64(27.0 * Float64(a * b))); else tmp = Float64(z * Float64(y * Float64(t * -9.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -6.4e+91)
tmp = -9.0 * (y * (z * t));
elseif (z <= 4.8e+25)
tmp = (2.0 * x) + (27.0 * (a * b));
else
tmp = z * (y * (t * -9.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -6.4e+91], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+25], N[(N[(2.0 * x), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+91}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+25}:\\
\;\;\;\;2 \cdot x + 27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -6.39999999999999979e91Initial program 92.5%
associate-+l-92.5%
*-commutative92.5%
*-commutative92.5%
associate-*l*90.7%
associate-+l-90.7%
associate-*l*92.5%
*-commutative92.5%
*-commutative92.5%
associate-*l*84.1%
associate-*l*82.3%
Simplified82.3%
Taylor expanded in x around inf 76.8%
Taylor expanded in t around inf 52.6%
associate-*r*52.2%
*-commutative52.2%
associate-*r*44.1%
Simplified44.1%
if -6.39999999999999979e91 < z < 4.79999999999999992e25Initial program 99.1%
associate-+l-99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.1%
associate-+l-99.1%
associate-*l*99.1%
*-commutative99.1%
*-commutative99.1%
associate-*l*99.2%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in y around 0 83.7%
if 4.79999999999999992e25 < z Initial program 90.2%
Taylor expanded in y around 0 90.3%
Taylor expanded in y around inf 63.4%
*-commutative63.4%
associate-*r*65.1%
associate-*l*65.1%
*-commutative65.1%
*-commutative65.1%
associate-*l*65.1%
*-commutative65.1%
associate-*r*69.6%
*-commutative69.6%
associate-*l*69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in t around 0 69.6%
*-commutative69.6%
*-commutative69.6%
associate-*r*69.6%
Simplified69.6%
Final simplification72.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 (or (<= b -1.15e-79) (not (<= b 5.5e+45))) (* 27.0 (* a b)) (* 2.0 x)))
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.15e-79) || !(b <= 5.5e+45)) {
tmp = 27.0 * (a * b);
} else {
tmp = 2.0 * x;
}
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.15d-79)) .or. (.not. (b <= 5.5d+45))) then
tmp = 27.0d0 * (a * b)
else
tmp = 2.0d0 * x
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.15e-79) || !(b <= 5.5e+45)) {
tmp = 27.0 * (a * b);
} else {
tmp = 2.0 * x;
}
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.15e-79) or not (b <= 5.5e+45): tmp = 27.0 * (a * b) else: tmp = 2.0 * x 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.15e-79) || !(b <= 5.5e+45)) tmp = Float64(27.0 * Float64(a * b)); else tmp = Float64(2.0 * x); 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.15e-79) || ~((b <= 5.5e+45)))
tmp = 27.0 * (a * b);
else
tmp = 2.0 * x;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.15e-79], N[Not[LessEqual[b, 5.5e+45]], $MachinePrecision]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(2.0 * x), $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.15 \cdot 10^{-79} \lor \neg \left(b \leq 5.5 \cdot 10^{+45}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot x\\
\end{array}
\end{array}
if b < -1.15000000000000006e-79 or 5.5000000000000001e45 < b Initial program 95.3%
associate-+l-95.3%
*-commutative95.3%
*-commutative95.3%
associate-*l*95.3%
associate-+l-95.3%
associate-*l*95.3%
*-commutative95.3%
*-commutative95.3%
associate-*l*94.7%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in a around inf 51.5%
if -1.15000000000000006e-79 < b < 5.5000000000000001e45Initial program 96.1%
associate-+l-96.1%
*-commutative96.1%
*-commutative96.1%
associate-*l*95.3%
associate-+l-95.3%
associate-*l*96.1%
*-commutative96.1%
*-commutative96.1%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in x around inf 43.8%
Final simplification47.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 (<= b -1.7e-79) (* 27.0 (* a b)) (if (<= b 1.65e+45) (* 2.0 x) (* b (* 27.0 a)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.7e-79) {
tmp = 27.0 * (a * b);
} else if (b <= 1.65e+45) {
tmp = 2.0 * x;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.7d-79)) then
tmp = 27.0d0 * (a * b)
else if (b <= 1.65d+45) then
tmp = 2.0d0 * x
else
tmp = b * (27.0d0 * a)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.7e-79) {
tmp = 27.0 * (a * b);
} else if (b <= 1.65e+45) {
tmp = 2.0 * x;
} else {
tmp = b * (27.0 * a);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -1.7e-79: tmp = 27.0 * (a * b) elif b <= 1.65e+45: tmp = 2.0 * x else: tmp = b * (27.0 * a) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.7e-79) tmp = Float64(27.0 * Float64(a * b)); elseif (b <= 1.65e+45) tmp = Float64(2.0 * x); else tmp = Float64(b * Float64(27.0 * a)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -1.7e-79)
tmp = 27.0 * (a * b);
elseif (b <= 1.65e+45)
tmp = 2.0 * x;
else
tmp = b * (27.0 * a);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.7e-79], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.65e+45], N[(2.0 * x), $MachinePrecision], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{-79}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;b \leq 1.65 \cdot 10^{+45}:\\
\;\;\;\;2 \cdot x\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if b < -1.69999999999999988e-79Initial program 95.1%
associate-+l-95.1%
*-commutative95.1%
*-commutative95.1%
associate-*l*95.1%
associate-+l-95.1%
associate-*l*95.1%
*-commutative95.1%
*-commutative95.1%
associate-*l*94.0%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in a around inf 46.7%
if -1.69999999999999988e-79 < b < 1.65e45Initial program 96.1%
associate-+l-96.1%
*-commutative96.1%
*-commutative96.1%
associate-*l*95.3%
associate-+l-95.3%
associate-*l*96.1%
*-commutative96.1%
*-commutative96.1%
associate-*l*93.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in x around inf 43.8%
if 1.65e45 < b Initial program 95.7%
associate-+l-95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*95.6%
associate-+l-95.6%
associate-*l*95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*96.0%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in a around inf 59.6%
associate-*r*59.7%
Simplified59.7%
Final simplification47.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 (* 2.0 x))
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 2.0 * x;
}
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 = 2.0d0 * x
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 2.0 * x;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return 2.0 * x
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(2.0 * x) 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 = 2.0 * x;
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[(2.0 * x), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
2 \cdot x
\end{array}
Initial program 95.7%
associate-+l-95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*95.3%
associate-+l-95.3%
associate-*l*95.7%
*-commutative95.7%
*-commutative95.7%
associate-*l*94.3%
associate-*l*94.0%
Simplified94.0%
Taylor expanded in x around inf 31.9%
(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 2024085
(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)))