
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
def code(x, y, z, t, a, b): return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z 1.35e-91) (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.0))))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && 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.35e-91) {
tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.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]) 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.35e-91) tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.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
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 1.35e-91], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.35 \cdot 10^{-91}:\\
\;\;\;\;\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}:\\
\;\;\;\;\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 < 1.3499999999999999e-91Initial program 96.4%
+-commutative96.4%
associate-+r-96.4%
*-commutative96.4%
cancel-sign-sub-inv96.4%
associate-*r*93.0%
distribute-lft-neg-in93.0%
*-commutative93.0%
cancel-sign-sub-inv93.0%
associate-+r-93.0%
associate-*l*93.6%
fma-define94.2%
fma-neg94.2%
associate-*l*96.2%
distribute-rgt-neg-in96.2%
*-commutative96.2%
associate-*l*96.2%
*-commutative96.2%
distribute-lft-neg-in96.2%
associate-*r*96.2%
Simplified96.2%
if 1.3499999999999999e-91 < z Initial program 87.4%
Final simplification93.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* a (* 27.0 b))))
(if (<= z -1.6e-48)
t_1
(if (<= z -1.3e-122)
(* x 2.0)
(if (<= z -1.15e-174)
t_1
(if (<= z 3.4e-275)
t_2
(if (<= z 8e-269)
(* x 2.0)
(if (<= z 1.15e-230)
(* 27.0 (* a b))
(if (<= z 1.15e-181)
(* x 2.0)
(if (<= z 1.52e-40) t_2 t_1))))))))))assert(x < y && y < z && z < t && t < a && 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 t_1 = -9.0 * (t * (z * y));
double t_2 = a * (27.0 * b);
double tmp;
if (z <= -1.6e-48) {
tmp = t_1;
} else if (z <= -1.3e-122) {
tmp = x * 2.0;
} else if (z <= -1.15e-174) {
tmp = t_1;
} else if (z <= 3.4e-275) {
tmp = t_2;
} else if (z <= 8e-269) {
tmp = x * 2.0;
} else if (z <= 1.15e-230) {
tmp = 27.0 * (a * b);
} else if (z <= 1.15e-181) {
tmp = x * 2.0;
} else if (z <= 1.52e-40) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = a * (27.0d0 * b)
if (z <= (-1.6d-48)) then
tmp = t_1
else if (z <= (-1.3d-122)) then
tmp = x * 2.0d0
else if (z <= (-1.15d-174)) then
tmp = t_1
else if (z <= 3.4d-275) then
tmp = t_2
else if (z <= 8d-269) then
tmp = x * 2.0d0
else if (z <= 1.15d-230) then
tmp = 27.0d0 * (a * b)
else if (z <= 1.15d-181) then
tmp = x * 2.0d0
else if (z <= 1.52d-40) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = a * (27.0 * b);
double tmp;
if (z <= -1.6e-48) {
tmp = t_1;
} else if (z <= -1.3e-122) {
tmp = x * 2.0;
} else if (z <= -1.15e-174) {
tmp = t_1;
} else if (z <= 3.4e-275) {
tmp = t_2;
} else if (z <= 8e-269) {
tmp = x * 2.0;
} else if (z <= 1.15e-230) {
tmp = 27.0 * (a * b);
} else if (z <= 1.15e-181) {
tmp = x * 2.0;
} else if (z <= 1.52e-40) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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 = a * (27.0 * b) tmp = 0 if z <= -1.6e-48: tmp = t_1 elif z <= -1.3e-122: tmp = x * 2.0 elif z <= -1.15e-174: tmp = t_1 elif z <= 3.4e-275: tmp = t_2 elif z <= 8e-269: tmp = x * 2.0 elif z <= 1.15e-230: tmp = 27.0 * (a * b) elif z <= 1.15e-181: tmp = x * 2.0 elif z <= 1.52e-40: tmp = t_2 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -1.6e-48) tmp = t_1; elseif (z <= -1.3e-122) tmp = Float64(x * 2.0); elseif (z <= -1.15e-174) tmp = t_1; elseif (z <= 3.4e-275) tmp = t_2; elseif (z <= 8e-269) tmp = Float64(x * 2.0); elseif (z <= 1.15e-230) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 1.15e-181) tmp = Float64(x * 2.0); elseif (z <= 1.52e-40) tmp = t_2; else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 = a * (27.0 * b);
tmp = 0.0;
if (z <= -1.6e-48)
tmp = t_1;
elseif (z <= -1.3e-122)
tmp = x * 2.0;
elseif (z <= -1.15e-174)
tmp = t_1;
elseif (z <= 3.4e-275)
tmp = t_2;
elseif (z <= 8e-269)
tmp = x * 2.0;
elseif (z <= 1.15e-230)
tmp = 27.0 * (a * b);
elseif (z <= 1.15e-181)
tmp = x * 2.0;
elseif (z <= 1.52e-40)
tmp = t_2;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e-48], t$95$1, If[LessEqual[z, -1.3e-122], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.15e-174], t$95$1, If[LessEqual[z, 3.4e-275], t$95$2, If[LessEqual[z, 8e-269], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.15e-230], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-181], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.52e-40], t$95$2, t$95$1]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-122}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-174}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{-275}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-269}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-230}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-181}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-40}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.5999999999999999e-48 or -1.29999999999999988e-122 < z < -1.1499999999999999e-174 or 1.51999999999999992e-40 < z Initial program 89.7%
sub-neg89.7%
sub-neg89.7%
associate-*l*92.9%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in y around inf 52.9%
if -1.5999999999999999e-48 < z < -1.29999999999999988e-122 or 3.39999999999999968e-275 < z < 7.9999999999999997e-269 or 1.1499999999999999e-230 < z < 1.14999999999999995e-181Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 47.3%
if -1.1499999999999999e-174 < z < 3.39999999999999968e-275 or 1.14999999999999995e-181 < z < 1.51999999999999992e-40Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*97.4%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in y around 0 99.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in a around inf 55.8%
associate-*r*54.3%
*-commutative54.3%
associate-*r*55.9%
Simplified55.9%
if 7.9999999999999997e-269 < z < 1.1499999999999999e-230Initial program 99.3%
sub-neg99.3%
sub-neg99.3%
associate-*l*99.3%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around 0 99.8%
associate-*r*77.9%
Simplified77.9%
Taylor expanded in a around inf 58.4%
Final simplification53.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* a (* 27.0 b))))
(if (<= z -2e-52)
(* -9.0 (* y (* z t)))
(if (<= z -3.5e-125)
(* x 2.0)
(if (<= z -1.2e-172)
t_1
(if (<= z 6.4e-275)
t_2
(if (<= z 1.05e-268)
(* x 2.0)
(if (<= z 1.35e-228)
(* 27.0 (* a b))
(if (<= z 8.6e-182)
(* x 2.0)
(if (<= z 9.2e-39) t_2 t_1))))))))))assert(x < y && y < z && z < t && t < a && 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 t_1 = -9.0 * (t * (z * y));
double t_2 = a * (27.0 * b);
double tmp;
if (z <= -2e-52) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -3.5e-125) {
tmp = x * 2.0;
} else if (z <= -1.2e-172) {
tmp = t_1;
} else if (z <= 6.4e-275) {
tmp = t_2;
} else if (z <= 1.05e-268) {
tmp = x * 2.0;
} else if (z <= 1.35e-228) {
tmp = 27.0 * (a * b);
} else if (z <= 8.6e-182) {
tmp = x * 2.0;
} else if (z <= 9.2e-39) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = a * (27.0d0 * b)
if (z <= (-2d-52)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= (-3.5d-125)) then
tmp = x * 2.0d0
else if (z <= (-1.2d-172)) then
tmp = t_1
else if (z <= 6.4d-275) then
tmp = t_2
else if (z <= 1.05d-268) then
tmp = x * 2.0d0
else if (z <= 1.35d-228) then
tmp = 27.0d0 * (a * b)
else if (z <= 8.6d-182) then
tmp = x * 2.0d0
else if (z <= 9.2d-39) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = a * (27.0 * b);
double tmp;
if (z <= -2e-52) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -3.5e-125) {
tmp = x * 2.0;
} else if (z <= -1.2e-172) {
tmp = t_1;
} else if (z <= 6.4e-275) {
tmp = t_2;
} else if (z <= 1.05e-268) {
tmp = x * 2.0;
} else if (z <= 1.35e-228) {
tmp = 27.0 * (a * b);
} else if (z <= 8.6e-182) {
tmp = x * 2.0;
} else if (z <= 9.2e-39) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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 = a * (27.0 * b) tmp = 0 if z <= -2e-52: tmp = -9.0 * (y * (z * t)) elif z <= -3.5e-125: tmp = x * 2.0 elif z <= -1.2e-172: tmp = t_1 elif z <= 6.4e-275: tmp = t_2 elif z <= 1.05e-268: tmp = x * 2.0 elif z <= 1.35e-228: tmp = 27.0 * (a * b) elif z <= 8.6e-182: tmp = x * 2.0 elif z <= 9.2e-39: tmp = t_2 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -2e-52) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= -3.5e-125) tmp = Float64(x * 2.0); elseif (z <= -1.2e-172) tmp = t_1; elseif (z <= 6.4e-275) tmp = t_2; elseif (z <= 1.05e-268) tmp = Float64(x * 2.0); elseif (z <= 1.35e-228) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 8.6e-182) tmp = Float64(x * 2.0); elseif (z <= 9.2e-39) tmp = t_2; else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 = a * (27.0 * b);
tmp = 0.0;
if (z <= -2e-52)
tmp = -9.0 * (y * (z * t));
elseif (z <= -3.5e-125)
tmp = x * 2.0;
elseif (z <= -1.2e-172)
tmp = t_1;
elseif (z <= 6.4e-275)
tmp = t_2;
elseif (z <= 1.05e-268)
tmp = x * 2.0;
elseif (z <= 1.35e-228)
tmp = 27.0 * (a * b);
elseif (z <= 8.6e-182)
tmp = x * 2.0;
elseif (z <= 9.2e-39)
tmp = t_2;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e-52], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.5e-125], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.2e-172], t$95$1, If[LessEqual[z, 6.4e-275], t$95$2, If[LessEqual[z, 1.05e-268], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.35e-228], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e-182], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 9.2e-39], t$95$2, t$95$1]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{-52}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-125}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-275}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-268}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-228}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-182}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-39}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2e-52Initial program 93.3%
sub-neg93.3%
sub-neg93.3%
associate-*l*91.9%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in y around 0 93.2%
associate-*r*97.0%
Simplified97.0%
Taylor expanded in t around 0 93.2%
associate-*r*93.2%
*-commutative93.2%
associate-*l*92.0%
*-commutative92.0%
Simplified92.0%
Taylor expanded in y around inf 62.7%
*-commutative62.7%
associate-*r*65.2%
Simplified65.2%
pow165.2%
associate-*l*65.2%
*-commutative65.2%
associate-*l*64.1%
Applied egg-rr64.1%
unpow164.1%
associate-*r*64.1%
associate-*r*64.1%
*-commutative64.1%
Simplified64.1%
if -2e-52 < z < -3.49999999999999998e-125 or 6.4e-275 < z < 1.04999999999999999e-268 or 1.34999999999999992e-228 < z < 8.6e-182Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in x around inf 45.5%
if -3.49999999999999998e-125 < z < -1.2e-172 or 9.20000000000000033e-39 < z Initial program 86.4%
sub-neg86.4%
sub-neg86.4%
associate-*l*93.9%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in y around inf 44.0%
if -1.2e-172 < z < 6.4e-275 or 8.6e-182 < z < 9.20000000000000033e-39Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*97.5%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in y around 0 99.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in a around inf 56.6%
associate-*r*55.1%
*-commutative55.1%
associate-*r*56.6%
Simplified56.6%
if 1.04999999999999999e-268 < z < 1.34999999999999992e-228Initial program 99.3%
sub-neg99.3%
sub-neg99.3%
associate-*l*99.3%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around 0 99.8%
associate-*r*77.9%
Simplified77.9%
Taylor expanded in a around inf 58.4%
Final simplification53.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (* a (* 27.0 b))))
(if (<= z -1.5e-48)
(* -9.0 (* y (* z t)))
(if (<= z -1.05e-124)
(* x 2.0)
(if (<= z -2.3e-177)
t_1
(if (<= z 6.4e-276)
t_2
(if (<= z 7.5e-269)
(* x 2.0)
(if (<= z 8.5e-230)
(* 27.0 (* a b))
(if (<= z 8e-185)
(* t (/ (* x 2.0) t))
(if (<= z 2.35e-39) t_2 t_1))))))))))assert(x < y && y < z && z < t && t < a && 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 t_1 = -9.0 * (t * (z * y));
double t_2 = a * (27.0 * b);
double tmp;
if (z <= -1.5e-48) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -1.05e-124) {
tmp = x * 2.0;
} else if (z <= -2.3e-177) {
tmp = t_1;
} else if (z <= 6.4e-276) {
tmp = t_2;
} else if (z <= 7.5e-269) {
tmp = x * 2.0;
} else if (z <= 8.5e-230) {
tmp = 27.0 * (a * b);
} else if (z <= 8e-185) {
tmp = t * ((x * 2.0) / t);
} else if (z <= 2.35e-39) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = a * (27.0d0 * b)
if (z <= (-1.5d-48)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= (-1.05d-124)) then
tmp = x * 2.0d0
else if (z <= (-2.3d-177)) then
tmp = t_1
else if (z <= 6.4d-276) then
tmp = t_2
else if (z <= 7.5d-269) then
tmp = x * 2.0d0
else if (z <= 8.5d-230) then
tmp = 27.0d0 * (a * b)
else if (z <= 8d-185) then
tmp = t * ((x * 2.0d0) / t)
else if (z <= 2.35d-39) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = a * (27.0 * b);
double tmp;
if (z <= -1.5e-48) {
tmp = -9.0 * (y * (z * t));
} else if (z <= -1.05e-124) {
tmp = x * 2.0;
} else if (z <= -2.3e-177) {
tmp = t_1;
} else if (z <= 6.4e-276) {
tmp = t_2;
} else if (z <= 7.5e-269) {
tmp = x * 2.0;
} else if (z <= 8.5e-230) {
tmp = 27.0 * (a * b);
} else if (z <= 8e-185) {
tmp = t * ((x * 2.0) / t);
} else if (z <= 2.35e-39) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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 = a * (27.0 * b) tmp = 0 if z <= -1.5e-48: tmp = -9.0 * (y * (z * t)) elif z <= -1.05e-124: tmp = x * 2.0 elif z <= -2.3e-177: tmp = t_1 elif z <= 6.4e-276: tmp = t_2 elif z <= 7.5e-269: tmp = x * 2.0 elif z <= 8.5e-230: tmp = 27.0 * (a * b) elif z <= 8e-185: tmp = t * ((x * 2.0) / t) elif z <= 2.35e-39: tmp = t_2 else: tmp = t_1 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -1.5e-48) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= -1.05e-124) tmp = Float64(x * 2.0); elseif (z <= -2.3e-177) tmp = t_1; elseif (z <= 6.4e-276) tmp = t_2; elseif (z <= 7.5e-269) tmp = Float64(x * 2.0); elseif (z <= 8.5e-230) tmp = Float64(27.0 * Float64(a * b)); elseif (z <= 8e-185) tmp = Float64(t * Float64(Float64(x * 2.0) / t)); elseif (z <= 2.35e-39) tmp = t_2; else tmp = t_1; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 = a * (27.0 * b);
tmp = 0.0;
if (z <= -1.5e-48)
tmp = -9.0 * (y * (z * t));
elseif (z <= -1.05e-124)
tmp = x * 2.0;
elseif (z <= -2.3e-177)
tmp = t_1;
elseif (z <= 6.4e-276)
tmp = t_2;
elseif (z <= 7.5e-269)
tmp = x * 2.0;
elseif (z <= 8.5e-230)
tmp = 27.0 * (a * b);
elseif (z <= 8e-185)
tmp = t * ((x * 2.0) / t);
elseif (z <= 2.35e-39)
tmp = t_2;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e-48], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.05e-124], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -2.3e-177], t$95$1, If[LessEqual[z, 6.4e-276], t$95$2, If[LessEqual[z, 7.5e-269], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 8.5e-230], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-185], N[(t * N[(N[(x * 2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.35e-39], t$95$2, t$95$1]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-48}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-124}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-177}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-276}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-269}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-230}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-185}:\\
\;\;\;\;t \cdot \frac{x \cdot 2}{t}\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{-39}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.5e-48Initial program 93.2%
sub-neg93.2%
sub-neg93.2%
associate-*l*91.8%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in y around 0 93.1%
associate-*r*96.9%
Simplified96.9%
Taylor expanded in t around 0 93.1%
associate-*r*93.1%
*-commutative93.1%
associate-*l*91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in y around inf 63.5%
*-commutative63.5%
associate-*r*66.0%
Simplified66.0%
pow166.0%
associate-*l*66.1%
*-commutative66.1%
associate-*l*65.0%
Applied egg-rr65.0%
unpow165.0%
associate-*r*65.0%
associate-*r*64.9%
*-commutative64.9%
Simplified64.9%
if -1.5e-48 < z < -1.05e-124 or 6.3999999999999998e-276 < z < 7.4999999999999993e-269Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 58.2%
if -1.05e-124 < z < -2.30000000000000022e-177 or 2.3500000000000001e-39 < z Initial program 86.5%
sub-neg86.5%
sub-neg86.5%
associate-*l*93.9%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in y around inf 43.5%
if -2.30000000000000022e-177 < z < 6.3999999999999998e-276 or 7.9999999999999999e-185 < z < 2.3500000000000001e-39Initial program 98.2%
sub-neg98.2%
sub-neg98.2%
associate-*l*97.4%
associate-*l*99.0%
Simplified99.0%
Taylor expanded in y around 0 99.8%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in a around inf 55.8%
associate-*r*54.3%
*-commutative54.3%
associate-*r*55.9%
Simplified55.9%
if 7.4999999999999993e-269 < z < 8.4999999999999998e-230Initial program 99.3%
sub-neg99.3%
sub-neg99.3%
associate-*l*99.3%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around 0 99.8%
associate-*r*77.9%
Simplified77.9%
Taylor expanded in a around inf 58.4%
if 8.4999999999999998e-230 < z < 7.9999999999999999e-185Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*99.9%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in t around inf 93.4%
Taylor expanded in x around inf 29.1%
associate-*r/29.1%
Simplified29.1%
Final simplification53.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 -2.7e-169)
(not
(or (<= z 2.06e-228) (and (not (<= z 4.5e-180)) (<= z 2.6e-38)))))
(- (* 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);
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.7e-169) || !((z <= 2.06e-228) || (!(z <= 4.5e-180) && (z <= 2.6e-38)))) {
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.
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.7d-169)) .or. (.not. (z <= 2.06d-228) .or. (.not. (z <= 4.5d-180)) .and. (z <= 2.6d-38))) 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;
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.7e-169) || !((z <= 2.06e-228) || (!(z <= 4.5e-180) && (z <= 2.6e-38)))) {
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]) [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.7e-169) or not ((z <= 2.06e-228) or (not (z <= 4.5e-180) and (z <= 2.6e-38))): 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]) 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.7e-169) || !((z <= 2.06e-228) || (!(z <= 4.5e-180) && (z <= 2.6e-38)))) 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])){:}
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.7e-169) || ~(((z <= 2.06e-228) || (~((z <= 4.5e-180)) && (z <= 2.6e-38)))))
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. 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, -2.7e-169], N[Not[Or[LessEqual[z, 2.06e-228], And[N[Not[LessEqual[z, 4.5e-180]], $MachinePrecision], LessEqual[z, 2.6e-38]]]], $MachinePrecision]], 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-169} \lor \neg \left(z \leq 2.06 \cdot 10^{-228} \lor \neg \left(z \leq 4.5 \cdot 10^{-180}\right) \land z \leq 2.6 \cdot 10^{-38}\right):\\
\;\;\;\;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 z < -2.7000000000000002e-169 or 2.06e-228 < z < 4.50000000000000009e-180 or 2.60000000000000011e-38 < z Initial program 91.2%
sub-neg91.2%
sub-neg91.2%
associate-*l*94.0%
associate-*l*94.5%
Simplified94.5%
Taylor expanded in a around 0 70.7%
if -2.7000000000000002e-169 < z < 2.06e-228 or 4.50000000000000009e-180 < z < 2.60000000000000011e-38Initial program 98.5%
sub-neg98.5%
sub-neg98.5%
associate-*l*97.8%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in y around 0 85.0%
Final simplification74.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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.25e+64) (+ (- (* x 2.0) (* y (* z (* t 9.0)))) (* a (* 27.0 b))) (- (* 27.0 (* a b)) (* 9.0 (* t (* z y))))))
assert(x < y && y < z && z < t && t < a && 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 <= 2.25e+64) {
tmp = ((x * 2.0) - (y * (z * (t * 9.0)))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (a * b)) - (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.
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.25d+64) then
tmp = ((x * 2.0d0) - (y * (z * (t * 9.0d0)))) + (a * (27.0d0 * b))
else
tmp = (27.0d0 * (a * b)) - (9.0d0 * (t * (z * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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.25e+64) {
tmp = ((x * 2.0) - (y * (z * (t * 9.0)))) + (a * (27.0 * b));
} else {
tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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.25e+64: tmp = ((x * 2.0) - (y * (z * (t * 9.0)))) + (a * (27.0 * b)) else: tmp = (27.0 * (a * b)) - (9.0 * (t * (z * y))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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.25e+64) tmp = Float64(Float64(Float64(x * 2.0) - Float64(y * Float64(z * Float64(t * 9.0)))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(27.0 * Float64(a * b)) - 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])){:}
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.25e+64)
tmp = ((x * 2.0) - (y * (z * (t * 9.0)))) + (a * (27.0 * b));
else
tmp = (27.0 * (a * b)) - (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. 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.25e+64], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.25 \cdot 10^{+64}:\\
\;\;\;\;\left(x \cdot 2 - y \cdot \left(z \cdot \left(t \cdot 9\right)\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < 2.24999999999999987e64Initial program 96.9%
sub-neg96.9%
sub-neg96.9%
associate-*l*95.8%
associate-*l*96.2%
Simplified96.2%
Taylor expanded in y around 0 97.3%
associate-*r*94.5%
Simplified94.5%
Taylor expanded in t around 0 97.3%
associate-*r*97.3%
*-commutative97.3%
associate-*l*96.2%
*-commutative96.2%
Simplified96.2%
if 2.24999999999999987e64 < z Initial program 80.5%
sub-neg80.5%
sub-neg80.5%
associate-*l*92.8%
associate-*l*94.7%
Simplified94.7%
Taylor expanded in x around 0 69.7%
Final simplification90.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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-91) (+ (- (* x 2.0) (* y (* z (* t 9.0)))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* b (* a 27.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
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-91) {
tmp = ((x * 2.0) - (y * (z * (t * 9.0)))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= 1d-91) then
tmp = ((x * 2.0d0) - (y * (z * (t * 9.0d0)))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (b * (a * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 1e-91) {
tmp = ((x * 2.0) - (y * (z * (t * 9.0)))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if z <= 1e-91: tmp = ((x * 2.0) - (y * (z * (t * 9.0)))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0)) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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-91) tmp = Float64(Float64(Float64(x * 2.0) - Float64(y * Float64(z * Float64(t * 9.0)))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + Float64(b * Float64(a * 27.0))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= 1e-91)
tmp = ((x * 2.0) - (y * (z * (t * 9.0)))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (b * (a * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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-91], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(y * N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 10^{-91}:\\
\;\;\;\;\left(x \cdot 2 - y \cdot \left(z \cdot \left(t \cdot 9\right)\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\end{array}
\end{array}
if z < 1.00000000000000002e-91Initial program 96.4%
sub-neg96.4%
sub-neg96.4%
associate-*l*95.0%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in y around 0 96.9%
associate-*r*93.5%
Simplified93.5%
Taylor expanded in t around 0 96.9%
associate-*r*96.8%
*-commutative96.8%
associate-*l*95.6%
*-commutative95.6%
Simplified95.6%
if 1.00000000000000002e-91 < z Initial program 87.4%
Final simplification92.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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))) (t_2 (* 9.0 (* t (* z y)))))
(if (<= a -8e-12)
(- t_1 t_2)
(if (<= a 0.75) (- (* x 2.0) t_2) (+ t_1 (* x 2.0))))))assert(x < y && y < z && z < t && t < a && 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 t_1 = 27.0 * (a * b);
double t_2 = 9.0 * (t * (z * y));
double tmp;
if (a <= -8e-12) {
tmp = t_1 - t_2;
} else if (a <= 0.75) {
tmp = (x * 2.0) - t_2;
} 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.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
t_2 = 9.0d0 * (t * (z * y))
if (a <= (-8d-12)) then
tmp = t_1 - t_2
else if (a <= 0.75d0) then
tmp = (x * 2.0d0) - t_2
else
tmp = t_1 + (x * 2.0d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 t_2 = 9.0 * (t * (z * y));
double tmp;
if (a <= -8e-12) {
tmp = t_1 - t_2;
} else if (a <= 0.75) {
tmp = (x * 2.0) - t_2;
} else {
tmp = t_1 + (x * 2.0);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [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) t_2 = 9.0 * (t * (z * y)) tmp = 0 if a <= -8e-12: tmp = t_1 - t_2 elif a <= 0.75: tmp = (x * 2.0) - t_2 else: tmp = t_1 + (x * 2.0) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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)) t_2 = Float64(9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (a <= -8e-12) tmp = Float64(t_1 - t_2); elseif (a <= 0.75) tmp = Float64(Float64(x * 2.0) - t_2); 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])){:}
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);
t_2 = 9.0 * (t * (z * y));
tmp = 0.0;
if (a <= -8e-12)
tmp = t_1 - t_2;
elseif (a <= 0.75)
tmp = (x * 2.0) - t_2;
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.
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]}, Block[{t$95$2 = N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8e-12], N[(t$95$1 - t$95$2), $MachinePrecision], If[LessEqual[a, 0.75], N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $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])\\\\
[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)\\
t_2 := 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;a \leq -8 \cdot 10^{-12}:\\
\;\;\;\;t\_1 - t\_2\\
\mathbf{elif}\;a \leq 0.75:\\
\;\;\;\;x \cdot 2 - t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x \cdot 2\\
\end{array}
\end{array}
if a < -7.99999999999999984e-12Initial program 94.3%
sub-neg94.3%
sub-neg94.3%
associate-*l*94.4%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in x around 0 88.2%
if -7.99999999999999984e-12 < a < 0.75Initial program 92.9%
sub-neg92.9%
sub-neg92.9%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in a around 0 82.8%
if 0.75 < a Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*93.3%
associate-*l*95.0%
Simplified95.0%
Taylor expanded in y around 0 59.4%
Final simplification78.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 -6500000.0) (* -9.0 (* y (* z t))) (if (<= z 6e+68) (+ (* 27.0 (* a b)) (* x 2.0)) (* -9.0 (* t (* z y))))))
assert(x < y && y < z && z < t && t < a && 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 <= -6500000.0) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 6e+68) {
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.
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 <= (-6500000.0d0)) then
tmp = (-9.0d0) * (y * (z * t))
else if (z <= 6d+68) 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;
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 <= -6500000.0) {
tmp = -9.0 * (y * (z * t));
} else if (z <= 6e+68) {
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]) [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 <= -6500000.0: tmp = -9.0 * (y * (z * t)) elif z <= 6e+68: 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]) 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 <= -6500000.0) tmp = Float64(-9.0 * Float64(y * Float64(z * t))); elseif (z <= 6e+68) 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])){:}
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 <= -6500000.0)
tmp = -9.0 * (y * (z * t));
elseif (z <= 6e+68)
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. 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, -6500000.0], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+68], 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6500000:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+68}:\\
\;\;\;\;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 < -6.5e6Initial program 93.1%
sub-neg93.1%
sub-neg93.1%
associate-*l*91.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in y around 0 93.0%
associate-*r*97.9%
Simplified97.9%
Taylor expanded in t around 0 93.0%
associate-*r*93.1%
*-commutative93.1%
associate-*l*91.4%
*-commutative91.4%
Simplified91.4%
Taylor expanded in y around inf 65.4%
*-commutative65.4%
associate-*r*68.6%
Simplified68.6%
pow168.6%
associate-*l*68.7%
*-commutative68.7%
associate-*l*67.2%
Applied egg-rr67.2%
unpow167.2%
associate-*r*67.2%
associate-*r*67.2%
*-commutative67.2%
Simplified67.2%
if -6.5e6 < z < 6.0000000000000004e68Initial program 98.4%
sub-neg98.4%
sub-neg98.4%
associate-*l*97.5%
associate-*l*98.1%
Simplified98.1%
Taylor expanded in y around 0 71.9%
if 6.0000000000000004e68 < z Initial program 80.1%
sub-neg80.1%
sub-neg80.1%
associate-*l*92.7%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in y around inf 44.4%
Final simplification65.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (* a (* 27.0 b)) (- (* x 2.0) (* 9.0 (* z (* y t))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (a * (27.0d0 * b)) + ((x * 2.0d0) - (9.0d0 * (z * (y * t))))
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))))
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t))))) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)
\end{array}
Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*95.1%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in y around 0 94.5%
associate-*r*95.6%
Simplified95.6%
Final simplification95.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.4e-158) (not (<= b 4.5e+91))) (* 27.0 (* a b)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && 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 ((b <= -2.4e-158) || !(b <= 4.5e+91)) {
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.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-2.4d-158)) .or. (.not. (b <= 4.5d+91))) 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;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.4e-158) || !(b <= 4.5e+91)) {
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]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.4e-158) or not (b <= 4.5e+91): 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]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.4e-158) || !(b <= 4.5e+91)) 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])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -2.4e-158) || ~((b <= 4.5e+91)))
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. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.4e-158], N[Not[LessEqual[b, 4.5e+91]], $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{-158} \lor \neg \left(b \leq 4.5 \cdot 10^{+91}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -2.40000000000000007e-158 or 4.5e91 < b Initial program 93.7%
sub-neg93.7%
sub-neg93.7%
associate-*l*96.4%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in y around 0 94.4%
associate-*r*93.7%
Simplified93.7%
Taylor expanded in a around inf 48.2%
if -2.40000000000000007e-158 < b < 4.5e91Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*93.5%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in x around inf 35.6%
Final simplification42.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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 -2.35e-158) (* a (* 27.0 b)) (if (<= b 4.5e+91) (* x 2.0) (* 27.0 (* a b)))))
assert(x < y && y < z && z < t && t < a && 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 (b <= -2.35e-158) {
tmp = a * (27.0 * b);
} else if (b <= 4.5e+91) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-2.35d-158)) then
tmp = a * (27.0d0 * b)
else if (b <= 4.5d+91) then
tmp = x * 2.0d0
else
tmp = 27.0d0 * (a * b)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.35e-158) {
tmp = a * (27.0 * b);
} else if (b <= 4.5e+91) {
tmp = x * 2.0;
} else {
tmp = 27.0 * (a * b);
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -2.35e-158: tmp = a * (27.0 * b) elif b <= 4.5e+91: tmp = x * 2.0 else: tmp = 27.0 * (a * b) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.35e-158) tmp = Float64(a * Float64(27.0 * b)); elseif (b <= 4.5e+91) tmp = Float64(x * 2.0); else tmp = Float64(27.0 * Float64(a * b)); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -2.35e-158)
tmp = a * (27.0 * b);
elseif (b <= 4.5e+91)
tmp = x * 2.0;
else
tmp = 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. 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, -2.35e-158], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.5e+91], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.35 \cdot 10^{-158}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+91}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if b < -2.35000000000000018e-158Initial program 92.3%
sub-neg92.3%
sub-neg92.3%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in y around 0 93.2%
associate-*r*93.2%
Simplified93.2%
Taylor expanded in a around inf 39.6%
associate-*r*39.6%
*-commutative39.6%
associate-*r*39.6%
Simplified39.6%
if -2.35000000000000018e-158 < b < 4.5e91Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*93.5%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in x around inf 35.6%
if 4.5e91 < b Initial program 97.3%
sub-neg97.3%
sub-neg97.3%
associate-*l*97.5%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in y around 0 97.3%
associate-*r*95.0%
Simplified95.0%
Taylor expanded in a around inf 70.1%
Final simplification42.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. 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);
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.
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;
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]) [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]) 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])){:}
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. 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, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Initial program 93.4%
sub-neg93.4%
sub-neg93.4%
associate-*l*95.1%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in x around inf 25.8%
Final simplification25.8%
(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 2024059
(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)))