
(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. 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 -5.2e+64) (- (+ (* 27.0 (* a b)) (* x 2.0)) (* y (* (* z 9.0) 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);
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 <= -5.2e+64) {
tmp = ((27.0 * (a * b)) + (x * 2.0)) - (y * ((z * 9.0) * 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]) 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 <= -5.2e+64) tmp = Float64(Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)) - Float64(y * Float64(Float64(z * 9.0) * 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. 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, -5.2e+64], N[(N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+64}:\\
\;\;\;\;\left(27 \cdot \left(a \cdot b\right) + x \cdot 2\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < -5.19999999999999994e64Initial program 89.4%
sub-neg89.4%
sub-neg89.4%
associate-*l*85.0%
associate-*l*85.0%
Simplified85.0%
+-commutative85.0%
associate-+r-85.0%
associate-*r*85.0%
*-commutative85.0%
associate-*l*85.0%
associate-*l*85.1%
associate-*r*85.1%
Applied egg-rr85.1%
if -5.19999999999999994e64 < z Initial program 96.7%
+-commutative96.7%
associate-+r-96.7%
*-commutative96.7%
cancel-sign-sub-inv96.7%
associate-*r*93.7%
distribute-lft-neg-in93.7%
*-commutative93.7%
cancel-sign-sub-inv93.7%
associate-+r-93.7%
associate-*l*93.8%
fma-def94.8%
cancel-sign-sub-inv94.8%
fma-def94.8%
distribute-lft-neg-in94.8%
distribute-rgt-neg-in94.8%
*-commutative94.8%
associate-*r*97.8%
associate-*l*97.8%
neg-mul-197.8%
associate-*r*97.8%
Simplified97.8%
Final simplification94.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 (+ (* 27.0 (* a b)) (* x 2.0))))
(if (<= z -1.55e+16)
(* z (* -9.0 (* y t)))
(if (<= z -3.2e-41)
t_1
(if (<= z -1.24e-83)
(* t (* -9.0 (* z y)))
(if (<= z 0.000155) t_1 (* z (* y (* t -9.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)) + (x * 2.0);
double tmp;
if (z <= -1.55e+16) {
tmp = z * (-9.0 * (y * t));
} else if (z <= -3.2e-41) {
tmp = t_1;
} else if (z <= -1.24e-83) {
tmp = t * (-9.0 * (z * y));
} else if (z <= 0.000155) {
tmp = t_1;
} 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.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (27.0d0 * (a * b)) + (x * 2.0d0)
if (z <= (-1.55d+16)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= (-3.2d-41)) then
tmp = t_1
else if (z <= (-1.24d-83)) then
tmp = t * ((-9.0d0) * (z * y))
else if (z <= 0.000155d0) then
tmp = t_1
else
tmp = z * (y * (t * (-9.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)) + (x * 2.0);
double tmp;
if (z <= -1.55e+16) {
tmp = z * (-9.0 * (y * t));
} else if (z <= -3.2e-41) {
tmp = t_1;
} else if (z <= -1.24e-83) {
tmp = t * (-9.0 * (z * y));
} else if (z <= 0.000155) {
tmp = t_1;
} else {
tmp = z * (y * (t * -9.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)) + (x * 2.0) tmp = 0 if z <= -1.55e+16: tmp = z * (-9.0 * (y * t)) elif z <= -3.2e-41: tmp = t_1 elif z <= -1.24e-83: tmp = t * (-9.0 * (z * y)) elif z <= 0.000155: tmp = t_1 else: tmp = z * (y * (t * -9.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(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)) tmp = 0.0 if (z <= -1.55e+16) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= -3.2e-41) tmp = t_1; elseif (z <= -1.24e-83) tmp = Float64(t * Float64(-9.0 * Float64(z * y))); elseif (z <= 0.000155) tmp = t_1; 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])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = (27.0 * (a * b)) + (x * 2.0);
tmp = 0.0;
if (z <= -1.55e+16)
tmp = z * (-9.0 * (y * t));
elseif (z <= -3.2e-41)
tmp = t_1;
elseif (z <= -1.24e-83)
tmp = t * (-9.0 * (z * y));
elseif (z <= 0.000155)
tmp = t_1;
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.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e+16], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.2e-41], t$95$1, If[LessEqual[z, -1.24e-83], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.000155], t$95$1, 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+16}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.24 \cdot 10^{-83}:\\
\;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
\mathbf{elif}\;z \leq 0.000155:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\\
\end{array}
\end{array}
if z < -1.55e16Initial program 90.4%
Taylor expanded in y around 0 90.4%
associate-*r*90.4%
*-commutative90.4%
associate-*r*90.3%
Simplified90.3%
Taylor expanded in y around inf 55.8%
associate-*r*55.9%
associate-*l*55.7%
*-commutative55.7%
*-commutative55.7%
associate-*l*55.6%
Simplified55.6%
Taylor expanded in t around 0 55.7%
if -1.55e16 < z < -3.20000000000000012e-41 or -1.24000000000000001e-83 < z < 1.55e-4Initial program 98.9%
sub-neg98.9%
sub-neg98.9%
associate-*l*98.7%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in y around 0 77.7%
if -3.20000000000000012e-41 < z < -1.24000000000000001e-83Initial program 99.7%
Taylor expanded in y around 0 99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*r*99.7%
Simplified99.7%
Taylor expanded in y around inf 21.8%
*-commutative21.8%
associate-*l*22.2%
Simplified22.2%
if 1.55e-4 < z Initial program 92.6%
Taylor expanded in y around 0 92.6%
associate-*r*92.6%
*-commutative92.6%
associate-*r*92.5%
Simplified92.5%
Taylor expanded in y around inf 52.4%
associate-*r*52.5%
associate-*l*57.5%
*-commutative57.5%
*-commutative57.5%
*-commutative57.5%
Simplified57.5%
Final simplification65.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 (* a (* 27.0 b))) (t_2 (* -9.0 (* t (* z y)))))
(if (<= z -8.5e-84)
t_2
(if (<= z -6.5e-257)
t_1
(if (<= z -9e-289) (* x 2.0) (if (<= z 1.45e-105) t_1 t_2))))))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 = a * (27.0 * b);
double t_2 = -9.0 * (t * (z * y));
double tmp;
if (z <= -8.5e-84) {
tmp = t_2;
} else if (z <= -6.5e-257) {
tmp = t_1;
} else if (z <= -9e-289) {
tmp = x * 2.0;
} else if (z <= 1.45e-105) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = a * (27.0d0 * b)
t_2 = (-9.0d0) * (t * (z * y))
if (z <= (-8.5d-84)) then
tmp = t_2
else if (z <= (-6.5d-257)) then
tmp = t_1
else if (z <= (-9d-289)) then
tmp = x * 2.0d0
else if (z <= 1.45d-105) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = a * (27.0 * b);
double t_2 = -9.0 * (t * (z * y));
double tmp;
if (z <= -8.5e-84) {
tmp = t_2;
} else if (z <= -6.5e-257) {
tmp = t_1;
} else if (z <= -9e-289) {
tmp = x * 2.0;
} else if (z <= 1.45e-105) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = a * (27.0 * b) t_2 = -9.0 * (t * (z * y)) tmp = 0 if z <= -8.5e-84: tmp = t_2 elif z <= -6.5e-257: tmp = t_1 elif z <= -9e-289: tmp = x * 2.0 elif z <= 1.45e-105: tmp = t_1 else: tmp = t_2 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(a * Float64(27.0 * b)) t_2 = Float64(-9.0 * Float64(t * Float64(z * y))) tmp = 0.0 if (z <= -8.5e-84) tmp = t_2; elseif (z <= -6.5e-257) tmp = t_1; elseif (z <= -9e-289) tmp = Float64(x * 2.0); elseif (z <= 1.45e-105) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 = a * (27.0 * b);
t_2 = -9.0 * (t * (z * y));
tmp = 0.0;
if (z <= -8.5e-84)
tmp = t_2;
elseif (z <= -6.5e-257)
tmp = t_1;
elseif (z <= -9e-289)
tmp = x * 2.0;
elseif (z <= 1.45e-105)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e-84], t$95$2, If[LessEqual[z, -6.5e-257], t$95$1, If[LessEqual[z, -9e-289], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.45e-105], t$95$1, t$95$2]]]]]]
\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 := a \cdot \left(27 \cdot b\right)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{-84}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-257}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-289}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-105}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -8.4999999999999994e-84 or 1.45000000000000002e-105 < z Initial program 92.5%
sub-neg92.5%
sub-neg92.5%
associate-*l*88.6%
associate-*l*88.6%
Simplified88.6%
Taylor expanded in y around inf 50.4%
if -8.4999999999999994e-84 < z < -6.5000000000000002e-257 or -9.0000000000000003e-289 < z < 1.45000000000000002e-105Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.5%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in a around inf 58.8%
associate-*r*58.8%
*-commutative58.8%
associate-*r*58.9%
Simplified58.9%
if -6.5000000000000002e-257 < z < -9.0000000000000003e-289Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 51.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
(let* ((t_1 (* a (* 27.0 b))))
(if (<= z -2.8e-86)
(* t (* z (* y -9.0)))
(if (<= z -2.2e-258)
t_1
(if (<= z -9.6e-289)
(* x 2.0)
(if (<= z 2.5e-105) t_1 (* -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 t_1 = a * (27.0 * b);
double tmp;
if (z <= -2.8e-86) {
tmp = t * (z * (y * -9.0));
} else if (z <= -2.2e-258) {
tmp = t_1;
} else if (z <= -9.6e-289) {
tmp = x * 2.0;
} else if (z <= 2.5e-105) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= (-2.8d-86)) then
tmp = t * (z * (y * (-9.0d0)))
else if (z <= (-2.2d-258)) then
tmp = t_1
else if (z <= (-9.6d-289)) then
tmp = x * 2.0d0
else if (z <= 2.5d-105) then
tmp = t_1
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 t_1 = a * (27.0 * b);
double tmp;
if (z <= -2.8e-86) {
tmp = t * (z * (y * -9.0));
} else if (z <= -2.2e-258) {
tmp = t_1;
} else if (z <= -9.6e-289) {
tmp = x * 2.0;
} else if (z <= 2.5e-105) {
tmp = t_1;
} 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): t_1 = a * (27.0 * b) tmp = 0 if z <= -2.8e-86: tmp = t * (z * (y * -9.0)) elif z <= -2.2e-258: tmp = t_1 elif z <= -9.6e-289: tmp = x * 2.0 elif z <= 2.5e-105: tmp = t_1 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) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -2.8e-86) tmp = Float64(t * Float64(z * Float64(y * -9.0))); elseif (z <= -2.2e-258) tmp = t_1; elseif (z <= -9.6e-289) tmp = Float64(x * 2.0); elseif (z <= 2.5e-105) tmp = t_1; 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)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= -2.8e-86)
tmp = t * (z * (y * -9.0));
elseif (z <= -2.2e-258)
tmp = t_1;
elseif (z <= -9.6e-289)
tmp = x * 2.0;
elseif (z <= 2.5e-105)
tmp = t_1;
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_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.8e-86], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e-258], t$95$1, If[LessEqual[z, -9.6e-289], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.5e-105], t$95$1, 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}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{-86}:\\
\;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-258}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9.6 \cdot 10^{-289}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-105}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -2.80000000000000009e-86Initial program 91.9%
sub-neg91.9%
sub-neg91.9%
associate-*l*88.6%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in y around inf 52.7%
*-commutative52.7%
associate-*l*52.8%
*-commutative52.8%
associate-*l*52.8%
Simplified52.8%
if -2.80000000000000009e-86 < z < -2.20000000000000015e-258 or -9.59999999999999975e-289 < z < 2.49999999999999982e-105Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.5%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in a around inf 58.8%
associate-*r*58.8%
*-commutative58.8%
associate-*r*58.9%
Simplified58.9%
if -2.20000000000000015e-258 < z < -9.59999999999999975e-289Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 51.1%
if 2.49999999999999982e-105 < z Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*88.6%
associate-*l*88.6%
Simplified88.6%
Taylor expanded in y around inf 48.2%
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 (* a (* 27.0 b))))
(if (<= z -28000000.0)
(* z (* -9.0 (* y t)))
(if (<= z -2.9e-258)
t_1
(if (<= z -1e-288)
(* x 2.0)
(if (<= z 5.6e-106) t_1 (* -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 t_1 = a * (27.0 * b);
double tmp;
if (z <= -28000000.0) {
tmp = z * (-9.0 * (y * t));
} else if (z <= -2.9e-258) {
tmp = t_1;
} else if (z <= -1e-288) {
tmp = x * 2.0;
} else if (z <= 5.6e-106) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= (-28000000.0d0)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= (-2.9d-258)) then
tmp = t_1
else if (z <= (-1d-288)) then
tmp = x * 2.0d0
else if (z <= 5.6d-106) then
tmp = t_1
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 t_1 = a * (27.0 * b);
double tmp;
if (z <= -28000000.0) {
tmp = z * (-9.0 * (y * t));
} else if (z <= -2.9e-258) {
tmp = t_1;
} else if (z <= -1e-288) {
tmp = x * 2.0;
} else if (z <= 5.6e-106) {
tmp = t_1;
} 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): t_1 = a * (27.0 * b) tmp = 0 if z <= -28000000.0: tmp = z * (-9.0 * (y * t)) elif z <= -2.9e-258: tmp = t_1 elif z <= -1e-288: tmp = x * 2.0 elif z <= 5.6e-106: tmp = t_1 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) t_1 = Float64(a * Float64(27.0 * b)) tmp = 0.0 if (z <= -28000000.0) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= -2.9e-258) tmp = t_1; elseif (z <= -1e-288) tmp = Float64(x * 2.0); elseif (z <= 5.6e-106) tmp = t_1; 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)
t_1 = a * (27.0 * b);
tmp = 0.0;
if (z <= -28000000.0)
tmp = z * (-9.0 * (y * t));
elseif (z <= -2.9e-258)
tmp = t_1;
elseif (z <= -1e-288)
tmp = x * 2.0;
elseif (z <= 5.6e-106)
tmp = t_1;
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_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -28000000.0], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.9e-258], t$95$1, If[LessEqual[z, -1e-288], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 5.6e-106], t$95$1, 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}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq -28000000:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-258}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-288}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{-106}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -2.8e7Initial program 90.7%
Taylor expanded in y around 0 90.6%
associate-*r*90.7%
*-commutative90.7%
associate-*r*90.6%
Simplified90.6%
Taylor expanded in y around inf 55.6%
associate-*r*55.7%
associate-*l*55.5%
*-commutative55.5%
*-commutative55.5%
associate-*l*55.5%
Simplified55.5%
Taylor expanded in t around 0 55.5%
if -2.8e7 < z < -2.9e-258 or -1.00000000000000006e-288 < z < 5.59999999999999977e-106Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.6%
associate-*l*99.7%
Simplified99.7%
Taylor expanded in a around inf 56.9%
associate-*r*56.8%
*-commutative56.8%
associate-*r*56.9%
Simplified56.9%
if -2.9e-258 < z < -1.00000000000000006e-288Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 51.1%
if 5.59999999999999977e-106 < z Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*88.6%
associate-*l*88.6%
Simplified88.6%
Taylor expanded in y around inf 48.2%
Final simplification53.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 -7e+143)
(* z (* -9.0 (* y t)))
(if (or (<= z -6.4e-83) (not (<= z 4.1e-105)))
(+ (* x 2.0) (* t (* y (* z -9.0))))
(+ (* 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 <= -7e+143) {
tmp = z * (-9.0 * (y * t));
} else if ((z <= -6.4e-83) || !(z <= 4.1e-105)) {
tmp = (x * 2.0) + (t * (y * (z * -9.0)));
} 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 <= (-7d+143)) then
tmp = z * ((-9.0d0) * (y * t))
else if ((z <= (-6.4d-83)) .or. (.not. (z <= 4.1d-105))) then
tmp = (x * 2.0d0) + (t * (y * (z * (-9.0d0))))
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 <= -7e+143) {
tmp = z * (-9.0 * (y * t));
} else if ((z <= -6.4e-83) || !(z <= 4.1e-105)) {
tmp = (x * 2.0) + (t * (y * (z * -9.0)));
} 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 <= -7e+143: tmp = z * (-9.0 * (y * t)) elif (z <= -6.4e-83) or not (z <= 4.1e-105): tmp = (x * 2.0) + (t * (y * (z * -9.0))) 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 <= -7e+143) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif ((z <= -6.4e-83) || !(z <= 4.1e-105)) tmp = Float64(Float64(x * 2.0) + Float64(t * Float64(y * Float64(z * -9.0)))); 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 <= -7e+143)
tmp = z * (-9.0 * (y * t));
elseif ((z <= -6.4e-83) || ~((z <= 4.1e-105)))
tmp = (x * 2.0) + (t * (y * (z * -9.0)));
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[LessEqual[z, -7e+143], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -6.4e-83], N[Not[LessEqual[z, 4.1e-105]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(t * N[(y * N[(z * -9.0), $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 -7 \cdot 10^{+143}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-83} \lor \neg \left(z \leq 4.1 \cdot 10^{-105}\right):\\
\;\;\;\;x \cdot 2 + t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\end{array}
\end{array}
if z < -7.00000000000000017e143Initial program 87.0%
Taylor expanded in y around 0 87.0%
associate-*r*87.0%
*-commutative87.0%
associate-*r*86.9%
Simplified86.9%
Taylor expanded in y around inf 60.8%
associate-*r*61.0%
associate-*l*60.7%
*-commutative60.7%
*-commutative60.7%
associate-*l*60.6%
Simplified60.6%
Taylor expanded in t around 0 60.6%
if -7.00000000000000017e143 < z < -6.4000000000000002e-83 or 4.1000000000000003e-105 < z Initial program 94.4%
sub-neg94.4%
sub-neg94.4%
associate-*l*90.7%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in a around 0 66.8%
sub-neg66.8%
*-commutative66.8%
*-commutative66.8%
distribute-rgt-neg-in66.8%
metadata-eval66.8%
associate-*r*66.8%
associate-*l*66.8%
Applied egg-rr66.8%
if -6.4000000000000002e-83 < z < 4.1000000000000003e-105Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.5%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around 0 80.6%
Final simplification70.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
(if (<= z -1.65e+143)
(* z (* -9.0 (* y t)))
(if (<= z -1.48e-83)
(+ (* x 2.0) (* t (* y (* z -9.0))))
(if (<= z 3.3e-105)
(+ (* 27.0 (* a b)) (* x 2.0))
(- (* 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 <= -1.65e+143) {
tmp = z * (-9.0 * (y * t));
} else if (z <= -1.48e-83) {
tmp = (x * 2.0) + (t * (y * (z * -9.0)));
} else if (z <= 3.3e-105) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (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 <= (-1.65d+143)) then
tmp = z * ((-9.0d0) * (y * t))
else if (z <= (-1.48d-83)) then
tmp = (x * 2.0d0) + (t * (y * (z * (-9.0d0))))
else if (z <= 3.3d-105) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (x * 2.0d0) - (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 <= -1.65e+143) {
tmp = z * (-9.0 * (y * t));
} else if (z <= -1.48e-83) {
tmp = (x * 2.0) + (t * (y * (z * -9.0)));
} else if (z <= 3.3e-105) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = (x * 2.0) - (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 <= -1.65e+143: tmp = z * (-9.0 * (y * t)) elif z <= -1.48e-83: tmp = (x * 2.0) + (t * (y * (z * -9.0))) elif z <= 3.3e-105: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = (x * 2.0) - (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 <= -1.65e+143) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (z <= -1.48e-83) tmp = Float64(Float64(x * 2.0) + Float64(t * Float64(y * Float64(z * -9.0)))); elseif (z <= 3.3e-105) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(Float64(x * 2.0) - 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 <= -1.65e+143)
tmp = z * (-9.0 * (y * t));
elseif (z <= -1.48e-83)
tmp = (x * 2.0) + (t * (y * (z * -9.0)));
elseif (z <= 3.3e-105)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = (x * 2.0) - (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, -1.65e+143], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.48e-83], N[(N[(x * 2.0), $MachinePrecision] + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e-105], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $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 -1.65 \cdot 10^{+143}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;z \leq -1.48 \cdot 10^{-83}:\\
\;\;\;\;x \cdot 2 + t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-105}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if z < -1.65e143Initial program 87.0%
Taylor expanded in y around 0 87.0%
associate-*r*87.0%
*-commutative87.0%
associate-*r*86.9%
Simplified86.9%
Taylor expanded in y around inf 60.8%
associate-*r*61.0%
associate-*l*60.7%
*-commutative60.7%
*-commutative60.7%
associate-*l*60.6%
Simplified60.6%
Taylor expanded in t around 0 60.6%
if -1.65e143 < z < -1.48e-83Initial program 97.4%
sub-neg97.4%
sub-neg97.4%
associate-*l*95.0%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in a around 0 70.6%
sub-neg70.6%
*-commutative70.6%
*-commutative70.6%
distribute-rgt-neg-in70.6%
metadata-eval70.6%
associate-*r*70.7%
associate-*l*70.7%
Applied egg-rr70.7%
if -1.48e-83 < z < 3.2999999999999999e-105Initial program 99.8%
sub-neg99.8%
sub-neg99.8%
associate-*l*99.5%
associate-*l*99.6%
Simplified99.6%
Taylor expanded in y around 0 80.6%
if 3.2999999999999999e-105 < z Initial program 93.0%
sub-neg93.0%
sub-neg93.0%
associate-*l*88.6%
associate-*l*88.6%
Simplified88.6%
Taylor expanded in a around 0 64.9%
Final simplification70.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 (* 27.0 (* a b))))
(if (<= t -3.4e-173)
(* z (* -9.0 (* y t)))
(if (<= t 320000000000.0)
(+ t_1 (* x 2.0))
(- t_1 (* 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 t_1 = 27.0 * (a * b);
double tmp;
if (t <= -3.4e-173) {
tmp = z * (-9.0 * (y * t));
} else if (t <= 320000000000.0) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (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) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (a * b)
if (t <= (-3.4d-173)) then
tmp = z * ((-9.0d0) * (y * t))
else if (t <= 320000000000.0d0) then
tmp = t_1 + (x * 2.0d0)
else
tmp = t_1 - (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 t_1 = 27.0 * (a * b);
double tmp;
if (t <= -3.4e-173) {
tmp = z * (-9.0 * (y * t));
} else if (t <= 320000000000.0) {
tmp = t_1 + (x * 2.0);
} else {
tmp = t_1 - (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): t_1 = 27.0 * (a * b) tmp = 0 if t <= -3.4e-173: tmp = z * (-9.0 * (y * t)) elif t <= 320000000000.0: tmp = t_1 + (x * 2.0) else: tmp = t_1 - (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) t_1 = Float64(27.0 * Float64(a * b)) tmp = 0.0 if (t <= -3.4e-173) tmp = Float64(z * Float64(-9.0 * Float64(y * t))); elseif (t <= 320000000000.0) tmp = Float64(t_1 + Float64(x * 2.0)); else tmp = Float64(t_1 - 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)
t_1 = 27.0 * (a * b);
tmp = 0.0;
if (t <= -3.4e-173)
tmp = z * (-9.0 * (y * t));
elseif (t <= 320000000000.0)
tmp = t_1 + (x * 2.0);
else
tmp = t_1 - (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_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e-173], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 320000000000.0], N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - 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}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{-173}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;t \leq 320000000000:\\
\;\;\;\;t_1 + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t_1 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
\end{array}
\end{array}
if t < -3.3999999999999999e-173Initial program 96.8%
Taylor expanded in y around 0 96.8%
associate-*r*96.8%
*-commutative96.8%
associate-*r*96.7%
Simplified96.7%
Taylor expanded in y around inf 49.3%
associate-*r*49.4%
associate-*l*47.3%
*-commutative47.3%
*-commutative47.3%
associate-*l*47.3%
Simplified47.3%
Taylor expanded in t around 0 47.3%
if -3.3999999999999999e-173 < t < 3.2e11Initial program 92.9%
sub-neg92.9%
sub-neg92.9%
associate-*l*98.6%
associate-*l*98.7%
Simplified98.7%
Taylor expanded in y around 0 79.5%
if 3.2e11 < t Initial program 95.2%
sub-neg95.2%
sub-neg95.2%
associate-*l*78.2%
associate-*l*78.2%
Simplified78.2%
Taylor expanded in x around 0 87.9%
Final simplification70.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 (* a (* 27.0 b))))
(if (<= z 2.25e-79)
(+ t_1 (- (* x 2.0) (* (* y 9.0) (* z t))))
(+ (- (* x 2.0) (* 9.0 (* z (* y t)))) 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 = a * (27.0 * b);
double tmp;
if (z <= 2.25e-79) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + 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) :: tmp
t_1 = a * (27.0d0 * b)
if (z <= 2.25d-79) then
tmp = t_1 + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = ((x * 2.0d0) - (9.0d0 * (z * (y * t)))) + 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 = a * (27.0 * b);
double tmp;
if (z <= 2.25e-79) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + 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 = a * (27.0 * b) tmp = 0 if z <= 2.25e-79: tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t))) else: tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + 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(a * Float64(27.0 * b)) tmp = 0.0 if (z <= 2.25e-79) tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + 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 = a * (27.0 * b);
tmp = 0.0;
if (z <= 2.25e-79)
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + 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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.25e-79], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq 2.25 \cdot 10^{-79}:\\
\;\;\;\;t_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + t_1\\
\end{array}
\end{array}
if z < 2.2500000000000001e-79Initial program 95.9%
sub-neg95.9%
sub-neg95.9%
associate-*l*94.2%
associate-*l*94.2%
Simplified94.2%
if 2.2500000000000001e-79 < z Initial program 92.6%
sub-neg92.6%
sub-neg92.6%
associate-*l*88.0%
associate-*l*88.0%
Simplified88.0%
Taylor expanded in y around 0 92.7%
associate-*r*97.2%
*-commutative97.2%
Simplified97.2%
Final simplification95.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 (<= t 1e+16) (+ (- (* x 2.0) (* 9.0 (* z (* y t)))) (* a (* 27.0 b))) (+ (- (* x 2.0) (* t (* y (* z 9.0)))) (* b (* 27.0 a)))))
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 (t <= 1e+16) {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (y * (z * 9.0)))) + (b * (27.0 * a));
}
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 (t <= 1d+16) then
tmp = ((x * 2.0d0) - (9.0d0 * (z * (y * t)))) + (a * (27.0d0 * b))
else
tmp = ((x * 2.0d0) - (t * (y * (z * 9.0d0)))) + (b * (27.0d0 * a))
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 (t <= 1e+16) {
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
} else {
tmp = ((x * 2.0) - (t * (y * (z * 9.0)))) + (b * (27.0 * a));
}
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 t <= 1e+16: tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b)) else: tmp = ((x * 2.0) - (t * (y * (z * 9.0)))) + (b * (27.0 * a)) 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 (t <= 1e+16) tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + Float64(a * Float64(27.0 * b))); else tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0)))) + Float64(b * Float64(27.0 * a))); 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 (t <= 1e+16)
tmp = ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
else
tmp = ((x * 2.0) - (t * (y * (z * 9.0)))) + (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. 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, 1e+16], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $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}\;t \leq 10^{+16}:\\
\;\;\;\;\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\
\end{array}
\end{array}
if t < 1e16Initial program 94.8%
sub-neg94.8%
sub-neg94.8%
associate-*l*97.2%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in y around 0 94.8%
associate-*r*95.8%
*-commutative95.8%
Simplified95.8%
if 1e16 < t Initial program 95.0%
Taylor expanded in y around 0 94.9%
associate-*r*95.0%
*-commutative95.0%
associate-*r*95.0%
Simplified95.0%
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 (+ (- (* x 2.0) (* 9.0 (* z (* y t)))) (* a (* 27.0 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) {
return ((x * 2.0) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
}
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) - (9.0d0 * (z * (y * t)))) + (a * (27.0d0 * b))
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) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
}
[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) - (9.0 * (z * (y * t)))) + (a * (27.0 * b))
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(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t)))) + Float64(a * Float64(27.0 * b))) 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) - (9.0 * (z * (y * t)))) + (a * (27.0 * b));
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[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Initial program 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*92.2%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in y around 0 94.9%
associate-*r*93.7%
*-commutative93.7%
Simplified93.7%
Final simplification93.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 (or (<= a -8e-19) (not (<= a 0.55))) (* 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 ((a <= -8e-19) || !(a <= 0.55)) {
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 ((a <= (-8d-19)) .or. (.not. (a <= 0.55d0))) 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 ((a <= -8e-19) || !(a <= 0.55)) {
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 (a <= -8e-19) or not (a <= 0.55): 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 ((a <= -8e-19) || !(a <= 0.55)) 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 ((a <= -8e-19) || ~((a <= 0.55)))
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[a, -8e-19], N[Not[LessEqual[a, 0.55]], $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}\;a \leq -8 \cdot 10^{-19} \lor \neg \left(a \leq 0.55\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -7.9999999999999998e-19 or 0.55000000000000004 < a Initial program 92.7%
sub-neg92.7%
sub-neg92.7%
associate-*l*91.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in a around inf 54.5%
if -7.9999999999999998e-19 < a < 0.55000000000000004Initial program 98.0%
sub-neg98.0%
sub-neg98.0%
associate-*l*94.1%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in x around inf 28.6%
Final simplification44.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. (FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.6e-18) (not (<= a 2.6e-19))) (* a (* 27.0 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 ((a <= -2.6e-18) || !(a <= 2.6e-19)) {
tmp = a * (27.0 * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2.6d-18)) .or. (.not. (a <= 2.6d-19))) then
tmp = a * (27.0d0 * b)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.6e-18) || !(a <= 2.6e-19)) {
tmp = a * (27.0 * b);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.6e-18) or not (a <= 2.6e-19): tmp = a * (27.0 * b) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.6e-18) || !(a <= 2.6e-19)) tmp = Float64(a * Float64(27.0 * b)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((a <= -2.6e-18) || ~((a <= 2.6e-19)))
tmp = a * (27.0 * b);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.6e-18], N[Not[LessEqual[a, 2.6e-19]], $MachinePrecision]], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{-18} \lor \neg \left(a \leq 2.6 \cdot 10^{-19}\right):\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if a < -2.6e-18 or 2.60000000000000013e-19 < a Initial program 92.8%
sub-neg92.8%
sub-neg92.8%
associate-*l*91.1%
associate-*l*91.1%
Simplified91.1%
Taylor expanded in a around inf 54.7%
associate-*r*54.7%
*-commutative54.7%
associate-*r*54.8%
Simplified54.8%
if -2.6e-18 < a < 2.60000000000000013e-19Initial program 98.0%
sub-neg98.0%
sub-neg98.0%
associate-*l*94.0%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in x around inf 29.0%
Final simplification44.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 (* 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 94.9%
sub-neg94.9%
sub-neg94.9%
associate-*l*92.2%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in x around inf 21.6%
Final simplification21.6%
(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 2024021
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(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)))