
(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 17 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 (* (* x 4.0) i)) (t_2 (* (* j 27.0) k)) (t_3 (* t (* a 4.0))))
(if (<=
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) t_3) (* b c)) t_1) t_2)
INFINITY)
(- (- (+ (* b c) (- (* y (* (* x 18.0) (* z t))) t_3)) t_1) t_2)
(* x (+ (* 18.0 (* z (* y t))) (* i -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 = (x * 4.0) * i;
double t_2 = (j * 27.0) * k;
double t_3 = t * (a * 4.0);
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - t_3) + (b * c)) - t_1) - t_2) <= ((double) INFINITY)) {
tmp = (((b * c) + ((y * ((x * 18.0) * (z * t))) - t_3)) - t_1) - t_2;
} else {
tmp = x * ((18.0 * (z * (y * t))) + (i * -4.0));
}
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 = (x * 4.0) * i;
double t_2 = (j * 27.0) * k;
double t_3 = t * (a * 4.0);
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - t_3) + (b * c)) - t_1) - t_2) <= Double.POSITIVE_INFINITY) {
tmp = (((b * c) + ((y * ((x * 18.0) * (z * t))) - t_3)) - t_1) - t_2;
} else {
tmp = x * ((18.0 * (z * (y * t))) + (i * -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 = (x * 4.0) * i t_2 = (j * 27.0) * k t_3 = t * (a * 4.0) tmp = 0 if ((((((((x * 18.0) * y) * z) * t) - t_3) + (b * c)) - t_1) - t_2) <= math.inf: tmp = (((b * c) + ((y * ((x * 18.0) * (z * t))) - t_3)) - t_1) - t_2 else: tmp = x * ((18.0 * (z * (y * t))) + (i * -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(Float64(x * 4.0) * i) t_2 = Float64(Float64(j * 27.0) * k) t_3 = Float64(t * Float64(a * 4.0)) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - t_3) + Float64(b * c)) - t_1) - t_2) <= Inf) tmp = Float64(Float64(Float64(Float64(b * c) + Float64(Float64(y * Float64(Float64(x * 18.0) * Float64(z * t))) - t_3)) - t_1) - t_2); else tmp = Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) + Float64(i * -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 = (x * 4.0) * i;
t_2 = (j * 27.0) * k;
t_3 = t * (a * 4.0);
tmp = 0.0;
if (((((((((x * 18.0) * y) * z) * t) - t_3) + (b * c)) - t_1) - t_2) <= Inf)
tmp = (((b * c) + ((y * ((x * 18.0) * (z * t))) - t_3)) - t_1) - t_2;
else
tmp = x * ((18.0 * (z * (y * t))) + (i * -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[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - t$95$3), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], Infinity], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(N[(y * N[(N[(x * 18.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -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 := \left(x \cdot 4\right) \cdot i\\
t_2 := \left(j \cdot 27\right) \cdot k\\
t_3 := t \cdot \left(a \cdot 4\right)\\
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t\_3\right) + b \cdot c\right) - t\_1\right) - t\_2 \leq \infty:\\
\;\;\;\;\left(\left(b \cdot c + \left(y \cdot \left(\left(x \cdot 18\right) \cdot \left(z \cdot t\right)\right) - t\_3\right)\right) - t\_1\right) - t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) + i \cdot -4\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0Initial program 93.4%
pow193.4%
associate-*l*87.9%
*-commutative87.9%
Applied egg-rr87.9%
unpow187.9%
associate-*l*92.7%
*-commutative92.7%
Simplified92.7%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) Initial program 0.0%
pow10.0%
associate-*l*0.0%
*-commutative0.0%
Applied egg-rr0.0%
unpow10.0%
associate-*l*17.1%
*-commutative17.1%
Simplified17.1%
Taylor expanded in x around inf 60.1%
cancel-sign-sub-inv60.1%
metadata-eval60.1%
associate-*r*60.2%
*-commutative60.2%
Simplified60.2%
Final simplification88.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 (<= (* b c) -1.76e+146)
(* b c)
(if (<= (* b c) -6.2e+94)
(* 18.0 (* t (* z (* x y))))
(if (<= (* b c) -4e-163)
(* -27.0 (* j k))
(if (<= (* b c) 2.7e-56)
(* x (* i -4.0))
(if (<= (* b c) 9e+198) (* 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.76e+146) {
tmp = b * c;
} else if ((b * c) <= -6.2e+94) {
tmp = 18.0 * (t * (z * (x * y)));
} else if ((b * c) <= -4e-163) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 2.7e-56) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 9e+198) {
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.76d+146)) then
tmp = b * c
else if ((b * c) <= (-6.2d+94)) then
tmp = 18.0d0 * (t * (z * (x * y)))
else if ((b * c) <= (-4d-163)) then
tmp = (-27.0d0) * (j * k)
else if ((b * c) <= 2.7d-56) then
tmp = x * (i * (-4.0d0))
else if ((b * c) <= 9d+198) 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.76e+146) {
tmp = b * c;
} else if ((b * c) <= -6.2e+94) {
tmp = 18.0 * (t * (z * (x * y)));
} else if ((b * c) <= -4e-163) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 2.7e-56) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 9e+198) {
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.76e+146: tmp = b * c elif (b * c) <= -6.2e+94: tmp = 18.0 * (t * (z * (x * y))) elif (b * c) <= -4e-163: tmp = -27.0 * (j * k) elif (b * c) <= 2.7e-56: tmp = x * (i * -4.0) elif (b * c) <= 9e+198: 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.76e+146) tmp = Float64(b * c); elseif (Float64(b * c) <= -6.2e+94) tmp = Float64(18.0 * Float64(t * Float64(z * Float64(x * y)))); elseif (Float64(b * c) <= -4e-163) tmp = Float64(-27.0 * Float64(j * k)); elseif (Float64(b * c) <= 2.7e-56) tmp = Float64(x * Float64(i * -4.0)); elseif (Float64(b * c) <= 9e+198) 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.76e+146)
tmp = b * c;
elseif ((b * c) <= -6.2e+94)
tmp = 18.0 * (t * (z * (x * y)));
elseif ((b * c) <= -4e-163)
tmp = -27.0 * (j * k);
elseif ((b * c) <= 2.7e-56)
tmp = x * (i * -4.0);
elseif ((b * c) <= 9e+198)
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.76e+146], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -6.2e+94], N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -4e-163], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.7e-56], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 9e+198], 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.76 \cdot 10^{+146}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -6.2 \cdot 10^{+94}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq -4 \cdot 10^{-163}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 2.7 \cdot 10^{-56}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 9 \cdot 10^{+198}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.76000000000000007e146 or 9.00000000000000003e198 < (*.f64 b c) Initial program 76.8%
pow176.8%
associate-*l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
unpow167.8%
associate-*l*72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in b around inf 67.0%
if -1.76000000000000007e146 < (*.f64 b c) < -6.19999999999999983e94Initial program 100.0%
Taylor expanded in t around -inf 75.6%
Taylor expanded in z around inf 75.6%
Taylor expanded in x around inf 75.7%
Taylor expanded in t around 0 64.2%
*-commutative64.2%
associate-*r*75.7%
Simplified75.7%
if -6.19999999999999983e94 < (*.f64 b c) < -3.99999999999999969e-163Initial program 76.7%
Simplified87.1%
Taylor expanded in j around inf 48.2%
if -3.99999999999999969e-163 < (*.f64 b c) < 2.69999999999999995e-56Initial program 82.3%
pow182.3%
associate-*l*77.9%
*-commutative77.9%
Applied egg-rr77.9%
unpow177.9%
associate-*l*84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in i around inf 33.4%
associate-*r*33.4%
*-commutative33.4%
*-commutative33.4%
Simplified33.4%
if 2.69999999999999995e-56 < (*.f64 b c) < 9.00000000000000003e198Initial program 84.2%
Simplified84.6%
Taylor expanded in j around inf 41.3%
associate-*r*41.4%
*-commutative41.4%
Simplified41.4%
Final simplification48.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0)))
(t_2 (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(t_3 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))
(if (<= x -1e+60)
t_3
(if (<= x -1.75e-79)
t_2
(if (<= x 5.2e-94)
(+ (* b c) t_1)
(if (<= x 1.26e-79)
t_2
(if (<= x 6.5e+190) (+ t_1 (* -4.0 (* x i))) t_3)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_3 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -1e+60) {
tmp = t_3;
} else if (x <= -1.75e-79) {
tmp = t_2;
} else if (x <= 5.2e-94) {
tmp = (b * c) + t_1;
} else if (x <= 1.26e-79) {
tmp = t_2;
} else if (x <= 6.5e+190) {
tmp = t_1 + (-4.0 * (x * i));
} else {
tmp = t_3;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
t_3 = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
if (x <= (-1d+60)) then
tmp = t_3
else if (x <= (-1.75d-79)) then
tmp = t_2
else if (x <= 5.2d-94) then
tmp = (b * c) + t_1
else if (x <= 1.26d-79) then
tmp = t_2
else if (x <= 6.5d+190) then
tmp = t_1 + ((-4.0d0) * (x * i))
else
tmp = t_3
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_3 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -1e+60) {
tmp = t_3;
} else if (x <= -1.75e-79) {
tmp = t_2;
} else if (x <= 5.2e-94) {
tmp = (b * c) + t_1;
} else if (x <= 1.26e-79) {
tmp = t_2;
} else if (x <= 6.5e+190) {
tmp = t_1 + (-4.0 * (x * i));
} else {
tmp = t_3;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) t_3 = x * ((18.0 * (t * (y * z))) - (4.0 * i)) tmp = 0 if x <= -1e+60: tmp = t_3 elif x <= -1.75e-79: tmp = t_2 elif x <= 5.2e-94: tmp = (b * c) + t_1 elif x <= 1.26e-79: tmp = t_2 elif x <= 6.5e+190: tmp = t_1 + (-4.0 * (x * i)) else: tmp = t_3 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) t_3 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -1e+60) tmp = t_3; elseif (x <= -1.75e-79) tmp = t_2; elseif (x <= 5.2e-94) tmp = Float64(Float64(b * c) + t_1); elseif (x <= 1.26e-79) tmp = t_2; elseif (x <= 6.5e+190) tmp = Float64(t_1 + Float64(-4.0 * Float64(x * i))); else tmp = t_3; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
t_3 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
tmp = 0.0;
if (x <= -1e+60)
tmp = t_3;
elseif (x <= -1.75e-79)
tmp = t_2;
elseif (x <= 5.2e-94)
tmp = (b * c) + t_1;
elseif (x <= 1.26e-79)
tmp = t_2;
elseif (x <= 6.5e+190)
tmp = t_1 + (-4.0 * (x * i));
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $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, -1e+60], t$95$3, If[LessEqual[x, -1.75e-79], t$95$2, If[LessEqual[x, 5.2e-94], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, 1.26e-79], t$95$2, If[LessEqual[x, 6.5e+190], N[(t$95$1 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\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 -1 \cdot 10^{+60}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-79}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-94}:\\
\;\;\;\;b \cdot c + t\_1\\
\mathbf{elif}\;x \leq 1.26 \cdot 10^{-79}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+190}:\\
\;\;\;\;t\_1 + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if x < -9.9999999999999995e59 or 6.5000000000000001e190 < x Initial program 62.5%
Simplified70.5%
Taylor expanded in x around inf 73.1%
if -9.9999999999999995e59 < x < -1.75000000000000015e-79 or 5.19999999999999988e-94 < x < 1.25999999999999993e-79Initial program 79.6%
pow179.6%
associate-*l*76.2%
*-commutative76.2%
Applied egg-rr76.2%
unpow176.2%
associate-*l*70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in t around inf 66.1%
if -1.75000000000000015e-79 < x < 5.19999999999999988e-94Initial program 98.9%
Simplified94.3%
Taylor expanded in b around inf 67.8%
if 1.25999999999999993e-79 < x < 6.5000000000000001e190Initial program 72.3%
Simplified80.7%
Taylor expanded in i around inf 62.6%
Final simplification68.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 (- (* 18.0 (* x (* y z))) (* a 4.0))))
(t_3 (* x (+ (* 18.0 (* z (* y t))) (* i -4.0)))))
(if (<= x -2.1e+60)
t_3
(if (<= x -3.8e-78)
t_2
(if (<= x 4.8e-94)
(+ (* b c) t_1)
(if (<= x 8.5e-82)
t_2
(if (<= x 5.8e+190) (+ t_1 (* -4.0 (* x i))) t_3)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_3 = x * ((18.0 * (z * (y * t))) + (i * -4.0));
double tmp;
if (x <= -2.1e+60) {
tmp = t_3;
} else if (x <= -3.8e-78) {
tmp = t_2;
} else if (x <= 4.8e-94) {
tmp = (b * c) + t_1;
} else if (x <= 8.5e-82) {
tmp = t_2;
} else if (x <= 5.8e+190) {
tmp = t_1 + (-4.0 * (x * i));
} else {
tmp = t_3;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
t_3 = x * ((18.0d0 * (z * (y * t))) + (i * (-4.0d0)))
if (x <= (-2.1d+60)) then
tmp = t_3
else if (x <= (-3.8d-78)) then
tmp = t_2
else if (x <= 4.8d-94) then
tmp = (b * c) + t_1
else if (x <= 8.5d-82) then
tmp = t_2
else if (x <= 5.8d+190) then
tmp = t_1 + ((-4.0d0) * (x * i))
else
tmp = t_3
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_3 = x * ((18.0 * (z * (y * t))) + (i * -4.0));
double tmp;
if (x <= -2.1e+60) {
tmp = t_3;
} else if (x <= -3.8e-78) {
tmp = t_2;
} else if (x <= 4.8e-94) {
tmp = (b * c) + t_1;
} else if (x <= 8.5e-82) {
tmp = t_2;
} else if (x <= 5.8e+190) {
tmp = t_1 + (-4.0 * (x * i));
} else {
tmp = t_3;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) t_3 = x * ((18.0 * (z * (y * t))) + (i * -4.0)) tmp = 0 if x <= -2.1e+60: tmp = t_3 elif x <= -3.8e-78: tmp = t_2 elif x <= 4.8e-94: tmp = (b * c) + t_1 elif x <= 8.5e-82: tmp = t_2 elif x <= 5.8e+190: tmp = t_1 + (-4.0 * (x * i)) else: tmp = t_3 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) t_3 = Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) + Float64(i * -4.0))) tmp = 0.0 if (x <= -2.1e+60) tmp = t_3; elseif (x <= -3.8e-78) tmp = t_2; elseif (x <= 4.8e-94) tmp = Float64(Float64(b * c) + t_1); elseif (x <= 8.5e-82) tmp = t_2; elseif (x <= 5.8e+190) tmp = Float64(t_1 + Float64(-4.0 * Float64(x * i))); else tmp = t_3; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
t_3 = x * ((18.0 * (z * (y * t))) + (i * -4.0));
tmp = 0.0;
if (x <= -2.1e+60)
tmp = t_3;
elseif (x <= -3.8e-78)
tmp = t_2;
elseif (x <= 4.8e-94)
tmp = (b * c) + t_1;
elseif (x <= 8.5e-82)
tmp = t_2;
elseif (x <= 5.8e+190)
tmp = t_1 + (-4.0 * (x * i));
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+60], t$95$3, If[LessEqual[x, -3.8e-78], t$95$2, If[LessEqual[x, 4.8e-94], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, 8.5e-82], t$95$2, If[LessEqual[x, 5.8e+190], N[(t$95$1 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
t_3 := x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) + i \cdot -4\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+60}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-78}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-94}:\\
\;\;\;\;b \cdot c + t\_1\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-82}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+190}:\\
\;\;\;\;t\_1 + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if x < -2.1000000000000001e60 or 5.79999999999999979e190 < x Initial program 62.5%
pow162.5%
associate-*l*61.1%
*-commutative61.1%
Applied egg-rr61.1%
unpow161.1%
associate-*l*74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in x around inf 73.1%
cancel-sign-sub-inv73.1%
metadata-eval73.1%
associate-*r*73.1%
*-commutative73.1%
Simplified73.1%
if -2.1000000000000001e60 < x < -3.7999999999999999e-78 or 4.8e-94 < x < 8.4999999999999997e-82Initial program 79.6%
pow179.6%
associate-*l*76.2%
*-commutative76.2%
Applied egg-rr76.2%
unpow176.2%
associate-*l*70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in t around inf 66.1%
if -3.7999999999999999e-78 < x < 4.8e-94Initial program 98.9%
Simplified94.3%
Taylor expanded in b around inf 67.8%
if 8.4999999999999997e-82 < x < 5.79999999999999979e190Initial program 72.3%
Simplified80.7%
Taylor expanded in i around inf 62.6%
Final simplification68.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 (<= x -2.3e+165)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(+ (* 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) {
double tmp;
if (x <= -2.3e+165) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * 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 (x <= (-2.3d+165)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - ((x * (4.0d0 * 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 (x <= -2.3e+165) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * 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 x <= -2.3e+165: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) else: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * 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 (x <= -2.3e+165) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(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 <= -2.3e+165)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
else
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * 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[x, -2.3e+165], 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[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+165}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\end{array}
\end{array}
if x < -2.30000000000000016e165Initial program 57.9%
Simplified63.0%
Taylor expanded in x around inf 80.5%
if -2.30000000000000016e165 < x Initial program 84.3%
Simplified86.2%
Final simplification85.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) -5.5e+103)
(* b c)
(if (<= (* b c) -3.8e-162)
(* -27.0 (* j k))
(if (<= (* b c) 3.1e-58)
(* x (* i -4.0))
(if (<= (* b c) 1.3e+201) (* 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) <= -5.5e+103) {
tmp = b * c;
} else if ((b * c) <= -3.8e-162) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 3.1e-58) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 1.3e+201) {
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) <= (-5.5d+103)) then
tmp = b * c
else if ((b * c) <= (-3.8d-162)) then
tmp = (-27.0d0) * (j * k)
else if ((b * c) <= 3.1d-58) then
tmp = x * (i * (-4.0d0))
else if ((b * c) <= 1.3d+201) 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) <= -5.5e+103) {
tmp = b * c;
} else if ((b * c) <= -3.8e-162) {
tmp = -27.0 * (j * k);
} else if ((b * c) <= 3.1e-58) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 1.3e+201) {
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) <= -5.5e+103: tmp = b * c elif (b * c) <= -3.8e-162: tmp = -27.0 * (j * k) elif (b * c) <= 3.1e-58: tmp = x * (i * -4.0) elif (b * c) <= 1.3e+201: 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) <= -5.5e+103) tmp = Float64(b * c); elseif (Float64(b * c) <= -3.8e-162) tmp = Float64(-27.0 * Float64(j * k)); elseif (Float64(b * c) <= 3.1e-58) tmp = Float64(x * Float64(i * -4.0)); elseif (Float64(b * c) <= 1.3e+201) 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) <= -5.5e+103)
tmp = b * c;
elseif ((b * c) <= -3.8e-162)
tmp = -27.0 * (j * k);
elseif ((b * c) <= 3.1e-58)
tmp = x * (i * -4.0);
elseif ((b * c) <= 1.3e+201)
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], -5.5e+103], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -3.8e-162], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3.1e-58], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.3e+201], 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 -5.5 \cdot 10^{+103}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -3.8 \cdot 10^{-162}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \cdot c \leq 3.1 \cdot 10^{-58}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 1.3 \cdot 10^{+201}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -5.50000000000000001e103 or 1.29999999999999993e201 < (*.f64 b c) Initial program 78.5%
pow178.5%
associate-*l*70.1%
*-commutative70.1%
Applied egg-rr70.1%
unpow170.1%
associate-*l*74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in b around inf 63.6%
if -5.50000000000000001e103 < (*.f64 b c) < -3.80000000000000005e-162Initial program 77.9%
Simplified87.7%
Taylor expanded in j around inf 45.8%
if -3.80000000000000005e-162 < (*.f64 b c) < 3.0999999999999999e-58Initial program 82.3%
pow182.3%
associate-*l*77.9%
*-commutative77.9%
Applied egg-rr77.9%
unpow177.9%
associate-*l*84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in i around inf 33.4%
associate-*r*33.4%
*-commutative33.4%
*-commutative33.4%
Simplified33.4%
if 3.0999999999999999e-58 < (*.f64 b c) < 1.29999999999999993e201Initial program 84.2%
Simplified84.6%
Taylor expanded in j around inf 41.3%
associate-*r*41.4%
*-commutative41.4%
Simplified41.4%
Final simplification46.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
(let* ((t_1 (* c (+ b (* (* k -27.0) (/ j c))))) (t_2 (* j (* k -27.0))))
(if (<= (* b c) -2e+135)
t_1
(if (<= (* b c) -2e-316)
(+ t_2 (* -4.0 (* t a)))
(if (<= (* b c) 4e+119) (+ t_2 (* -4.0 (* x i))) 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 = c * (b + ((k * -27.0) * (j / c)));
double t_2 = j * (k * -27.0);
double tmp;
if ((b * c) <= -2e+135) {
tmp = t_1;
} else if ((b * c) <= -2e-316) {
tmp = t_2 + (-4.0 * (t * a));
} else if ((b * c) <= 4e+119) {
tmp = t_2 + (-4.0 * (x * i));
} 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 = c * (b + ((k * (-27.0d0)) * (j / c)))
t_2 = j * (k * (-27.0d0))
if ((b * c) <= (-2d+135)) then
tmp = t_1
else if ((b * c) <= (-2d-316)) then
tmp = t_2 + ((-4.0d0) * (t * a))
else if ((b * c) <= 4d+119) then
tmp = t_2 + ((-4.0d0) * (x * i))
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 = c * (b + ((k * -27.0) * (j / c)));
double t_2 = j * (k * -27.0);
double tmp;
if ((b * c) <= -2e+135) {
tmp = t_1;
} else if ((b * c) <= -2e-316) {
tmp = t_2 + (-4.0 * (t * a));
} else if ((b * c) <= 4e+119) {
tmp = t_2 + (-4.0 * (x * i));
} 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 = c * (b + ((k * -27.0) * (j / c))) t_2 = j * (k * -27.0) tmp = 0 if (b * c) <= -2e+135: tmp = t_1 elif (b * c) <= -2e-316: tmp = t_2 + (-4.0 * (t * a)) elif (b * c) <= 4e+119: tmp = t_2 + (-4.0 * (x * i)) 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(c * Float64(b + Float64(Float64(k * -27.0) * Float64(j / c)))) t_2 = Float64(j * Float64(k * -27.0)) tmp = 0.0 if (Float64(b * c) <= -2e+135) tmp = t_1; elseif (Float64(b * c) <= -2e-316) tmp = Float64(t_2 + Float64(-4.0 * Float64(t * a))); elseif (Float64(b * c) <= 4e+119) tmp = Float64(t_2 + Float64(-4.0 * Float64(x * i))); 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 = c * (b + ((k * -27.0) * (j / c)));
t_2 = j * (k * -27.0);
tmp = 0.0;
if ((b * c) <= -2e+135)
tmp = t_1;
elseif ((b * c) <= -2e-316)
tmp = t_2 + (-4.0 * (t * a));
elseif ((b * c) <= 4e+119)
tmp = t_2 + (-4.0 * (x * i));
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[(c * N[(b + N[(N[(k * -27.0), $MachinePrecision] * N[(j / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2e+135], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -2e-316], N[(t$95$2 + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4e+119], N[(t$95$2 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 := c \cdot \left(b + \left(k \cdot -27\right) \cdot \frac{j}{c}\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq -2 \cdot 10^{-316}:\\
\;\;\;\;t\_2 + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq 4 \cdot 10^{+119}:\\
\;\;\;\;t\_2 + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -1.99999999999999992e135 or 3.99999999999999978e119 < (*.f64 b c) Initial program 78.0%
Simplified83.4%
Taylor expanded in b around inf 69.7%
Taylor expanded in c around inf 70.9%
associate-*r/70.9%
*-commutative70.9%
associate-*r*70.9%
*-commutative70.9%
*-commutative70.9%
associate-/l*72.0%
*-commutative72.0%
Simplified72.0%
if -1.99999999999999992e135 < (*.f64 b c) < -2.000000017e-316Initial program 80.2%
Simplified86.0%
Taylor expanded in a around inf 60.6%
*-commutative60.6%
Simplified60.6%
if -2.000000017e-316 < (*.f64 b c) < 3.99999999999999978e119Initial program 83.5%
Simplified84.7%
Taylor expanded in i around inf 56.5%
Final simplification63.1%
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 -1.22e+162) (not (<= x 5.8e+190))) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) (- (- (- (* b c) (* 4.0 (* t a))) (* (* 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) {
double tmp;
if ((x <= -1.22e+162) || !(x <= 5.8e+190)) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else {
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * 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 ((x <= (-1.22d+162)) .or. (.not. (x <= 5.8d+190))) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else
tmp = (((b * c) - (4.0d0 * (t * a))) - ((x * 4.0d0) * 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 ((x <= -1.22e+162) || !(x <= 5.8e+190)) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else {
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * 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 (x <= -1.22e+162) or not (x <= 5.8e+190): tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) else: tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * 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 ((x <= -1.22e+162) || !(x <= 5.8e+190)) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); else tmp = Float64(Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(x * 4.0) * 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 ((x <= -1.22e+162) || ~((x <= 5.8e+190)))
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
else
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * 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[Or[LessEqual[x, -1.22e+162], N[Not[LessEqual[x, 5.8e+190]], $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[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $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 -1.22 \cdot 10^{+162} \lor \neg \left(x \leq 5.8 \cdot 10^{+190}\right):\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -1.22e162 or 5.79999999999999979e190 < x Initial program 57.7%
Simplified64.1%
Taylor expanded in x around inf 81.4%
if -1.22e162 < x < 5.79999999999999979e190Initial program 87.4%
Taylor expanded in x around 0 84.0%
Final simplification83.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (or (<= t_1 -2e+166) (not (<= t_1 5e+141)))
(+ (* j (* k -27.0)) (* -4.0 (* t a)))
(- (* 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 t_1 = (j * 27.0) * k;
double tmp;
if ((t_1 <= -2e+166) || !(t_1 <= 5e+141)) {
tmp = (j * (k * -27.0)) + (-4.0 * (t * a));
} else {
tmp = (b * c) - (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) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if ((t_1 <= (-2d+166)) .or. (.not. (t_1 <= 5d+141))) then
tmp = (j * (k * (-27.0d0))) + ((-4.0d0) * (t * a))
else
tmp = (b * c) - (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 t_1 = (j * 27.0) * k;
double tmp;
if ((t_1 <= -2e+166) || !(t_1 <= 5e+141)) {
tmp = (j * (k * -27.0)) + (-4.0 * (t * a));
} else {
tmp = (b * c) - (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): t_1 = (j * 27.0) * k tmp = 0 if (t_1 <= -2e+166) or not (t_1 <= 5e+141): tmp = (j * (k * -27.0)) + (-4.0 * (t * a)) else: tmp = (b * c) - (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) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if ((t_1 <= -2e+166) || !(t_1 <= 5e+141)) tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(-4.0 * Float64(t * a))); else tmp = Float64(Float64(b * c) - 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)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if ((t_1 <= -2e+166) || ~((t_1 <= 5e+141)))
tmp = (j * (k * -27.0)) + (-4.0 * (t * a));
else
tmp = (b * c) - (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_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+166], N[Not[LessEqual[t$95$1, 5e+141]], $MachinePrecision]], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+166} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+141}\right):\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + -4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.99999999999999988e166 or 5.00000000000000025e141 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 72.3%
Simplified79.7%
Taylor expanded in a around inf 76.3%
*-commutative76.3%
Simplified76.3%
if -1.99999999999999988e166 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.00000000000000025e141Initial program 84.4%
Taylor expanded in x around 0 76.8%
Taylor expanded in j around 0 70.9%
distribute-lft-out70.9%
Simplified70.9%
Final simplification72.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 27.0) k)) (t_2 (* j (* k -27.0))))
(if (<= t_1 -5e+161)
(+ (* 18.0 (* t (* x (* y z)))) t_2)
(if (<= t_1 5e+141)
(- (* b c) (* 4.0 (+ (* t a) (* x i))))
(+ t_2 (* -4.0 (* t a)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = j * (k * -27.0);
double tmp;
if (t_1 <= -5e+161) {
tmp = (18.0 * (t * (x * (y * z)))) + t_2;
} else if (t_1 <= 5e+141) {
tmp = (b * c) - (4.0 * ((t * a) + (x * i)));
} else {
tmp = t_2 + (-4.0 * (t * a));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = j * (k * (-27.0d0))
if (t_1 <= (-5d+161)) then
tmp = (18.0d0 * (t * (x * (y * z)))) + t_2
else if (t_1 <= 5d+141) then
tmp = (b * c) - (4.0d0 * ((t * a) + (x * i)))
else
tmp = t_2 + ((-4.0d0) * (t * a))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = j * (k * -27.0);
double tmp;
if (t_1 <= -5e+161) {
tmp = (18.0 * (t * (x * (y * z)))) + t_2;
} else if (t_1 <= 5e+141) {
tmp = (b * c) - (4.0 * ((t * a) + (x * i)));
} else {
tmp = t_2 + (-4.0 * (t * a));
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = j * (k * -27.0) tmp = 0 if t_1 <= -5e+161: tmp = (18.0 * (t * (x * (y * z)))) + t_2 elif t_1 <= 5e+141: tmp = (b * c) - (4.0 * ((t * a) + (x * i))) else: tmp = t_2 + (-4.0 * (t * a)) return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(j * Float64(k * -27.0)) tmp = 0.0 if (t_1 <= -5e+161) tmp = Float64(Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))) + t_2); elseif (t_1 <= 5e+141) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))); else tmp = Float64(t_2 + Float64(-4.0 * Float64(t * a))); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = j * (k * -27.0);
tmp = 0.0;
if (t_1 <= -5e+161)
tmp = (18.0 * (t * (x * (y * z)))) + t_2;
elseif (t_1 <= 5e+141)
tmp = (b * c) - (4.0 * ((t * a) + (x * i)));
else
tmp = t_2 + (-4.0 * (t * a));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+161], N[(N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 5e+141], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+161}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+141}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + -4 \cdot \left(t \cdot a\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999997e161Initial program 77.5%
Simplified82.4%
Taylor expanded in y around inf 75.2%
if -4.9999999999999997e161 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 5.00000000000000025e141Initial program 84.3%
Taylor expanded in x around 0 77.2%
Taylor expanded in j around 0 71.4%
distribute-lft-out71.4%
Simplified71.4%
if 5.00000000000000025e141 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 67.8%
Simplified77.5%
Taylor expanded in a around inf 80.3%
*-commutative80.3%
Simplified80.3%
Final simplification73.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 (or (<= (* b c) -2e+190) (not (<= (* b c) 4e+119))) (* c (+ b (* (* k -27.0) (/ j c)))) (+ (* j (* k -27.0)) (* -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) <= -2e+190) || !((b * c) <= 4e+119)) {
tmp = c * (b + ((k * -27.0) * (j / c)));
} else {
tmp = (j * (k * -27.0)) + (-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) <= (-2d+190)) .or. (.not. ((b * c) <= 4d+119))) then
tmp = c * (b + ((k * (-27.0d0)) * (j / c)))
else
tmp = (j * (k * (-27.0d0))) + ((-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) <= -2e+190) || !((b * c) <= 4e+119)) {
tmp = c * (b + ((k * -27.0) * (j / c)));
} else {
tmp = (j * (k * -27.0)) + (-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) <= -2e+190) or not ((b * c) <= 4e+119): tmp = c * (b + ((k * -27.0) * (j / c))) else: tmp = (j * (k * -27.0)) + (-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) <= -2e+190) || !(Float64(b * c) <= 4e+119)) tmp = Float64(c * Float64(b + Float64(Float64(k * -27.0) * Float64(j / c)))); else tmp = Float64(Float64(j * Float64(k * -27.0)) + 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) <= -2e+190) || ~(((b * c) <= 4e+119)))
tmp = c * (b + ((k * -27.0) * (j / c)));
else
tmp = (j * (k * -27.0)) + (-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[Or[LessEqual[N[(b * c), $MachinePrecision], -2e+190], N[Not[LessEqual[N[(b * c), $MachinePrecision], 4e+119]], $MachinePrecision]], N[(c * N[(b + N[(N[(k * -27.0), $MachinePrecision] * N[(j / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * N[(k * -27.0), $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}\;b \cdot c \leq -2 \cdot 10^{+190} \lor \neg \left(b \cdot c \leq 4 \cdot 10^{+119}\right):\\
\;\;\;\;c \cdot \left(b + \left(k \cdot -27\right) \cdot \frac{j}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + -4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -2.0000000000000001e190 or 3.99999999999999978e119 < (*.f64 b c) Initial program 76.7%
Simplified82.4%
Taylor expanded in b around inf 71.3%
Taylor expanded in c around inf 72.6%
associate-*r/72.6%
*-commutative72.6%
associate-*r*72.6%
*-commutative72.6%
*-commutative72.6%
associate-/l*73.8%
*-commutative73.8%
Simplified73.8%
if -2.0000000000000001e190 < (*.f64 b c) < 3.99999999999999978e119Initial program 82.6%
Simplified85.7%
Taylor expanded in i around inf 52.9%
Final simplification59.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 (if (or (<= t -240000000000.0) (not (<= t 40000000000000.0))) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) (+ (* 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 ((t <= -240000000000.0) || !(t <= 40000000000000.0)) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} 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 ((t <= (-240000000000.0d0)) .or. (.not. (t <= 40000000000000.0d0))) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
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 ((t <= -240000000000.0) || !(t <= 40000000000000.0)) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} 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 (t <= -240000000000.0) or not (t <= 40000000000000.0): tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) 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 ((t <= -240000000000.0) || !(t <= 40000000000000.0)) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); 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 ((t <= -240000000000.0) || ~((t <= 40000000000000.0)))
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
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[t, -240000000000.0], N[Not[LessEqual[t, 40000000000000.0]], $MachinePrecision]], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $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}\;t \leq -240000000000 \lor \neg \left(t \leq 40000000000000\right):\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if t < -2.4e11 or 4e13 < t Initial program 83.7%
pow183.7%
associate-*l*73.2%
*-commutative73.2%
Applied egg-rr73.2%
unpow173.2%
associate-*l*75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in t around inf 61.4%
if -2.4e11 < t < 4e13Initial program 77.0%
Simplified79.6%
Taylor expanded in b around inf 62.9%
Final simplification62.1%
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 -1.22e+162) (not (<= x 5.8e+190))) (* (* x (* z t)) (* y (- -18.0))) (+ (* 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 <= -1.22e+162) || !(x <= 5.8e+190)) {
tmp = (x * (z * t)) * (y * -(-18.0));
} 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 <= (-1.22d+162)) .or. (.not. (x <= 5.8d+190))) then
tmp = (x * (z * t)) * (y * -(-18.0d0))
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 <= -1.22e+162) || !(x <= 5.8e+190)) {
tmp = (x * (z * t)) * (y * -(-18.0));
} 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 <= -1.22e+162) or not (x <= 5.8e+190): tmp = (x * (z * t)) * (y * -(-18.0)) 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 <= -1.22e+162) || !(x <= 5.8e+190)) tmp = Float64(Float64(x * Float64(z * t)) * Float64(y * Float64(-(-18.0)))); 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 <= -1.22e+162) || ~((x <= 5.8e+190)))
tmp = (x * (z * t)) * (y * -(-18.0));
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, -1.22e+162], N[Not[LessEqual[x, 5.8e+190]], $MachinePrecision]], N[(N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision] * N[(y * (--18.0)), $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 -1.22 \cdot 10^{+162} \lor \neg \left(x \leq 5.8 \cdot 10^{+190}\right):\\
\;\;\;\;\left(x \cdot \left(z \cdot t\right)\right) \cdot \left(y \cdot \left(--18\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if x < -1.22e162 or 5.79999999999999979e190 < x Initial program 57.7%
Taylor expanded in t around -inf 59.6%
Taylor expanded in z around inf 56.5%
Taylor expanded in x around inf 51.4%
Taylor expanded in t around 0 53.0%
associate-*r*60.2%
*-commutative60.2%
associate-*r*61.8%
associate-*r*60.1%
associate-*l*60.1%
*-commutative60.1%
associate-*l*60.1%
associate-*r*61.8%
*-commutative61.8%
associate-*l*56.7%
Simplified56.7%
if -1.22e162 < x < 5.79999999999999979e190Initial program 87.4%
Simplified90.1%
Taylor expanded in b around inf 56.2%
Final simplification56.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 (<= c -1.65e+44)
(* b c)
(if (<= c 220000000.0)
(* -27.0 (* j k))
(if (<= c 2.5e+93) (* -4.0 (* t a)) (* 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 (c <= -1.65e+44) {
tmp = b * c;
} else if (c <= 220000000.0) {
tmp = -27.0 * (j * k);
} else if (c <= 2.5e+93) {
tmp = -4.0 * (t * a);
} 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 (c <= (-1.65d+44)) then
tmp = b * c
else if (c <= 220000000.0d0) then
tmp = (-27.0d0) * (j * k)
else if (c <= 2.5d+93) then
tmp = (-4.0d0) * (t * a)
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 (c <= -1.65e+44) {
tmp = b * c;
} else if (c <= 220000000.0) {
tmp = -27.0 * (j * k);
} else if (c <= 2.5e+93) {
tmp = -4.0 * (t * a);
} 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 c <= -1.65e+44: tmp = b * c elif c <= 220000000.0: tmp = -27.0 * (j * k) elif c <= 2.5e+93: tmp = -4.0 * (t * a) 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 (c <= -1.65e+44) tmp = Float64(b * c); elseif (c <= 220000000.0) tmp = Float64(-27.0 * Float64(j * k)); elseif (c <= 2.5e+93) tmp = Float64(-4.0 * Float64(t * a)); 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 (c <= -1.65e+44)
tmp = b * c;
elseif (c <= 220000000.0)
tmp = -27.0 * (j * k);
elseif (c <= 2.5e+93)
tmp = -4.0 * (t * a);
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[c, -1.65e+44], N[(b * c), $MachinePrecision], If[LessEqual[c, 220000000.0], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.5e+93], N[(-4.0 * N[(t * a), $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}\;c \leq -1.65 \cdot 10^{+44}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;c \leq 220000000:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;c \leq 2.5 \cdot 10^{+93}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if c < -1.65000000000000007e44 or 2.5000000000000001e93 < c Initial program 78.1%
pow178.1%
associate-*l*70.2%
*-commutative70.2%
Applied egg-rr70.2%
unpow170.2%
associate-*l*76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in b around inf 47.7%
if -1.65000000000000007e44 < c < 2.2e8Initial program 81.1%
Simplified85.6%
Taylor expanded in j around inf 31.7%
if 2.2e8 < c < 2.5000000000000001e93Initial program 90.0%
pow190.0%
associate-*l*80.4%
*-commutative80.4%
Applied egg-rr80.4%
unpow180.4%
associate-*l*75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in a around inf 41.3%
*-commutative41.3%
*-commutative41.3%
Simplified41.3%
Final simplification38.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 -1.22e+162) (not (<= x 1.22e+185))) (* 18.0 (* t (* z (* x y)))) (+ (* 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 <= -1.22e+162) || !(x <= 1.22e+185)) {
tmp = 18.0 * (t * (z * (x * y)));
} 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 <= (-1.22d+162)) .or. (.not. (x <= 1.22d+185))) then
tmp = 18.0d0 * (t * (z * (x * y)))
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 <= -1.22e+162) || !(x <= 1.22e+185)) {
tmp = 18.0 * (t * (z * (x * y)));
} 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 <= -1.22e+162) or not (x <= 1.22e+185): tmp = 18.0 * (t * (z * (x * y))) 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 <= -1.22e+162) || !(x <= 1.22e+185)) tmp = Float64(18.0 * Float64(t * Float64(z * Float64(x * y)))); 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 <= -1.22e+162) || ~((x <= 1.22e+185)))
tmp = 18.0 * (t * (z * (x * y)));
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, -1.22e+162], N[Not[LessEqual[x, 1.22e+185]], $MachinePrecision]], N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $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 -1.22 \cdot 10^{+162} \lor \neg \left(x \leq 1.22 \cdot 10^{+185}\right):\\
\;\;\;\;18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if x < -1.22e162 or 1.22000000000000002e185 < x Initial program 58.4%
Taylor expanded in t around -inf 58.7%
Taylor expanded in z around inf 55.6%
Taylor expanded in x around inf 50.6%
Taylor expanded in t around 0 52.2%
*-commutative52.2%
associate-*r*50.6%
Simplified50.6%
if -1.22e162 < x < 1.22000000000000002e185Initial program 87.3%
Simplified90.0%
Taylor expanded in b around inf 56.0%
Final simplification54.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 (<= c -2.2e+44) (not (<= c 6.8e+84))) (* 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 ((c <= -2.2e+44) || !(c <= 6.8e+84)) {
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 ((c <= (-2.2d+44)) .or. (.not. (c <= 6.8d+84))) 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 ((c <= -2.2e+44) || !(c <= 6.8e+84)) {
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 (c <= -2.2e+44) or not (c <= 6.8e+84): 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 ((c <= -2.2e+44) || !(c <= 6.8e+84)) 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 ((c <= -2.2e+44) || ~((c <= 6.8e+84)))
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[c, -2.2e+44], N[Not[LessEqual[c, 6.8e+84]], $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}\;c \leq -2.2 \cdot 10^{+44} \lor \neg \left(c \leq 6.8 \cdot 10^{+84}\right):\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if c < -2.19999999999999996e44 or 6.7999999999999996e84 < c Initial program 78.2%
pow178.2%
associate-*l*69.8%
*-commutative69.8%
Applied egg-rr69.8%
unpow169.8%
associate-*l*75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in b around inf 45.6%
if -2.19999999999999996e44 < c < 6.7999999999999996e84Initial program 82.3%
Simplified86.4%
Taylor expanded in j around inf 30.8%
Final simplification36.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 80.7%
pow180.7%
associate-*l*75.9%
*-commutative75.9%
Applied egg-rr75.9%
unpow175.9%
associate-*l*82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in b around inf 25.9%
(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 2024116
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
:alt
(! :herbie-platform default (if (< t -8105407698770699/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))) (if (< t 8284013971902611/50000000000000) (+ (- (* (* 18 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4)) (- (* c b) (* 27 (* k j)))) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))))))
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))