
(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 23 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
(let* ((t_1
(-
(-
(- (* b c) (- (* t (* a 4.0)) (* (* (* (* x 18.0) y) z) t)))
(* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_1 INFINITY) t_1 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))))))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 = (((b * c) - ((t * (a * 4.0)) - ((((x * 18.0) * y) * z) * t))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
}
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 t_1 = (((b * c) - ((t * (a * 4.0)) - ((((x * 18.0) * y) * z) * t))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
}
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 = (((b * c) - ((t * (a * 4.0)) - ((((x * 18.0) * y) * z) * t))) - ((x * 4.0) * i)) - ((j * 27.0) * k) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) 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(Float64(Float64(Float64(b * c) - Float64(Float64(t * Float64(a * 4.0)) - Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t))) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); 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 = (((b * c) - ((t * (a * 4.0)) - ((((x * 18.0) * y) * z) * t))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
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[(N[(N[(N[(b * c), $MachinePrecision] - N[(N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $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 := \left(\left(b \cdot c - \left(t \cdot \left(a \cdot 4\right) - \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t\right)\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 97.4%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
Simplified12.5%
Taylor expanded in x around inf 58.9%
Final simplification93.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 (* (* t a) -4.0)) (t_2 (+ t_1 (* j (* k -27.0)))))
(if (<= (* b c) -4.6e+123)
(+ (* b c) t_1)
(if (<= (* b c) -1.4e-249)
t_2
(if (<= (* b c) 6.8e-305)
(* -4.0 (+ (* t a) (* x i)))
(if (<= (* b c) 2.5e-115)
t_2
(if (<= (* b c) 11500000000.0)
(* t (* 18.0 (* z (* x y))))
(if (<= (* b c) 4.4e+70) t_2 (- (* b c) (* 4.0 (* x i)))))))))))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 = (t * a) * -4.0;
double t_2 = t_1 + (j * (k * -27.0));
double tmp;
if ((b * c) <= -4.6e+123) {
tmp = (b * c) + t_1;
} else if ((b * c) <= -1.4e-249) {
tmp = t_2;
} else if ((b * c) <= 6.8e-305) {
tmp = -4.0 * ((t * a) + (x * i));
} else if ((b * c) <= 2.5e-115) {
tmp = t_2;
} else if ((b * c) <= 11500000000.0) {
tmp = t * (18.0 * (z * (x * y)));
} else if ((b * c) <= 4.4e+70) {
tmp = t_2;
} else {
tmp = (b * c) - (4.0 * (x * i));
}
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 = (t * a) * (-4.0d0)
t_2 = t_1 + (j * (k * (-27.0d0)))
if ((b * c) <= (-4.6d+123)) then
tmp = (b * c) + t_1
else if ((b * c) <= (-1.4d-249)) then
tmp = t_2
else if ((b * c) <= 6.8d-305) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else if ((b * c) <= 2.5d-115) then
tmp = t_2
else if ((b * c) <= 11500000000.0d0) then
tmp = t * (18.0d0 * (z * (x * y)))
else if ((b * c) <= 4.4d+70) then
tmp = t_2
else
tmp = (b * c) - (4.0d0 * (x * i))
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 = (t * a) * -4.0;
double t_2 = t_1 + (j * (k * -27.0));
double tmp;
if ((b * c) <= -4.6e+123) {
tmp = (b * c) + t_1;
} else if ((b * c) <= -1.4e-249) {
tmp = t_2;
} else if ((b * c) <= 6.8e-305) {
tmp = -4.0 * ((t * a) + (x * i));
} else if ((b * c) <= 2.5e-115) {
tmp = t_2;
} else if ((b * c) <= 11500000000.0) {
tmp = t * (18.0 * (z * (x * y)));
} else if ((b * c) <= 4.4e+70) {
tmp = t_2;
} else {
tmp = (b * c) - (4.0 * (x * i));
}
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 = (t * a) * -4.0 t_2 = t_1 + (j * (k * -27.0)) tmp = 0 if (b * c) <= -4.6e+123: tmp = (b * c) + t_1 elif (b * c) <= -1.4e-249: tmp = t_2 elif (b * c) <= 6.8e-305: tmp = -4.0 * ((t * a) + (x * i)) elif (b * c) <= 2.5e-115: tmp = t_2 elif (b * c) <= 11500000000.0: tmp = t * (18.0 * (z * (x * y))) elif (b * c) <= 4.4e+70: tmp = t_2 else: tmp = (b * c) - (4.0 * (x * i)) 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(Float64(t * a) * -4.0) t_2 = Float64(t_1 + Float64(j * Float64(k * -27.0))) tmp = 0.0 if (Float64(b * c) <= -4.6e+123) tmp = Float64(Float64(b * c) + t_1); elseif (Float64(b * c) <= -1.4e-249) tmp = t_2; elseif (Float64(b * c) <= 6.8e-305) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); elseif (Float64(b * c) <= 2.5e-115) tmp = t_2; elseif (Float64(b * c) <= 11500000000.0) tmp = Float64(t * Float64(18.0 * Float64(z * Float64(x * y)))); elseif (Float64(b * c) <= 4.4e+70) tmp = t_2; else tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); 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 = (t * a) * -4.0;
t_2 = t_1 + (j * (k * -27.0));
tmp = 0.0;
if ((b * c) <= -4.6e+123)
tmp = (b * c) + t_1;
elseif ((b * c) <= -1.4e-249)
tmp = t_2;
elseif ((b * c) <= 6.8e-305)
tmp = -4.0 * ((t * a) + (x * i));
elseif ((b * c) <= 2.5e-115)
tmp = t_2;
elseif ((b * c) <= 11500000000.0)
tmp = t * (18.0 * (z * (x * y)));
elseif ((b * c) <= 4.4e+70)
tmp = t_2;
else
tmp = (b * c) - (4.0 * (x * i));
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[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -4.6e+123], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.4e-249], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 6.8e-305], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.5e-115], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 11500000000.0], N[(t * N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4.4e+70], t$95$2, N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $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 := \left(t \cdot a\right) \cdot -4\\
t_2 := t\_1 + j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;b \cdot c \leq -4.6 \cdot 10^{+123}:\\
\;\;\;\;b \cdot c + t\_1\\
\mathbf{elif}\;b \cdot c \leq -1.4 \cdot 10^{-249}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq 6.8 \cdot 10^{-305}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 2.5 \cdot 10^{-115}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq 11500000000:\\
\;\;\;\;t \cdot \left(18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 4.4 \cdot 10^{+70}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -4.59999999999999981e123Initial program 93.1%
Simplified93.1%
Taylor expanded in j around 0 90.8%
Taylor expanded in x around 0 73.9%
if -4.59999999999999981e123 < (*.f64 b c) < -1.4e-249 or 6.8000000000000001e-305 < (*.f64 b c) < 2.5000000000000001e-115 or 1.15e10 < (*.f64 b c) < 4.40000000000000001e70Initial program 88.0%
Simplified89.1%
Taylor expanded in a around inf 57.5%
*-commutative57.5%
Simplified57.5%
if -1.4e-249 < (*.f64 b c) < 6.8000000000000001e-305Initial program 91.8%
Simplified94.4%
Taylor expanded in j around 0 73.0%
Taylor expanded in y around 0 67.7%
Taylor expanded in b around 0 67.7%
Taylor expanded in a around 0 67.7%
distribute-lft-out67.7%
*-commutative67.7%
*-commutative67.7%
Simplified67.7%
if 2.5000000000000001e-115 < (*.f64 b c) < 1.15e10Initial program 76.9%
Simplified84.6%
Taylor expanded in t around inf 56.1%
Taylor expanded in x around inf 47.3%
associate-*r*43.6%
Simplified43.6%
if 4.40000000000000001e70 < (*.f64 b c) Initial program 88.1%
Simplified88.3%
Taylor expanded in j around 0 83.0%
Taylor expanded in t around 0 65.6%
Final simplification61.9%
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 (* -4.0 (+ (* t a) (* x i)))))
(if (<= (* b c) -3.6e+234)
(* b c)
(if (<= (* b c) -1.4e-165)
t_1
(if (<= (* b c) -4.4e-246)
(* -27.0 (* j k))
(if (<= (* b c) 1.35e-301)
t_1
(if (<= (* b c) 1.75e-84)
(* t (* 18.0 (* z (* x y))))
(if (<= (* b c) 2e+172) t_1 (* b c)))))))))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 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -3.6e+234) {
tmp = b * c;
} else if ((b * c) <= -1.4e-165) {
tmp = t_1;
} else if ((b * c) <= -4.4e-246) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 1.35e-301) {
tmp = t_1;
} else if ((b * c) <= 1.75e-84) {
tmp = t * (18.0 * (z * (x * y)));
} else if ((b * c) <= 2e+172) {
tmp = t_1;
} else {
tmp = b * c;
}
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 = (-4.0d0) * ((t * a) + (x * i))
if ((b * c) <= (-3.6d+234)) then
tmp = b * c
else if ((b * c) <= (-1.4d-165)) then
tmp = t_1
else if ((b * c) <= (-4.4d-246)) then
tmp = (-27.0d0) * (j * k)
else if ((b * c) <= 1.35d-301) then
tmp = t_1
else if ((b * c) <= 1.75d-84) then
tmp = t * (18.0d0 * (z * (x * y)))
else if ((b * c) <= 2d+172) then
tmp = t_1
else
tmp = b * c
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 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -3.6e+234) {
tmp = b * c;
} else if ((b * c) <= -1.4e-165) {
tmp = t_1;
} else if ((b * c) <= -4.4e-246) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 1.35e-301) {
tmp = t_1;
} else if ((b * c) <= 1.75e-84) {
tmp = t * (18.0 * (z * (x * y)));
} else if ((b * c) <= 2e+172) {
tmp = t_1;
} else {
tmp = b * c;
}
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 = -4.0 * ((t * a) + (x * i)) tmp = 0 if (b * c) <= -3.6e+234: tmp = b * c elif (b * c) <= -1.4e-165: tmp = t_1 elif (b * c) <= -4.4e-246: tmp = -27.0 * (j * k) elif (b * c) <= 1.35e-301: tmp = t_1 elif (b * c) <= 1.75e-84: tmp = t * (18.0 * (z * (x * y))) elif (b * c) <= 2e+172: tmp = t_1 else: tmp = b * c 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(-4.0 * Float64(Float64(t * a) + Float64(x * i))) tmp = 0.0 if (Float64(b * c) <= -3.6e+234) tmp = Float64(b * c); elseif (Float64(b * c) <= -1.4e-165) tmp = t_1; elseif (Float64(b * c) <= -4.4e-246) tmp = Float64(-27.0 * Float64(j * k)); elseif (Float64(b * c) <= 1.35e-301) tmp = t_1; elseif (Float64(b * c) <= 1.75e-84) tmp = Float64(t * Float64(18.0 * Float64(z * Float64(x * y)))); elseif (Float64(b * c) <= 2e+172) tmp = t_1; else tmp = Float64(b * c); 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 = -4.0 * ((t * a) + (x * i));
tmp = 0.0;
if ((b * c) <= -3.6e+234)
tmp = b * c;
elseif ((b * c) <= -1.4e-165)
tmp = t_1;
elseif ((b * c) <= -4.4e-246)
tmp = -27.0 * (j * k);
elseif ((b * c) <= 1.35e-301)
tmp = t_1;
elseif ((b * c) <= 1.75e-84)
tmp = t * (18.0 * (z * (x * y)));
elseif ((b * c) <= 2e+172)
tmp = t_1;
else
tmp = b * c;
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[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -3.6e+234], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.4e-165], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -4.4e-246], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.35e-301], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 1.75e-84], N[(t * N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+172], t$95$1, N[(b * c), $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 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{if}\;b \cdot c \leq -3.6 \cdot 10^{+234}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -1.4 \cdot 10^{-165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq -4.4 \cdot 10^{-246}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 1.35 \cdot 10^{-301}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq 1.75 \cdot 10^{-84}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -3.59999999999999999e234 or 2.0000000000000002e172 < (*.f64 b c) Initial program 89.6%
Simplified88.0%
associate-*r*89.6%
distribute-rgt-out--89.6%
associate-*l*82.7%
*-commutative82.7%
*-commutative82.7%
Applied egg-rr82.7%
Taylor expanded in b around inf 70.9%
if -3.59999999999999999e234 < (*.f64 b c) < -1.4e-165 or -4.39999999999999996e-246 < (*.f64 b c) < 1.35e-301 or 1.7500000000000001e-84 < (*.f64 b c) < 2.0000000000000002e172Initial program 87.7%
Simplified89.0%
Taylor expanded in j around 0 72.2%
Taylor expanded in y around 0 63.1%
Taylor expanded in b around 0 53.3%
Taylor expanded in a around 0 53.3%
distribute-lft-out53.3%
*-commutative53.3%
*-commutative53.3%
Simplified53.3%
if -1.4e-165 < (*.f64 b c) < -4.39999999999999996e-246Initial program 90.5%
Simplified90.6%
Taylor expanded in j around inf 53.5%
if 1.35e-301 < (*.f64 b c) < 1.7500000000000001e-84Initial program 88.2%
Simplified94.1%
Taylor expanded in t around inf 61.2%
Taylor expanded in x around inf 47.8%
associate-*r*45.0%
Simplified45.0%
Final simplification56.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 (+ (* b c) (* (* t a) -4.0))) (t_2 (* -4.0 (+ (* t a) (* x i)))))
(if (<= (* b c) -2.4e+194)
t_1
(if (<= (* b c) -1e-164)
t_2
(if (<= (* b c) -2.16e-246)
(* -27.0 (* j k))
(if (<= (* b c) 1.45e-301)
t_2
(if (<= (* b c) 1.35e-84)
(* t (* 18.0 (* z (* x y))))
(if (<= (* b c) 4.5e+113) t_2 t_1))))))))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 = (b * c) + ((t * a) * -4.0);
double t_2 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -2.4e+194) {
tmp = t_1;
} else if ((b * c) <= -1e-164) {
tmp = t_2;
} else if ((b * c) <= -2.16e-246) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 1.45e-301) {
tmp = t_2;
} else if ((b * c) <= 1.35e-84) {
tmp = t * (18.0 * (z * (x * y)));
} else if ((b * c) <= 4.5e+113) {
tmp = t_2;
} else {
tmp = t_1;
}
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 = (b * c) + ((t * a) * (-4.0d0))
t_2 = (-4.0d0) * ((t * a) + (x * i))
if ((b * c) <= (-2.4d+194)) then
tmp = t_1
else if ((b * c) <= (-1d-164)) then
tmp = t_2
else if ((b * c) <= (-2.16d-246)) then
tmp = (-27.0d0) * (j * k)
else if ((b * c) <= 1.45d-301) then
tmp = t_2
else if ((b * c) <= 1.35d-84) then
tmp = t * (18.0d0 * (z * (x * y)))
else if ((b * c) <= 4.5d+113) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && 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 = (b * c) + ((t * a) * -4.0);
double t_2 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -2.4e+194) {
tmp = t_1;
} else if ((b * c) <= -1e-164) {
tmp = t_2;
} else if ((b * c) <= -2.16e-246) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 1.45e-301) {
tmp = t_2;
} else if ((b * c) <= 1.35e-84) {
tmp = t * (18.0 * (z * (x * y)));
} else if ((b * c) <= 4.5e+113) {
tmp = t_2;
} else {
tmp = t_1;
}
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 = (b * c) + ((t * a) * -4.0) t_2 = -4.0 * ((t * a) + (x * i)) tmp = 0 if (b * c) <= -2.4e+194: tmp = t_1 elif (b * c) <= -1e-164: tmp = t_2 elif (b * c) <= -2.16e-246: tmp = -27.0 * (j * k) elif (b * c) <= 1.45e-301: tmp = t_2 elif (b * c) <= 1.35e-84: tmp = t * (18.0 * (z * (x * y))) elif (b * c) <= 4.5e+113: tmp = t_2 else: tmp = t_1 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(Float64(b * c) + Float64(Float64(t * a) * -4.0)) t_2 = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) tmp = 0.0 if (Float64(b * c) <= -2.4e+194) tmp = t_1; elseif (Float64(b * c) <= -1e-164) tmp = t_2; elseif (Float64(b * c) <= -2.16e-246) tmp = Float64(-27.0 * Float64(j * k)); elseif (Float64(b * c) <= 1.45e-301) tmp = t_2; elseif (Float64(b * c) <= 1.35e-84) tmp = Float64(t * Float64(18.0 * Float64(z * Float64(x * y)))); elseif (Float64(b * c) <= 4.5e+113) tmp = t_2; else tmp = t_1; 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 = (b * c) + ((t * a) * -4.0);
t_2 = -4.0 * ((t * a) + (x * i));
tmp = 0.0;
if ((b * c) <= -2.4e+194)
tmp = t_1;
elseif ((b * c) <= -1e-164)
tmp = t_2;
elseif ((b * c) <= -2.16e-246)
tmp = -27.0 * (j * k);
elseif ((b * c) <= 1.45e-301)
tmp = t_2;
elseif ((b * c) <= 1.35e-84)
tmp = t * (18.0 * (z * (x * y)));
elseif ((b * c) <= 4.5e+113)
tmp = t_2;
else
tmp = t_1;
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[(N[(b * c), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2.4e+194], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -1e-164], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], -2.16e-246], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.45e-301], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 1.35e-84], N[(t * N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4.5e+113], t$95$2, t$95$1]]]]]]]]
\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 := b \cdot c + \left(t \cdot a\right) \cdot -4\\
t_2 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{if}\;b \cdot c \leq -2.4 \cdot 10^{+194}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq -1 \cdot 10^{-164}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq -2.16 \cdot 10^{-246}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 1.45 \cdot 10^{-301}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq 1.35 \cdot 10^{-84}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 4.5 \cdot 10^{+113}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -2.4e194 or 4.5000000000000001e113 < (*.f64 b c) Initial program 90.8%
Simplified90.9%
Taylor expanded in j around 0 87.4%
Taylor expanded in x around 0 70.5%
if -2.4e194 < (*.f64 b c) < -9.99999999999999962e-165 or -2.16000000000000007e-246 < (*.f64 b c) < 1.44999999999999992e-301 or 1.35e-84 < (*.f64 b c) < 4.5000000000000001e113Initial program 86.7%
Simplified87.4%
Taylor expanded in j around 0 69.7%
Taylor expanded in y around 0 61.4%
Taylor expanded in b around 0 55.7%
Taylor expanded in a around 0 55.7%
distribute-lft-out55.7%
*-commutative55.7%
*-commutative55.7%
Simplified55.7%
if -9.99999999999999962e-165 < (*.f64 b c) < -2.16000000000000007e-246Initial program 90.5%
Simplified90.6%
Taylor expanded in j around inf 53.5%
if 1.44999999999999992e-301 < (*.f64 b c) < 1.35e-84Initial program 88.2%
Simplified94.1%
Taylor expanded in t around inf 61.2%
Taylor expanded in x around inf 47.8%
associate-*r*45.0%
Simplified45.0%
Final simplification58.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 (* x (* i -4.0))))
(t_3 (+ (* b c) t_1))
(t_4 (* t (+ (* (* x 18.0) (* y z)) (* a -4.0)))))
(if (<= t -5.5e+63)
t_4
(if (<= t -2.3e-133)
t_3
(if (<= t -6.5e-199)
t_2
(if (<= t 2.9e-269)
t_3
(if (<= t 1.66e-62)
(- (* b c) (* 4.0 (* x i)))
(if (<= t 1.06e+126) t_2 t_4))))))))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 + (x * (i * -4.0));
double t_3 = (b * c) + t_1;
double t_4 = t * (((x * 18.0) * (y * z)) + (a * -4.0));
double tmp;
if (t <= -5.5e+63) {
tmp = t_4;
} else if (t <= -2.3e-133) {
tmp = t_3;
} else if (t <= -6.5e-199) {
tmp = t_2;
} else if (t <= 2.9e-269) {
tmp = t_3;
} else if (t <= 1.66e-62) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 1.06e+126) {
tmp = t_2;
} else {
tmp = t_4;
}
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) :: t_4
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = t_1 + (x * (i * (-4.0d0)))
t_3 = (b * c) + t_1
t_4 = t * (((x * 18.0d0) * (y * z)) + (a * (-4.0d0)))
if (t <= (-5.5d+63)) then
tmp = t_4
else if (t <= (-2.3d-133)) then
tmp = t_3
else if (t <= (-6.5d-199)) then
tmp = t_2
else if (t <= 2.9d-269) then
tmp = t_3
else if (t <= 1.66d-62) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (t <= 1.06d+126) then
tmp = t_2
else
tmp = t_4
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 + (x * (i * -4.0));
double t_3 = (b * c) + t_1;
double t_4 = t * (((x * 18.0) * (y * z)) + (a * -4.0));
double tmp;
if (t <= -5.5e+63) {
tmp = t_4;
} else if (t <= -2.3e-133) {
tmp = t_3;
} else if (t <= -6.5e-199) {
tmp = t_2;
} else if (t <= 2.9e-269) {
tmp = t_3;
} else if (t <= 1.66e-62) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 1.06e+126) {
tmp = t_2;
} else {
tmp = t_4;
}
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 + (x * (i * -4.0)) t_3 = (b * c) + t_1 t_4 = t * (((x * 18.0) * (y * z)) + (a * -4.0)) tmp = 0 if t <= -5.5e+63: tmp = t_4 elif t <= -2.3e-133: tmp = t_3 elif t <= -6.5e-199: tmp = t_2 elif t <= 2.9e-269: tmp = t_3 elif t <= 1.66e-62: tmp = (b * c) - (4.0 * (x * i)) elif t <= 1.06e+126: tmp = t_2 else: tmp = t_4 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(x * Float64(i * -4.0))) t_3 = Float64(Float64(b * c) + t_1) t_4 = Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) + Float64(a * -4.0))) tmp = 0.0 if (t <= -5.5e+63) tmp = t_4; elseif (t <= -2.3e-133) tmp = t_3; elseif (t <= -6.5e-199) tmp = t_2; elseif (t <= 2.9e-269) tmp = t_3; elseif (t <= 1.66e-62) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (t <= 1.06e+126) tmp = t_2; else tmp = t_4; 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 + (x * (i * -4.0));
t_3 = (b * c) + t_1;
t_4 = t * (((x * 18.0) * (y * z)) + (a * -4.0));
tmp = 0.0;
if (t <= -5.5e+63)
tmp = t_4;
elseif (t <= -2.3e-133)
tmp = t_3;
elseif (t <= -6.5e-199)
tmp = t_2;
elseif (t <= 2.9e-269)
tmp = t_3;
elseif (t <= 1.66e-62)
tmp = (b * c) - (4.0 * (x * i));
elseif (t <= 1.06e+126)
tmp = t_2;
else
tmp = t_4;
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[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e+63], t$95$4, If[LessEqual[t, -2.3e-133], t$95$3, If[LessEqual[t, -6.5e-199], t$95$2, If[LessEqual[t, 2.9e-269], t$95$3, If[LessEqual[t, 1.66e-62], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.06e+126], t$95$2, t$95$4]]]]]]]]]]
\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 + x \cdot \left(i \cdot -4\right)\\
t_3 := b \cdot c + t\_1\\
t_4 := t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) + a \cdot -4\right)\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+63}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-133}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{-199}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-269}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 1.66 \cdot 10^{-62}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;t \leq 1.06 \cdot 10^{+126}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if t < -5.50000000000000004e63 or 1.0600000000000001e126 < t Initial program 87.9%
Simplified89.8%
Taylor expanded in t around inf 67.7%
cancel-sign-sub-inv67.7%
associate-*r*67.7%
*-commutative67.7%
metadata-eval67.7%
Applied egg-rr67.7%
if -5.50000000000000004e63 < t < -2.3e-133 or -6.50000000000000017e-199 < t < 2.9000000000000001e-269Initial program 87.9%
Simplified91.0%
Taylor expanded in b around inf 68.8%
if -2.3e-133 < t < -6.50000000000000017e-199 or 1.65999999999999992e-62 < t < 1.0600000000000001e126Initial program 85.0%
Simplified86.8%
Taylor expanded in i around inf 61.6%
associate-*r*61.6%
*-commutative61.6%
Simplified61.6%
if 2.9000000000000001e-269 < t < 1.65999999999999992e-62Initial program 96.6%
Simplified96.6%
Taylor expanded in j around 0 77.4%
Taylor expanded in t around 0 66.0%
Final simplification66.5%
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 (* x (* i -4.0))))
(t_3 (+ (* b c) t_1)))
(if (<= t -5.6e+65)
(* t (- (* 18.0 (* x (* y z))) (* a 4.0)))
(if (<= t -3.5e-130)
t_3
(if (<= t -8.8e-201)
t_2
(if (<= t 6e-269)
t_3
(if (<= t 9.4e-61)
(- (* b c) (* 4.0 (* x i)))
(if (<= t 1.8e+126)
t_2
(* t (+ (* (* x 18.0) (* y z)) (* a -4.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 t_1 = j * (k * -27.0);
double t_2 = t_1 + (x * (i * -4.0));
double t_3 = (b * c) + t_1;
double tmp;
if (t <= -5.6e+65) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else if (t <= -3.5e-130) {
tmp = t_3;
} else if (t <= -8.8e-201) {
tmp = t_2;
} else if (t <= 6e-269) {
tmp = t_3;
} else if (t <= 9.4e-61) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 1.8e+126) {
tmp = t_2;
} else {
tmp = t * (((x * 18.0) * (y * z)) + (a * -4.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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = t_1 + (x * (i * (-4.0d0)))
t_3 = (b * c) + t_1
if (t <= (-5.6d+65)) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else if (t <= (-3.5d-130)) then
tmp = t_3
else if (t <= (-8.8d-201)) then
tmp = t_2
else if (t <= 6d-269) then
tmp = t_3
else if (t <= 9.4d-61) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (t <= 1.8d+126) then
tmp = t_2
else
tmp = t * (((x * 18.0d0) * (y * z)) + (a * (-4.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 t_1 = j * (k * -27.0);
double t_2 = t_1 + (x * (i * -4.0));
double t_3 = (b * c) + t_1;
double tmp;
if (t <= -5.6e+65) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else if (t <= -3.5e-130) {
tmp = t_3;
} else if (t <= -8.8e-201) {
tmp = t_2;
} else if (t <= 6e-269) {
tmp = t_3;
} else if (t <= 9.4e-61) {
tmp = (b * c) - (4.0 * (x * i));
} else if (t <= 1.8e+126) {
tmp = t_2;
} else {
tmp = t * (((x * 18.0) * (y * z)) + (a * -4.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): t_1 = j * (k * -27.0) t_2 = t_1 + (x * (i * -4.0)) t_3 = (b * c) + t_1 tmp = 0 if t <= -5.6e+65: tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) elif t <= -3.5e-130: tmp = t_3 elif t <= -8.8e-201: tmp = t_2 elif t <= 6e-269: tmp = t_3 elif t <= 9.4e-61: tmp = (b * c) - (4.0 * (x * i)) elif t <= 1.8e+126: tmp = t_2 else: tmp = t * (((x * 18.0) * (y * z)) + (a * -4.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) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(t_1 + Float64(x * Float64(i * -4.0))) t_3 = Float64(Float64(b * c) + t_1) tmp = 0.0 if (t <= -5.6e+65) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); elseif (t <= -3.5e-130) tmp = t_3; elseif (t <= -8.8e-201) tmp = t_2; elseif (t <= 6e-269) tmp = t_3; elseif (t <= 9.4e-61) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (t <= 1.8e+126) tmp = t_2; else tmp = Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) + Float64(a * -4.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)
t_1 = j * (k * -27.0);
t_2 = t_1 + (x * (i * -4.0));
t_3 = (b * c) + t_1;
tmp = 0.0;
if (t <= -5.6e+65)
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
elseif (t <= -3.5e-130)
tmp = t_3;
elseif (t <= -8.8e-201)
tmp = t_2;
elseif (t <= 6e-269)
tmp = t_3;
elseif (t <= 9.4e-61)
tmp = (b * c) - (4.0 * (x * i));
elseif (t <= 1.8e+126)
tmp = t_2;
else
tmp = t * (((x * 18.0) * (y * z)) + (a * -4.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_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t, -5.6e+65], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.5e-130], t$95$3, If[LessEqual[t, -8.8e-201], t$95$2, If[LessEqual[t, 6e-269], t$95$3, If[LessEqual[t, 9.4e-61], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+126], t$95$2, N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * -4.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}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := t\_1 + x \cdot \left(i \cdot -4\right)\\
t_3 := b \cdot c + t\_1\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+65}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{-130}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq -8.8 \cdot 10^{-201}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-269}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 9.4 \cdot 10^{-61}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+126}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) + a \cdot -4\right)\\
\end{array}
\end{array}
if t < -5.5999999999999998e65Initial program 84.6%
Simplified89.2%
Taylor expanded in t around inf 72.9%
if -5.5999999999999998e65 < t < -3.4999999999999999e-130 or -8.8e-201 < t < 5.9999999999999997e-269Initial program 87.9%
Simplified91.0%
Taylor expanded in b around inf 68.8%
if -3.4999999999999999e-130 < t < -8.8e-201 or 9.3999999999999993e-61 < t < 1.8e126Initial program 85.0%
Simplified86.8%
Taylor expanded in i around inf 61.6%
associate-*r*61.6%
*-commutative61.6%
Simplified61.6%
if 5.9999999999999997e-269 < t < 9.3999999999999993e-61Initial program 96.6%
Simplified96.6%
Taylor expanded in j around 0 77.4%
Taylor expanded in t around 0 66.0%
if 1.8e126 < t Initial program 92.9%
Simplified90.8%
Taylor expanded in t around inf 59.9%
cancel-sign-sub-inv59.9%
associate-*r*59.9%
*-commutative59.9%
metadata-eval59.9%
Applied egg-rr59.9%
Final simplification66.5%
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 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))))
(t_3 (+ (* b c) t_1))
(t_4 (* (* t a) -4.0)))
(if (<= x -2300000000.0)
t_2
(if (<= x -9.5e-86)
t_3
(if (<= x -4.2e-145)
t_2
(if (<= x -7.6e-209)
(+ (* b c) t_4)
(if (<= x 7.3e-214) (+ t_4 t_1) (if (<= x 7.8e+17) 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 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double t_3 = (b * c) + t_1;
double t_4 = (t * a) * -4.0;
double tmp;
if (x <= -2300000000.0) {
tmp = t_2;
} else if (x <= -9.5e-86) {
tmp = t_3;
} else if (x <= -4.2e-145) {
tmp = t_2;
} else if (x <= -7.6e-209) {
tmp = (b * c) + t_4;
} else if (x <= 7.3e-214) {
tmp = t_4 + t_1;
} else if (x <= 7.8e+17) {
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) :: t_4
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
t_3 = (b * c) + t_1
t_4 = (t * a) * (-4.0d0)
if (x <= (-2300000000.0d0)) then
tmp = t_2
else if (x <= (-9.5d-86)) then
tmp = t_3
else if (x <= (-4.2d-145)) then
tmp = t_2
else if (x <= (-7.6d-209)) then
tmp = (b * c) + t_4
else if (x <= 7.3d-214) then
tmp = t_4 + t_1
else if (x <= 7.8d+17) 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 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double t_3 = (b * c) + t_1;
double t_4 = (t * a) * -4.0;
double tmp;
if (x <= -2300000000.0) {
tmp = t_2;
} else if (x <= -9.5e-86) {
tmp = t_3;
} else if (x <= -4.2e-145) {
tmp = t_2;
} else if (x <= -7.6e-209) {
tmp = (b * c) + t_4;
} else if (x <= 7.3e-214) {
tmp = t_4 + t_1;
} else if (x <= 7.8e+17) {
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 = x * ((18.0 * (t * (y * z))) - (4.0 * i)) t_3 = (b * c) + t_1 t_4 = (t * a) * -4.0 tmp = 0 if x <= -2300000000.0: tmp = t_2 elif x <= -9.5e-86: tmp = t_3 elif x <= -4.2e-145: tmp = t_2 elif x <= -7.6e-209: tmp = (b * c) + t_4 elif x <= 7.3e-214: tmp = t_4 + t_1 elif x <= 7.8e+17: 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(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) t_3 = Float64(Float64(b * c) + t_1) t_4 = Float64(Float64(t * a) * -4.0) tmp = 0.0 if (x <= -2300000000.0) tmp = t_2; elseif (x <= -9.5e-86) tmp = t_3; elseif (x <= -4.2e-145) tmp = t_2; elseif (x <= -7.6e-209) tmp = Float64(Float64(b * c) + t_4); elseif (x <= 7.3e-214) tmp = Float64(t_4 + t_1); elseif (x <= 7.8e+17) 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 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
t_3 = (b * c) + t_1;
t_4 = (t * a) * -4.0;
tmp = 0.0;
if (x <= -2300000000.0)
tmp = t_2;
elseif (x <= -9.5e-86)
tmp = t_3;
elseif (x <= -4.2e-145)
tmp = t_2;
elseif (x <= -7.6e-209)
tmp = (b * c) + t_4;
elseif (x <= 7.3e-214)
tmp = t_4 + t_1;
elseif (x <= 7.8e+17)
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[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[x, -2300000000.0], t$95$2, If[LessEqual[x, -9.5e-86], t$95$3, If[LessEqual[x, -4.2e-145], t$95$2, If[LessEqual[x, -7.6e-209], N[(N[(b * c), $MachinePrecision] + t$95$4), $MachinePrecision], If[LessEqual[x, 7.3e-214], N[(t$95$4 + t$95$1), $MachinePrecision], If[LessEqual[x, 7.8e+17], 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 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
t_3 := b \cdot c + t\_1\\
t_4 := \left(t \cdot a\right) \cdot -4\\
\mathbf{if}\;x \leq -2300000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-86}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-145}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -7.6 \cdot 10^{-209}:\\
\;\;\;\;b \cdot c + t\_4\\
\mathbf{elif}\;x \leq 7.3 \cdot 10^{-214}:\\
\;\;\;\;t\_4 + t\_1\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+17}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.3e9 or -9.4999999999999996e-86 < x < -4.19999999999999982e-145 or 7.8e17 < x Initial program 80.5%
Simplified85.1%
Taylor expanded in x around inf 74.1%
if -2.3e9 < x < -9.4999999999999996e-86 or 7.30000000000000029e-214 < x < 7.8e17Initial program 96.9%
Simplified94.2%
Taylor expanded in b around inf 66.4%
if -4.19999999999999982e-145 < x < -7.5999999999999998e-209Initial program 99.8%
Simplified99.8%
Taylor expanded in j around 0 87.5%
Taylor expanded in x around 0 65.5%
if -7.5999999999999998e-209 < x < 7.30000000000000029e-214Initial program 93.2%
Simplified91.0%
Taylor expanded in a around inf 73.4%
*-commutative73.4%
Simplified73.4%
Final simplification71.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
(if (<= (* b c) -1.4e+177)
(* b c)
(if (<= (* b c) -5.2e-13)
(* t (* a -4.0))
(if (<= (* b c) -2.1e-267)
(* -27.0 (* j k))
(if (<= (* b c) 0.0)
(* i (* x -4.0))
(if (<= (* b c) 1.85e+121) (* k (* j -27.0)) (* b c)))))))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) <= -1.4e+177) {
tmp = b * c;
} else if ((b * c) <= -5.2e-13) {
tmp = t * (a * -4.0);
} else if ((b * c) <= -2.1e-267) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 0.0) {
tmp = i * (x * -4.0);
} else if ((b * c) <= 1.85e+121) {
tmp = k * (j * -27.0);
} else {
tmp = b * c;
}
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 ((b * c) <= (-1.4d+177)) then
tmp = b * c
else if ((b * c) <= (-5.2d-13)) then
tmp = t * (a * (-4.0d0))
else if ((b * c) <= (-2.1d-267)) then
tmp = (-27.0d0) * (j * k)
else if ((b * c) <= 0.0d0) then
tmp = i * (x * (-4.0d0))
else if ((b * c) <= 1.85d+121) then
tmp = k * (j * (-27.0d0))
else
tmp = b * c
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 ((b * c) <= -1.4e+177) {
tmp = b * c;
} else if ((b * c) <= -5.2e-13) {
tmp = t * (a * -4.0);
} else if ((b * c) <= -2.1e-267) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 0.0) {
tmp = i * (x * -4.0);
} else if ((b * c) <= 1.85e+121) {
tmp = k * (j * -27.0);
} else {
tmp = b * c;
}
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) <= -1.4e+177: tmp = b * c elif (b * c) <= -5.2e-13: tmp = t * (a * -4.0) elif (b * c) <= -2.1e-267: tmp = -27.0 * (j * k) elif (b * c) <= 0.0: tmp = i * (x * -4.0) elif (b * c) <= 1.85e+121: tmp = k * (j * -27.0) else: tmp = b * c 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(b * c) <= -1.4e+177) tmp = Float64(b * c); elseif (Float64(b * c) <= -5.2e-13) tmp = Float64(t * Float64(a * -4.0)); elseif (Float64(b * c) <= -2.1e-267) tmp = Float64(-27.0 * Float64(j * k)); elseif (Float64(b * c) <= 0.0) tmp = Float64(i * Float64(x * -4.0)); elseif (Float64(b * c) <= 1.85e+121) tmp = Float64(k * Float64(j * -27.0)); else tmp = Float64(b * c); 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) <= -1.4e+177)
tmp = b * c;
elseif ((b * c) <= -5.2e-13)
tmp = t * (a * -4.0);
elseif ((b * c) <= -2.1e-267)
tmp = -27.0 * (j * k);
elseif ((b * c) <= 0.0)
tmp = i * (x * -4.0);
elseif ((b * c) <= 1.85e+121)
tmp = k * (j * -27.0);
else
tmp = b * c;
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[(b * c), $MachinePrecision], -1.4e+177], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -5.2e-13], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -2.1e-267], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 0.0], N[(i * N[(x * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.85e+121], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $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}\;b \cdot c \leq -1.4 \cdot 10^{+177}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -5.2 \cdot 10^{-13}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq -2.1 \cdot 10^{-267}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 0:\\
\;\;\;\;i \cdot \left(x \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 1.85 \cdot 10^{+121}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.40000000000000001e177 or 1.85000000000000006e121 < (*.f64 b c) Initial program 91.1%
Simplified91.2%
associate-*r*91.1%
distribute-rgt-out--91.1%
associate-*l*83.8%
*-commutative83.8%
*-commutative83.8%
Applied egg-rr83.8%
Taylor expanded in b around inf 60.5%
if -1.40000000000000001e177 < (*.f64 b c) < -5.2000000000000001e-13Initial program 79.6%
Simplified79.6%
associate-*r*79.6%
distribute-rgt-out--79.6%
associate-*l*85.3%
*-commutative85.3%
*-commutative85.3%
Applied egg-rr85.3%
Taylor expanded in a around inf 34.1%
*-commutative34.1%
*-commutative34.1%
associate-*r*37.0%
Simplified37.0%
if -5.2000000000000001e-13 < (*.f64 b c) < -2.1000000000000001e-267Initial program 89.7%
Simplified87.3%
Taylor expanded in j around inf 41.7%
if -2.1000000000000001e-267 < (*.f64 b c) < -0.0Initial program 93.8%
Simplified96.7%
associate-*r*93.8%
distribute-rgt-out--93.8%
associate-*l*90.6%
*-commutative90.6%
*-commutative90.6%
Applied egg-rr90.6%
Taylor expanded in i around inf 45.6%
*-commutative45.6%
associate-*r*45.6%
*-commutative45.6%
Simplified45.6%
if -0.0 < (*.f64 b c) < 1.85000000000000006e121Initial program 86.2%
Simplified90.3%
Taylor expanded in j around inf 33.4%
*-commutative33.4%
*-commutative33.4%
associate-*r*33.5%
Simplified33.5%
Final simplification45.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 (+ (* x (* 4.0 i)) (* j (* 27.0 k)))))
(if (<= y -4e+80)
(- (+ (* y (* 18.0 (* t (* x z)))) (- (* b c) (* t (* a 4.0)))) t_1)
(- (- (* b c) (* t (- (* a 4.0) (* (* x 18.0) (* y z))))) t_1))))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 = (x * (4.0 * i)) + (j * (27.0 * k));
double tmp;
if (y <= -4e+80) {
tmp = ((y * (18.0 * (t * (x * z)))) + ((b * c) - (t * (a * 4.0)))) - t_1;
} else {
tmp = ((b * c) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - t_1;
}
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 = (x * (4.0d0 * i)) + (j * (27.0d0 * k))
if (y <= (-4d+80)) then
tmp = ((y * (18.0d0 * (t * (x * z)))) + ((b * c) - (t * (a * 4.0d0)))) - t_1
else
tmp = ((b * c) - (t * ((a * 4.0d0) - ((x * 18.0d0) * (y * z))))) - t_1
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 = (x * (4.0 * i)) + (j * (27.0 * k));
double tmp;
if (y <= -4e+80) {
tmp = ((y * (18.0 * (t * (x * z)))) + ((b * c) - (t * (a * 4.0)))) - t_1;
} else {
tmp = ((b * c) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - t_1;
}
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 = (x * (4.0 * i)) + (j * (27.0 * k)) tmp = 0 if y <= -4e+80: tmp = ((y * (18.0 * (t * (x * z)))) + ((b * c) - (t * (a * 4.0)))) - t_1 else: tmp = ((b * c) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - t_1 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(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k))) tmp = 0.0 if (y <= -4e+80) tmp = Float64(Float64(Float64(y * Float64(18.0 * Float64(t * Float64(x * z)))) + Float64(Float64(b * c) - Float64(t * Float64(a * 4.0)))) - t_1); else tmp = Float64(Float64(Float64(b * c) - Float64(t * Float64(Float64(a * 4.0) - Float64(Float64(x * 18.0) * Float64(y * z))))) - t_1); 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 = (x * (4.0 * i)) + (j * (27.0 * k));
tmp = 0.0;
if (y <= -4e+80)
tmp = ((y * (18.0 * (t * (x * z)))) + ((b * c) - (t * (a * 4.0)))) - t_1;
else
tmp = ((b * c) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - t_1;
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[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e+80], N[(N[(N[(y * N[(18.0 * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(t * N[(N[(a * 4.0), $MachinePrecision] - N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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 := x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\\
\mathbf{if}\;y \leq -4 \cdot 10^{+80}:\\
\;\;\;\;\left(y \cdot \left(18 \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) + \left(b \cdot c - t \cdot \left(a \cdot 4\right)\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - t \cdot \left(a \cdot 4 - \left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right)\right) - t\_1\\
\end{array}
\end{array}
if y < -4e80Initial program 84.9%
Simplified82.6%
associate-*r*84.9%
distribute-rgt-out--84.9%
associate-*l*85.2%
*-commutative85.2%
*-commutative85.2%
Applied egg-rr85.2%
associate-+l-85.2%
associate-*l*87.6%
Applied egg-rr87.6%
Taylor expanded in x around 0 90.0%
if -4e80 < y Initial program 88.9%
Simplified90.8%
Final simplification90.7%
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 (* (* t a) -4.0))
(t_2 (* j (* k -27.0)))
(t_3 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))
(if (<= x -8.2e+53)
t_3
(if (<= x -4.3e-209)
(- (+ (* b c) t_1) (* 4.0 (* x i)))
(if (<= x 6.8e-214)
(+ t_1 t_2)
(if (<= x 46000.0) (+ (* b c) t_2) 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 = (t * a) * -4.0;
double t_2 = j * (k * -27.0);
double t_3 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -8.2e+53) {
tmp = t_3;
} else if (x <= -4.3e-209) {
tmp = ((b * c) + t_1) - (4.0 * (x * i));
} else if (x <= 6.8e-214) {
tmp = t_1 + t_2;
} else if (x <= 46000.0) {
tmp = (b * c) + t_2;
} 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 = (t * a) * (-4.0d0)
t_2 = j * (k * (-27.0d0))
t_3 = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
if (x <= (-8.2d+53)) then
tmp = t_3
else if (x <= (-4.3d-209)) then
tmp = ((b * c) + t_1) - (4.0d0 * (x * i))
else if (x <= 6.8d-214) then
tmp = t_1 + t_2
else if (x <= 46000.0d0) then
tmp = (b * c) + t_2
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 = (t * a) * -4.0;
double t_2 = j * (k * -27.0);
double t_3 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -8.2e+53) {
tmp = t_3;
} else if (x <= -4.3e-209) {
tmp = ((b * c) + t_1) - (4.0 * (x * i));
} else if (x <= 6.8e-214) {
tmp = t_1 + t_2;
} else if (x <= 46000.0) {
tmp = (b * c) + t_2;
} 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 = (t * a) * -4.0 t_2 = j * (k * -27.0) t_3 = x * ((18.0 * (t * (y * z))) - (4.0 * i)) tmp = 0 if x <= -8.2e+53: tmp = t_3 elif x <= -4.3e-209: tmp = ((b * c) + t_1) - (4.0 * (x * i)) elif x <= 6.8e-214: tmp = t_1 + t_2 elif x <= 46000.0: tmp = (b * c) + t_2 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(Float64(t * a) * -4.0) t_2 = Float64(j * Float64(k * -27.0)) t_3 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -8.2e+53) tmp = t_3; elseif (x <= -4.3e-209) tmp = Float64(Float64(Float64(b * c) + t_1) - Float64(4.0 * Float64(x * i))); elseif (x <= 6.8e-214) tmp = Float64(t_1 + t_2); elseif (x <= 46000.0) tmp = Float64(Float64(b * c) + t_2); 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 = (t * a) * -4.0;
t_2 = j * (k * -27.0);
t_3 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
tmp = 0.0;
if (x <= -8.2e+53)
tmp = t_3;
elseif (x <= -4.3e-209)
tmp = ((b * c) + t_1) - (4.0 * (x * i));
elseif (x <= 6.8e-214)
tmp = t_1 + t_2;
elseif (x <= 46000.0)
tmp = (b * c) + t_2;
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[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.2e+53], t$95$3, If[LessEqual[x, -4.3e-209], N[(N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.8e-214], N[(t$95$1 + t$95$2), $MachinePrecision], If[LessEqual[x, 46000.0], N[(N[(b * c), $MachinePrecision] + t$95$2), $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 := \left(t \cdot a\right) \cdot -4\\
t_2 := j \cdot \left(k \cdot -27\right)\\
t_3 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -8.2 \cdot 10^{+53}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq -4.3 \cdot 10^{-209}:\\
\;\;\;\;\left(b \cdot c + t\_1\right) - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-214}:\\
\;\;\;\;t\_1 + t\_2\\
\mathbf{elif}\;x \leq 46000:\\
\;\;\;\;b \cdot c + t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if x < -8.20000000000000037e53 or 46000 < x Initial program 78.0%
Simplified83.9%
Taylor expanded in x around inf 78.4%
if -8.20000000000000037e53 < x < -4.30000000000000005e-209Initial program 93.4%
Simplified93.4%
Taylor expanded in j around 0 82.4%
Taylor expanded in y around 0 65.4%
if -4.30000000000000005e-209 < x < 6.7999999999999998e-214Initial program 93.2%
Simplified91.0%
Taylor expanded in a around inf 73.4%
*-commutative73.4%
Simplified73.4%
if 6.7999999999999998e-214 < x < 46000Initial program 97.9%
Simplified94.3%
Taylor expanded in b around inf 64.8%
Final simplification71.7%
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 (* 4.0 (* x i))))
(if (<= (* j 27.0) -5e-64)
(- (- (* b c) (+ (* 4.0 (* t a)) t_1)) (* (* j 27.0) k))
(- (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))) t_1))))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 = 4.0 * (x * i);
double tmp;
if ((j * 27.0) <= -5e-64) {
tmp = ((b * c) - ((4.0 * (t * a)) + t_1)) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
}
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 = 4.0d0 * (x * i)
if ((j * 27.0d0) <= (-5d-64)) then
tmp = ((b * c) - ((4.0d0 * (t * a)) + t_1)) - ((j * 27.0d0) * k)
else
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - t_1
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 = 4.0 * (x * i);
double tmp;
if ((j * 27.0) <= -5e-64) {
tmp = ((b * c) - ((4.0 * (t * a)) + t_1)) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
}
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 = 4.0 * (x * i) tmp = 0 if (j * 27.0) <= -5e-64: tmp = ((b * c) - ((4.0 * (t * a)) + t_1)) - ((j * 27.0) * k) else: tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1 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(4.0 * Float64(x * i)) tmp = 0.0 if (Float64(j * 27.0) <= -5e-64) tmp = Float64(Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(t * a)) + t_1)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) - t_1); 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 = 4.0 * (x * i);
tmp = 0.0;
if ((j * 27.0) <= -5e-64)
tmp = ((b * c) - ((4.0 * (t * a)) + t_1)) - ((j * 27.0) * k);
else
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - t_1;
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[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(j * 27.0), $MachinePrecision], -5e-64], N[(N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $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 := 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;j \cdot 27 \leq -5 \cdot 10^{-64}:\\
\;\;\;\;\left(b \cdot c - \left(4 \cdot \left(t \cdot a\right) + t\_1\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\right) - t\_1\\
\end{array}
\end{array}
if (*.f64 j 27) < -5.00000000000000033e-64Initial program 84.9%
Taylor expanded in y around 0 80.8%
if -5.00000000000000033e-64 < (*.f64 j 27) Initial program 90.0%
Simplified91.8%
Taylor expanded in j around 0 80.6%
Final simplification80.7%
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 (<= x -32000000000.0)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= x 1950000000.0)
(- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))
(- (+ (* b c) (* 18.0 (* t (* x (* y z))))) (* 4.0 (* x i))))))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 <= -32000000000.0) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= 1950000000.0) {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (4.0 * (x * i));
}
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 <= (-32000000000.0d0)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (x <= 1950000000.0d0) then
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
else
tmp = ((b * c) + (18.0d0 * (t * (x * (y * z))))) - (4.0d0 * (x * i))
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 <= -32000000000.0) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= 1950000000.0) {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (4.0 * (x * i));
}
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 <= -32000000000.0: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif x <= 1950000000.0: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) else: tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (4.0 * (x * i)) 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 <= -32000000000.0) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (x <= 1950000000.0) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))) - Float64(4.0 * Float64(x * i))); 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 <= -32000000000.0)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (x <= 1950000000.0)
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
else
tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (4.0 * (x * i));
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[x, -32000000000.0], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1950000000.0], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $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 -32000000000:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;x \leq 1950000000:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if x < -3.2e10Initial program 71.9%
Simplified77.4%
Taylor expanded in x around inf 72.7%
if -3.2e10 < x < 1.95e9Initial program 95.8%
Taylor expanded in x around 0 80.0%
if 1.95e9 < x Initial program 84.2%
Simplified89.4%
Taylor expanded in j around 0 87.0%
Taylor expanded in a around 0 82.4%
Final simplification79.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) (* t (- (* a 4.0) (* (* x 18.0) (* y z))))) (+ (* x (* 4.0 i)) (* j (* 27.0 k)))))
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) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
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) - (t * ((a * 4.0d0) - ((x * 18.0d0) * (y * z))))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
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) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
[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) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - ((x * (4.0 * i)) + (j * (27.0 * k)))
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(Float64(b * c) - Float64(t * Float64(Float64(a * 4.0) - Float64(Float64(x * 18.0) * Float64(y * z))))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))) 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) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
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[(N[(b * c), $MachinePrecision] - N[(t * N[(N[(a * 4.0), $MachinePrecision] - N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $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])\\
\\
\left(b \cdot c - t \cdot \left(a \cdot 4 - \left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)
\end{array}
Initial program 88.3%
Simplified89.5%
Final simplification89.5%
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) -3.1e+177)
(* b c)
(if (<= (* b c) -2.7e-20)
(* t (* a -4.0))
(if (<= (* b c) 1.45e+117) (* k (* j -27.0)) (* b c)))))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) <= -3.1e+177) {
tmp = b * c;
} else if ((b * c) <= -2.7e-20) {
tmp = t * (a * -4.0);
} else if ((b * c) <= 1.45e+117) {
tmp = k * (j * -27.0);
} else {
tmp = b * c;
}
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 ((b * c) <= (-3.1d+177)) then
tmp = b * c
else if ((b * c) <= (-2.7d-20)) then
tmp = t * (a * (-4.0d0))
else if ((b * c) <= 1.45d+117) then
tmp = k * (j * (-27.0d0))
else
tmp = b * c
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 ((b * c) <= -3.1e+177) {
tmp = b * c;
} else if ((b * c) <= -2.7e-20) {
tmp = t * (a * -4.0);
} else if ((b * c) <= 1.45e+117) {
tmp = k * (j * -27.0);
} else {
tmp = b * c;
}
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) <= -3.1e+177: tmp = b * c elif (b * c) <= -2.7e-20: tmp = t * (a * -4.0) elif (b * c) <= 1.45e+117: tmp = k * (j * -27.0) else: tmp = b * c 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(b * c) <= -3.1e+177) tmp = Float64(b * c); elseif (Float64(b * c) <= -2.7e-20) tmp = Float64(t * Float64(a * -4.0)); elseif (Float64(b * c) <= 1.45e+117) tmp = Float64(k * Float64(j * -27.0)); else tmp = Float64(b * c); 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) <= -3.1e+177)
tmp = b * c;
elseif ((b * c) <= -2.7e-20)
tmp = t * (a * -4.0);
elseif ((b * c) <= 1.45e+117)
tmp = k * (j * -27.0);
else
tmp = b * c;
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[(b * c), $MachinePrecision], -3.1e+177], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -2.7e-20], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.45e+117], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $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}\;b \cdot c \leq -3.1 \cdot 10^{+177}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -2.7 \cdot 10^{-20}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 1.45 \cdot 10^{+117}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -3.0999999999999999e177 or 1.45000000000000014e117 < (*.f64 b c) Initial program 91.1%
Simplified91.2%
associate-*r*91.1%
distribute-rgt-out--91.1%
associate-*l*83.8%
*-commutative83.8%
*-commutative83.8%
Applied egg-rr83.8%
Taylor expanded in b around inf 60.5%
if -3.0999999999999999e177 < (*.f64 b c) < -2.7e-20Initial program 80.7%
Simplified78.2%
associate-*r*78.2%
distribute-rgt-out--78.2%
associate-*l*83.6%
*-commutative83.6%
*-commutative83.6%
Applied egg-rr83.6%
Taylor expanded in a around inf 35.1%
*-commutative35.1%
*-commutative35.1%
associate-*r*37.8%
Simplified37.8%
if -2.7e-20 < (*.f64 b c) < 1.45000000000000014e117Initial program 88.7%
Simplified91.5%
Taylor expanded in j around inf 33.2%
*-commutative33.2%
*-commutative33.2%
associate-*r*33.2%
Simplified33.2%
Final simplification42.3%
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 (<= t -9e+179) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) (- (- (* b c) (+ (* 4.0 (* t a)) (* 4.0 (* x i)))) (* (* j 27.0) k))))
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 (t <= -9e+179) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = ((b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)))) - ((j * 27.0) * k);
}
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 (t <= (-9d+179)) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else
tmp = ((b * c) - ((4.0d0 * (t * a)) + (4.0d0 * (x * i)))) - ((j * 27.0d0) * k)
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 (t <= -9e+179) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = ((b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)))) - ((j * 27.0) * k);
}
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 t <= -9e+179: tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) else: tmp = ((b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)))) - ((j * 27.0) * k) 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 (t <= -9e+179) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); else tmp = Float64(Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(t * a)) + Float64(4.0 * Float64(x * i)))) - Float64(Float64(j * 27.0) * k)); 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 (t <= -9e+179)
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
else
tmp = ((b * c) - ((4.0 * (t * a)) + (4.0 * (x * i)))) - ((j * 27.0) * k);
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[t, -9e+179], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $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}\;t \leq -9 \cdot 10^{+179}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - \left(4 \cdot \left(t \cdot a\right) + 4 \cdot \left(x \cdot i\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if t < -9.0000000000000005e179Initial program 77.3%
Simplified83.8%
Taylor expanded in t around inf 90.4%
if -9.0000000000000005e179 < t Initial program 89.8%
Taylor expanded in y around 0 81.6%
Final simplification82.7%
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 -4400000000000.0) (not (<= x 6.8e+21))) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) (- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))))
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 <= -4400000000000.0) || !(x <= 6.8e+21)) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
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 <= (-4400000000000.0d0)) .or. (.not. (x <= 6.8d+21))) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
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 <= -4400000000000.0) || !(x <= 6.8e+21)) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
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 <= -4400000000000.0) or not (x <= 6.8e+21): tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) else: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) 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 <= -4400000000000.0) || !(x <= 6.8e+21)) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); 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 <= -4400000000000.0) || ~((x <= 6.8e+21)))
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
else
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
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, -4400000000000.0], N[Not[LessEqual[x, 6.8e+21]], $MachinePrecision]], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $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 -4400000000000 \lor \neg \left(x \leq 6.8 \cdot 10^{+21}\right):\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -4.4e12 or 6.8e21 < x Initial program 78.2%
Simplified83.6%
Taylor expanded in x around inf 76.0%
if -4.4e12 < x < 6.8e21Initial program 95.8%
Taylor expanded in x around 0 80.0%
Final simplification78.3%
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) -2.5e+94)
(+ (* b c) (* (* t a) -4.0))
(if (<= (* b c) 2.8e+118)
(+ (* j (* k -27.0)) (* x (* i -4.0)))
(- (* b c) (* 4.0 (* x i))))))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) <= -2.5e+94) {
tmp = (b * c) + ((t * a) * -4.0);
} else if ((b * c) <= 2.8e+118) {
tmp = (j * (k * -27.0)) + (x * (i * -4.0));
} else {
tmp = (b * c) - (4.0 * (x * i));
}
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 ((b * c) <= (-2.5d+94)) then
tmp = (b * c) + ((t * a) * (-4.0d0))
else if ((b * c) <= 2.8d+118) then
tmp = (j * (k * (-27.0d0))) + (x * (i * (-4.0d0)))
else
tmp = (b * c) - (4.0d0 * (x * i))
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 ((b * c) <= -2.5e+94) {
tmp = (b * c) + ((t * a) * -4.0);
} else if ((b * c) <= 2.8e+118) {
tmp = (j * (k * -27.0)) + (x * (i * -4.0));
} else {
tmp = (b * c) - (4.0 * (x * i));
}
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) <= -2.5e+94: tmp = (b * c) + ((t * a) * -4.0) elif (b * c) <= 2.8e+118: tmp = (j * (k * -27.0)) + (x * (i * -4.0)) else: tmp = (b * c) - (4.0 * (x * i)) 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(b * c) <= -2.5e+94) tmp = Float64(Float64(b * c) + Float64(Float64(t * a) * -4.0)); elseif (Float64(b * c) <= 2.8e+118) tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(x * Float64(i * -4.0))); else tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); 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) <= -2.5e+94)
tmp = (b * c) + ((t * a) * -4.0);
elseif ((b * c) <= 2.8e+118)
tmp = (j * (k * -27.0)) + (x * (i * -4.0));
else
tmp = (b * c) - (4.0 * (x * i));
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[(b * c), $MachinePrecision], -2.5e+94], N[(N[(b * c), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.8e+118], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $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}\;b \cdot c \leq -2.5 \cdot 10^{+94}:\\
\;\;\;\;b \cdot c + \left(t \cdot a\right) \cdot -4\\
\mathbf{elif}\;b \cdot c \leq 2.8 \cdot 10^{+118}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + x \cdot \left(i \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -2.50000000000000005e94Initial program 93.7%
Simplified93.7%
Taylor expanded in j around 0 89.5%
Taylor expanded in x around 0 72.0%
if -2.50000000000000005e94 < (*.f64 b c) < 2.79999999999999986e118Initial program 87.3%
Simplified89.7%
Taylor expanded in i around inf 56.8%
associate-*r*56.8%
*-commutative56.8%
Simplified56.8%
if 2.79999999999999986e118 < (*.f64 b c) Initial program 86.3%
Simplified86.5%
Taylor expanded in j around 0 84.6%
Taylor expanded in t around 0 66.5%
Final simplification61.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 (if (or (<= (* b c) -3.2e+119) (not (<= (* b c) 1.05e+117))) (* b c) (* -27.0 (* j k))))
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) <= -3.2e+119) || !((b * c) <= 1.05e+117)) {
tmp = b * c;
} else {
tmp = -27.0 * (j * k);
}
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 (((b * c) <= (-3.2d+119)) .or. (.not. ((b * c) <= 1.05d+117))) then
tmp = b * c
else
tmp = (-27.0d0) * (j * k)
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 (((b * c) <= -3.2e+119) || !((b * c) <= 1.05e+117)) {
tmp = b * c;
} else {
tmp = -27.0 * (j * k);
}
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) <= -3.2e+119) or not ((b * c) <= 1.05e+117): tmp = b * c else: tmp = -27.0 * (j * k) 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(b * c) <= -3.2e+119) || !(Float64(b * c) <= 1.05e+117)) tmp = Float64(b * c); else tmp = Float64(-27.0 * Float64(j * k)); 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) <= -3.2e+119) || ~(((b * c) <= 1.05e+117)))
tmp = b * c;
else
tmp = -27.0 * (j * k);
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[N[(b * c), $MachinePrecision], -3.2e+119], N[Not[LessEqual[N[(b * c), $MachinePrecision], 1.05e+117]], $MachinePrecision]], N[(b * c), $MachinePrecision], N[(-27.0 * N[(j * k), $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}\;b \cdot c \leq -3.2 \cdot 10^{+119} \lor \neg \left(b \cdot c \leq 1.05 \cdot 10^{+117}\right):\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -3.19999999999999989e119 or 1.0500000000000001e117 < (*.f64 b c) Initial program 89.8%
Simplified89.9%
associate-*r*89.8%
distribute-rgt-out--89.8%
associate-*l*84.3%
*-commutative84.3%
*-commutative84.3%
Applied egg-rr84.3%
Taylor expanded in b around inf 56.6%
if -3.19999999999999989e119 < (*.f64 b c) < 1.0500000000000001e117Initial program 87.5%
Simplified89.9%
Taylor expanded in j around inf 32.2%
Final simplification40.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 (if (or (<= (* b c) -7.2e+116) (not (<= (* b c) 1.06e+119))) (* 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) {
double tmp;
if (((b * c) <= -7.2e+116) || !((b * c) <= 1.06e+119)) {
tmp = b * c;
} else {
tmp = j * (k * -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 (((b * c) <= (-7.2d+116)) .or. (.not. ((b * c) <= 1.06d+119))) then
tmp = b * c
else
tmp = j * (k * (-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 (((b * c) <= -7.2e+116) || !((b * c) <= 1.06e+119)) {
tmp = b * c;
} else {
tmp = j * (k * -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 ((b * c) <= -7.2e+116) or not ((b * c) <= 1.06e+119): tmp = b * c else: tmp = j * (k * -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 ((Float64(b * c) <= -7.2e+116) || !(Float64(b * c) <= 1.06e+119)) tmp = Float64(b * c); else tmp = Float64(j * Float64(k * -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 (((b * c) <= -7.2e+116) || ~(((b * c) <= 1.06e+119)))
tmp = b * c;
else
tmp = j * (k * -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[N[(b * c), $MachinePrecision], -7.2e+116], N[Not[LessEqual[N[(b * c), $MachinePrecision], 1.06e+119]], $MachinePrecision]], N[(b * c), $MachinePrecision], N[(j * N[(k * -27.0), $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}\;b \cdot c \leq -7.2 \cdot 10^{+116} \lor \neg \left(b \cdot c \leq 1.06 \cdot 10^{+119}\right):\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -7.19999999999999941e116 or 1.0599999999999999e119 < (*.f64 b c) Initial program 89.8%
Simplified89.9%
associate-*r*89.8%
distribute-rgt-out--89.8%
associate-*l*84.3%
*-commutative84.3%
*-commutative84.3%
Applied egg-rr84.3%
Taylor expanded in b around inf 56.6%
if -7.19999999999999941e116 < (*.f64 b c) < 1.0599999999999999e119Initial program 87.5%
Simplified89.3%
associate-*r*88.2%
distribute-rgt-out--87.0%
associate-*l*85.8%
*-commutative85.8%
*-commutative85.8%
Applied egg-rr85.8%
Taylor expanded in j around inf 32.2%
*-commutative32.2%
associate-*r*31.8%
Simplified31.8%
Final simplification40.3%
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 (<= c -2.16e-72) (not (<= c 3.8e+178))) (* b c) (* -4.0 (+ (* t a) (* x i)))))
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 ((c <= -2.16e-72) || !(c <= 3.8e+178)) {
tmp = b * c;
} else {
tmp = -4.0 * ((t * a) + (x * i));
}
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 ((c <= (-2.16d-72)) .or. (.not. (c <= 3.8d+178))) then
tmp = b * c
else
tmp = (-4.0d0) * ((t * a) + (x * i))
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 ((c <= -2.16e-72) || !(c <= 3.8e+178)) {
tmp = b * c;
} else {
tmp = -4.0 * ((t * a) + (x * i));
}
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 (c <= -2.16e-72) or not (c <= 3.8e+178): tmp = b * c else: tmp = -4.0 * ((t * a) + (x * i)) 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 ((c <= -2.16e-72) || !(c <= 3.8e+178)) tmp = Float64(b * c); else tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); 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 ((c <= -2.16e-72) || ~((c <= 3.8e+178)))
tmp = b * c;
else
tmp = -4.0 * ((t * a) + (x * i));
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[c, -2.16e-72], N[Not[LessEqual[c, 3.8e+178]], $MachinePrecision]], N[(b * c), $MachinePrecision], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $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}\;c \leq -2.16 \cdot 10^{-72} \lor \neg \left(c \leq 3.8 \cdot 10^{+178}\right):\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\end{array}
\end{array}
if c < -2.15999999999999996e-72 or 3.79999999999999998e178 < c Initial program 84.4%
Simplified84.5%
associate-*r*85.4%
distribute-rgt-out--84.4%
associate-*l*81.3%
*-commutative81.3%
*-commutative81.3%
Applied egg-rr81.3%
Taylor expanded in b around inf 45.5%
if -2.15999999999999996e-72 < c < 3.79999999999999998e178Initial program 90.7%
Simplified92.5%
Taylor expanded in j around 0 72.9%
Taylor expanded in y around 0 56.8%
Taylor expanded in b around 0 49.3%
Taylor expanded in a around 0 49.3%
distribute-lft-out49.3%
*-commutative49.3%
*-commutative49.3%
Simplified49.3%
Final simplification47.9%
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 -3200000000000.0) (not (<= x 9.5e+21))) (* -4.0 (+ (* t a) (* x i))) (+ (* 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) {
double tmp;
if ((x <= -3200000000000.0) || !(x <= 9.5e+21)) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = (b * c) + (j * (k * -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 <= (-3200000000000.0d0)) .or. (.not. (x <= 9.5d+21))) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else
tmp = (b * c) + (j * (k * (-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 <= -3200000000000.0) || !(x <= 9.5e+21)) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = (b * c) + (j * (k * -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 <= -3200000000000.0) or not (x <= 9.5e+21): tmp = -4.0 * ((t * a) + (x * i)) else: tmp = (b * c) + (j * (k * -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 <= -3200000000000.0) || !(x <= 9.5e+21)) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); else tmp = Float64(Float64(b * c) + Float64(j * Float64(k * -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 <= -3200000000000.0) || ~((x <= 9.5e+21)))
tmp = -4.0 * ((t * a) + (x * i));
else
tmp = (b * c) + (j * (k * -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, -3200000000000.0], N[Not[LessEqual[x, 9.5e+21]], $MachinePrecision]], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3200000000000 \lor \neg \left(x \leq 9.5 \cdot 10^{+21}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if x < -3.2e12 or 9.500000000000001e21 < x Initial program 78.2%
Simplified83.6%
Taylor expanded in j around 0 81.6%
Taylor expanded in y around 0 62.5%
Taylor expanded in b around 0 52.5%
Taylor expanded in a around 0 52.5%
distribute-lft-out52.5%
*-commutative52.5%
*-commutative52.5%
Simplified52.5%
if -3.2e12 < x < 9.500000000000001e21Initial program 95.8%
Simplified93.9%
Taylor expanded in b around inf 58.5%
Final simplification55.9%
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 (<= x -65000000000.0)
(* -4.0 (+ (* t a) (* x i)))
(if (<= x 30000000000.0)
(+ (* b c) (* j (* k -27.0)))
(- (* b c) (* 4.0 (* x i))))))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 <= -65000000000.0) {
tmp = -4.0 * ((t * a) + (x * i));
} else if (x <= 30000000000.0) {
tmp = (b * c) + (j * (k * -27.0));
} else {
tmp = (b * c) - (4.0 * (x * i));
}
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 <= (-65000000000.0d0)) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else if (x <= 30000000000.0d0) then
tmp = (b * c) + (j * (k * (-27.0d0)))
else
tmp = (b * c) - (4.0d0 * (x * i))
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 <= -65000000000.0) {
tmp = -4.0 * ((t * a) + (x * i));
} else if (x <= 30000000000.0) {
tmp = (b * c) + (j * (k * -27.0));
} else {
tmp = (b * c) - (4.0 * (x * i));
}
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 <= -65000000000.0: tmp = -4.0 * ((t * a) + (x * i)) elif x <= 30000000000.0: tmp = (b * c) + (j * (k * -27.0)) else: tmp = (b * c) - (4.0 * (x * i)) 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 <= -65000000000.0) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); elseif (x <= 30000000000.0) tmp = Float64(Float64(b * c) + Float64(j * Float64(k * -27.0))); else tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); 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 <= -65000000000.0)
tmp = -4.0 * ((t * a) + (x * i));
elseif (x <= 30000000000.0)
tmp = (b * c) + (j * (k * -27.0));
else
tmp = (b * c) - (4.0 * (x * i));
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[x, -65000000000.0], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 30000000000.0], N[(N[(b * c), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $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 -65000000000:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{elif}\;x \leq 30000000000:\\
\;\;\;\;b \cdot c + j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if x < -6.5e10Initial program 71.9%
Simplified77.4%
Taylor expanded in j around 0 75.8%
Taylor expanded in y around 0 63.6%
Taylor expanded in b around 0 54.9%
Taylor expanded in a around 0 54.9%
distribute-lft-out54.9%
*-commutative54.9%
*-commutative54.9%
Simplified54.9%
if -6.5e10 < x < 3e10Initial program 95.8%
Simplified93.9%
Taylor expanded in b around inf 58.5%
if 3e10 < x Initial program 84.2%
Simplified89.4%
Taylor expanded in j around 0 87.0%
Taylor expanded in t around 0 54.7%
Final simplification56.9%
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))
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;
}
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
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;
}
[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
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(b * c) 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;
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[(b * c), $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
\end{array}
Initial program 88.3%
Simplified89.5%
associate-*r*88.7%
distribute-rgt-out--88.0%
associate-*l*85.3%
*-commutative85.3%
*-commutative85.3%
Applied egg-rr85.3%
Taylor expanded in b around inf 23.2%
Final simplification23.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 2024039
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
:herbie-target
(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)))