
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (or (<= x -8e-32) (not (<= x 6.6e-35)))
(+
(*
x
(+
(* -4.0 i)
(+ (* -4.0 (/ (* a t) x)) (+ (* 18.0 (* t (* y z))) (/ (* b c) x)))))
(* j (* k -27.0)))
(-
(-
(+ (* b c) (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))))
(* i (* x 4.0)))
(* k (* j 27.0)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -8e-32) || !(x <= 6.6e-35)) {
tmp = (x * ((-4.0 * i) + ((-4.0 * ((a * t) / x)) + ((18.0 * (t * (y * z))) + ((b * c) / x))))) + (j * (k * -27.0));
} else {
tmp = (((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-8d-32)) .or. (.not. (x <= 6.6d-35))) then
tmp = (x * (((-4.0d0) * i) + (((-4.0d0) * ((a * t) / x)) + ((18.0d0 * (t * (y * z))) + ((b * c) / x))))) + (j * (k * (-27.0d0)))
else
tmp = (((b * c) + ((t * (z * (y * (x * 18.0d0)))) - (t * (a * 4.0d0)))) - (i * (x * 4.0d0))) - (k * (j * 27.0d0))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -8e-32) || !(x <= 6.6e-35)) {
tmp = (x * ((-4.0 * i) + ((-4.0 * ((a * t) / x)) + ((18.0 * (t * (y * z))) + ((b * c) / x))))) + (j * (k * -27.0));
} else {
tmp = (((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0));
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -8e-32) or not (x <= 6.6e-35): tmp = (x * ((-4.0 * i) + ((-4.0 * ((a * t) / x)) + ((18.0 * (t * (y * z))) + ((b * c) / x))))) + (j * (k * -27.0)) else: tmp = (((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0)) return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -8e-32) || !(x <= 6.6e-35)) tmp = Float64(Float64(x * Float64(Float64(-4.0 * i) + Float64(Float64(-4.0 * Float64(Float64(a * t) / x)) + Float64(Float64(18.0 * Float64(t * Float64(y * z))) + Float64(Float64(b * c) / x))))) + Float64(j * Float64(k * -27.0))); else tmp = Float64(Float64(Float64(Float64(b * c) + Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0)))) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -8e-32) || ~((x <= 6.6e-35)))
tmp = (x * ((-4.0 * i) + ((-4.0 * ((a * t) / x)) + ((18.0 * (t * (y * z))) + ((b * c) / x))))) + (j * (k * -27.0));
else
tmp = (((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -8e-32], N[Not[LessEqual[x, 6.6e-35]], $MachinePrecision]], N[(N[(x * N[(N[(-4.0 * i), $MachinePrecision] + N[(N[(-4.0 * N[(N[(a * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-32} \lor \neg \left(x \leq 6.6 \cdot 10^{-35}\right):\\
\;\;\;\;x \cdot \left(-4 \cdot i + \left(-4 \cdot \frac{a \cdot t}{x} + \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) + \frac{b \cdot c}{x}\right)\right)\right) + j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot c + \left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right)\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right)\\
\end{array}
\end{array}
if x < -8.00000000000000045e-32 or 6.6000000000000001e-35 < x Initial program 67.6%
Simplified78.3%
Taylor expanded in x around inf 89.1%
if -8.00000000000000045e-32 < x < 6.6000000000000001e-35Initial program 97.5%
Final simplification93.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(-
(+ (* b c) (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))))
(* i (* x 4.0)))
(* k (* j 27.0)))
INFINITY)
(-
(+ (* b c) (* t (- (* (* y z) (* x 18.0)) (* a 4.0))))
(+ (* x (* i 4.0)) (* j (* k 27.0))))
(+ (* j (* k -27.0)) (* z (+ (* 18.0 (* t (* x y))) (/ (* b c) z))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= ((double) INFINITY)) {
tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (k * 27.0)));
} else {
tmp = (j * (k * -27.0)) + (z * ((18.0 * (t * (x * y))) + ((b * c) / z)));
}
return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= Double.POSITIVE_INFINITY) {
tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (k * 27.0)));
} else {
tmp = (j * (k * -27.0)) + (z * ((18.0 * (t * (x * y))) + ((b * c) / z)));
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if ((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= math.inf: tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (k * 27.0))) else: tmp = (j * (k * -27.0)) + (z * ((18.0 * (t * (x * y))) + ((b * c) / z))) return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(b * c) + Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0)))) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) <= Inf) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(y * z) * Float64(x * 18.0)) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(i * 4.0)) + Float64(j * Float64(k * 27.0)))); else tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(z * Float64(Float64(18.0 * Float64(t * Float64(x * y))) + Float64(Float64(b * c) / z)))); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= Inf)
tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (k * 27.0)));
else
tmp = (j * (k * -27.0)) + (z * ((18.0 * (t * (x * y))) + ((b * c) / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(b * c), $MachinePrecision] + N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(x * 18.0), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(18.0 * N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(b \cdot c + \left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right)\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right) \leq \infty:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot 18\right) - a \cdot 4\right)\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(k \cdot 27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + z \cdot \left(18 \cdot \left(t \cdot \left(x \cdot y\right)\right) + \frac{b \cdot c}{z}\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0Initial program 92.7%
Simplified93.9%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) Initial program 0.0%
Simplified29.0%
Taylor expanded in x around inf 58.1%
Taylor expanded in z around inf 16.1%
Taylor expanded in b around inf 58.1%
Final simplification89.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0)))
(t_2 (+ t_1 (+ (* b c) (* -4.0 (* x i)))))
(t_3 (+ t_1 (* t (+ (* -4.0 a) (* 18.0 (* x (* y z))))))))
(if (<= t -2.5e+162)
t_3
(if (<= t -1.7e+128)
t_2
(if (<= t -8.2e+59)
t_3
(if (<= t -1.75e+43)
t_2
(if (<= t -3.8e-70)
t_3
(if (<= t 1.16e-58)
t_2
(if (<= t 1.82e+127)
(+ t_1 (+ (* b c) (* -4.0 (* a t))))
t_3)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = t_1 + ((b * c) + (-4.0 * (x * i)));
double t_3 = t_1 + (t * ((-4.0 * a) + (18.0 * (x * (y * z)))));
double tmp;
if (t <= -2.5e+162) {
tmp = t_3;
} else if (t <= -1.7e+128) {
tmp = t_2;
} else if (t <= -8.2e+59) {
tmp = t_3;
} else if (t <= -1.75e+43) {
tmp = t_2;
} else if (t <= -3.8e-70) {
tmp = t_3;
} else if (t <= 1.16e-58) {
tmp = t_2;
} else if (t <= 1.82e+127) {
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
} else {
tmp = t_3;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = t_1 + ((b * c) + ((-4.0d0) * (x * i)))
t_3 = t_1 + (t * (((-4.0d0) * a) + (18.0d0 * (x * (y * z)))))
if (t <= (-2.5d+162)) then
tmp = t_3
else if (t <= (-1.7d+128)) then
tmp = t_2
else if (t <= (-8.2d+59)) then
tmp = t_3
else if (t <= (-1.75d+43)) then
tmp = t_2
else if (t <= (-3.8d-70)) then
tmp = t_3
else if (t <= 1.16d-58) then
tmp = t_2
else if (t <= 1.82d+127) then
tmp = t_1 + ((b * c) + ((-4.0d0) * (a * t)))
else
tmp = t_3
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = t_1 + ((b * c) + (-4.0 * (x * i)));
double t_3 = t_1 + (t * ((-4.0 * a) + (18.0 * (x * (y * z)))));
double tmp;
if (t <= -2.5e+162) {
tmp = t_3;
} else if (t <= -1.7e+128) {
tmp = t_2;
} else if (t <= -8.2e+59) {
tmp = t_3;
} else if (t <= -1.75e+43) {
tmp = t_2;
} else if (t <= -3.8e-70) {
tmp = t_3;
} else if (t <= 1.16e-58) {
tmp = t_2;
} else if (t <= 1.82e+127) {
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
} else {
tmp = t_3;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = t_1 + ((b * c) + (-4.0 * (x * i))) t_3 = t_1 + (t * ((-4.0 * a) + (18.0 * (x * (y * z))))) tmp = 0 if t <= -2.5e+162: tmp = t_3 elif t <= -1.7e+128: tmp = t_2 elif t <= -8.2e+59: tmp = t_3 elif t <= -1.75e+43: tmp = t_2 elif t <= -3.8e-70: tmp = t_3 elif t <= 1.16e-58: tmp = t_2 elif t <= 1.82e+127: tmp = t_1 + ((b * c) + (-4.0 * (a * t))) else: tmp = t_3 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(t_1 + Float64(Float64(b * c) + Float64(-4.0 * Float64(x * i)))) t_3 = Float64(t_1 + Float64(t * Float64(Float64(-4.0 * a) + Float64(18.0 * Float64(x * Float64(y * z)))))) tmp = 0.0 if (t <= -2.5e+162) tmp = t_3; elseif (t <= -1.7e+128) tmp = t_2; elseif (t <= -8.2e+59) tmp = t_3; elseif (t <= -1.75e+43) tmp = t_2; elseif (t <= -3.8e-70) tmp = t_3; elseif (t <= 1.16e-58) tmp = t_2; elseif (t <= 1.82e+127) tmp = Float64(t_1 + Float64(Float64(b * c) + Float64(-4.0 * Float64(a * t)))); else tmp = t_3; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = t_1 + ((b * c) + (-4.0 * (x * i)));
t_3 = t_1 + (t * ((-4.0 * a) + (18.0 * (x * (y * z)))));
tmp = 0.0;
if (t <= -2.5e+162)
tmp = t_3;
elseif (t <= -1.7e+128)
tmp = t_2;
elseif (t <= -8.2e+59)
tmp = t_3;
elseif (t <= -1.75e+43)
tmp = t_2;
elseif (t <= -3.8e-70)
tmp = t_3;
elseif (t <= 1.16e-58)
tmp = t_2;
elseif (t <= 1.82e+127)
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 + N[(t * N[(N[(-4.0 * a), $MachinePrecision] + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.5e+162], t$95$3, If[LessEqual[t, -1.7e+128], t$95$2, If[LessEqual[t, -8.2e+59], t$95$3, If[LessEqual[t, -1.75e+43], t$95$2, If[LessEqual[t, -3.8e-70], t$95$3, If[LessEqual[t, 1.16e-58], t$95$2, If[LessEqual[t, 1.82e+127], N[(t$95$1 + N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := t\_1 + \left(b \cdot c + -4 \cdot \left(x \cdot i\right)\right)\\
t_3 := t\_1 + t \cdot \left(-4 \cdot a + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+162}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{+128}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -8.2 \cdot 10^{+59}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq -1.75 \cdot 10^{+43}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-70}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 1.16 \cdot 10^{-58}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.82 \cdot 10^{+127}:\\
\;\;\;\;t\_1 + \left(b \cdot c + -4 \cdot \left(a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if t < -2.4999999999999998e162 or -1.6999999999999999e128 < t < -8.2e59 or -1.7500000000000001e43 < t < -3.7999999999999998e-70 or 1.82000000000000009e127 < t Initial program 82.0%
Simplified89.0%
Taylor expanded in t around inf 85.3%
if -2.4999999999999998e162 < t < -1.6999999999999999e128 or -8.2e59 < t < -1.7500000000000001e43 or -3.7999999999999998e-70 < t < 1.16000000000000007e-58Initial program 81.4%
Simplified83.8%
Taylor expanded in t around 0 84.7%
if 1.16000000000000007e-58 < t < 1.82000000000000009e127Initial program 80.3%
Simplified85.7%
Taylor expanded in x around 0 80.2%
Final simplification84.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))) (t_2 (+ (* b c) t_1)))
(if (<= (* b c) -2.2e+186)
t_2
(if (<= (* b c) -1.25e-63)
(+ t_1 (* t (* -4.0 a)))
(if (<= (* b c) 2.3e-42)
(+ (* x (* -4.0 i)) (* -27.0 (* j k)))
(if (<= (* b c) 1.7e+108)
(+ t_1 (* x (* (* t y) (* 18.0 z))))
t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double tmp;
if ((b * c) <= -2.2e+186) {
tmp = t_2;
} else if ((b * c) <= -1.25e-63) {
tmp = t_1 + (t * (-4.0 * a));
} else if ((b * c) <= 2.3e-42) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 1.7e+108) {
tmp = t_1 + (x * ((t * y) * (18.0 * z)));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = (b * c) + t_1
if ((b * c) <= (-2.2d+186)) then
tmp = t_2
else if ((b * c) <= (-1.25d-63)) then
tmp = t_1 + (t * ((-4.0d0) * a))
else if ((b * c) <= 2.3d-42) then
tmp = (x * ((-4.0d0) * i)) + ((-27.0d0) * (j * k))
else if ((b * c) <= 1.7d+108) then
tmp = t_1 + (x * ((t * y) * (18.0d0 * z)))
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double tmp;
if ((b * c) <= -2.2e+186) {
tmp = t_2;
} else if ((b * c) <= -1.25e-63) {
tmp = t_1 + (t * (-4.0 * a));
} else if ((b * c) <= 2.3e-42) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 1.7e+108) {
tmp = t_1 + (x * ((t * y) * (18.0 * z)));
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = (b * c) + t_1 tmp = 0 if (b * c) <= -2.2e+186: tmp = t_2 elif (b * c) <= -1.25e-63: tmp = t_1 + (t * (-4.0 * a)) elif (b * c) <= 2.3e-42: tmp = (x * (-4.0 * i)) + (-27.0 * (j * k)) elif (b * c) <= 1.7e+108: tmp = t_1 + (x * ((t * y) * (18.0 * z))) else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(Float64(b * c) + t_1) tmp = 0.0 if (Float64(b * c) <= -2.2e+186) tmp = t_2; elseif (Float64(b * c) <= -1.25e-63) tmp = Float64(t_1 + Float64(t * Float64(-4.0 * a))); elseif (Float64(b * c) <= 2.3e-42) tmp = Float64(Float64(x * Float64(-4.0 * i)) + Float64(-27.0 * Float64(j * k))); elseif (Float64(b * c) <= 1.7e+108) tmp = Float64(t_1 + Float64(x * Float64(Float64(t * y) * Float64(18.0 * z)))); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = (b * c) + t_1;
tmp = 0.0;
if ((b * c) <= -2.2e+186)
tmp = t_2;
elseif ((b * c) <= -1.25e-63)
tmp = t_1 + (t * (-4.0 * a));
elseif ((b * c) <= 2.3e-42)
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
elseif ((b * c) <= 1.7e+108)
tmp = t_1 + (x * ((t * y) * (18.0 * z)));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2.2e+186], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], -1.25e-63], N[(t$95$1 + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.3e-42], N[(N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.7e+108], N[(t$95$1 + N[(x * N[(N[(t * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := b \cdot c + t\_1\\
\mathbf{if}\;b \cdot c \leq -2.2 \cdot 10^{+186}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq -1.25 \cdot 10^{-63}:\\
\;\;\;\;t\_1 + t \cdot \left(-4 \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq 2.3 \cdot 10^{-42}:\\
\;\;\;\;x \cdot \left(-4 \cdot i\right) + -27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 1.7 \cdot 10^{+108}:\\
\;\;\;\;t\_1 + x \cdot \left(\left(t \cdot y\right) \cdot \left(18 \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 b c) < -2.1999999999999998e186 or 1.69999999999999998e108 < (*.f64 b c) Initial program 72.0%
Simplified79.4%
Taylor expanded in b around inf 76.8%
if -2.1999999999999998e186 < (*.f64 b c) < -1.25e-63Initial program 87.2%
Simplified89.1%
Taylor expanded in a around inf 54.9%
*-commutative54.9%
*-commutative54.9%
associate-*r*54.9%
*-commutative54.9%
Simplified54.9%
if -1.25e-63 < (*.f64 b c) < 2.30000000000000004e-42Initial program 85.9%
Simplified91.5%
Taylor expanded in i around inf 63.3%
associate-*r*63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in j around 0 63.3%
if 2.30000000000000004e-42 < (*.f64 b c) < 1.69999999999999998e108Initial program 76.3%
Simplified76.0%
Taylor expanded in y around inf 66.4%
*-commutative66.4%
associate-*r*69.7%
associate-*l*69.7%
*-commutative69.7%
*-commutative69.7%
associate-*r*72.9%
associate-*l*73.0%
*-commutative73.0%
Simplified73.0%
Final simplification66.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))) (t_2 (+ (* b c) t_1)))
(if (<= (* b c) -3.2e+188)
t_2
(if (<= (* b c) -7.8e-64)
(+ t_1 (* t (* -4.0 a)))
(if (<= (* b c) 1.4e-43)
(+ (* x (* -4.0 i)) (* -27.0 (* j k)))
(if (<= (* b c) 4.2e+170)
(+ t_1 (* x (* t (* z (* 18.0 y)))))
t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double tmp;
if ((b * c) <= -3.2e+188) {
tmp = t_2;
} else if ((b * c) <= -7.8e-64) {
tmp = t_1 + (t * (-4.0 * a));
} else if ((b * c) <= 1.4e-43) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 4.2e+170) {
tmp = t_1 + (x * (t * (z * (18.0 * y))));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = (b * c) + t_1
if ((b * c) <= (-3.2d+188)) then
tmp = t_2
else if ((b * c) <= (-7.8d-64)) then
tmp = t_1 + (t * ((-4.0d0) * a))
else if ((b * c) <= 1.4d-43) then
tmp = (x * ((-4.0d0) * i)) + ((-27.0d0) * (j * k))
else if ((b * c) <= 4.2d+170) then
tmp = t_1 + (x * (t * (z * (18.0d0 * y))))
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double tmp;
if ((b * c) <= -3.2e+188) {
tmp = t_2;
} else if ((b * c) <= -7.8e-64) {
tmp = t_1 + (t * (-4.0 * a));
} else if ((b * c) <= 1.4e-43) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 4.2e+170) {
tmp = t_1 + (x * (t * (z * (18.0 * y))));
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = (b * c) + t_1 tmp = 0 if (b * c) <= -3.2e+188: tmp = t_2 elif (b * c) <= -7.8e-64: tmp = t_1 + (t * (-4.0 * a)) elif (b * c) <= 1.4e-43: tmp = (x * (-4.0 * i)) + (-27.0 * (j * k)) elif (b * c) <= 4.2e+170: tmp = t_1 + (x * (t * (z * (18.0 * y)))) else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(Float64(b * c) + t_1) tmp = 0.0 if (Float64(b * c) <= -3.2e+188) tmp = t_2; elseif (Float64(b * c) <= -7.8e-64) tmp = Float64(t_1 + Float64(t * Float64(-4.0 * a))); elseif (Float64(b * c) <= 1.4e-43) tmp = Float64(Float64(x * Float64(-4.0 * i)) + Float64(-27.0 * Float64(j * k))); elseif (Float64(b * c) <= 4.2e+170) tmp = Float64(t_1 + Float64(x * Float64(t * Float64(z * Float64(18.0 * y))))); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = (b * c) + t_1;
tmp = 0.0;
if ((b * c) <= -3.2e+188)
tmp = t_2;
elseif ((b * c) <= -7.8e-64)
tmp = t_1 + (t * (-4.0 * a));
elseif ((b * c) <= 1.4e-43)
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
elseif ((b * c) <= 4.2e+170)
tmp = t_1 + (x * (t * (z * (18.0 * y))));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -3.2e+188], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], -7.8e-64], N[(t$95$1 + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.4e-43], N[(N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4.2e+170], N[(t$95$1 + N[(x * N[(t * N[(z * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := b \cdot c + t\_1\\
\mathbf{if}\;b \cdot c \leq -3.2 \cdot 10^{+188}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq -7.8 \cdot 10^{-64}:\\
\;\;\;\;t\_1 + t \cdot \left(-4 \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq 1.4 \cdot 10^{-43}:\\
\;\;\;\;x \cdot \left(-4 \cdot i\right) + -27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 4.2 \cdot 10^{+170}:\\
\;\;\;\;t\_1 + x \cdot \left(t \cdot \left(z \cdot \left(18 \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 b c) < -3.1999999999999997e188 or 4.19999999999999996e170 < (*.f64 b c) Initial program 69.9%
Simplified78.3%
Taylor expanded in b around inf 80.4%
if -3.1999999999999997e188 < (*.f64 b c) < -7.7999999999999994e-64Initial program 87.2%
Simplified89.1%
Taylor expanded in a around inf 54.9%
*-commutative54.9%
*-commutative54.9%
associate-*r*54.9%
*-commutative54.9%
Simplified54.9%
if -7.7999999999999994e-64 < (*.f64 b c) < 1.3999999999999999e-43Initial program 85.9%
Simplified91.5%
Taylor expanded in i around inf 63.3%
associate-*r*63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in j around 0 63.3%
if 1.3999999999999999e-43 < (*.f64 b c) < 4.19999999999999996e170Initial program 78.7%
Simplified78.4%
Taylor expanded in y around inf 63.0%
*-commutative63.0%
associate-*r*65.5%
associate-*l*65.5%
*-commutative65.5%
*-commutative65.5%
associate-*l*65.5%
*-commutative65.5%
associate-*l*65.6%
*-commutative65.6%
Simplified65.6%
Final simplification65.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))) (t_2 (+ (* b c) t_1)))
(if (<= (* b c) -2.2e+190)
t_2
(if (<= (* b c) -2.6e-65)
(+ t_1 (* t (* -4.0 a)))
(if (<= (* b c) 1.05e-41)
(+ (* x (* -4.0 i)) (* -27.0 (* j k)))
(if (<= (* b c) 1.25e+184)
(+ t_1 (* x (* 18.0 (* t (* y z)))))
t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double tmp;
if ((b * c) <= -2.2e+190) {
tmp = t_2;
} else if ((b * c) <= -2.6e-65) {
tmp = t_1 + (t * (-4.0 * a));
} else if ((b * c) <= 1.05e-41) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 1.25e+184) {
tmp = t_1 + (x * (18.0 * (t * (y * z))));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = (b * c) + t_1
if ((b * c) <= (-2.2d+190)) then
tmp = t_2
else if ((b * c) <= (-2.6d-65)) then
tmp = t_1 + (t * ((-4.0d0) * a))
else if ((b * c) <= 1.05d-41) then
tmp = (x * ((-4.0d0) * i)) + ((-27.0d0) * (j * k))
else if ((b * c) <= 1.25d+184) then
tmp = t_1 + (x * (18.0d0 * (t * (y * z))))
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double tmp;
if ((b * c) <= -2.2e+190) {
tmp = t_2;
} else if ((b * c) <= -2.6e-65) {
tmp = t_1 + (t * (-4.0 * a));
} else if ((b * c) <= 1.05e-41) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 1.25e+184) {
tmp = t_1 + (x * (18.0 * (t * (y * z))));
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = (b * c) + t_1 tmp = 0 if (b * c) <= -2.2e+190: tmp = t_2 elif (b * c) <= -2.6e-65: tmp = t_1 + (t * (-4.0 * a)) elif (b * c) <= 1.05e-41: tmp = (x * (-4.0 * i)) + (-27.0 * (j * k)) elif (b * c) <= 1.25e+184: tmp = t_1 + (x * (18.0 * (t * (y * z)))) else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(Float64(b * c) + t_1) tmp = 0.0 if (Float64(b * c) <= -2.2e+190) tmp = t_2; elseif (Float64(b * c) <= -2.6e-65) tmp = Float64(t_1 + Float64(t * Float64(-4.0 * a))); elseif (Float64(b * c) <= 1.05e-41) tmp = Float64(Float64(x * Float64(-4.0 * i)) + Float64(-27.0 * Float64(j * k))); elseif (Float64(b * c) <= 1.25e+184) tmp = Float64(t_1 + Float64(x * Float64(18.0 * Float64(t * Float64(y * z))))); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = (b * c) + t_1;
tmp = 0.0;
if ((b * c) <= -2.2e+190)
tmp = t_2;
elseif ((b * c) <= -2.6e-65)
tmp = t_1 + (t * (-4.0 * a));
elseif ((b * c) <= 1.05e-41)
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
elseif ((b * c) <= 1.25e+184)
tmp = t_1 + (x * (18.0 * (t * (y * z))));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2.2e+190], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], -2.6e-65], N[(t$95$1 + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.05e-41], N[(N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.25e+184], N[(t$95$1 + N[(x * N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := b \cdot c + t\_1\\
\mathbf{if}\;b \cdot c \leq -2.2 \cdot 10^{+190}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq -2.6 \cdot 10^{-65}:\\
\;\;\;\;t\_1 + t \cdot \left(-4 \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq 1.05 \cdot 10^{-41}:\\
\;\;\;\;x \cdot \left(-4 \cdot i\right) + -27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 1.25 \cdot 10^{+184}:\\
\;\;\;\;t\_1 + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 b c) < -2.2e190 or 1.25e184 < (*.f64 b c) Initial program 69.9%
Simplified78.3%
Taylor expanded in b around inf 80.4%
if -2.2e190 < (*.f64 b c) < -2.6000000000000001e-65Initial program 87.2%
Simplified89.1%
Taylor expanded in a around inf 54.9%
*-commutative54.9%
*-commutative54.9%
associate-*r*54.9%
*-commutative54.9%
Simplified54.9%
if -2.6000000000000001e-65 < (*.f64 b c) < 1.05000000000000006e-41Initial program 85.9%
Simplified91.5%
Taylor expanded in i around inf 63.3%
associate-*r*63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in j around 0 63.3%
if 1.05000000000000006e-41 < (*.f64 b c) < 1.25e184Initial program 78.7%
Simplified78.4%
Taylor expanded in y around inf 63.0%
*-commutative63.0%
associate-*r*65.5%
associate-*l*65.5%
*-commutative65.5%
*-commutative65.5%
associate-*r*68.1%
associate-*l*68.1%
*-commutative68.1%
Simplified68.1%
Taylor expanded in t around 0 65.5%
Final simplification65.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))) (t_2 (+ (* b c) t_1)))
(if (<= (* b c) -2.2e+186)
t_2
(if (<= (* b c) -3.6e-65)
(+ t_1 (* t (* -4.0 a)))
(if (<= (* b c) 8.8e-44)
(+ (* x (* -4.0 i)) (* -27.0 (* j k)))
(if (<= (* b c) 6.6e+181)
(+ t_1 (* 18.0 (* (* y z) (* x t))))
t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double tmp;
if ((b * c) <= -2.2e+186) {
tmp = t_2;
} else if ((b * c) <= -3.6e-65) {
tmp = t_1 + (t * (-4.0 * a));
} else if ((b * c) <= 8.8e-44) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 6.6e+181) {
tmp = t_1 + (18.0 * ((y * z) * (x * t)));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = (b * c) + t_1
if ((b * c) <= (-2.2d+186)) then
tmp = t_2
else if ((b * c) <= (-3.6d-65)) then
tmp = t_1 + (t * ((-4.0d0) * a))
else if ((b * c) <= 8.8d-44) then
tmp = (x * ((-4.0d0) * i)) + ((-27.0d0) * (j * k))
else if ((b * c) <= 6.6d+181) then
tmp = t_1 + (18.0d0 * ((y * z) * (x * t)))
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double tmp;
if ((b * c) <= -2.2e+186) {
tmp = t_2;
} else if ((b * c) <= -3.6e-65) {
tmp = t_1 + (t * (-4.0 * a));
} else if ((b * c) <= 8.8e-44) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 6.6e+181) {
tmp = t_1 + (18.0 * ((y * z) * (x * t)));
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = (b * c) + t_1 tmp = 0 if (b * c) <= -2.2e+186: tmp = t_2 elif (b * c) <= -3.6e-65: tmp = t_1 + (t * (-4.0 * a)) elif (b * c) <= 8.8e-44: tmp = (x * (-4.0 * i)) + (-27.0 * (j * k)) elif (b * c) <= 6.6e+181: tmp = t_1 + (18.0 * ((y * z) * (x * t))) else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(Float64(b * c) + t_1) tmp = 0.0 if (Float64(b * c) <= -2.2e+186) tmp = t_2; elseif (Float64(b * c) <= -3.6e-65) tmp = Float64(t_1 + Float64(t * Float64(-4.0 * a))); elseif (Float64(b * c) <= 8.8e-44) tmp = Float64(Float64(x * Float64(-4.0 * i)) + Float64(-27.0 * Float64(j * k))); elseif (Float64(b * c) <= 6.6e+181) tmp = Float64(t_1 + Float64(18.0 * Float64(Float64(y * z) * Float64(x * t)))); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = (b * c) + t_1;
tmp = 0.0;
if ((b * c) <= -2.2e+186)
tmp = t_2;
elseif ((b * c) <= -3.6e-65)
tmp = t_1 + (t * (-4.0 * a));
elseif ((b * c) <= 8.8e-44)
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
elseif ((b * c) <= 6.6e+181)
tmp = t_1 + (18.0 * ((y * z) * (x * t)));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2.2e+186], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], -3.6e-65], N[(t$95$1 + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 8.8e-44], N[(N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 6.6e+181], N[(t$95$1 + N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := b \cdot c + t\_1\\
\mathbf{if}\;b \cdot c \leq -2.2 \cdot 10^{+186}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq -3.6 \cdot 10^{-65}:\\
\;\;\;\;t\_1 + t \cdot \left(-4 \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq 8.8 \cdot 10^{-44}:\\
\;\;\;\;x \cdot \left(-4 \cdot i\right) + -27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 6.6 \cdot 10^{+181}:\\
\;\;\;\;t\_1 + 18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 b c) < -2.1999999999999998e186 or 6.60000000000000034e181 < (*.f64 b c) Initial program 69.9%
Simplified78.3%
Taylor expanded in b around inf 80.4%
if -2.1999999999999998e186 < (*.f64 b c) < -3.5999999999999998e-65Initial program 87.2%
Simplified89.1%
Taylor expanded in a around inf 54.9%
*-commutative54.9%
*-commutative54.9%
associate-*r*54.9%
*-commutative54.9%
Simplified54.9%
if -3.5999999999999998e-65 < (*.f64 b c) < 8.80000000000000048e-44Initial program 85.9%
Simplified91.5%
Taylor expanded in i around inf 63.3%
associate-*r*63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in j around 0 63.3%
if 8.80000000000000048e-44 < (*.f64 b c) < 6.60000000000000034e181Initial program 78.7%
Simplified78.4%
Taylor expanded in y around inf 63.0%
associate-*r*63.0%
Simplified63.0%
Final simplification65.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))) (t_2 (+ (* b c) t_1)))
(if (<= (* b c) -2.9e+193)
t_2
(if (<= (* b c) -7.2e-65)
(+ t_1 (* t (* -4.0 a)))
(if (<= (* b c) 1.6e-43)
(+ (* x (* -4.0 i)) (* -27.0 (* j k)))
(if (<= (* b c) 7.5e+179)
(+ t_1 (* 18.0 (* t (* x (* y z)))))
t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double tmp;
if ((b * c) <= -2.9e+193) {
tmp = t_2;
} else if ((b * c) <= -7.2e-65) {
tmp = t_1 + (t * (-4.0 * a));
} else if ((b * c) <= 1.6e-43) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 7.5e+179) {
tmp = t_1 + (18.0 * (t * (x * (y * z))));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = (b * c) + t_1
if ((b * c) <= (-2.9d+193)) then
tmp = t_2
else if ((b * c) <= (-7.2d-65)) then
tmp = t_1 + (t * ((-4.0d0) * a))
else if ((b * c) <= 1.6d-43) then
tmp = (x * ((-4.0d0) * i)) + ((-27.0d0) * (j * k))
else if ((b * c) <= 7.5d+179) then
tmp = t_1 + (18.0d0 * (t * (x * (y * z))))
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double tmp;
if ((b * c) <= -2.9e+193) {
tmp = t_2;
} else if ((b * c) <= -7.2e-65) {
tmp = t_1 + (t * (-4.0 * a));
} else if ((b * c) <= 1.6e-43) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 7.5e+179) {
tmp = t_1 + (18.0 * (t * (x * (y * z))));
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = (b * c) + t_1 tmp = 0 if (b * c) <= -2.9e+193: tmp = t_2 elif (b * c) <= -7.2e-65: tmp = t_1 + (t * (-4.0 * a)) elif (b * c) <= 1.6e-43: tmp = (x * (-4.0 * i)) + (-27.0 * (j * k)) elif (b * c) <= 7.5e+179: tmp = t_1 + (18.0 * (t * (x * (y * z)))) else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(Float64(b * c) + t_1) tmp = 0.0 if (Float64(b * c) <= -2.9e+193) tmp = t_2; elseif (Float64(b * c) <= -7.2e-65) tmp = Float64(t_1 + Float64(t * Float64(-4.0 * a))); elseif (Float64(b * c) <= 1.6e-43) tmp = Float64(Float64(x * Float64(-4.0 * i)) + Float64(-27.0 * Float64(j * k))); elseif (Float64(b * c) <= 7.5e+179) tmp = Float64(t_1 + Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))); else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = (b * c) + t_1;
tmp = 0.0;
if ((b * c) <= -2.9e+193)
tmp = t_2;
elseif ((b * c) <= -7.2e-65)
tmp = t_1 + (t * (-4.0 * a));
elseif ((b * c) <= 1.6e-43)
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
elseif ((b * c) <= 7.5e+179)
tmp = t_1 + (18.0 * (t * (x * (y * z))));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2.9e+193], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], -7.2e-65], N[(t$95$1 + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.6e-43], N[(N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 7.5e+179], N[(t$95$1 + N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := b \cdot c + t\_1\\
\mathbf{if}\;b \cdot c \leq -2.9 \cdot 10^{+193}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq -7.2 \cdot 10^{-65}:\\
\;\;\;\;t\_1 + t \cdot \left(-4 \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq 1.6 \cdot 10^{-43}:\\
\;\;\;\;x \cdot \left(-4 \cdot i\right) + -27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 7.5 \cdot 10^{+179}:\\
\;\;\;\;t\_1 + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 b c) < -2.90000000000000013e193 or 7.50000000000000007e179 < (*.f64 b c) Initial program 69.9%
Simplified78.3%
Taylor expanded in b around inf 80.4%
if -2.90000000000000013e193 < (*.f64 b c) < -7.1999999999999996e-65Initial program 87.2%
Simplified89.1%
Taylor expanded in a around inf 54.9%
*-commutative54.9%
*-commutative54.9%
associate-*r*54.9%
*-commutative54.9%
Simplified54.9%
if -7.1999999999999996e-65 < (*.f64 b c) < 1.59999999999999992e-43Initial program 85.9%
Simplified91.5%
Taylor expanded in i around inf 63.3%
associate-*r*63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in j around 0 63.3%
if 1.59999999999999992e-43 < (*.f64 b c) < 7.50000000000000007e179Initial program 78.7%
Simplified78.4%
Taylor expanded in y around inf 63.0%
Final simplification65.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0)))
(t_2 (+ (* b c) t_1))
(t_3 (+ t_1 (* t (* -4.0 a)))))
(if (<= (* b c) -4.1e+186)
t_2
(if (<= (* b c) -3e-63)
t_3
(if (<= (* b c) 5.2e-45)
(+ (* x (* -4.0 i)) (* -27.0 (* j k)))
(if (<= (* b c) 2.6e+173) t_3 t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double t_3 = t_1 + (t * (-4.0 * a));
double tmp;
if ((b * c) <= -4.1e+186) {
tmp = t_2;
} else if ((b * c) <= -3e-63) {
tmp = t_3;
} else if ((b * c) <= 5.2e-45) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 2.6e+173) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = (b * c) + t_1
t_3 = t_1 + (t * ((-4.0d0) * a))
if ((b * c) <= (-4.1d+186)) then
tmp = t_2
else if ((b * c) <= (-3d-63)) then
tmp = t_3
else if ((b * c) <= 5.2d-45) then
tmp = (x * ((-4.0d0) * i)) + ((-27.0d0) * (j * k))
else if ((b * c) <= 2.6d+173) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = (b * c) + t_1;
double t_3 = t_1 + (t * (-4.0 * a));
double tmp;
if ((b * c) <= -4.1e+186) {
tmp = t_2;
} else if ((b * c) <= -3e-63) {
tmp = t_3;
} else if ((b * c) <= 5.2e-45) {
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
} else if ((b * c) <= 2.6e+173) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = (b * c) + t_1 t_3 = t_1 + (t * (-4.0 * a)) tmp = 0 if (b * c) <= -4.1e+186: tmp = t_2 elif (b * c) <= -3e-63: tmp = t_3 elif (b * c) <= 5.2e-45: tmp = (x * (-4.0 * i)) + (-27.0 * (j * k)) elif (b * c) <= 2.6e+173: tmp = t_3 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(Float64(b * c) + t_1) t_3 = Float64(t_1 + Float64(t * Float64(-4.0 * a))) tmp = 0.0 if (Float64(b * c) <= -4.1e+186) tmp = t_2; elseif (Float64(b * c) <= -3e-63) tmp = t_3; elseif (Float64(b * c) <= 5.2e-45) tmp = Float64(Float64(x * Float64(-4.0 * i)) + Float64(-27.0 * Float64(j * k))); elseif (Float64(b * c) <= 2.6e+173) tmp = t_3; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = (b * c) + t_1;
t_3 = t_1 + (t * (-4.0 * a));
tmp = 0.0;
if ((b * c) <= -4.1e+186)
tmp = t_2;
elseif ((b * c) <= -3e-63)
tmp = t_3;
elseif ((b * c) <= 5.2e-45)
tmp = (x * (-4.0 * i)) + (-27.0 * (j * k));
elseif ((b * c) <= 2.6e+173)
tmp = t_3;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -4.1e+186], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], -3e-63], t$95$3, If[LessEqual[N[(b * c), $MachinePrecision], 5.2e-45], N[(N[(x * N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.6e+173], t$95$3, t$95$2]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := b \cdot c + t\_1\\
t_3 := t\_1 + t \cdot \left(-4 \cdot a\right)\\
\mathbf{if}\;b \cdot c \leq -4.1 \cdot 10^{+186}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq -3 \cdot 10^{-63}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;b \cdot c \leq 5.2 \cdot 10^{-45}:\\
\;\;\;\;x \cdot \left(-4 \cdot i\right) + -27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 2.6 \cdot 10^{+173}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 b c) < -4.1e186 or 2.5999999999999999e173 < (*.f64 b c) Initial program 69.9%
Simplified78.3%
Taylor expanded in b around inf 80.4%
if -4.1e186 < (*.f64 b c) < -2.99999999999999979e-63 or 5.19999999999999973e-45 < (*.f64 b c) < 2.5999999999999999e173Initial program 83.7%
Simplified84.8%
Taylor expanded in a around inf 56.9%
*-commutative56.9%
*-commutative56.9%
associate-*r*56.9%
*-commutative56.9%
Simplified56.9%
if -2.99999999999999979e-63 < (*.f64 b c) < 5.19999999999999973e-45Initial program 85.9%
Simplified91.5%
Taylor expanded in i around inf 63.3%
associate-*r*63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in j around 0 63.3%
Final simplification65.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))))
(if (<= t -5e-27)
(+ t_1 (* x (+ (* -4.0 i) (* 18.0 (* t (* y z))))))
(if (<= t 2.9e-58)
(+ t_1 (+ (* b c) (* -4.0 (* x i))))
(if (<= t 1.25e+127)
(+ t_1 (+ (* b c) (* -4.0 (* a t))))
(+ t_1 (* t (+ (* -4.0 a) (* 18.0 (* x (* y z)))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double tmp;
if (t <= -5e-27) {
tmp = t_1 + (x * ((-4.0 * i) + (18.0 * (t * (y * z)))));
} else if (t <= 2.9e-58) {
tmp = t_1 + ((b * c) + (-4.0 * (x * i)));
} else if (t <= 1.25e+127) {
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
} else {
tmp = t_1 + (t * ((-4.0 * a) + (18.0 * (x * (y * z)))));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
if (t <= (-5d-27)) then
tmp = t_1 + (x * (((-4.0d0) * i) + (18.0d0 * (t * (y * z)))))
else if (t <= 2.9d-58) then
tmp = t_1 + ((b * c) + ((-4.0d0) * (x * i)))
else if (t <= 1.25d+127) then
tmp = t_1 + ((b * c) + ((-4.0d0) * (a * t)))
else
tmp = t_1 + (t * (((-4.0d0) * a) + (18.0d0 * (x * (y * z)))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double tmp;
if (t <= -5e-27) {
tmp = t_1 + (x * ((-4.0 * i) + (18.0 * (t * (y * z)))));
} else if (t <= 2.9e-58) {
tmp = t_1 + ((b * c) + (-4.0 * (x * i)));
} else if (t <= 1.25e+127) {
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
} else {
tmp = t_1 + (t * ((-4.0 * a) + (18.0 * (x * (y * z)))));
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) tmp = 0 if t <= -5e-27: tmp = t_1 + (x * ((-4.0 * i) + (18.0 * (t * (y * z))))) elif t <= 2.9e-58: tmp = t_1 + ((b * c) + (-4.0 * (x * i))) elif t <= 1.25e+127: tmp = t_1 + ((b * c) + (-4.0 * (a * t))) else: tmp = t_1 + (t * ((-4.0 * a) + (18.0 * (x * (y * z))))) return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) tmp = 0.0 if (t <= -5e-27) tmp = Float64(t_1 + Float64(x * Float64(Float64(-4.0 * i) + Float64(18.0 * Float64(t * Float64(y * z)))))); elseif (t <= 2.9e-58) tmp = Float64(t_1 + Float64(Float64(b * c) + Float64(-4.0 * Float64(x * i)))); elseif (t <= 1.25e+127) tmp = Float64(t_1 + Float64(Float64(b * c) + Float64(-4.0 * Float64(a * t)))); else tmp = Float64(t_1 + Float64(t * Float64(Float64(-4.0 * a) + Float64(18.0 * Float64(x * Float64(y * z)))))); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
tmp = 0.0;
if (t <= -5e-27)
tmp = t_1 + (x * ((-4.0 * i) + (18.0 * (t * (y * z)))));
elseif (t <= 2.9e-58)
tmp = t_1 + ((b * c) + (-4.0 * (x * i)));
elseif (t <= 1.25e+127)
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
else
tmp = t_1 + (t * ((-4.0 * a) + (18.0 * (x * (y * z)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5e-27], N[(t$95$1 + N[(x * N[(N[(-4.0 * i), $MachinePrecision] + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e-58], N[(t$95$1 + N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.25e+127], N[(t$95$1 + N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t * N[(N[(-4.0 * a), $MachinePrecision] + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;t \leq -5 \cdot 10^{-27}:\\
\;\;\;\;t\_1 + x \cdot \left(-4 \cdot i + 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-58}:\\
\;\;\;\;t\_1 + \left(b \cdot c + -4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+127}:\\
\;\;\;\;t\_1 + \left(b \cdot c + -4 \cdot \left(a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + t \cdot \left(-4 \cdot a + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if t < -5.0000000000000002e-27Initial program 86.7%
Simplified91.1%
Taylor expanded in x around inf 75.4%
if -5.0000000000000002e-27 < t < 2.8999999999999999e-58Initial program 81.0%
Simplified82.7%
Taylor expanded in t around 0 82.0%
if 2.8999999999999999e-58 < t < 1.2500000000000001e127Initial program 80.3%
Simplified85.7%
Taylor expanded in x around 0 80.2%
if 1.2500000000000001e127 < t Initial program 74.9%
Simplified87.5%
Taylor expanded in t around inf 87.8%
Final simplification81.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))))
(if (<= x -1.04e-23)
(+ t_1 (* x (+ (* -4.0 i) (/ (* b c) x))))
(if (<= x 2.75e-96)
(+ t_1 (+ (* b c) (* -4.0 (* a t))))
(if (<= x 1.3e+249)
(+ t_1 (+ (* b c) (* -4.0 (* x i))))
(+ t_1 (* (* t 18.0) (* z (* x y)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double tmp;
if (x <= -1.04e-23) {
tmp = t_1 + (x * ((-4.0 * i) + ((b * c) / x)));
} else if (x <= 2.75e-96) {
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
} else if (x <= 1.3e+249) {
tmp = t_1 + ((b * c) + (-4.0 * (x * i)));
} else {
tmp = t_1 + ((t * 18.0) * (z * (x * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
if (x <= (-1.04d-23)) then
tmp = t_1 + (x * (((-4.0d0) * i) + ((b * c) / x)))
else if (x <= 2.75d-96) then
tmp = t_1 + ((b * c) + ((-4.0d0) * (a * t)))
else if (x <= 1.3d+249) then
tmp = t_1 + ((b * c) + ((-4.0d0) * (x * i)))
else
tmp = t_1 + ((t * 18.0d0) * (z * (x * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double tmp;
if (x <= -1.04e-23) {
tmp = t_1 + (x * ((-4.0 * i) + ((b * c) / x)));
} else if (x <= 2.75e-96) {
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
} else if (x <= 1.3e+249) {
tmp = t_1 + ((b * c) + (-4.0 * (x * i)));
} else {
tmp = t_1 + ((t * 18.0) * (z * (x * y)));
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) tmp = 0 if x <= -1.04e-23: tmp = t_1 + (x * ((-4.0 * i) + ((b * c) / x))) elif x <= 2.75e-96: tmp = t_1 + ((b * c) + (-4.0 * (a * t))) elif x <= 1.3e+249: tmp = t_1 + ((b * c) + (-4.0 * (x * i))) else: tmp = t_1 + ((t * 18.0) * (z * (x * y))) return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) tmp = 0.0 if (x <= -1.04e-23) tmp = Float64(t_1 + Float64(x * Float64(Float64(-4.0 * i) + Float64(Float64(b * c) / x)))); elseif (x <= 2.75e-96) tmp = Float64(t_1 + Float64(Float64(b * c) + Float64(-4.0 * Float64(a * t)))); elseif (x <= 1.3e+249) tmp = Float64(t_1 + Float64(Float64(b * c) + Float64(-4.0 * Float64(x * i)))); else tmp = Float64(t_1 + Float64(Float64(t * 18.0) * Float64(z * Float64(x * y)))); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
tmp = 0.0;
if (x <= -1.04e-23)
tmp = t_1 + (x * ((-4.0 * i) + ((b * c) / x)));
elseif (x <= 2.75e-96)
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
elseif (x <= 1.3e+249)
tmp = t_1 + ((b * c) + (-4.0 * (x * i)));
else
tmp = t_1 + ((t * 18.0) * (z * (x * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.04e-23], N[(t$95$1 + N[(x * N[(N[(-4.0 * i), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.75e-96], N[(t$95$1 + N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+249], N[(t$95$1 + N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(t * 18.0), $MachinePrecision] * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;x \leq -1.04 \cdot 10^{-23}:\\
\;\;\;\;t\_1 + x \cdot \left(-4 \cdot i + \frac{b \cdot c}{x}\right)\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{-96}:\\
\;\;\;\;t\_1 + \left(b \cdot c + -4 \cdot \left(a \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+249}:\\
\;\;\;\;t\_1 + \left(b \cdot c + -4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(t \cdot 18\right) \cdot \left(z \cdot \left(x \cdot y\right)\right)\\
\end{array}
\end{array}
if x < -1.04e-23Initial program 68.2%
Simplified78.2%
Taylor expanded in x around inf 90.0%
Taylor expanded in t around 0 65.5%
if -1.04e-23 < x < 2.7499999999999998e-96Initial program 99.9%
Simplified96.2%
Taylor expanded in x around 0 85.8%
if 2.7499999999999998e-96 < x < 1.3000000000000001e249Initial program 74.4%
Simplified85.9%
Taylor expanded in t around 0 69.6%
if 1.3000000000000001e249 < x Initial program 40.5%
Simplified47.1%
Taylor expanded in x around inf 93.2%
Taylor expanded in y around inf 67.6%
associate-*r*67.6%
associate-*r*74.2%
Simplified74.2%
Final simplification75.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))) (t_2 (+ t_1 (+ (* b c) (* -4.0 (* x i))))))
(if (<= x -6.2e-80)
t_2
(if (<= x 1.3e-99)
(+ t_1 (+ (* b c) (* -4.0 (* a t))))
(if (<= x 1.3e+249) t_2 (+ t_1 (* (* t 18.0) (* z (* x y)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = t_1 + ((b * c) + (-4.0 * (x * i)));
double tmp;
if (x <= -6.2e-80) {
tmp = t_2;
} else if (x <= 1.3e-99) {
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
} else if (x <= 1.3e+249) {
tmp = t_2;
} else {
tmp = t_1 + ((t * 18.0) * (z * (x * y)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = t_1 + ((b * c) + ((-4.0d0) * (x * i)))
if (x <= (-6.2d-80)) then
tmp = t_2
else if (x <= 1.3d-99) then
tmp = t_1 + ((b * c) + ((-4.0d0) * (a * t)))
else if (x <= 1.3d+249) then
tmp = t_2
else
tmp = t_1 + ((t * 18.0d0) * (z * (x * y)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = t_1 + ((b * c) + (-4.0 * (x * i)));
double tmp;
if (x <= -6.2e-80) {
tmp = t_2;
} else if (x <= 1.3e-99) {
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
} else if (x <= 1.3e+249) {
tmp = t_2;
} else {
tmp = t_1 + ((t * 18.0) * (z * (x * y)));
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = t_1 + ((b * c) + (-4.0 * (x * i))) tmp = 0 if x <= -6.2e-80: tmp = t_2 elif x <= 1.3e-99: tmp = t_1 + ((b * c) + (-4.0 * (a * t))) elif x <= 1.3e+249: tmp = t_2 else: tmp = t_1 + ((t * 18.0) * (z * (x * y))) return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(t_1 + Float64(Float64(b * c) + Float64(-4.0 * Float64(x * i)))) tmp = 0.0 if (x <= -6.2e-80) tmp = t_2; elseif (x <= 1.3e-99) tmp = Float64(t_1 + Float64(Float64(b * c) + Float64(-4.0 * Float64(a * t)))); elseif (x <= 1.3e+249) tmp = t_2; else tmp = Float64(t_1 + Float64(Float64(t * 18.0) * Float64(z * Float64(x * y)))); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = t_1 + ((b * c) + (-4.0 * (x * i)));
tmp = 0.0;
if (x <= -6.2e-80)
tmp = t_2;
elseif (x <= 1.3e-99)
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
elseif (x <= 1.3e+249)
tmp = t_2;
else
tmp = t_1 + ((t * 18.0) * (z * (x * y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.2e-80], t$95$2, If[LessEqual[x, 1.3e-99], N[(t$95$1 + N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+249], t$95$2, N[(t$95$1 + N[(N[(t * 18.0), $MachinePrecision] * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := t\_1 + \left(b \cdot c + -4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{-80}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-99}:\\
\;\;\;\;t\_1 + \left(b \cdot c + -4 \cdot \left(a \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+249}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(t \cdot 18\right) \cdot \left(z \cdot \left(x \cdot y\right)\right)\\
\end{array}
\end{array}
if x < -6.20000000000000032e-80 or 1.30000000000000003e-99 < x < 1.3000000000000001e249Initial program 73.8%
Simplified83.9%
Taylor expanded in t around 0 66.9%
if -6.20000000000000032e-80 < x < 1.30000000000000003e-99Initial program 99.9%
Simplified95.7%
Taylor expanded in x around 0 87.7%
if 1.3000000000000001e249 < x Initial program 40.5%
Simplified47.1%
Taylor expanded in x around inf 93.2%
Taylor expanded in y around inf 67.6%
associate-*r*67.6%
associate-*r*74.2%
Simplified74.2%
Final simplification75.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))))
(if (or (<= (* b c) -2.7e+187) (not (<= (* b c) 1.7e+171)))
(+ (* b c) t_1)
(+ t_1 (* t (* -4.0 a))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double tmp;
if (((b * c) <= -2.7e+187) || !((b * c) <= 1.7e+171)) {
tmp = (b * c) + t_1;
} else {
tmp = t_1 + (t * (-4.0 * a));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
if (((b * c) <= (-2.7d+187)) .or. (.not. ((b * c) <= 1.7d+171))) then
tmp = (b * c) + t_1
else
tmp = t_1 + (t * ((-4.0d0) * a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double tmp;
if (((b * c) <= -2.7e+187) || !((b * c) <= 1.7e+171)) {
tmp = (b * c) + t_1;
} else {
tmp = t_1 + (t * (-4.0 * a));
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) tmp = 0 if ((b * c) <= -2.7e+187) or not ((b * c) <= 1.7e+171): tmp = (b * c) + t_1 else: tmp = t_1 + (t * (-4.0 * a)) return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) tmp = 0.0 if ((Float64(b * c) <= -2.7e+187) || !(Float64(b * c) <= 1.7e+171)) tmp = Float64(Float64(b * c) + t_1); else tmp = Float64(t_1 + Float64(t * Float64(-4.0 * a))); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
tmp = 0.0;
if (((b * c) <= -2.7e+187) || ~(((b * c) <= 1.7e+171)))
tmp = (b * c) + t_1;
else
tmp = t_1 + (t * (-4.0 * a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(b * c), $MachinePrecision], -2.7e+187], N[Not[LessEqual[N[(b * c), $MachinePrecision], 1.7e+171]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;b \cdot c \leq -2.7 \cdot 10^{+187} \lor \neg \left(b \cdot c \leq 1.7 \cdot 10^{+171}\right):\\
\;\;\;\;b \cdot c + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + t \cdot \left(-4 \cdot a\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -2.70000000000000008e187 or 1.7000000000000001e171 < (*.f64 b c) Initial program 69.9%
Simplified78.3%
Taylor expanded in b around inf 80.4%
if -2.70000000000000008e187 < (*.f64 b c) < 1.7000000000000001e171Initial program 84.9%
Simplified88.4%
Taylor expanded in a around inf 55.7%
*-commutative55.7%
*-commutative55.7%
associate-*r*55.7%
*-commutative55.7%
Simplified55.7%
Final simplification61.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))))
(if (<= z -1.15e-20)
(+ t_1 (* 18.0 (* (* x y) (* t z))))
(if (<= z 1.5e+178)
(+ t_1 (+ (* b c) (* -4.0 (* a t))))
(+ t_1 (* x (* (* t y) (* 18.0 z))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double tmp;
if (z <= -1.15e-20) {
tmp = t_1 + (18.0 * ((x * y) * (t * z)));
} else if (z <= 1.5e+178) {
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
} else {
tmp = t_1 + (x * ((t * y) * (18.0 * z)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
if (z <= (-1.15d-20)) then
tmp = t_1 + (18.0d0 * ((x * y) * (t * z)))
else if (z <= 1.5d+178) then
tmp = t_1 + ((b * c) + ((-4.0d0) * (a * t)))
else
tmp = t_1 + (x * ((t * y) * (18.0d0 * z)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double tmp;
if (z <= -1.15e-20) {
tmp = t_1 + (18.0 * ((x * y) * (t * z)));
} else if (z <= 1.5e+178) {
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
} else {
tmp = t_1 + (x * ((t * y) * (18.0 * z)));
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) tmp = 0 if z <= -1.15e-20: tmp = t_1 + (18.0 * ((x * y) * (t * z))) elif z <= 1.5e+178: tmp = t_1 + ((b * c) + (-4.0 * (a * t))) else: tmp = t_1 + (x * ((t * y) * (18.0 * z))) return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) tmp = 0.0 if (z <= -1.15e-20) tmp = Float64(t_1 + Float64(18.0 * Float64(Float64(x * y) * Float64(t * z)))); elseif (z <= 1.5e+178) tmp = Float64(t_1 + Float64(Float64(b * c) + Float64(-4.0 * Float64(a * t)))); else tmp = Float64(t_1 + Float64(x * Float64(Float64(t * y) * Float64(18.0 * z)))); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
tmp = 0.0;
if (z <= -1.15e-20)
tmp = t_1 + (18.0 * ((x * y) * (t * z)));
elseif (z <= 1.5e+178)
tmp = t_1 + ((b * c) + (-4.0 * (a * t)));
else
tmp = t_1 + (x * ((t * y) * (18.0 * z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-20], N[(t$95$1 + N[(18.0 * N[(N[(x * y), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+178], N[(t$95$1 + N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(x * N[(N[(t * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-20}:\\
\;\;\;\;t\_1 + 18 \cdot \left(\left(x \cdot y\right) \cdot \left(t \cdot z\right)\right)\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+178}:\\
\;\;\;\;t\_1 + \left(b \cdot c + -4 \cdot \left(a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x \cdot \left(\left(t \cdot y\right) \cdot \left(18 \cdot z\right)\right)\\
\end{array}
\end{array}
if z < -1.15e-20Initial program 76.6%
Simplified71.3%
Taylor expanded in x around inf 71.8%
Taylor expanded in y around inf 58.3%
associate-*r*58.2%
associate-*r*61.8%
Simplified61.8%
Taylor expanded in t around 0 58.3%
*-commutative58.3%
associate-*r*61.8%
associate-*l*61.6%
Simplified61.6%
if -1.15e-20 < z < 1.50000000000000008e178Initial program 84.9%
Simplified93.2%
Taylor expanded in x around 0 68.9%
if 1.50000000000000008e178 < z Initial program 67.0%
Simplified67.0%
Taylor expanded in y around inf 68.1%
*-commutative68.1%
associate-*r*72.0%
associate-*l*72.0%
*-commutative72.0%
*-commutative72.0%
associate-*r*76.4%
associate-*l*76.4%
*-commutative76.4%
Simplified76.4%
Final simplification68.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (+ (* b c) (* j (* k -27.0))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (b * c) + (j * (k * -27.0));
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (b * c) + (j * (k * (-27.0d0)))
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (b * c) + (j * (k * -27.0));
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): return (b * c) + (j * (k * -27.0))
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(b * c) + Float64(j * Float64(k * -27.0))) end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = (b * c) + (j * (k * -27.0));
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(b * c), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
b \cdot c + j \cdot \left(k \cdot -27\right)
\end{array}
Initial program 81.5%
Simplified86.1%
Taylor expanded in b around inf 47.2%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
(t_2
(-
(- (* (* 18.0 t) (* (* x y) z)) t_1)
(- (* (* k j) 27.0) (* c b)))))
(if (< t -1.6210815397541398e-69)
t_2
(if (< t 165.68027943805222)
(+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((a * t) + (i * x)) * 4.0d0
t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
if (t < (-1.6210815397541398d-69)) then
tmp = t_2
else if (t < 165.68027943805222d0) then
tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((a * t) + (i * x)) * 4.0 t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)) tmp = 0 if t < -1.6210815397541398e-69: tmp = t_2 elif t < 165.68027943805222: tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0) t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b))) tmp = 0.0 if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = ((a * t) + (i * x)) * 4.0; t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)); tmp = 0.0; if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t\_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t\_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024111
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
:alt
(if (< t -1.6210815397541398e-69) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b))) (if (< t 165.68027943805222) (+ (- (* (* 18.0 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4.0)) (- (* c b) (* 27.0 (* k j)))) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b)))))
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))