
(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
(let* ((t_1 (* b (* a 27.0))))
(if (<= (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) t_1) 5e+295)
(+ (- (* x 2.0) (* t (* y (* 9.0 z)))) t_1)
(fma a (* 27.0 b) (fma x 2.0 (* (* y -9.0) (* z 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) {
double t_1 = b * (a * 27.0);
double tmp;
if ((((x * 2.0) - (((y * 9.0) * z) * t)) + t_1) <= 5e+295) {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + t_1;
} else {
tmp = fma(a, (27.0 * b), fma(x, 2.0, ((y * -9.0) * (z * t))));
}
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(b * Float64(a * 27.0)) tmp = 0.0 if (Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + t_1) <= 5e+295) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * z)))) + t_1); else tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(Float64(y * -9.0) * Float64(z * t)))); 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_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], 5e+295], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(N[(y * -9.0), $MachinePrecision] * N[(z * t), $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 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + t\_1 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \left(y \cdot -9\right) \cdot \left(z \cdot t\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) (*.f64 (*.f64 a #s(literal 27 binary64)) b)) < 4.99999999999999991e295Initial program 94.9%
associate-*l*94.9%
*-commutative94.9%
Applied egg-rr94.9%
if 4.99999999999999991e295 < (+.f64 (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) (*.f64 (*.f64 a #s(literal 27 binary64)) b)) Initial program 87.3%
+-commutative87.3%
associate-+r-87.3%
*-commutative87.3%
cancel-sign-sub-inv87.3%
associate-*r*93.5%
distribute-lft-neg-in93.5%
*-commutative93.5%
cancel-sign-sub-inv93.5%
associate-+r-93.5%
associate-*l*93.5%
fma-define97.8%
fma-neg97.8%
associate-*l*97.8%
distribute-lft-neg-in97.8%
*-commutative97.8%
distribute-rgt-neg-in97.8%
metadata-eval97.8%
Simplified97.8%
Final simplification95.4%
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 (* b (* a 27.0))))
(if (<= b -1e-46)
t_1
(if (<= b -2.9e-135)
(* x 2.0)
(if (<= b -1.6e-145)
t_1
(if (<= b -1.7e-176)
(* -9.0 (* t (* y z)))
(if (<= b 6.4e-215)
(* x 2.0)
(if (<= b 4e-154)
(* (* y z) (* t -9.0))
(if (<= b 1.55e+24) (* x 2.0) 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 = b * (a * 27.0);
double tmp;
if (b <= -1e-46) {
tmp = t_1;
} else if (b <= -2.9e-135) {
tmp = x * 2.0;
} else if (b <= -1.6e-145) {
tmp = t_1;
} else if (b <= -1.7e-176) {
tmp = -9.0 * (t * (y * z));
} else if (b <= 6.4e-215) {
tmp = x * 2.0;
} else if (b <= 4e-154) {
tmp = (y * z) * (t * -9.0);
} else if (b <= 1.55e+24) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a * 27.0d0)
if (b <= (-1d-46)) then
tmp = t_1
else if (b <= (-2.9d-135)) then
tmp = x * 2.0d0
else if (b <= (-1.6d-145)) then
tmp = t_1
else if (b <= (-1.7d-176)) then
tmp = (-9.0d0) * (t * (y * z))
else if (b <= 6.4d-215) then
tmp = x * 2.0d0
else if (b <= 4d-154) then
tmp = (y * z) * (t * (-9.0d0))
else if (b <= 1.55d+24) then
tmp = x * 2.0d0
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 = b * (a * 27.0);
double tmp;
if (b <= -1e-46) {
tmp = t_1;
} else if (b <= -2.9e-135) {
tmp = x * 2.0;
} else if (b <= -1.6e-145) {
tmp = t_1;
} else if (b <= -1.7e-176) {
tmp = -9.0 * (t * (y * z));
} else if (b <= 6.4e-215) {
tmp = x * 2.0;
} else if (b <= 4e-154) {
tmp = (y * z) * (t * -9.0);
} else if (b <= 1.55e+24) {
tmp = x * 2.0;
} 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 = b * (a * 27.0) tmp = 0 if b <= -1e-46: tmp = t_1 elif b <= -2.9e-135: tmp = x * 2.0 elif b <= -1.6e-145: tmp = t_1 elif b <= -1.7e-176: tmp = -9.0 * (t * (y * z)) elif b <= 6.4e-215: tmp = x * 2.0 elif b <= 4e-154: tmp = (y * z) * (t * -9.0) elif b <= 1.55e+24: tmp = x * 2.0 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(b * Float64(a * 27.0)) tmp = 0.0 if (b <= -1e-46) tmp = t_1; elseif (b <= -2.9e-135) tmp = Float64(x * 2.0); elseif (b <= -1.6e-145) tmp = t_1; elseif (b <= -1.7e-176) tmp = Float64(-9.0 * Float64(t * Float64(y * z))); elseif (b <= 6.4e-215) tmp = Float64(x * 2.0); elseif (b <= 4e-154) tmp = Float64(Float64(y * z) * Float64(t * -9.0)); elseif (b <= 1.55e+24) tmp = Float64(x * 2.0); 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 = b * (a * 27.0);
tmp = 0.0;
if (b <= -1e-46)
tmp = t_1;
elseif (b <= -2.9e-135)
tmp = x * 2.0;
elseif (b <= -1.6e-145)
tmp = t_1;
elseif (b <= -1.7e-176)
tmp = -9.0 * (t * (y * z));
elseif (b <= 6.4e-215)
tmp = x * 2.0;
elseif (b <= 4e-154)
tmp = (y * z) * (t * -9.0);
elseif (b <= 1.55e+24)
tmp = x * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1e-46], t$95$1, If[LessEqual[b, -2.9e-135], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, -1.6e-145], t$95$1, If[LessEqual[b, -1.7e-176], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.4e-215], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 4e-154], N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.55e+24], N[(x * 2.0), $MachinePrecision], 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 := b \cdot \left(a \cdot 27\right)\\
\mathbf{if}\;b \leq -1 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-135}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq -1.6 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.7 \cdot 10^{-176}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{elif}\;b \leq 6.4 \cdot 10^{-215}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 4 \cdot 10^{-154}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{+24}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.00000000000000002e-46 or -2.9000000000000002e-135 < b < -1.60000000000000004e-145 or 1.55000000000000005e24 < b Initial program 93.9%
Taylor expanded in a around inf 61.8%
*-commutative61.8%
*-commutative61.8%
associate-*r*61.8%
*-commutative61.8%
Simplified61.8%
if -1.00000000000000002e-46 < b < -2.9000000000000002e-135 or -1.6999999999999999e-176 < b < 6.4000000000000003e-215 or 3.9999999999999999e-154 < b < 1.55000000000000005e24Initial program 94.5%
Taylor expanded in x around inf 49.9%
if -1.60000000000000004e-145 < b < -1.6999999999999999e-176Initial program 80.3%
Taylor expanded in y around inf 41.4%
if 6.4000000000000003e-215 < b < 3.9999999999999999e-154Initial program 87.8%
Taylor expanded in y around inf 48.3%
associate-*r*48.4%
Applied egg-rr48.4%
Final simplification55.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
(let* ((t_1 (* b (* a 27.0))) (t_2 (* -9.0 (* t (* y z)))))
(if (<= b -6e-36)
t_1
(if (<= b -2.9e-135)
(* x 2.0)
(if (<= b -1.6e-145)
t_1
(if (<= b -6.2e-177)
t_2
(if (<= b 5.2e-215)
(* x 2.0)
(if (<= b 5e-154) t_2 (if (<= b 2.4e+24) (* x 2.0) 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 = b * (a * 27.0);
double t_2 = -9.0 * (t * (y * z));
double tmp;
if (b <= -6e-36) {
tmp = t_1;
} else if (b <= -2.9e-135) {
tmp = x * 2.0;
} else if (b <= -1.6e-145) {
tmp = t_1;
} else if (b <= -6.2e-177) {
tmp = t_2;
} else if (b <= 5.2e-215) {
tmp = x * 2.0;
} else if (b <= 5e-154) {
tmp = t_2;
} else if (b <= 2.4e+24) {
tmp = x * 2.0;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = b * (a * 27.0d0)
t_2 = (-9.0d0) * (t * (y * z))
if (b <= (-6d-36)) then
tmp = t_1
else if (b <= (-2.9d-135)) then
tmp = x * 2.0d0
else if (b <= (-1.6d-145)) then
tmp = t_1
else if (b <= (-6.2d-177)) then
tmp = t_2
else if (b <= 5.2d-215) then
tmp = x * 2.0d0
else if (b <= 5d-154) then
tmp = t_2
else if (b <= 2.4d+24) then
tmp = x * 2.0d0
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 = b * (a * 27.0);
double t_2 = -9.0 * (t * (y * z));
double tmp;
if (b <= -6e-36) {
tmp = t_1;
} else if (b <= -2.9e-135) {
tmp = x * 2.0;
} else if (b <= -1.6e-145) {
tmp = t_1;
} else if (b <= -6.2e-177) {
tmp = t_2;
} else if (b <= 5.2e-215) {
tmp = x * 2.0;
} else if (b <= 5e-154) {
tmp = t_2;
} else if (b <= 2.4e+24) {
tmp = x * 2.0;
} 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 = b * (a * 27.0) t_2 = -9.0 * (t * (y * z)) tmp = 0 if b <= -6e-36: tmp = t_1 elif b <= -2.9e-135: tmp = x * 2.0 elif b <= -1.6e-145: tmp = t_1 elif b <= -6.2e-177: tmp = t_2 elif b <= 5.2e-215: tmp = x * 2.0 elif b <= 5e-154: tmp = t_2 elif b <= 2.4e+24: tmp = x * 2.0 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(b * Float64(a * 27.0)) t_2 = Float64(-9.0 * Float64(t * Float64(y * z))) tmp = 0.0 if (b <= -6e-36) tmp = t_1; elseif (b <= -2.9e-135) tmp = Float64(x * 2.0); elseif (b <= -1.6e-145) tmp = t_1; elseif (b <= -6.2e-177) tmp = t_2; elseif (b <= 5.2e-215) tmp = Float64(x * 2.0); elseif (b <= 5e-154) tmp = t_2; elseif (b <= 2.4e+24) tmp = Float64(x * 2.0); 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 = b * (a * 27.0);
t_2 = -9.0 * (t * (y * z));
tmp = 0.0;
if (b <= -6e-36)
tmp = t_1;
elseif (b <= -2.9e-135)
tmp = x * 2.0;
elseif (b <= -1.6e-145)
tmp = t_1;
elseif (b <= -6.2e-177)
tmp = t_2;
elseif (b <= 5.2e-215)
tmp = x * 2.0;
elseif (b <= 5e-154)
tmp = t_2;
elseif (b <= 2.4e+24)
tmp = x * 2.0;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6e-36], t$95$1, If[LessEqual[b, -2.9e-135], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, -1.6e-145], t$95$1, If[LessEqual[b, -6.2e-177], t$95$2, If[LessEqual[b, 5.2e-215], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 5e-154], t$95$2, If[LessEqual[b, 2.4e+24], N[(x * 2.0), $MachinePrecision], 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 := b \cdot \left(a \cdot 27\right)\\
t_2 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;b \leq -6 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-135}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq -1.6 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -6.2 \cdot 10^{-177}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-215}:\\
\;\;\;\;x \cdot 2\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-154}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{+24}:\\
\;\;\;\;x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.0000000000000003e-36 or -2.9000000000000002e-135 < b < -1.60000000000000004e-145 or 2.4000000000000001e24 < b Initial program 93.9%
Taylor expanded in a around inf 62.2%
*-commutative62.2%
*-commutative62.2%
associate-*r*62.2%
*-commutative62.2%
Simplified62.2%
if -6.0000000000000003e-36 < b < -2.9000000000000002e-135 or -6.20000000000000036e-177 < b < 5.2e-215 or 5.0000000000000002e-154 < b < 2.4000000000000001e24Initial program 94.5%
Taylor expanded in x around inf 50.4%
if -1.60000000000000004e-145 < b < -6.20000000000000036e-177 or 5.2e-215 < b < 5.0000000000000002e-154Initial program 85.9%
Taylor expanded in y around inf 46.6%
Final simplification56.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
(if (<= t -1.16e-99)
(- (* x 2.0) (* 9.0 (* y (* z t))))
(if (<= t 1.58e+47)
(+ (* 27.0 (* a b)) (* x 2.0))
(if (or (<= t 9.5e+98) (not (<= t 1.14e+105)))
(- (* x 2.0) (* 9.0 (* t (* y z))))
(* x (+ 2.0 (* 27.0 (/ (* a b) x))))))))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 <= -1.16e-99) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (t <= 1.58e+47) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else if ((t <= 9.5e+98) || !(t <= 1.14e+105)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = x * (2.0 + (27.0 * ((a * b) / x)));
}
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 <= (-1.16d-99)) then
tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
else if (t <= 1.58d+47) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else if ((t <= 9.5d+98) .or. (.not. (t <= 1.14d+105))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else
tmp = x * (2.0d0 + (27.0d0 * ((a * b) / x)))
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 <= -1.16e-99) {
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
} else if (t <= 1.58e+47) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else if ((t <= 9.5e+98) || !(t <= 1.14e+105)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = x * (2.0 + (27.0 * ((a * b) / x)));
}
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 <= -1.16e-99: tmp = (x * 2.0) - (9.0 * (y * (z * t))) elif t <= 1.58e+47: tmp = (27.0 * (a * b)) + (x * 2.0) elif (t <= 9.5e+98) or not (t <= 1.14e+105): tmp = (x * 2.0) - (9.0 * (t * (y * z))) else: tmp = x * (2.0 + (27.0 * ((a * b) / x))) 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 <= -1.16e-99) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t)))); elseif (t <= 1.58e+47) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); elseif ((t <= 9.5e+98) || !(t <= 1.14e+105)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); else tmp = Float64(x * Float64(2.0 + Float64(27.0 * Float64(Float64(a * b) / x)))); 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 <= -1.16e-99)
tmp = (x * 2.0) - (9.0 * (y * (z * t)));
elseif (t <= 1.58e+47)
tmp = (27.0 * (a * b)) + (x * 2.0);
elseif ((t <= 9.5e+98) || ~((t <= 1.14e+105)))
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
else
tmp = x * (2.0 + (27.0 * ((a * b) / x)));
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, -1.16e-99], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.58e+47], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 9.5e+98], N[Not[LessEqual[t, 1.14e+105]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 + N[(27.0 * N[(N[(a * b), $MachinePrecision] / x), $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}\;t \leq -1.16 \cdot 10^{-99}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;t \leq 1.58 \cdot 10^{+47}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+98} \lor \neg \left(t \leq 1.14 \cdot 10^{+105}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 + 27 \cdot \frac{a \cdot b}{x}\right)\\
\end{array}
\end{array}
if t < -1.1599999999999999e-99Initial program 97.8%
Taylor expanded in a around 0 59.0%
*-commutative59.0%
associate-*r*58.9%
Applied egg-rr58.9%
if -1.1599999999999999e-99 < t < 1.5800000000000001e47Initial program 89.4%
Taylor expanded in y around 0 77.0%
if 1.5800000000000001e47 < t < 9.5000000000000001e98 or 1.13999999999999997e105 < t Initial program 95.7%
Taylor expanded in a around 0 82.9%
if 9.5000000000000001e98 < t < 1.13999999999999997e105Initial program 100.0%
Taylor expanded in y around 0 95.1%
Taylor expanded in x around inf 95.1%
Final simplification72.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 (<= t -2.15e-98)
(* (* y t) (* z -9.0))
(if (<= t 1.65e+46)
(+ (* 27.0 (* a b)) (* x 2.0))
(if (or (<= t 9.5e+98) (not (<= t 1.4e+105)))
(- (* x 2.0) (* 9.0 (* t (* y z))))
(* x (+ 2.0 (* 27.0 (/ (* a b) x))))))))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 <= -2.15e-98) {
tmp = (y * t) * (z * -9.0);
} else if (t <= 1.65e+46) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else if ((t <= 9.5e+98) || !(t <= 1.4e+105)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = x * (2.0 + (27.0 * ((a * b) / x)));
}
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 <= (-2.15d-98)) then
tmp = (y * t) * (z * (-9.0d0))
else if (t <= 1.65d+46) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else if ((t <= 9.5d+98) .or. (.not. (t <= 1.4d+105))) then
tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
else
tmp = x * (2.0d0 + (27.0d0 * ((a * b) / x)))
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 <= -2.15e-98) {
tmp = (y * t) * (z * -9.0);
} else if (t <= 1.65e+46) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else if ((t <= 9.5e+98) || !(t <= 1.4e+105)) {
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
} else {
tmp = x * (2.0 + (27.0 * ((a * b) / x)));
}
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 <= -2.15e-98: tmp = (y * t) * (z * -9.0) elif t <= 1.65e+46: tmp = (27.0 * (a * b)) + (x * 2.0) elif (t <= 9.5e+98) or not (t <= 1.4e+105): tmp = (x * 2.0) - (9.0 * (t * (y * z))) else: tmp = x * (2.0 + (27.0 * ((a * b) / x))) 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 <= -2.15e-98) tmp = Float64(Float64(y * t) * Float64(z * -9.0)); elseif (t <= 1.65e+46) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); elseif ((t <= 9.5e+98) || !(t <= 1.4e+105)) tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z)))); else tmp = Float64(x * Float64(2.0 + Float64(27.0 * Float64(Float64(a * b) / x)))); 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 <= -2.15e-98)
tmp = (y * t) * (z * -9.0);
elseif (t <= 1.65e+46)
tmp = (27.0 * (a * b)) + (x * 2.0);
elseif ((t <= 9.5e+98) || ~((t <= 1.4e+105)))
tmp = (x * 2.0) - (9.0 * (t * (y * z)));
else
tmp = x * (2.0 + (27.0 * ((a * b) / x)));
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, -2.15e-98], N[(N[(y * t), $MachinePrecision] * N[(z * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e+46], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 9.5e+98], N[Not[LessEqual[t, 1.4e+105]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 + N[(27.0 * N[(N[(a * b), $MachinePrecision] / x), $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}\;t \leq -2.15 \cdot 10^{-98}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(z \cdot -9\right)\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{+46}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+98} \lor \neg \left(t \leq 1.4 \cdot 10^{+105}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(2 + 27 \cdot \frac{a \cdot b}{x}\right)\\
\end{array}
\end{array}
if t < -2.14999999999999994e-98Initial program 97.8%
Taylor expanded in y around inf 35.4%
*-commutative35.4%
associate-*r*34.3%
associate-*l*34.3%
Simplified34.3%
if -2.14999999999999994e-98 < t < 1.6499999999999999e46Initial program 89.4%
Taylor expanded in y around 0 77.0%
if 1.6499999999999999e46 < t < 9.5000000000000001e98 or 1.4000000000000001e105 < t Initial program 95.7%
Taylor expanded in a around 0 82.9%
if 9.5000000000000001e98 < t < 1.4000000000000001e105Initial program 100.0%
Taylor expanded in y around 0 95.1%
Taylor expanded in x around inf 95.1%
Final simplification64.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
(let* ((t_1 (* (* y 9.0) z)))
(if (<= t_1 1e+280)
(+ (- (* x 2.0) (* t_1 t)) (* b (* a 27.0)))
(* y (- (+ (* 2.0 (/ x y)) (* 27.0 (/ (* a b) y))) (* 9.0 (* z t)))))))assert(x < y && y < z && z < t && t < a && a < b);
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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 1e+280) {
tmp = ((x * 2.0) - (t_1 * t)) + (b * (a * 27.0));
} else {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = (y * 9.0d0) * z
if (t_1 <= 1d+280) then
tmp = ((x * 2.0d0) - (t_1 * t)) + (b * (a * 27.0d0))
else
tmp = y * (((2.0d0 * (x / y)) + (27.0d0 * ((a * b) / y))) - (9.0d0 * (z * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 1e+280) {
tmp = ((x * 2.0) - (t_1 * t)) + (b * (a * 27.0));
} else {
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * t)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (y * 9.0) * z tmp = 0 if t_1 <= 1e+280: tmp = ((x * 2.0) - (t_1 * t)) + (b * (a * 27.0)) else: tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(y * 9.0) * z) tmp = 0.0 if (t_1 <= 1e+280) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(b * Float64(a * 27.0))); else tmp = Float64(y * Float64(Float64(Float64(2.0 * Float64(x / y)) + Float64(27.0 * Float64(Float64(a * b) / y))) - Float64(9.0 * Float64(z * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 1e+280)
tmp = ((x * 2.0) - (t_1 * t)) + (b * (a * 27.0));
else
tmp = y * (((2.0 * (x / y)) + (27.0 * ((a * b) / y))) - (9.0 * (z * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+280], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(N[(2.0 * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t\_1 \leq 10^{+280}:\\
\;\;\;\;\left(x \cdot 2 - t\_1 \cdot t\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\left(2 \cdot \frac{x}{y} + 27 \cdot \frac{a \cdot b}{y}\right) - 9 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 1e280Initial program 95.0%
if 1e280 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 75.8%
Taylor expanded in y around inf 99.9%
Final simplification95.4%
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 (* (* y 9.0) z)))
(if (<= t_1 5e+301)
(+ (- (* x 2.0) (* t_1 t)) (* b (* a 27.0)))
(* y (- (* 27.0 (/ (* a b) y)) (* 9.0 (* z 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) {
double t_1 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+301) {
tmp = ((x * 2.0) - (t_1 * t)) + (b * (a * 27.0));
} else {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = (y * 9.0d0) * z
if (t_1 <= 5d+301) then
tmp = ((x * 2.0d0) - (t_1 * t)) + (b * (a * 27.0d0))
else
tmp = y * ((27.0d0 * ((a * b) / y)) - (9.0d0 * (z * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = (y * 9.0) * z;
double tmp;
if (t_1 <= 5e+301) {
tmp = ((x * 2.0) - (t_1 * t)) + (b * (a * 27.0));
} else {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = (y * 9.0) * z tmp = 0 if t_1 <= 5e+301: tmp = ((x * 2.0) - (t_1 * t)) + (b * (a * 27.0)) else: tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) 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(y * 9.0) * z) tmp = 0.0 if (t_1 <= 5e+301) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t_1 * t)) + Float64(b * Float64(a * 27.0))); else tmp = Float64(y * Float64(Float64(27.0 * Float64(Float64(a * b) / y)) - Float64(9.0 * Float64(z * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 = (y * 9.0) * z;
tmp = 0.0;
if (t_1 <= 5e+301)
tmp = ((x * 2.0) - (t_1 * t)) + (b * (a * 27.0));
else
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(y * 9.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+301], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := \left(y \cdot 9\right) \cdot z\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\left(x \cdot 2 - t\_1 \cdot t\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(27 \cdot \frac{a \cdot b}{y} - 9 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 5.0000000000000004e301Initial program 95.1%
if 5.0000000000000004e301 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 71.6%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around 0 94.3%
Final simplification95.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 (<= (* (* y 9.0) z) 5e+301) (+ (- (* x 2.0) (* t (* y (* 9.0 z)))) (* b (* a 27.0))) (* y (- (* 27.0 (/ (* a b) y)) (* 9.0 (* z 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) {
double tmp;
if (((y * 9.0) * z) <= 5e+301) {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (a * 27.0));
} else {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((y * 9.0d0) * z) <= 5d+301) then
tmp = ((x * 2.0d0) - (t * (y * (9.0d0 * z)))) + (b * (a * 27.0d0))
else
tmp = y * ((27.0d0 * ((a * b) / y)) - (9.0d0 * (z * t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((y * 9.0) * z) <= 5e+301) {
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (a * 27.0));
} else {
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if ((y * 9.0) * z) <= 5e+301: tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (a * 27.0)) else: tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t))) return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(y * 9.0) * z) <= 5e+301) tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * z)))) + Float64(b * Float64(a * 27.0))); else tmp = Float64(y * Float64(Float64(27.0 * Float64(Float64(a * b) / y)) - Float64(9.0 * Float64(z * t)))); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (((y * 9.0) * z) <= 5e+301)
tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (a * 27.0));
else
tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision], 5e+301], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(y \cdot 9\right) \cdot z \leq 5 \cdot 10^{+301}:\\
\;\;\;\;\left(x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(27 \cdot \frac{a \cdot b}{y} - 9 \cdot \left(z \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 5.0000000000000004e301Initial program 95.1%
associate-*l*95.1%
*-commutative95.1%
Applied egg-rr95.1%
if 5.0000000000000004e301 < (*.f64 (*.f64 y #s(literal 9 binary64)) z) Initial program 71.6%
Taylor expanded in y around inf 99.9%
Taylor expanded in x around 0 94.3%
Final simplification95.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
(let* ((t_1 (* 9.0 (* t (* y z)))))
(if (or (<= b -5e-45) (not (<= b 2.4e+24)))
(- (* 27.0 (* a b)) t_1)
(- (* x 2.0) 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 * (y * z));
double tmp;
if ((b <= -5e-45) || !(b <= 2.4e+24)) {
tmp = (27.0 * (a * b)) - t_1;
} else {
tmp = (x * 2.0) - 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 = 9.0d0 * (t * (y * z))
if ((b <= (-5d-45)) .or. (.not. (b <= 2.4d+24))) then
tmp = (27.0d0 * (a * b)) - t_1
else
tmp = (x * 2.0d0) - 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 * (y * z));
double tmp;
if ((b <= -5e-45) || !(b <= 2.4e+24)) {
tmp = (27.0 * (a * b)) - t_1;
} else {
tmp = (x * 2.0) - 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 * (y * z)) tmp = 0 if (b <= -5e-45) or not (b <= 2.4e+24): tmp = (27.0 * (a * b)) - t_1 else: tmp = (x * 2.0) - 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(y * z))) tmp = 0.0 if ((b <= -5e-45) || !(b <= 2.4e+24)) tmp = Float64(Float64(27.0 * Float64(a * b)) - t_1); else tmp = Float64(Float64(x * 2.0) - 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 * (y * z));
tmp = 0.0;
if ((b <= -5e-45) || ~((b <= 2.4e+24)))
tmp = (27.0 * (a * b)) - t_1;
else
tmp = (x * 2.0) - t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[b, -5e-45], N[Not[LessEqual[b, 2.4e+24]], $MachinePrecision]], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * 2.0), $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 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;b \leq -5 \cdot 10^{-45} \lor \neg \left(b \leq 2.4 \cdot 10^{+24}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2 - t\_1\\
\end{array}
\end{array}
if b < -4.99999999999999976e-45 or 2.4000000000000001e24 < b Initial program 93.8%
Taylor expanded in x around 0 77.2%
if -4.99999999999999976e-45 < b < 2.4000000000000001e24Initial program 93.2%
Taylor expanded in a around 0 83.2%
Final simplification80.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 (<= z -5.6e+65) (* (* y t) (* z -9.0)) (if (<= z 2.3e-13) (+ (* 27.0 (* a b)) (* x 2.0)) (* -9.0 (* t (* y z))))))
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.6e+65) {
tmp = (y * t) * (z * -9.0);
} else if (z <= 2.3e-13) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = -9.0 * (t * (y * z));
}
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 <= (-5.6d+65)) then
tmp = (y * t) * (z * (-9.0d0))
else if (z <= 2.3d-13) then
tmp = (27.0d0 * (a * b)) + (x * 2.0d0)
else
tmp = (-9.0d0) * (t * (y * z))
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 <= -5.6e+65) {
tmp = (y * t) * (z * -9.0);
} else if (z <= 2.3e-13) {
tmp = (27.0 * (a * b)) + (x * 2.0);
} else {
tmp = -9.0 * (t * (y * z));
}
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 <= -5.6e+65: tmp = (y * t) * (z * -9.0) elif z <= 2.3e-13: tmp = (27.0 * (a * b)) + (x * 2.0) else: tmp = -9.0 * (t * (y * z)) 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.6e+65) tmp = Float64(Float64(y * t) * Float64(z * -9.0)); elseif (z <= 2.3e-13) tmp = Float64(Float64(27.0 * Float64(a * b)) + Float64(x * 2.0)); else tmp = Float64(-9.0 * Float64(t * Float64(y * z))); 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 <= -5.6e+65)
tmp = (y * t) * (z * -9.0);
elseif (z <= 2.3e-13)
tmp = (27.0 * (a * b)) + (x * 2.0);
else
tmp = -9.0 * (t * (y * z));
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, -5.6e+65], N[(N[(y * t), $MachinePrecision] * N[(z * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e-13], N[(N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(y * z), $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.6 \cdot 10^{+65}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(z \cdot -9\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-13}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\
\mathbf{else}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -5.5999999999999998e65Initial program 87.3%
Taylor expanded in y around inf 43.2%
*-commutative43.2%
associate-*r*49.4%
associate-*l*47.5%
Simplified47.5%
if -5.5999999999999998e65 < z < 2.29999999999999979e-13Initial program 98.6%
Taylor expanded in y around 0 81.4%
if 2.29999999999999979e-13 < z Initial program 87.4%
Taylor expanded in y around inf 51.1%
Final simplification67.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 (if (or (<= b -1.16e-42) (not (<= b 1.45e+24))) (* b (* a 27.0)) (* 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 <= -1.16e-42) || !(b <= 1.45e+24)) {
tmp = b * (a * 27.0);
} else {
tmp = x * 2.0;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.16d-42)) .or. (.not. (b <= 1.45d+24))) then
tmp = b * (a * 27.0d0)
else
tmp = x * 2.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.16e-42) || !(b <= 1.45e+24)) {
tmp = b * (a * 27.0);
} else {
tmp = x * 2.0;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) [x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.16e-42) or not (b <= 1.45e+24): tmp = b * (a * 27.0) else: tmp = x * 2.0 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.16e-42) || !(b <= 1.45e+24)) tmp = Float64(b * Float64(a * 27.0)); else tmp = Float64(x * 2.0); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((b <= -1.16e-42) || ~((b <= 1.45e+24)))
tmp = b * (a * 27.0);
else
tmp = x * 2.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.16e-42], N[Not[LessEqual[b, 1.45e+24]], $MachinePrecision]], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.16 \cdot 10^{-42} \lor \neg \left(b \leq 1.45 \cdot 10^{+24}\right):\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.1600000000000001e-42 or 1.4499999999999999e24 < b Initial program 93.8%
Taylor expanded in a around inf 61.9%
*-commutative61.9%
*-commutative61.9%
associate-*r*61.9%
*-commutative61.9%
Simplified61.9%
if -1.1600000000000001e-42 < b < 1.4499999999999999e24Initial program 93.2%
Taylor expanded in x around inf 46.5%
Final simplification54.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 (or (<= b -1.5e-46) (not (<= b 8.5e+24))) (* 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 <= -1.5e-46) || !(b <= 8.5e+24)) {
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 <= (-1.5d-46)) .or. (.not. (b <= 8.5d+24))) 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 <= -1.5e-46) || !(b <= 8.5e+24)) {
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 <= -1.5e-46) or not (b <= 8.5e+24): 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 <= -1.5e-46) || !(b <= 8.5e+24)) 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 <= -1.5e-46) || ~((b <= 8.5e+24)))
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, -1.5e-46], N[Not[LessEqual[b, 8.5e+24]], $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 -1.5 \cdot 10^{-46} \lor \neg \left(b \leq 8.5 \cdot 10^{+24}\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 2\\
\end{array}
\end{array}
if b < -1.49999999999999994e-46 or 8.49999999999999959e24 < b Initial program 93.8%
Taylor expanded in a around inf 61.9%
if -1.49999999999999994e-46 < b < 8.49999999999999959e24Initial program 93.2%
Taylor expanded in x around inf 46.5%
Final simplification54.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 (* 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.5%
Taylor expanded in x around inf 32.5%
Final simplification32.5%
(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 2024096
(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)))