
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))
INFINITY)
(-
(fma b c (* t (fma -4.0 a (* 18.0 (* z (* x y))))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(* x (- (* y (* t (* z (- -18.0)))) (* 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 tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = fma(b, c, (t * fma(-4.0, a, (18.0 * (z * (x * y)))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = x * ((y * (t * (z * -(-18.0)))) - (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) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) <= Inf) tmp = Float64(fma(b, c, Float64(t * fma(-4.0, a, Float64(18.0 * Float64(z * Float64(x * y)))))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(x * Float64(Float64(y * Float64(t * Float64(z * Float64(-(-18.0))))) - Float64(4.0 * i))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $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], Infinity], N[(N[(b * c + N[(t * N[(-4.0 * a + N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y * N[(t * N[(z * (--18.0)), $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}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(b, c, t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(t \cdot \left(z \cdot \left(--18\right)\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.0%
Simplified95.3%
associate-*r*97.0%
distribute-rgt-out--97.0%
associate-+l-97.0%
associate-*r*95.3%
*-commutative95.3%
*-commutative95.3%
associate-*l*95.3%
fma-neg95.3%
Applied egg-rr95.3%
Taylor expanded in t around 0 95.3%
fma-def95.3%
cancel-sign-sub-inv95.3%
metadata-eval95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in t around 0 95.3%
fma-def95.3%
associate-*r*97.0%
Simplified97.0%
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%
Simplified33.3%
associate-*r*29.6%
distribute-rgt-out--0.0%
associate-+l-0.0%
associate-*r*3.7%
*-commutative3.7%
*-commutative3.7%
associate-*l*3.7%
fma-neg7.4%
Applied egg-rr7.4%
Taylor expanded in t around 0 33.3%
fma-def44.4%
cancel-sign-sub-inv44.4%
metadata-eval44.4%
*-commutative44.4%
Simplified44.4%
Taylor expanded in x around -inf 74.1%
associate-*r*74.1%
neg-mul-174.1%
cancel-sign-sub-inv74.1%
*-commutative74.1%
associate-*r*74.2%
metadata-eval74.2%
Simplified74.2%
Taylor expanded in t around 0 74.1%
*-commutative74.1%
associate-*r*74.2%
*-commutative74.2%
associate-*r*74.2%
associate-*l*74.2%
Simplified74.2%
Final simplification94.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
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_1 INFINITY) t_1 (* x (- (* y (* t (* z (- -18.0)))) (* 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 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * ((y * (t * (z * -(-18.0)))) - (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 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x * ((y * (t * (z * -(-18.0)))) - (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 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x * ((y * (t * (z * -(-18.0)))) - (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(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - 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(y * Float64(t * Float64(z * Float64(-(-18.0))))) - 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 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = x * ((y * (t * (z * -(-18.0)))) - (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[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $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]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x * N[(N[(y * N[(t * N[(z * (--18.0)), $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(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\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(y \cdot \left(t \cdot \left(z \cdot \left(--18\right)\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.0%
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%
Simplified33.3%
associate-*r*29.6%
distribute-rgt-out--0.0%
associate-+l-0.0%
associate-*r*3.7%
*-commutative3.7%
*-commutative3.7%
associate-*l*3.7%
fma-neg7.4%
Applied egg-rr7.4%
Taylor expanded in t around 0 33.3%
fma-def44.4%
cancel-sign-sub-inv44.4%
metadata-eval44.4%
*-commutative44.4%
Simplified44.4%
Taylor expanded in x around -inf 74.1%
associate-*r*74.1%
neg-mul-174.1%
cancel-sign-sub-inv74.1%
*-commutative74.1%
associate-*r*74.2%
metadata-eval74.2%
Simplified74.2%
Taylor expanded in t around 0 74.1%
*-commutative74.1%
associate-*r*74.2%
*-commutative74.2%
associate-*r*74.2%
associate-*l*74.2%
Simplified74.2%
Final simplification94.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 (+ (* b c) (* 18.0 (* t (* x (* y z))))))
(t_2 (* j (* k -27.0)))
(t_3 (+ t_2 (* -4.0 (* t a)))))
(if (<= x -6.8e+160)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= x -1.05e+50)
(+ t_2 (* -4.0 (* x i)))
(if (<= x -1.4e+33)
t_1
(if (<= x -4.4e-257)
t_3
(if (<= x 1.3e-299)
(+ (* b c) t_2)
(if (<= x 2.1e-163)
t_3
(if (<= x 3.5e+14)
t_1
(if (<= x 4.5e+57)
t_3
(* x (- (* y (* t (* z (- -18.0)))) (* 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) + (18.0 * (t * (x * (y * z))));
double t_2 = j * (k * -27.0);
double t_3 = t_2 + (-4.0 * (t * a));
double tmp;
if (x <= -6.8e+160) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= -1.05e+50) {
tmp = t_2 + (-4.0 * (x * i));
} else if (x <= -1.4e+33) {
tmp = t_1;
} else if (x <= -4.4e-257) {
tmp = t_3;
} else if (x <= 1.3e-299) {
tmp = (b * c) + t_2;
} else if (x <= 2.1e-163) {
tmp = t_3;
} else if (x <= 3.5e+14) {
tmp = t_1;
} else if (x <= 4.5e+57) {
tmp = t_3;
} else {
tmp = x * ((y * (t * (z * -(-18.0)))) - (4.0 * 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) :: t_3
real(8) :: tmp
t_1 = (b * c) + (18.0d0 * (t * (x * (y * z))))
t_2 = j * (k * (-27.0d0))
t_3 = t_2 + ((-4.0d0) * (t * a))
if (x <= (-6.8d+160)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (x <= (-1.05d+50)) then
tmp = t_2 + ((-4.0d0) * (x * i))
else if (x <= (-1.4d+33)) then
tmp = t_1
else if (x <= (-4.4d-257)) then
tmp = t_3
else if (x <= 1.3d-299) then
tmp = (b * c) + t_2
else if (x <= 2.1d-163) then
tmp = t_3
else if (x <= 3.5d+14) then
tmp = t_1
else if (x <= 4.5d+57) then
tmp = t_3
else
tmp = x * ((y * (t * (z * -(-18.0d0)))) - (4.0d0 * 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 = (b * c) + (18.0 * (t * (x * (y * z))));
double t_2 = j * (k * -27.0);
double t_3 = t_2 + (-4.0 * (t * a));
double tmp;
if (x <= -6.8e+160) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= -1.05e+50) {
tmp = t_2 + (-4.0 * (x * i));
} else if (x <= -1.4e+33) {
tmp = t_1;
} else if (x <= -4.4e-257) {
tmp = t_3;
} else if (x <= 1.3e-299) {
tmp = (b * c) + t_2;
} else if (x <= 2.1e-163) {
tmp = t_3;
} else if (x <= 3.5e+14) {
tmp = t_1;
} else if (x <= 4.5e+57) {
tmp = t_3;
} else {
tmp = x * ((y * (t * (z * -(-18.0)))) - (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) + (18.0 * (t * (x * (y * z)))) t_2 = j * (k * -27.0) t_3 = t_2 + (-4.0 * (t * a)) tmp = 0 if x <= -6.8e+160: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif x <= -1.05e+50: tmp = t_2 + (-4.0 * (x * i)) elif x <= -1.4e+33: tmp = t_1 elif x <= -4.4e-257: tmp = t_3 elif x <= 1.3e-299: tmp = (b * c) + t_2 elif x <= 2.1e-163: tmp = t_3 elif x <= 3.5e+14: tmp = t_1 elif x <= 4.5e+57: tmp = t_3 else: tmp = x * ((y * (t * (z * -(-18.0)))) - (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(b * c) + Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))) t_2 = Float64(j * Float64(k * -27.0)) t_3 = Float64(t_2 + Float64(-4.0 * Float64(t * a))) tmp = 0.0 if (x <= -6.8e+160) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (x <= -1.05e+50) tmp = Float64(t_2 + Float64(-4.0 * Float64(x * i))); elseif (x <= -1.4e+33) tmp = t_1; elseif (x <= -4.4e-257) tmp = t_3; elseif (x <= 1.3e-299) tmp = Float64(Float64(b * c) + t_2); elseif (x <= 2.1e-163) tmp = t_3; elseif (x <= 3.5e+14) tmp = t_1; elseif (x <= 4.5e+57) tmp = t_3; else tmp = Float64(x * Float64(Float64(y * Float64(t * Float64(z * Float64(-(-18.0))))) - 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) + (18.0 * (t * (x * (y * z))));
t_2 = j * (k * -27.0);
t_3 = t_2 + (-4.0 * (t * a));
tmp = 0.0;
if (x <= -6.8e+160)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (x <= -1.05e+50)
tmp = t_2 + (-4.0 * (x * i));
elseif (x <= -1.4e+33)
tmp = t_1;
elseif (x <= -4.4e-257)
tmp = t_3;
elseif (x <= 1.3e-299)
tmp = (b * c) + t_2;
elseif (x <= 2.1e-163)
tmp = t_3;
elseif (x <= 3.5e+14)
tmp = t_1;
elseif (x <= 4.5e+57)
tmp = t_3;
else
tmp = x * ((y * (t * (z * -(-18.0)))) - (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[(b * c), $MachinePrecision] + N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.8e+160], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.05e+50], N[(t$95$2 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.4e+33], t$95$1, If[LessEqual[x, -4.4e-257], t$95$3, If[LessEqual[x, 1.3e-299], N[(N[(b * c), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[x, 2.1e-163], t$95$3, If[LessEqual[x, 3.5e+14], t$95$1, If[LessEqual[x, 4.5e+57], t$95$3, N[(x * N[(N[(y * N[(t * N[(z * (--18.0)), $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 := b \cdot c + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
t_3 := t\_2 + -4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{+160}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{+50}:\\
\;\;\;\;t\_2 + -4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{-257}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-299}:\\
\;\;\;\;b \cdot c + t\_2\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-163}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+57}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(t \cdot \left(z \cdot \left(--18\right)\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if x < -6.80000000000000061e160Initial program 73.2%
Simplified80.8%
Taylor expanded in x around inf 85.5%
if -6.80000000000000061e160 < x < -1.05e50Initial program 73.1%
Simplified76.9%
Taylor expanded in i around inf 66.3%
*-commutative66.3%
Simplified66.3%
if -1.05e50 < x < -1.4e33 or 2.09999999999999998e-163 < x < 3.5e14Initial program 92.9%
Simplified93.1%
Taylor expanded in j around 0 89.9%
Taylor expanded in a around 0 75.7%
Taylor expanded in i around 0 65.1%
if -1.4e33 < x < -4.39999999999999975e-257 or 1.2999999999999999e-299 < x < 2.09999999999999998e-163 or 3.5e14 < x < 4.49999999999999996e57Initial program 95.8%
Simplified94.0%
Taylor expanded in a around inf 73.6%
if -4.39999999999999975e-257 < x < 1.2999999999999999e-299Initial program 92.1%
Simplified92.3%
Taylor expanded in b around inf 77.6%
if 4.49999999999999996e57 < x Initial program 80.3%
Simplified86.3%
associate-*r*83.3%
distribute-rgt-out--80.3%
associate-+l-80.3%
associate-*r*83.2%
*-commutative83.2%
*-commutative83.2%
associate-*l*83.2%
fma-neg83.2%
Applied egg-rr83.2%
Taylor expanded in t around 0 86.2%
fma-def87.8%
cancel-sign-sub-inv87.8%
metadata-eval87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in x around -inf 80.6%
associate-*r*80.6%
neg-mul-180.6%
cancel-sign-sub-inv80.6%
*-commutative80.6%
associate-*r*80.6%
metadata-eval80.6%
Simplified80.6%
Taylor expanded in t around 0 80.6%
*-commutative80.6%
associate-*r*80.6%
*-commutative80.6%
associate-*r*80.6%
associate-*l*78.1%
Simplified78.1%
Final simplification74.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 (* -4.0 (* t a)))
(t_2 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))))
(t_3 (* j (* k -27.0)))
(t_4 (+ (* b c) t_3))
(t_5 (+ t_3 t_1)))
(if (<= x -9.5e+160)
t_2
(if (<= x -1e+50)
(+ t_3 (* -4.0 (* x i)))
(if (<= x -9.2e+45)
t_2
(if (<= x -6e-259)
t_5
(if (<= x 1.7e-300)
t_4
(if (<= x 4.6e-164)
t_5
(if (<= x 235000.0)
(+ (* b c) t_1)
(if (<= x 4.3e+57) t_4 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 = -4.0 * (t * a);
double t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double t_3 = j * (k * -27.0);
double t_4 = (b * c) + t_3;
double t_5 = t_3 + t_1;
double tmp;
if (x <= -9.5e+160) {
tmp = t_2;
} else if (x <= -1e+50) {
tmp = t_3 + (-4.0 * (x * i));
} else if (x <= -9.2e+45) {
tmp = t_2;
} else if (x <= -6e-259) {
tmp = t_5;
} else if (x <= 1.7e-300) {
tmp = t_4;
} else if (x <= 4.6e-164) {
tmp = t_5;
} else if (x <= 235000.0) {
tmp = (b * c) + t_1;
} else if (x <= 4.3e+57) {
tmp = t_4;
} 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) :: t_5
real(8) :: tmp
t_1 = (-4.0d0) * (t * a)
t_2 = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
t_3 = j * (k * (-27.0d0))
t_4 = (b * c) + t_3
t_5 = t_3 + t_1
if (x <= (-9.5d+160)) then
tmp = t_2
else if (x <= (-1d+50)) then
tmp = t_3 + ((-4.0d0) * (x * i))
else if (x <= (-9.2d+45)) then
tmp = t_2
else if (x <= (-6d-259)) then
tmp = t_5
else if (x <= 1.7d-300) then
tmp = t_4
else if (x <= 4.6d-164) then
tmp = t_5
else if (x <= 235000.0d0) then
tmp = (b * c) + t_1
else if (x <= 4.3d+57) then
tmp = t_4
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 = -4.0 * (t * a);
double t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double t_3 = j * (k * -27.0);
double t_4 = (b * c) + t_3;
double t_5 = t_3 + t_1;
double tmp;
if (x <= -9.5e+160) {
tmp = t_2;
} else if (x <= -1e+50) {
tmp = t_3 + (-4.0 * (x * i));
} else if (x <= -9.2e+45) {
tmp = t_2;
} else if (x <= -6e-259) {
tmp = t_5;
} else if (x <= 1.7e-300) {
tmp = t_4;
} else if (x <= 4.6e-164) {
tmp = t_5;
} else if (x <= 235000.0) {
tmp = (b * c) + t_1;
} else if (x <= 4.3e+57) {
tmp = t_4;
} 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 = -4.0 * (t * a) t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i)) t_3 = j * (k * -27.0) t_4 = (b * c) + t_3 t_5 = t_3 + t_1 tmp = 0 if x <= -9.5e+160: tmp = t_2 elif x <= -1e+50: tmp = t_3 + (-4.0 * (x * i)) elif x <= -9.2e+45: tmp = t_2 elif x <= -6e-259: tmp = t_5 elif x <= 1.7e-300: tmp = t_4 elif x <= 4.6e-164: tmp = t_5 elif x <= 235000.0: tmp = (b * c) + t_1 elif x <= 4.3e+57: tmp = t_4 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(-4.0 * Float64(t * a)) t_2 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) t_3 = Float64(j * Float64(k * -27.0)) t_4 = Float64(Float64(b * c) + t_3) t_5 = Float64(t_3 + t_1) tmp = 0.0 if (x <= -9.5e+160) tmp = t_2; elseif (x <= -1e+50) tmp = Float64(t_3 + Float64(-4.0 * Float64(x * i))); elseif (x <= -9.2e+45) tmp = t_2; elseif (x <= -6e-259) tmp = t_5; elseif (x <= 1.7e-300) tmp = t_4; elseif (x <= 4.6e-164) tmp = t_5; elseif (x <= 235000.0) tmp = Float64(Float64(b * c) + t_1); elseif (x <= 4.3e+57) tmp = t_4; 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 = -4.0 * (t * a);
t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
t_3 = j * (k * -27.0);
t_4 = (b * c) + t_3;
t_5 = t_3 + t_1;
tmp = 0.0;
if (x <= -9.5e+160)
tmp = t_2;
elseif (x <= -1e+50)
tmp = t_3 + (-4.0 * (x * i));
elseif (x <= -9.2e+45)
tmp = t_2;
elseif (x <= -6e-259)
tmp = t_5;
elseif (x <= 1.7e-300)
tmp = t_4;
elseif (x <= 4.6e-164)
tmp = t_5;
elseif (x <= 235000.0)
tmp = (b * c) + t_1;
elseif (x <= 4.3e+57)
tmp = t_4;
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[(-4.0 * N[(t * a), $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[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(b * c), $MachinePrecision] + t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 + t$95$1), $MachinePrecision]}, If[LessEqual[x, -9.5e+160], t$95$2, If[LessEqual[x, -1e+50], N[(t$95$3 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.2e+45], t$95$2, If[LessEqual[x, -6e-259], t$95$5, If[LessEqual[x, 1.7e-300], t$95$4, If[LessEqual[x, 4.6e-164], t$95$5, If[LessEqual[x, 235000.0], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, 4.3e+57], t$95$4, 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 := -4 \cdot \left(t \cdot a\right)\\
t_2 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
t_3 := j \cdot \left(k \cdot -27\right)\\
t_4 := b \cdot c + t\_3\\
t_5 := t\_3 + t\_1\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+160}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1 \cdot 10^{+50}:\\
\;\;\;\;t\_3 + -4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;x \leq -9.2 \cdot 10^{+45}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-259}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-300}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-164}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;x \leq 235000:\\
\;\;\;\;b \cdot c + t\_1\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{+57}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -9.5000000000000006e160 or -1.0000000000000001e50 < x < -9.20000000000000049e45 or 4.30000000000000033e57 < x Initial program 78.9%
Simplified85.2%
Taylor expanded in x around inf 82.6%
if -9.5000000000000006e160 < x < -1.0000000000000001e50Initial program 73.1%
Simplified76.9%
Taylor expanded in i around inf 66.3%
*-commutative66.3%
Simplified66.3%
if -9.20000000000000049e45 < x < -6.0000000000000004e-259 or 1.70000000000000009e-300 < x < 4.59999999999999971e-164Initial program 95.5%
Simplified93.6%
Taylor expanded in a around inf 72.3%
if -6.0000000000000004e-259 < x < 1.70000000000000009e-300 or 235000 < x < 4.30000000000000033e57Initial program 89.8%
Simplified95.0%
Taylor expanded in b around inf 75.0%
if 4.59999999999999971e-164 < x < 235000Initial program 95.7%
Simplified91.5%
Taylor expanded in j around 0 87.7%
Taylor expanded in x around 0 56.2%
Final simplification74.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) (* 18.0 (* t (* x (* y z))))))
(t_2 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))))
(t_3 (* j (* k -27.0)))
(t_4 (+ t_3 (* -4.0 (* t a)))))
(if (<= x -5.4e+160)
t_2
(if (<= x -1.2e+50)
(+ t_3 (* -4.0 (* x i)))
(if (<= x -7.2e+41)
t_1
(if (<= x -2e-252)
t_4
(if (<= x 5.8e-300)
(+ (* b c) t_3)
(if (<= x 4.3e-163)
t_4
(if (<= x 1.85e+16) t_1 (if (<= x 1.1e+57) t_4 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 = (b * c) + (18.0 * (t * (x * (y * z))));
double t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double t_3 = j * (k * -27.0);
double t_4 = t_3 + (-4.0 * (t * a));
double tmp;
if (x <= -5.4e+160) {
tmp = t_2;
} else if (x <= -1.2e+50) {
tmp = t_3 + (-4.0 * (x * i));
} else if (x <= -7.2e+41) {
tmp = t_1;
} else if (x <= -2e-252) {
tmp = t_4;
} else if (x <= 5.8e-300) {
tmp = (b * c) + t_3;
} else if (x <= 4.3e-163) {
tmp = t_4;
} else if (x <= 1.85e+16) {
tmp = t_1;
} else if (x <= 1.1e+57) {
tmp = t_4;
} 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 = (b * c) + (18.0d0 * (t * (x * (y * z))))
t_2 = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
t_3 = j * (k * (-27.0d0))
t_4 = t_3 + ((-4.0d0) * (t * a))
if (x <= (-5.4d+160)) then
tmp = t_2
else if (x <= (-1.2d+50)) then
tmp = t_3 + ((-4.0d0) * (x * i))
else if (x <= (-7.2d+41)) then
tmp = t_1
else if (x <= (-2d-252)) then
tmp = t_4
else if (x <= 5.8d-300) then
tmp = (b * c) + t_3
else if (x <= 4.3d-163) then
tmp = t_4
else if (x <= 1.85d+16) then
tmp = t_1
else if (x <= 1.1d+57) then
tmp = t_4
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 = (b * c) + (18.0 * (t * (x * (y * z))));
double t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double t_3 = j * (k * -27.0);
double t_4 = t_3 + (-4.0 * (t * a));
double tmp;
if (x <= -5.4e+160) {
tmp = t_2;
} else if (x <= -1.2e+50) {
tmp = t_3 + (-4.0 * (x * i));
} else if (x <= -7.2e+41) {
tmp = t_1;
} else if (x <= -2e-252) {
tmp = t_4;
} else if (x <= 5.8e-300) {
tmp = (b * c) + t_3;
} else if (x <= 4.3e-163) {
tmp = t_4;
} else if (x <= 1.85e+16) {
tmp = t_1;
} else if (x <= 1.1e+57) {
tmp = t_4;
} 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 = (b * c) + (18.0 * (t * (x * (y * z)))) t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i)) t_3 = j * (k * -27.0) t_4 = t_3 + (-4.0 * (t * a)) tmp = 0 if x <= -5.4e+160: tmp = t_2 elif x <= -1.2e+50: tmp = t_3 + (-4.0 * (x * i)) elif x <= -7.2e+41: tmp = t_1 elif x <= -2e-252: tmp = t_4 elif x <= 5.8e-300: tmp = (b * c) + t_3 elif x <= 4.3e-163: tmp = t_4 elif x <= 1.85e+16: tmp = t_1 elif x <= 1.1e+57: tmp = t_4 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(Float64(b * c) + Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))) t_2 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) t_3 = Float64(j * Float64(k * -27.0)) t_4 = Float64(t_3 + Float64(-4.0 * Float64(t * a))) tmp = 0.0 if (x <= -5.4e+160) tmp = t_2; elseif (x <= -1.2e+50) tmp = Float64(t_3 + Float64(-4.0 * Float64(x * i))); elseif (x <= -7.2e+41) tmp = t_1; elseif (x <= -2e-252) tmp = t_4; elseif (x <= 5.8e-300) tmp = Float64(Float64(b * c) + t_3); elseif (x <= 4.3e-163) tmp = t_4; elseif (x <= 1.85e+16) tmp = t_1; elseif (x <= 1.1e+57) tmp = t_4; 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 = (b * c) + (18.0 * (t * (x * (y * z))));
t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
t_3 = j * (k * -27.0);
t_4 = t_3 + (-4.0 * (t * a));
tmp = 0.0;
if (x <= -5.4e+160)
tmp = t_2;
elseif (x <= -1.2e+50)
tmp = t_3 + (-4.0 * (x * i));
elseif (x <= -7.2e+41)
tmp = t_1;
elseif (x <= -2e-252)
tmp = t_4;
elseif (x <= 5.8e-300)
tmp = (b * c) + t_3;
elseif (x <= 4.3e-163)
tmp = t_4;
elseif (x <= 1.85e+16)
tmp = t_1;
elseif (x <= 1.1e+57)
tmp = t_4;
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[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.4e+160], t$95$2, If[LessEqual[x, -1.2e+50], N[(t$95$3 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.2e+41], t$95$1, If[LessEqual[x, -2e-252], t$95$4, If[LessEqual[x, 5.8e-300], N[(N[(b * c), $MachinePrecision] + t$95$3), $MachinePrecision], If[LessEqual[x, 4.3e-163], t$95$4, If[LessEqual[x, 1.85e+16], t$95$1, If[LessEqual[x, 1.1e+57], t$95$4, 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 := b \cdot c + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
t_2 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
t_3 := j \cdot \left(k \cdot -27\right)\\
t_4 := t\_3 + -4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;x \leq -5.4 \cdot 10^{+160}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{+50}:\\
\;\;\;\;t\_3 + -4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-252}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-300}:\\
\;\;\;\;b \cdot c + t\_3\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-163}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+57}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -5.4e160 or 1.1e57 < x Initial program 78.2%
Simplified84.7%
Taylor expanded in x around inf 82.0%
if -5.4e160 < x < -1.2000000000000001e50Initial program 73.1%
Simplified76.9%
Taylor expanded in i around inf 66.3%
*-commutative66.3%
Simplified66.3%
if -1.2000000000000001e50 < x < -7.20000000000000051e41 or 4.30000000000000009e-163 < x < 1.85e16Initial program 92.9%
Simplified93.1%
Taylor expanded in j around 0 89.9%
Taylor expanded in a around 0 75.7%
Taylor expanded in i around 0 65.1%
if -7.20000000000000051e41 < x < -1.99999999999999989e-252 or 5.79999999999999985e-300 < x < 4.30000000000000009e-163 or 1.85e16 < x < 1.1e57Initial program 95.8%
Simplified94.0%
Taylor expanded in a around inf 73.6%
if -1.99999999999999989e-252 < x < 5.79999999999999985e-300Initial program 92.1%
Simplified92.3%
Taylor expanded in b around inf 77.6%
Final simplification75.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
(let* ((t_1 (* 4.0 (* x i)))
(t_2 (+ (* j (* k -27.0)) (* 18.0 (* t (* z (* x y))))))
(t_3 (- (+ (* b c) (* -4.0 (* t a))) t_1)))
(if (<= t -1.6e+171)
t_2
(if (<= t -4.8e+60)
t_3
(if (<= t 2.25e+72)
(- (* b c) (+ t_1 (* 27.0 (* j k))))
(if (<= t 1.22e+217)
t_3
(if (<= t 3.6e+246)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= t 5e+275) 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 = 4.0 * (x * i);
double t_2 = (j * (k * -27.0)) + (18.0 * (t * (z * (x * y))));
double t_3 = ((b * c) + (-4.0 * (t * a))) - t_1;
double tmp;
if (t <= -1.6e+171) {
tmp = t_2;
} else if (t <= -4.8e+60) {
tmp = t_3;
} else if (t <= 2.25e+72) {
tmp = (b * c) - (t_1 + (27.0 * (j * k)));
} else if (t <= 1.22e+217) {
tmp = t_3;
} else if (t <= 3.6e+246) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (t <= 5e+275) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 4.0d0 * (x * i)
t_2 = (j * (k * (-27.0d0))) + (18.0d0 * (t * (z * (x * y))))
t_3 = ((b * c) + ((-4.0d0) * (t * a))) - t_1
if (t <= (-1.6d+171)) then
tmp = t_2
else if (t <= (-4.8d+60)) then
tmp = t_3
else if (t <= 2.25d+72) then
tmp = (b * c) - (t_1 + (27.0d0 * (j * k)))
else if (t <= 1.22d+217) then
tmp = t_3
else if (t <= 3.6d+246) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (t <= 5d+275) 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 = 4.0 * (x * i);
double t_2 = (j * (k * -27.0)) + (18.0 * (t * (z * (x * y))));
double t_3 = ((b * c) + (-4.0 * (t * a))) - t_1;
double tmp;
if (t <= -1.6e+171) {
tmp = t_2;
} else if (t <= -4.8e+60) {
tmp = t_3;
} else if (t <= 2.25e+72) {
tmp = (b * c) - (t_1 + (27.0 * (j * k)));
} else if (t <= 1.22e+217) {
tmp = t_3;
} else if (t <= 3.6e+246) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (t <= 5e+275) {
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 = 4.0 * (x * i) t_2 = (j * (k * -27.0)) + (18.0 * (t * (z * (x * y)))) t_3 = ((b * c) + (-4.0 * (t * a))) - t_1 tmp = 0 if t <= -1.6e+171: tmp = t_2 elif t <= -4.8e+60: tmp = t_3 elif t <= 2.25e+72: tmp = (b * c) - (t_1 + (27.0 * (j * k))) elif t <= 1.22e+217: tmp = t_3 elif t <= 3.6e+246: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif t <= 5e+275: 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(4.0 * Float64(x * i)) t_2 = Float64(Float64(j * Float64(k * -27.0)) + Float64(18.0 * Float64(t * Float64(z * Float64(x * y))))) t_3 = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - t_1) tmp = 0.0 if (t <= -1.6e+171) tmp = t_2; elseif (t <= -4.8e+60) tmp = t_3; elseif (t <= 2.25e+72) tmp = Float64(Float64(b * c) - Float64(t_1 + Float64(27.0 * Float64(j * k)))); elseif (t <= 1.22e+217) tmp = t_3; elseif (t <= 3.6e+246) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (t <= 5e+275) 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 = 4.0 * (x * i);
t_2 = (j * (k * -27.0)) + (18.0 * (t * (z * (x * y))));
t_3 = ((b * c) + (-4.0 * (t * a))) - t_1;
tmp = 0.0;
if (t <= -1.6e+171)
tmp = t_2;
elseif (t <= -4.8e+60)
tmp = t_3;
elseif (t <= 2.25e+72)
tmp = (b * c) - (t_1 + (27.0 * (j * k)));
elseif (t <= 1.22e+217)
tmp = t_3;
elseif (t <= 3.6e+246)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (t <= 5e+275)
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[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[t, -1.6e+171], t$95$2, If[LessEqual[t, -4.8e+60], t$95$3, If[LessEqual[t, 2.25e+72], N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.22e+217], t$95$3, If[LessEqual[t, 3.6e+246], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5e+275], 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 := 4 \cdot \left(x \cdot i\right)\\
t_2 := j \cdot \left(k \cdot -27\right) + 18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
t_3 := \left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - t\_1\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+171}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{+60}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+72}:\\
\;\;\;\;b \cdot c - \left(t\_1 + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;t \leq 1.22 \cdot 10^{+217}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+246}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+275}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.60000000000000006e171 or 5.0000000000000003e275 < t Initial program 71.3%
Simplified82.9%
Taylor expanded in y around inf 69.3%
*-commutative69.3%
Simplified69.3%
Taylor expanded in x around 0 69.3%
associate-*r*69.4%
Simplified69.4%
if -1.60000000000000006e171 < t < -4.8e60 or 2.2499999999999999e72 < t < 1.2200000000000001e217 or 3.6e246 < t < 5.0000000000000003e275Initial program 81.4%
Simplified90.7%
Taylor expanded in j around 0 91.1%
Taylor expanded in y around 0 74.1%
if -4.8e60 < t < 2.2499999999999999e72Initial program 91.6%
Simplified89.7%
Taylor expanded in t around 0 85.3%
if 1.2200000000000001e217 < t < 3.6e246Initial program 92.9%
Simplified92.9%
Taylor expanded in x around inf 92.9%
Final simplification81.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 (* 4.0 (* x i)))
(t_2 (- (+ (* b c) (* -4.0 (* t a))) t_1))
(t_3 (* j (* k -27.0)))
(t_4 (+ t_3 (* t (+ (* a -4.0) (* 18.0 (* x (* y z))))))))
(if (<= t -6.8e+125)
t_4
(if (<= t -2e-41)
t_2
(if (<= t -1.7e-48)
(+ t_3 (* 18.0 (* t (* z (* x y)))))
(if (<= t -1.15e-104)
t_2
(if (<= t 1.85e+53) (- (* b c) (+ t_1 (* 27.0 (* j k)))) 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 = 4.0 * (x * i);
double t_2 = ((b * c) + (-4.0 * (t * a))) - t_1;
double t_3 = j * (k * -27.0);
double t_4 = t_3 + (t * ((a * -4.0) + (18.0 * (x * (y * z)))));
double tmp;
if (t <= -6.8e+125) {
tmp = t_4;
} else if (t <= -2e-41) {
tmp = t_2;
} else if (t <= -1.7e-48) {
tmp = t_3 + (18.0 * (t * (z * (x * y))));
} else if (t <= -1.15e-104) {
tmp = t_2;
} else if (t <= 1.85e+53) {
tmp = (b * c) - (t_1 + (27.0 * (j * k)));
} 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 = 4.0d0 * (x * i)
t_2 = ((b * c) + ((-4.0d0) * (t * a))) - t_1
t_3 = j * (k * (-27.0d0))
t_4 = t_3 + (t * ((a * (-4.0d0)) + (18.0d0 * (x * (y * z)))))
if (t <= (-6.8d+125)) then
tmp = t_4
else if (t <= (-2d-41)) then
tmp = t_2
else if (t <= (-1.7d-48)) then
tmp = t_3 + (18.0d0 * (t * (z * (x * y))))
else if (t <= (-1.15d-104)) then
tmp = t_2
else if (t <= 1.85d+53) then
tmp = (b * c) - (t_1 + (27.0d0 * (j * k)))
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 = 4.0 * (x * i);
double t_2 = ((b * c) + (-4.0 * (t * a))) - t_1;
double t_3 = j * (k * -27.0);
double t_4 = t_3 + (t * ((a * -4.0) + (18.0 * (x * (y * z)))));
double tmp;
if (t <= -6.8e+125) {
tmp = t_4;
} else if (t <= -2e-41) {
tmp = t_2;
} else if (t <= -1.7e-48) {
tmp = t_3 + (18.0 * (t * (z * (x * y))));
} else if (t <= -1.15e-104) {
tmp = t_2;
} else if (t <= 1.85e+53) {
tmp = (b * c) - (t_1 + (27.0 * (j * k)));
} 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 = 4.0 * (x * i) t_2 = ((b * c) + (-4.0 * (t * a))) - t_1 t_3 = j * (k * -27.0) t_4 = t_3 + (t * ((a * -4.0) + (18.0 * (x * (y * z))))) tmp = 0 if t <= -6.8e+125: tmp = t_4 elif t <= -2e-41: tmp = t_2 elif t <= -1.7e-48: tmp = t_3 + (18.0 * (t * (z * (x * y)))) elif t <= -1.15e-104: tmp = t_2 elif t <= 1.85e+53: tmp = (b * c) - (t_1 + (27.0 * (j * k))) 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(4.0 * Float64(x * i)) t_2 = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - t_1) t_3 = Float64(j * Float64(k * -27.0)) t_4 = Float64(t_3 + Float64(t * Float64(Float64(a * -4.0) + Float64(18.0 * Float64(x * Float64(y * z)))))) tmp = 0.0 if (t <= -6.8e+125) tmp = t_4; elseif (t <= -2e-41) tmp = t_2; elseif (t <= -1.7e-48) tmp = Float64(t_3 + Float64(18.0 * Float64(t * Float64(z * Float64(x * y))))); elseif (t <= -1.15e-104) tmp = t_2; elseif (t <= 1.85e+53) tmp = Float64(Float64(b * c) - Float64(t_1 + Float64(27.0 * Float64(j * k)))); 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 = 4.0 * (x * i);
t_2 = ((b * c) + (-4.0 * (t * a))) - t_1;
t_3 = j * (k * -27.0);
t_4 = t_3 + (t * ((a * -4.0) + (18.0 * (x * (y * z)))));
tmp = 0.0;
if (t <= -6.8e+125)
tmp = t_4;
elseif (t <= -2e-41)
tmp = t_2;
elseif (t <= -1.7e-48)
tmp = t_3 + (18.0 * (t * (z * (x * y))));
elseif (t <= -1.15e-104)
tmp = t_2;
elseif (t <= 1.85e+53)
tmp = (b * c) - (t_1 + (27.0 * (j * k)));
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[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(t * N[(N[(a * -4.0), $MachinePrecision] + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.8e+125], t$95$4, If[LessEqual[t, -2e-41], t$95$2, If[LessEqual[t, -1.7e-48], N[(t$95$3 + N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.15e-104], t$95$2, If[LessEqual[t, 1.85e+53], N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 := 4 \cdot \left(x \cdot i\right)\\
t_2 := \left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - t\_1\\
t_3 := j \cdot \left(k \cdot -27\right)\\
t_4 := t\_3 + t \cdot \left(a \cdot -4 + 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{+125}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t \leq -2 \cdot 10^{-41}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-48}:\\
\;\;\;\;t\_3 + 18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-104}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{+53}:\\
\;\;\;\;b \cdot c - \left(t\_1 + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if t < -6.7999999999999998e125 or 1.85e53 < t Initial program 78.5%
Simplified87.7%
Taylor expanded in t around inf 84.5%
if -6.7999999999999998e125 < t < -2.00000000000000001e-41 or -1.70000000000000014e-48 < t < -1.15e-104Initial program 97.2%
Simplified94.7%
Taylor expanded in j around 0 84.4%
Taylor expanded in y around 0 74.0%
if -2.00000000000000001e-41 < t < -1.70000000000000014e-48Initial program 100.0%
Simplified61.9%
Taylor expanded in y around inf 61.9%
*-commutative61.9%
Simplified61.9%
Taylor expanded in x around 0 61.9%
associate-*r*100.0%
Simplified100.0%
if -1.15e-104 < t < 1.85e53Initial program 89.8%
Simplified89.7%
Taylor expanded in t around 0 92.3%
Final simplification86.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 (* 4.0 (* x i)))
(t_2 (* j (* k -27.0)))
(t_3 (* 18.0 (* x (* y z))))
(t_4 (+ t_2 (* t (+ (* a -4.0) t_3))))
(t_5 (- (* b c) (+ t_1 (* 27.0 (* j k))))))
(if (<= t -8.2e+68)
(- (* t (- t_3 (* a 4.0))) t_1)
(if (<= t -3.45e-7)
t_5
(if (<= t -5.5e-19)
t_4
(if (<= t -2.35e-48)
(+ t_2 (* 18.0 (* t (* z (* x y)))))
(if (<= t 1.35e+53) t_5 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 = 4.0 * (x * i);
double t_2 = j * (k * -27.0);
double t_3 = 18.0 * (x * (y * z));
double t_4 = t_2 + (t * ((a * -4.0) + t_3));
double t_5 = (b * c) - (t_1 + (27.0 * (j * k)));
double tmp;
if (t <= -8.2e+68) {
tmp = (t * (t_3 - (a * 4.0))) - t_1;
} else if (t <= -3.45e-7) {
tmp = t_5;
} else if (t <= -5.5e-19) {
tmp = t_4;
} else if (t <= -2.35e-48) {
tmp = t_2 + (18.0 * (t * (z * (x * y))));
} else if (t <= 1.35e+53) {
tmp = t_5;
} 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) :: t_5
real(8) :: tmp
t_1 = 4.0d0 * (x * i)
t_2 = j * (k * (-27.0d0))
t_3 = 18.0d0 * (x * (y * z))
t_4 = t_2 + (t * ((a * (-4.0d0)) + t_3))
t_5 = (b * c) - (t_1 + (27.0d0 * (j * k)))
if (t <= (-8.2d+68)) then
tmp = (t * (t_3 - (a * 4.0d0))) - t_1
else if (t <= (-3.45d-7)) then
tmp = t_5
else if (t <= (-5.5d-19)) then
tmp = t_4
else if (t <= (-2.35d-48)) then
tmp = t_2 + (18.0d0 * (t * (z * (x * y))))
else if (t <= 1.35d+53) then
tmp = t_5
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 = 4.0 * (x * i);
double t_2 = j * (k * -27.0);
double t_3 = 18.0 * (x * (y * z));
double t_4 = t_2 + (t * ((a * -4.0) + t_3));
double t_5 = (b * c) - (t_1 + (27.0 * (j * k)));
double tmp;
if (t <= -8.2e+68) {
tmp = (t * (t_3 - (a * 4.0))) - t_1;
} else if (t <= -3.45e-7) {
tmp = t_5;
} else if (t <= -5.5e-19) {
tmp = t_4;
} else if (t <= -2.35e-48) {
tmp = t_2 + (18.0 * (t * (z * (x * y))));
} else if (t <= 1.35e+53) {
tmp = t_5;
} 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 = 4.0 * (x * i) t_2 = j * (k * -27.0) t_3 = 18.0 * (x * (y * z)) t_4 = t_2 + (t * ((a * -4.0) + t_3)) t_5 = (b * c) - (t_1 + (27.0 * (j * k))) tmp = 0 if t <= -8.2e+68: tmp = (t * (t_3 - (a * 4.0))) - t_1 elif t <= -3.45e-7: tmp = t_5 elif t <= -5.5e-19: tmp = t_4 elif t <= -2.35e-48: tmp = t_2 + (18.0 * (t * (z * (x * y)))) elif t <= 1.35e+53: tmp = t_5 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(4.0 * Float64(x * i)) t_2 = Float64(j * Float64(k * -27.0)) t_3 = Float64(18.0 * Float64(x * Float64(y * z))) t_4 = Float64(t_2 + Float64(t * Float64(Float64(a * -4.0) + t_3))) t_5 = Float64(Float64(b * c) - Float64(t_1 + Float64(27.0 * Float64(j * k)))) tmp = 0.0 if (t <= -8.2e+68) tmp = Float64(Float64(t * Float64(t_3 - Float64(a * 4.0))) - t_1); elseif (t <= -3.45e-7) tmp = t_5; elseif (t <= -5.5e-19) tmp = t_4; elseif (t <= -2.35e-48) tmp = Float64(t_2 + Float64(18.0 * Float64(t * Float64(z * Float64(x * y))))); elseif (t <= 1.35e+53) tmp = t_5; 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 = 4.0 * (x * i);
t_2 = j * (k * -27.0);
t_3 = 18.0 * (x * (y * z));
t_4 = t_2 + (t * ((a * -4.0) + t_3));
t_5 = (b * c) - (t_1 + (27.0 * (j * k)));
tmp = 0.0;
if (t <= -8.2e+68)
tmp = (t * (t_3 - (a * 4.0))) - t_1;
elseif (t <= -3.45e-7)
tmp = t_5;
elseif (t <= -5.5e-19)
tmp = t_4;
elseif (t <= -2.35e-48)
tmp = t_2 + (18.0 * (t * (z * (x * y))));
elseif (t <= 1.35e+53)
tmp = t_5;
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[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 + N[(t * N[(N[(a * -4.0), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.2e+68], N[(N[(t * N[(t$95$3 - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, -3.45e-7], t$95$5, If[LessEqual[t, -5.5e-19], t$95$4, If[LessEqual[t, -2.35e-48], N[(t$95$2 + N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+53], t$95$5, 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 := 4 \cdot \left(x \cdot i\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
t_3 := 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\\
t_4 := t\_2 + t \cdot \left(a \cdot -4 + t\_3\right)\\
t_5 := b \cdot c - \left(t\_1 + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{+68}:\\
\;\;\;\;t \cdot \left(t\_3 - a \cdot 4\right) - t\_1\\
\mathbf{elif}\;t \leq -3.45 \cdot 10^{-7}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-19}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t \leq -2.35 \cdot 10^{-48}:\\
\;\;\;\;t\_2 + 18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+53}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if t < -8.1999999999999998e68Initial program 79.9%
Simplified82.2%
Taylor expanded in j around 0 78.3%
Taylor expanded in b around 0 81.7%
if -8.1999999999999998e68 < t < -3.4499999999999998e-7 or -2.3499999999999999e-48 < t < 1.3500000000000001e53Initial program 90.7%
Simplified90.6%
Taylor expanded in t around 0 90.0%
if -3.4499999999999998e-7 < t < -5.4999999999999996e-19 or 1.3500000000000001e53 < t Initial program 81.8%
Simplified92.4%
Taylor expanded in t around inf 83.8%
if -5.4999999999999996e-19 < t < -2.3499999999999999e-48Initial program 99.8%
Simplified59.3%
Taylor expanded in y around inf 45.4%
*-commutative45.4%
Simplified45.4%
Taylor expanded in x around 0 45.4%
associate-*r*85.9%
Simplified85.9%
Final simplification86.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0)))
(t_2 (+ t_1 (* 18.0 (* t (* z (* x y))))))
(t_3 (* -4.0 (* t a))))
(if (<= t -9.5e+127)
t_2
(if (<= t 1.4e+54)
(- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* j k))))
(if (<= t 2.9e+161)
(+ t_1 t_3)
(if (<= t 4.7e+179)
t_2
(if (<= t 1.05e+218)
(+ (* b c) t_3)
(+ (* b c) (* 18.0 (* t (* x (* y z))))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = t_1 + (18.0 * (t * (z * (x * y))));
double t_3 = -4.0 * (t * a);
double tmp;
if (t <= -9.5e+127) {
tmp = t_2;
} else if (t <= 1.4e+54) {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
} else if (t <= 2.9e+161) {
tmp = t_1 + t_3;
} else if (t <= 4.7e+179) {
tmp = t_2;
} else if (t <= 1.05e+218) {
tmp = (b * c) + t_3;
} else {
tmp = (b * c) + (18.0 * (t * (x * (y * z))));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = t_1 + (18.0d0 * (t * (z * (x * y))))
t_3 = (-4.0d0) * (t * a)
if (t <= (-9.5d+127)) then
tmp = t_2
else if (t <= 1.4d+54) then
tmp = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (j * k)))
else if (t <= 2.9d+161) then
tmp = t_1 + t_3
else if (t <= 4.7d+179) then
tmp = t_2
else if (t <= 1.05d+218) then
tmp = (b * c) + t_3
else
tmp = (b * c) + (18.0d0 * (t * (x * (y * z))))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = t_1 + (18.0 * (t * (z * (x * y))));
double t_3 = -4.0 * (t * a);
double tmp;
if (t <= -9.5e+127) {
tmp = t_2;
} else if (t <= 1.4e+54) {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
} else if (t <= 2.9e+161) {
tmp = t_1 + t_3;
} else if (t <= 4.7e+179) {
tmp = t_2;
} else if (t <= 1.05e+218) {
tmp = (b * c) + t_3;
} else {
tmp = (b * c) + (18.0 * (t * (x * (y * z))));
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = t_1 + (18.0 * (t * (z * (x * y)))) t_3 = -4.0 * (t * a) tmp = 0 if t <= -9.5e+127: tmp = t_2 elif t <= 1.4e+54: tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k))) elif t <= 2.9e+161: tmp = t_1 + t_3 elif t <= 4.7e+179: tmp = t_2 elif t <= 1.05e+218: tmp = (b * c) + t_3 else: tmp = (b * c) + (18.0 * (t * (x * (y * z)))) return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(t_1 + Float64(18.0 * Float64(t * Float64(z * Float64(x * y))))) t_3 = Float64(-4.0 * Float64(t * a)) tmp = 0.0 if (t <= -9.5e+127) tmp = t_2; elseif (t <= 1.4e+54) tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(j * k)))); elseif (t <= 2.9e+161) tmp = Float64(t_1 + t_3); elseif (t <= 4.7e+179) tmp = t_2; elseif (t <= 1.05e+218) tmp = Float64(Float64(b * c) + t_3); else tmp = Float64(Float64(b * c) + Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))); end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = t_1 + (18.0 * (t * (z * (x * y))));
t_3 = -4.0 * (t * a);
tmp = 0.0;
if (t <= -9.5e+127)
tmp = t_2;
elseif (t <= 1.4e+54)
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
elseif (t <= 2.9e+161)
tmp = t_1 + t_3;
elseif (t <= 4.7e+179)
tmp = t_2;
elseif (t <= 1.05e+218)
tmp = (b * c) + t_3;
else
tmp = (b * c) + (18.0 * (t * (x * (y * z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.5e+127], t$95$2, If[LessEqual[t, 1.4e+54], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.9e+161], N[(t$95$1 + t$95$3), $MachinePrecision], If[LessEqual[t, 4.7e+179], t$95$2, If[LessEqual[t, 1.05e+218], N[(N[(b * c), $MachinePrecision] + t$95$3), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := t\_1 + 18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
t_3 := -4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{+127}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+54}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+161}:\\
\;\;\;\;t\_1 + t\_3\\
\mathbf{elif}\;t \leq 4.7 \cdot 10^{+179}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+218}:\\
\;\;\;\;b \cdot c + t\_3\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if t < -9.49999999999999975e127 or 2.90000000000000016e161 < t < 4.70000000000000007e179Initial program 71.7%
Simplified79.4%
Taylor expanded in y around inf 64.8%
*-commutative64.8%
Simplified64.8%
Taylor expanded in x around 0 64.8%
associate-*r*64.9%
Simplified64.9%
if -9.49999999999999975e127 < t < 1.40000000000000008e54Initial program 91.9%
Simplified90.1%
Taylor expanded in t around 0 84.0%
if 1.40000000000000008e54 < t < 2.90000000000000016e161Initial program 88.2%
Simplified94.0%
Taylor expanded in a around inf 71.5%
if 4.70000000000000007e179 < t < 1.0499999999999999e218Initial program 84.6%
Simplified100.0%
Taylor expanded in j around 0 100.0%
Taylor expanded in x around 0 77.0%
if 1.0499999999999999e218 < t Initial program 78.5%
Simplified89.2%
Taylor expanded in j around 0 96.4%
Taylor expanded in a around 0 67.5%
Taylor expanded in i around 0 68.3%
Final simplification78.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 (<= k -1.5e-19)
(+ (* x (* (* y t) (* 18.0 z))) (* j (* k -27.0)))
(-
(+ (* 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 (k <= -1.5e-19) {
tmp = (x * ((y * t) * (18.0 * z))) + (j * (k * -27.0));
} 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 (k <= (-1.5d-19)) then
tmp = (x * ((y * t) * (18.0d0 * z))) + (j * (k * (-27.0d0)))
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 (k <= -1.5e-19) {
tmp = (x * ((y * t) * (18.0 * z))) + (j * (k * -27.0));
} 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 k <= -1.5e-19: tmp = (x * ((y * t) * (18.0 * z))) + (j * (k * -27.0)) 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 (k <= -1.5e-19) tmp = Float64(Float64(x * Float64(Float64(y * t) * Float64(18.0 * z))) + Float64(j * Float64(k * -27.0))); 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 (k <= -1.5e-19)
tmp = (x * ((y * t) * (18.0 * z))) + (j * (k * -27.0));
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[k, -1.5e-19], N[(N[(x * N[(N[(y * t), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $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}\;k \leq -1.5 \cdot 10^{-19}:\\
\;\;\;\;x \cdot \left(\left(y \cdot t\right) \cdot \left(18 \cdot z\right)\right) + j \cdot \left(k \cdot -27\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 k < -1.49999999999999996e-19Initial program 81.2%
Simplified82.6%
Taylor expanded in y around inf 52.3%
*-commutative52.3%
associate-*r*53.6%
associate-*l*53.6%
*-commutative53.6%
*-commutative53.6%
associate-*r*54.9%
associate-*l*54.9%
*-commutative54.9%
Simplified54.9%
if -1.49999999999999996e-19 < k Initial program 89.2%
Simplified91.5%
Final simplification80.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
(let* ((t_1 (* 18.0 (* x (* y z)))) (t_2 (* 4.0 (* x i))))
(if (<= t -9.8e+125)
(+ (* j (* k -27.0)) (* t (+ (* a -4.0) t_1)))
(if (<= t 1.9e+111)
(- (+ (* b c) (* -4.0 (* t a))) (+ t_2 (* 27.0 (* j k))))
(- (+ (* b c) (* t (- t_1 (* a 4.0)))) 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 = 18.0 * (x * (y * z));
double t_2 = 4.0 * (x * i);
double tmp;
if (t <= -9.8e+125) {
tmp = (j * (k * -27.0)) + (t * ((a * -4.0) + t_1));
} else if (t <= 1.9e+111) {
tmp = ((b * c) + (-4.0 * (t * a))) - (t_2 + (27.0 * (j * k)));
} else {
tmp = ((b * c) + (t * (t_1 - (a * 4.0)))) - t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 18.0d0 * (x * (y * z))
t_2 = 4.0d0 * (x * i)
if (t <= (-9.8d+125)) then
tmp = (j * (k * (-27.0d0))) + (t * ((a * (-4.0d0)) + t_1))
else if (t <= 1.9d+111) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (t_2 + (27.0d0 * (j * k)))
else
tmp = ((b * c) + (t * (t_1 - (a * 4.0d0)))) - 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 = 18.0 * (x * (y * z));
double t_2 = 4.0 * (x * i);
double tmp;
if (t <= -9.8e+125) {
tmp = (j * (k * -27.0)) + (t * ((a * -4.0) + t_1));
} else if (t <= 1.9e+111) {
tmp = ((b * c) + (-4.0 * (t * a))) - (t_2 + (27.0 * (j * k)));
} else {
tmp = ((b * c) + (t * (t_1 - (a * 4.0)))) - 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 = 18.0 * (x * (y * z)) t_2 = 4.0 * (x * i) tmp = 0 if t <= -9.8e+125: tmp = (j * (k * -27.0)) + (t * ((a * -4.0) + t_1)) elif t <= 1.9e+111: tmp = ((b * c) + (-4.0 * (t * a))) - (t_2 + (27.0 * (j * k))) else: tmp = ((b * c) + (t * (t_1 - (a * 4.0)))) - 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(18.0 * Float64(x * Float64(y * z))) t_2 = Float64(4.0 * Float64(x * i)) tmp = 0.0 if (t <= -9.8e+125) tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(t * Float64(Float64(a * -4.0) + t_1))); elseif (t <= 1.9e+111) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(t_2 + Float64(27.0 * Float64(j * k)))); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(t_1 - Float64(a * 4.0)))) - 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 = 18.0 * (x * (y * z));
t_2 = 4.0 * (x * i);
tmp = 0.0;
if (t <= -9.8e+125)
tmp = (j * (k * -27.0)) + (t * ((a * -4.0) + t_1));
elseif (t <= 1.9e+111)
tmp = ((b * c) + (-4.0 * (t * a))) - (t_2 + (27.0 * (j * k)));
else
tmp = ((b * c) + (t * (t_1 - (a * 4.0)))) - 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[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.8e+125], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(t * N[(N[(a * -4.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+111], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$2 + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(t$95$1 - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $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 := 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\\
t_2 := 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;t \leq -9.8 \cdot 10^{+125}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + t \cdot \left(a \cdot -4 + t\_1\right)\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+111}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - \left(t\_2 + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(t\_1 - a \cdot 4\right)\right) - t\_2\\
\end{array}
\end{array}
if t < -9.80000000000000032e125Initial program 74.9%
Simplified80.5%
Taylor expanded in t around inf 84.9%
if -9.80000000000000032e125 < t < 1.89999999999999988e111Initial program 92.5%
Simplified90.8%
Taylor expanded in y around 0 91.1%
if 1.89999999999999988e111 < t Initial program 75.4%
Simplified89.8%
Taylor expanded in j around 0 92.1%
Final simplification90.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 (<= t -2.4e+52)
(not (or (<= t -2.45e-7) (and (not (<= t -1.2e-76)) (<= t 6.8e+73)))))
(+ (* b c) (* -4.0 (* t a)))
(+ (* 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 ((t <= -2.4e+52) || !((t <= -2.45e-7) || (!(t <= -1.2e-76) && (t <= 6.8e+73)))) {
tmp = (b * c) + (-4.0 * (t * a));
} 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 ((t <= (-2.4d+52)) .or. (.not. (t <= (-2.45d-7)) .or. (.not. (t <= (-1.2d-76))) .and. (t <= 6.8d+73))) then
tmp = (b * c) + ((-4.0d0) * (t * a))
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 ((t <= -2.4e+52) || !((t <= -2.45e-7) || (!(t <= -1.2e-76) && (t <= 6.8e+73)))) {
tmp = (b * c) + (-4.0 * (t * a));
} 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 (t <= -2.4e+52) or not ((t <= -2.45e-7) or (not (t <= -1.2e-76) and (t <= 6.8e+73))): tmp = (b * c) + (-4.0 * (t * a)) 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 ((t <= -2.4e+52) || !((t <= -2.45e-7) || (!(t <= -1.2e-76) && (t <= 6.8e+73)))) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); 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 ((t <= -2.4e+52) || ~(((t <= -2.45e-7) || (~((t <= -1.2e-76)) && (t <= 6.8e+73)))))
tmp = (b * c) + (-4.0 * (t * a));
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[t, -2.4e+52], N[Not[Or[LessEqual[t, -2.45e-7], And[N[Not[LessEqual[t, -1.2e-76]], $MachinePrecision], LessEqual[t, 6.8e+73]]]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $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}\;t \leq -2.4 \cdot 10^{+52} \lor \neg \left(t \leq -2.45 \cdot 10^{-7} \lor \neg \left(t \leq -1.2 \cdot 10^{-76}\right) \land t \leq 6.8 \cdot 10^{+73}\right):\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + -4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if t < -2.4e52 or -2.4499999999999998e-7 < t < -1.20000000000000007e-76 or 6.8000000000000003e73 < t Initial program 82.4%
Simplified86.8%
Taylor expanded in j around 0 83.8%
Taylor expanded in x around 0 50.9%
if -2.4e52 < t < -2.4499999999999998e-7 or -1.20000000000000007e-76 < t < 6.8000000000000003e73Initial program 90.5%
Simplified91.2%
Taylor expanded in i around inf 73.6%
*-commutative73.6%
Simplified73.6%
Final simplification63.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0)))
(t_2 (+ t_1 (* -4.0 (* t a))))
(t_3 (- (* b c) (* x (* 4.0 i)))))
(if (<= x -3.8e+61)
t_3
(if (<= x -3.65e-258)
t_2
(if (<= x 1.6e-299) (+ (* b c) t_1) (if (<= x 3.3e-24) 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 = j * (k * -27.0);
double t_2 = t_1 + (-4.0 * (t * a));
double t_3 = (b * c) - (x * (4.0 * i));
double tmp;
if (x <= -3.8e+61) {
tmp = t_3;
} else if (x <= -3.65e-258) {
tmp = t_2;
} else if (x <= 1.6e-299) {
tmp = (b * c) + t_1;
} else if (x <= 3.3e-24) {
tmp = 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 = j * (k * (-27.0d0))
t_2 = t_1 + ((-4.0d0) * (t * a))
t_3 = (b * c) - (x * (4.0d0 * i))
if (x <= (-3.8d+61)) then
tmp = t_3
else if (x <= (-3.65d-258)) then
tmp = t_2
else if (x <= 1.6d-299) then
tmp = (b * c) + t_1
else if (x <= 3.3d-24) then
tmp = 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 = j * (k * -27.0);
double t_2 = t_1 + (-4.0 * (t * a));
double t_3 = (b * c) - (x * (4.0 * i));
double tmp;
if (x <= -3.8e+61) {
tmp = t_3;
} else if (x <= -3.65e-258) {
tmp = t_2;
} else if (x <= 1.6e-299) {
tmp = (b * c) + t_1;
} else if (x <= 3.3e-24) {
tmp = 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 = j * (k * -27.0) t_2 = t_1 + (-4.0 * (t * a)) t_3 = (b * c) - (x * (4.0 * i)) tmp = 0 if x <= -3.8e+61: tmp = t_3 elif x <= -3.65e-258: tmp = t_2 elif x <= 1.6e-299: tmp = (b * c) + t_1 elif x <= 3.3e-24: tmp = 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(j * Float64(k * -27.0)) t_2 = Float64(t_1 + Float64(-4.0 * Float64(t * a))) t_3 = Float64(Float64(b * c) - Float64(x * Float64(4.0 * i))) tmp = 0.0 if (x <= -3.8e+61) tmp = t_3; elseif (x <= -3.65e-258) tmp = t_2; elseif (x <= 1.6e-299) tmp = Float64(Float64(b * c) + t_1); elseif (x <= 3.3e-24) tmp = 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 = j * (k * -27.0);
t_2 = t_1 + (-4.0 * (t * a));
t_3 = (b * c) - (x * (4.0 * i));
tmp = 0.0;
if (x <= -3.8e+61)
tmp = t_3;
elseif (x <= -3.65e-258)
tmp = t_2;
elseif (x <= 1.6e-299)
tmp = (b * c) + t_1;
elseif (x <= 3.3e-24)
tmp = 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[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+61], t$95$3, If[LessEqual[x, -3.65e-258], t$95$2, If[LessEqual[x, 1.6e-299], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, 3.3e-24], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := t\_1 + -4 \cdot \left(t \cdot a\right)\\
t_3 := b \cdot c - x \cdot \left(4 \cdot i\right)\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+61}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq -3.65 \cdot 10^{-258}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-299}:\\
\;\;\;\;b \cdot c + t\_1\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-24}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if x < -3.79999999999999995e61 or 3.29999999999999984e-24 < x Initial program 78.7%
Simplified85.2%
Taylor expanded in t around 0 64.5%
Taylor expanded in i around inf 55.9%
*-commutative55.9%
associate-*r*55.9%
*-commutative55.9%
associate-*l*55.9%
Simplified55.9%
if -3.79999999999999995e61 < x < -3.6500000000000001e-258 or 1.60000000000000004e-299 < x < 3.29999999999999984e-24Initial program 94.1%
Simplified91.9%
Taylor expanded in a around inf 66.4%
if -3.6500000000000001e-258 < x < 1.60000000000000004e-299Initial program 92.1%
Simplified92.3%
Taylor expanded in b around inf 77.6%
Final simplification62.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 (* 18.0 (* x (* y z)))) (t_2 (* 4.0 (* x i))))
(if (<= t -1.15e+126)
(+ (* j (* k -27.0)) (* t (+ (* a -4.0) t_1)))
(if (<= t 5.6e+185)
(- (+ (* b c) (* -4.0 (* t a))) (+ t_2 (* 27.0 (* j k))))
(- (* t (- t_1 (* a 4.0))) 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 = 18.0 * (x * (y * z));
double t_2 = 4.0 * (x * i);
double tmp;
if (t <= -1.15e+126) {
tmp = (j * (k * -27.0)) + (t * ((a * -4.0) + t_1));
} else if (t <= 5.6e+185) {
tmp = ((b * c) + (-4.0 * (t * a))) - (t_2 + (27.0 * (j * k)));
} else {
tmp = (t * (t_1 - (a * 4.0))) - t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 18.0d0 * (x * (y * z))
t_2 = 4.0d0 * (x * i)
if (t <= (-1.15d+126)) then
tmp = (j * (k * (-27.0d0))) + (t * ((a * (-4.0d0)) + t_1))
else if (t <= 5.6d+185) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (t_2 + (27.0d0 * (j * k)))
else
tmp = (t * (t_1 - (a * 4.0d0))) - 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 = 18.0 * (x * (y * z));
double t_2 = 4.0 * (x * i);
double tmp;
if (t <= -1.15e+126) {
tmp = (j * (k * -27.0)) + (t * ((a * -4.0) + t_1));
} else if (t <= 5.6e+185) {
tmp = ((b * c) + (-4.0 * (t * a))) - (t_2 + (27.0 * (j * k)));
} else {
tmp = (t * (t_1 - (a * 4.0))) - 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 = 18.0 * (x * (y * z)) t_2 = 4.0 * (x * i) tmp = 0 if t <= -1.15e+126: tmp = (j * (k * -27.0)) + (t * ((a * -4.0) + t_1)) elif t <= 5.6e+185: tmp = ((b * c) + (-4.0 * (t * a))) - (t_2 + (27.0 * (j * k))) else: tmp = (t * (t_1 - (a * 4.0))) - 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(18.0 * Float64(x * Float64(y * z))) t_2 = Float64(4.0 * Float64(x * i)) tmp = 0.0 if (t <= -1.15e+126) tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(t * Float64(Float64(a * -4.0) + t_1))); elseif (t <= 5.6e+185) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(t_2 + Float64(27.0 * Float64(j * k)))); else tmp = Float64(Float64(t * Float64(t_1 - Float64(a * 4.0))) - 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 = 18.0 * (x * (y * z));
t_2 = 4.0 * (x * i);
tmp = 0.0;
if (t <= -1.15e+126)
tmp = (j * (k * -27.0)) + (t * ((a * -4.0) + t_1));
elseif (t <= 5.6e+185)
tmp = ((b * c) + (-4.0 * (t * a))) - (t_2 + (27.0 * (j * k)));
else
tmp = (t * (t_1 - (a * 4.0))) - 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[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.15e+126], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(t * N[(N[(a * -4.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+185], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$2 + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(t$95$1 - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $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 := 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\\
t_2 := 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{+126}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + t \cdot \left(a \cdot -4 + t\_1\right)\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+185}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - \left(t\_2 + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(t\_1 - a \cdot 4\right) - t\_2\\
\end{array}
\end{array}
if t < -1.15e126Initial program 74.9%
Simplified80.5%
Taylor expanded in t around inf 84.9%
if -1.15e126 < t < 5.59999999999999964e185Initial program 90.7%
Simplified90.2%
Taylor expanded in y around 0 89.3%
if 5.59999999999999964e185 < t Initial program 78.9%
Simplified92.1%
Taylor expanded in j around 0 97.4%
Taylor expanded in b around 0 97.4%
Final simplification89.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 (* 27.0 (* j k))))
(if (<= x -3.6e+161)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= x -3.1e+27)
(- (* b c) (+ (* 4.0 (* x i)) t_1))
(if (<= x 3.8e+57)
(- (+ (* b c) (* -4.0 (* t a))) t_1)
(* x (- (* y (* t (* z (- -18.0)))) (* 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 = 27.0 * (j * k);
double tmp;
if (x <= -3.6e+161) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= -3.1e+27) {
tmp = (b * c) - ((4.0 * (x * i)) + t_1);
} else if (x <= 3.8e+57) {
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
} else {
tmp = x * ((y * (t * (z * -(-18.0)))) - (4.0 * 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 = 27.0d0 * (j * k)
if (x <= (-3.6d+161)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (x <= (-3.1d+27)) then
tmp = (b * c) - ((4.0d0 * (x * i)) + t_1)
else if (x <= 3.8d+57) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - t_1
else
tmp = x * ((y * (t * (z * -(-18.0d0)))) - (4.0d0 * 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 = 27.0 * (j * k);
double tmp;
if (x <= -3.6e+161) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= -3.1e+27) {
tmp = (b * c) - ((4.0 * (x * i)) + t_1);
} else if (x <= 3.8e+57) {
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
} else {
tmp = x * ((y * (t * (z * -(-18.0)))) - (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 = 27.0 * (j * k) tmp = 0 if x <= -3.6e+161: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif x <= -3.1e+27: tmp = (b * c) - ((4.0 * (x * i)) + t_1) elif x <= 3.8e+57: tmp = ((b * c) + (-4.0 * (t * a))) - t_1 else: tmp = x * ((y * (t * (z * -(-18.0)))) - (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(27.0 * Float64(j * k)) tmp = 0.0 if (x <= -3.6e+161) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (x <= -3.1e+27) tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + t_1)); elseif (x <= 3.8e+57) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - t_1); else tmp = Float64(x * Float64(Float64(y * Float64(t * Float64(z * Float64(-(-18.0))))) - 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 = 27.0 * (j * k);
tmp = 0.0;
if (x <= -3.6e+161)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (x <= -3.1e+27)
tmp = (b * c) - ((4.0 * (x * i)) + t_1);
elseif (x <= 3.8e+57)
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
else
tmp = x * ((y * (t * (z * -(-18.0)))) - (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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e+161], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.1e+27], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e+57], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(x * N[(N[(y * N[(t * N[(z * (--18.0)), $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 := 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+161}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{+27}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + t\_1\right)\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+57}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(t \cdot \left(z \cdot \left(--18\right)\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if x < -3.59999999999999984e161Initial program 73.2%
Simplified80.8%
Taylor expanded in x around inf 85.5%
if -3.59999999999999984e161 < x < -3.09999999999999996e27Initial program 80.5%
Simplified83.3%
Taylor expanded in t around 0 73.7%
if -3.09999999999999996e27 < x < 3.7999999999999999e57Initial program 94.4%
Simplified93.1%
Taylor expanded in x around 0 80.6%
if 3.7999999999999999e57 < x Initial program 80.3%
Simplified86.3%
associate-*r*83.3%
distribute-rgt-out--80.3%
associate-+l-80.3%
associate-*r*83.2%
*-commutative83.2%
*-commutative83.2%
associate-*l*83.2%
fma-neg83.2%
Applied egg-rr83.2%
Taylor expanded in t around 0 86.2%
fma-def87.8%
cancel-sign-sub-inv87.8%
metadata-eval87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in x around -inf 80.6%
associate-*r*80.6%
neg-mul-180.6%
cancel-sign-sub-inv80.6%
*-commutative80.6%
associate-*r*80.6%
metadata-eval80.6%
Simplified80.6%
Taylor expanded in t around 0 80.6%
*-commutative80.6%
associate-*r*80.6%
*-commutative80.6%
associate-*r*80.6%
associate-*l*78.1%
Simplified78.1%
Final simplification79.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 (+ (* b c) (* -4.0 (* t a)))) (t_2 (* x (* i -4.0))))
(if (<= x -1.24e+95)
t_2
(if (<= x -1.3e-103)
t_1
(if (<= x -1.35e-147) (* -27.0 (* j k)) (if (<= x 2.8e+60) t_1 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 = (b * c) + (-4.0 * (t * a));
double t_2 = x * (i * -4.0);
double tmp;
if (x <= -1.24e+95) {
tmp = t_2;
} else if (x <= -1.3e-103) {
tmp = t_1;
} else if (x <= -1.35e-147) {
tmp = -27.0 * (j * k);
} else if (x <= 2.8e+60) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) + ((-4.0d0) * (t * a))
t_2 = x * (i * (-4.0d0))
if (x <= (-1.24d+95)) then
tmp = t_2
else if (x <= (-1.3d-103)) then
tmp = t_1
else if (x <= (-1.35d-147)) then
tmp = (-27.0d0) * (j * k)
else if (x <= 2.8d+60) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && 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) + (-4.0 * (t * a));
double t_2 = x * (i * -4.0);
double tmp;
if (x <= -1.24e+95) {
tmp = t_2;
} else if (x <= -1.3e-103) {
tmp = t_1;
} else if (x <= -1.35e-147) {
tmp = -27.0 * (j * k);
} else if (x <= 2.8e+60) {
tmp = t_1;
} 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 = (b * c) + (-4.0 * (t * a)) t_2 = x * (i * -4.0) tmp = 0 if x <= -1.24e+95: tmp = t_2 elif x <= -1.3e-103: tmp = t_1 elif x <= -1.35e-147: tmp = -27.0 * (j * k) elif x <= 2.8e+60: tmp = t_1 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(Float64(b * c) + Float64(-4.0 * Float64(t * a))) t_2 = Float64(x * Float64(i * -4.0)) tmp = 0.0 if (x <= -1.24e+95) tmp = t_2; elseif (x <= -1.3e-103) tmp = t_1; elseif (x <= -1.35e-147) tmp = Float64(-27.0 * Float64(j * k)); elseif (x <= 2.8e+60) tmp = t_1; 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 = (b * c) + (-4.0 * (t * a));
t_2 = x * (i * -4.0);
tmp = 0.0;
if (x <= -1.24e+95)
tmp = t_2;
elseif (x <= -1.3e-103)
tmp = t_1;
elseif (x <= -1.35e-147)
tmp = -27.0 * (j * k);
elseif (x <= 2.8e+60)
tmp = t_1;
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[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.24e+95], t$95$2, If[LessEqual[x, -1.3e-103], t$95$1, If[LessEqual[x, -1.35e-147], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e+60], t$95$1, 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 := b \cdot c + -4 \cdot \left(t \cdot a\right)\\
t_2 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;x \leq -1.24 \cdot 10^{+95}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-103}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-147}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -1.23999999999999997e95 or 2.8e60 < x Initial program 77.3%
Simplified83.9%
associate-*r*79.2%
distribute-rgt-out--77.3%
associate-+l-77.3%
associate-*r*81.0%
*-commutative81.0%
*-commutative81.0%
associate-*l*81.0%
fma-neg81.0%
Applied egg-rr81.0%
Taylor expanded in i around inf 50.7%
*-commutative50.7%
associate-*l*50.7%
metadata-eval50.7%
distribute-lft-neg-in50.7%
*-commutative50.7%
distribute-lft-neg-in50.7%
associate-*l*50.7%
distribute-rgt-neg-in50.7%
distribute-lft-neg-in50.7%
metadata-eval50.7%
Simplified50.7%
if -1.23999999999999997e95 < x < -1.29999999999999998e-103 or -1.35e-147 < x < 2.8e60Initial program 92.9%
Simplified91.7%
Taylor expanded in j around 0 68.3%
Taylor expanded in x around 0 50.7%
if -1.29999999999999998e-103 < x < -1.35e-147Initial program 99.8%
Simplified100.0%
Taylor expanded in j around inf 65.1%
Final simplification51.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
(let* ((t_1 (+ (* b c) (* j (* k -27.0)))) (t_2 (* x (* i -4.0))))
(if (<= x -3.8e+146)
t_2
(if (<= x 2.75e-235)
t_1
(if (<= x 2.8e-41)
(+ (* b c) (* -4.0 (* t a)))
(if (<= x 3.1e+60) t_1 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 = (b * c) + (j * (k * -27.0));
double t_2 = x * (i * -4.0);
double tmp;
if (x <= -3.8e+146) {
tmp = t_2;
} else if (x <= 2.75e-235) {
tmp = t_1;
} else if (x <= 2.8e-41) {
tmp = (b * c) + (-4.0 * (t * a));
} else if (x <= 3.1e+60) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) + (j * (k * (-27.0d0)))
t_2 = x * (i * (-4.0d0))
if (x <= (-3.8d+146)) then
tmp = t_2
else if (x <= 2.75d-235) then
tmp = t_1
else if (x <= 2.8d-41) then
tmp = (b * c) + ((-4.0d0) * (t * a))
else if (x <= 3.1d+60) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && 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) + (j * (k * -27.0));
double t_2 = x * (i * -4.0);
double tmp;
if (x <= -3.8e+146) {
tmp = t_2;
} else if (x <= 2.75e-235) {
tmp = t_1;
} else if (x <= 2.8e-41) {
tmp = (b * c) + (-4.0 * (t * a));
} else if (x <= 3.1e+60) {
tmp = t_1;
} 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 = (b * c) + (j * (k * -27.0)) t_2 = x * (i * -4.0) tmp = 0 if x <= -3.8e+146: tmp = t_2 elif x <= 2.75e-235: tmp = t_1 elif x <= 2.8e-41: tmp = (b * c) + (-4.0 * (t * a)) elif x <= 3.1e+60: tmp = t_1 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(Float64(b * c) + Float64(j * Float64(k * -27.0))) t_2 = Float64(x * Float64(i * -4.0)) tmp = 0.0 if (x <= -3.8e+146) tmp = t_2; elseif (x <= 2.75e-235) tmp = t_1; elseif (x <= 2.8e-41) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); elseif (x <= 3.1e+60) tmp = t_1; 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 = (b * c) + (j * (k * -27.0));
t_2 = x * (i * -4.0);
tmp = 0.0;
if (x <= -3.8e+146)
tmp = t_2;
elseif (x <= 2.75e-235)
tmp = t_1;
elseif (x <= 2.8e-41)
tmp = (b * c) + (-4.0 * (t * a));
elseif (x <= 3.1e+60)
tmp = t_1;
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[(N[(b * c), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+146], t$95$2, If[LessEqual[x, 2.75e-235], t$95$1, If[LessEqual[x, 2.8e-41], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1e+60], t$95$1, 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 := b \cdot c + j \cdot \left(k \cdot -27\right)\\
t_2 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+146}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{-235}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-41}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -3.79999999999999979e146 or 3.1000000000000001e60 < x Initial program 78.1%
Simplified85.3%
associate-*r*80.2%
distribute-rgt-out--78.1%
associate-+l-78.1%
associate-*r*82.2%
*-commutative82.2%
*-commutative82.2%
associate-*l*82.2%
fma-neg82.2%
Applied egg-rr82.2%
Taylor expanded in i around inf 51.8%
*-commutative51.8%
associate-*l*51.8%
metadata-eval51.8%
distribute-lft-neg-in51.8%
*-commutative51.8%
distribute-lft-neg-in51.8%
associate-*l*51.8%
distribute-rgt-neg-in51.8%
distribute-lft-neg-in51.8%
metadata-eval51.8%
Simplified51.8%
if -3.79999999999999979e146 < x < 2.7499999999999999e-235 or 2.8000000000000002e-41 < x < 3.1000000000000001e60Initial program 90.6%
Simplified91.5%
Taylor expanded in b around inf 58.9%
if 2.7499999999999999e-235 < x < 2.8000000000000002e-41Initial program 96.8%
Simplified88.0%
Taylor expanded in j around 0 67.0%
Taylor expanded in x around 0 50.4%
Final simplification55.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) (* j (* k -27.0)))) (t_2 (- (* b c) (* x (* 4.0 i)))))
(if (<= x -5.8e+55)
t_2
(if (<= x 3.7e-237)
t_1
(if (<= x 5.5e-39)
(+ (* b c) (* -4.0 (* t a)))
(if (<= x 2.2e+59) t_1 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 = (b * c) + (j * (k * -27.0));
double t_2 = (b * c) - (x * (4.0 * i));
double tmp;
if (x <= -5.8e+55) {
tmp = t_2;
} else if (x <= 3.7e-237) {
tmp = t_1;
} else if (x <= 5.5e-39) {
tmp = (b * c) + (-4.0 * (t * a));
} else if (x <= 2.2e+59) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) + (j * (k * (-27.0d0)))
t_2 = (b * c) - (x * (4.0d0 * i))
if (x <= (-5.8d+55)) then
tmp = t_2
else if (x <= 3.7d-237) then
tmp = t_1
else if (x <= 5.5d-39) then
tmp = (b * c) + ((-4.0d0) * (t * a))
else if (x <= 2.2d+59) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && 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) + (j * (k * -27.0));
double t_2 = (b * c) - (x * (4.0 * i));
double tmp;
if (x <= -5.8e+55) {
tmp = t_2;
} else if (x <= 3.7e-237) {
tmp = t_1;
} else if (x <= 5.5e-39) {
tmp = (b * c) + (-4.0 * (t * a));
} else if (x <= 2.2e+59) {
tmp = t_1;
} 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 = (b * c) + (j * (k * -27.0)) t_2 = (b * c) - (x * (4.0 * i)) tmp = 0 if x <= -5.8e+55: tmp = t_2 elif x <= 3.7e-237: tmp = t_1 elif x <= 5.5e-39: tmp = (b * c) + (-4.0 * (t * a)) elif x <= 2.2e+59: tmp = t_1 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(Float64(b * c) + Float64(j * Float64(k * -27.0))) t_2 = Float64(Float64(b * c) - Float64(x * Float64(4.0 * i))) tmp = 0.0 if (x <= -5.8e+55) tmp = t_2; elseif (x <= 3.7e-237) tmp = t_1; elseif (x <= 5.5e-39) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); elseif (x <= 2.2e+59) tmp = t_1; 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 = (b * c) + (j * (k * -27.0));
t_2 = (b * c) - (x * (4.0 * i));
tmp = 0.0;
if (x <= -5.8e+55)
tmp = t_2;
elseif (x <= 3.7e-237)
tmp = t_1;
elseif (x <= 5.5e-39)
tmp = (b * c) + (-4.0 * (t * a));
elseif (x <= 2.2e+59)
tmp = t_1;
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[(N[(b * c), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.8e+55], t$95$2, If[LessEqual[x, 3.7e-237], t$95$1, If[LessEqual[x, 5.5e-39], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e+59], t$95$1, 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 := b \cdot c + j \cdot \left(k \cdot -27\right)\\
t_2 := b \cdot c - x \cdot \left(4 \cdot i\right)\\
\mathbf{if}\;x \leq -5.8 \cdot 10^{+55}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-237}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-39}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -5.7999999999999997e55 or 2.2e59 < x Initial program 77.4%
Simplified83.4%
Taylor expanded in t around 0 65.0%
Taylor expanded in i around inf 56.7%
*-commutative56.7%
associate-*r*56.7%
*-commutative56.7%
associate-*l*56.7%
Simplified56.7%
if -5.7999999999999997e55 < x < 3.7000000000000001e-237 or 5.50000000000000018e-39 < x < 2.2e59Initial program 93.5%
Simplified94.5%
Taylor expanded in b around inf 59.6%
if 3.7000000000000001e-237 < x < 5.50000000000000018e-39Initial program 96.8%
Simplified88.0%
Taylor expanded in j around 0 67.0%
Taylor expanded in x around 0 50.4%
Final simplification57.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 (* x (* i -4.0))))
(if (<= x -1.35e+147)
t_1
(if (<= x 4e-166)
(* j (* k -27.0))
(if (<= x 1.12e+21)
(* b c)
(if (<= x 8.5e+62) (* -27.0 (* j k)) 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 * (i * -4.0);
double tmp;
if (x <= -1.35e+147) {
tmp = t_1;
} else if (x <= 4e-166) {
tmp = j * (k * -27.0);
} else if (x <= 1.12e+21) {
tmp = b * c;
} else if (x <= 8.5e+62) {
tmp = -27.0 * (j * k);
} 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) :: tmp
t_1 = x * (i * (-4.0d0))
if (x <= (-1.35d+147)) then
tmp = t_1
else if (x <= 4d-166) then
tmp = j * (k * (-27.0d0))
else if (x <= 1.12d+21) then
tmp = b * c
else if (x <= 8.5d+62) then
tmp = (-27.0d0) * (j * k)
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 = x * (i * -4.0);
double tmp;
if (x <= -1.35e+147) {
tmp = t_1;
} else if (x <= 4e-166) {
tmp = j * (k * -27.0);
} else if (x <= 1.12e+21) {
tmp = b * c;
} else if (x <= 8.5e+62) {
tmp = -27.0 * (j * k);
} 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 = x * (i * -4.0) tmp = 0 if x <= -1.35e+147: tmp = t_1 elif x <= 4e-166: tmp = j * (k * -27.0) elif x <= 1.12e+21: tmp = b * c elif x <= 8.5e+62: tmp = -27.0 * (j * k) 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(x * Float64(i * -4.0)) tmp = 0.0 if (x <= -1.35e+147) tmp = t_1; elseif (x <= 4e-166) tmp = Float64(j * Float64(k * -27.0)); elseif (x <= 1.12e+21) tmp = Float64(b * c); elseif (x <= 8.5e+62) tmp = Float64(-27.0 * Float64(j * k)); 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 = x * (i * -4.0);
tmp = 0.0;
if (x <= -1.35e+147)
tmp = t_1;
elseif (x <= 4e-166)
tmp = j * (k * -27.0);
elseif (x <= 1.12e+21)
tmp = b * c;
elseif (x <= 8.5e+62)
tmp = -27.0 * (j * k);
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[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.35e+147], t$95$1, If[LessEqual[x, 4e-166], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.12e+21], N[(b * c), $MachinePrecision], If[LessEqual[x, 8.5e+62], N[(-27.0 * N[(j * k), $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 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-166}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{+21}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+62}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.34999999999999999e147 or 8.4999999999999997e62 < x Initial program 78.1%
Simplified85.3%
associate-*r*80.2%
distribute-rgt-out--78.1%
associate-+l-78.1%
associate-*r*82.2%
*-commutative82.2%
*-commutative82.2%
associate-*l*82.2%
fma-neg82.2%
Applied egg-rr82.2%
Taylor expanded in i around inf 51.8%
*-commutative51.8%
associate-*l*51.8%
metadata-eval51.8%
distribute-lft-neg-in51.8%
*-commutative51.8%
distribute-lft-neg-in51.8%
associate-*l*51.8%
distribute-rgt-neg-in51.8%
distribute-lft-neg-in51.8%
metadata-eval51.8%
Simplified51.8%
if -1.34999999999999999e147 < x < 4.00000000000000016e-166Initial program 91.5%
Simplified90.1%
Taylor expanded in j around inf 39.8%
*-commutative39.8%
associate-*r*39.8%
*-commutative39.8%
Simplified39.8%
if 4.00000000000000016e-166 < x < 1.12e21Initial program 91.7%
Simplified91.9%
associate-*r*100.0%
distribute-rgt-out--91.7%
associate-+l-91.7%
associate-*r*83.6%
*-commutative83.6%
*-commutative83.6%
associate-*l*83.6%
fma-neg87.7%
Applied egg-rr87.7%
Taylor expanded in t around 0 91.9%
fma-def91.9%
cancel-sign-sub-inv91.9%
metadata-eval91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in b around inf 30.6%
if 1.12e21 < x < 8.4999999999999997e62Initial program 100.0%
Simplified100.0%
Taylor expanded in j around inf 48.7%
Final simplification43.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 (* x (* i -4.0))))
(if (<= x -3.7e+146)
t_1
(if (<= x 4.6e-164)
(* k (* j -27.0))
(if (<= x 3.3e+18)
(* b c)
(if (<= x 2.6e+63) (* -27.0 (* j k)) 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 * (i * -4.0);
double tmp;
if (x <= -3.7e+146) {
tmp = t_1;
} else if (x <= 4.6e-164) {
tmp = k * (j * -27.0);
} else if (x <= 3.3e+18) {
tmp = b * c;
} else if (x <= 2.6e+63) {
tmp = -27.0 * (j * k);
} 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) :: tmp
t_1 = x * (i * (-4.0d0))
if (x <= (-3.7d+146)) then
tmp = t_1
else if (x <= 4.6d-164) then
tmp = k * (j * (-27.0d0))
else if (x <= 3.3d+18) then
tmp = b * c
else if (x <= 2.6d+63) then
tmp = (-27.0d0) * (j * k)
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 = x * (i * -4.0);
double tmp;
if (x <= -3.7e+146) {
tmp = t_1;
} else if (x <= 4.6e-164) {
tmp = k * (j * -27.0);
} else if (x <= 3.3e+18) {
tmp = b * c;
} else if (x <= 2.6e+63) {
tmp = -27.0 * (j * k);
} 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 = x * (i * -4.0) tmp = 0 if x <= -3.7e+146: tmp = t_1 elif x <= 4.6e-164: tmp = k * (j * -27.0) elif x <= 3.3e+18: tmp = b * c elif x <= 2.6e+63: tmp = -27.0 * (j * k) 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(x * Float64(i * -4.0)) tmp = 0.0 if (x <= -3.7e+146) tmp = t_1; elseif (x <= 4.6e-164) tmp = Float64(k * Float64(j * -27.0)); elseif (x <= 3.3e+18) tmp = Float64(b * c); elseif (x <= 2.6e+63) tmp = Float64(-27.0 * Float64(j * k)); 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 = x * (i * -4.0);
tmp = 0.0;
if (x <= -3.7e+146)
tmp = t_1;
elseif (x <= 4.6e-164)
tmp = k * (j * -27.0);
elseif (x <= 3.3e+18)
tmp = b * c;
elseif (x <= 2.6e+63)
tmp = -27.0 * (j * k);
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[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.7e+146], t$95$1, If[LessEqual[x, 4.6e-164], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+18], N[(b * c), $MachinePrecision], If[LessEqual[x, 2.6e+63], N[(-27.0 * N[(j * k), $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 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{+146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-164}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+18}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+63}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.70000000000000004e146 or 2.6000000000000001e63 < x Initial program 78.1%
Simplified85.3%
associate-*r*80.2%
distribute-rgt-out--78.1%
associate-+l-78.1%
associate-*r*82.2%
*-commutative82.2%
*-commutative82.2%
associate-*l*82.2%
fma-neg82.2%
Applied egg-rr82.2%
Taylor expanded in i around inf 51.8%
*-commutative51.8%
associate-*l*51.8%
metadata-eval51.8%
distribute-lft-neg-in51.8%
*-commutative51.8%
distribute-lft-neg-in51.8%
associate-*l*51.8%
distribute-rgt-neg-in51.8%
distribute-lft-neg-in51.8%
metadata-eval51.8%
Simplified51.8%
if -3.70000000000000004e146 < x < 4.59999999999999971e-164Initial program 91.5%
Simplified90.1%
associate-*r*94.6%
distribute-rgt-out--91.5%
associate-+l-91.5%
associate-*r*87.8%
*-commutative87.8%
*-commutative87.8%
associate-*l*87.8%
fma-neg87.8%
Applied egg-rr87.8%
Taylor expanded in j around inf 39.8%
associate-*r*39.8%
*-commutative39.8%
Simplified39.8%
if 4.59999999999999971e-164 < x < 3.3e18Initial program 91.7%
Simplified91.9%
associate-*r*100.0%
distribute-rgt-out--91.7%
associate-+l-91.7%
associate-*r*83.6%
*-commutative83.6%
*-commutative83.6%
associate-*l*83.6%
fma-neg87.7%
Applied egg-rr87.7%
Taylor expanded in t around 0 91.9%
fma-def91.9%
cancel-sign-sub-inv91.9%
metadata-eval91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in b around inf 30.6%
if 3.3e18 < x < 2.6000000000000001e63Initial program 100.0%
Simplified100.0%
Taylor expanded in j around inf 48.7%
Final simplification43.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+232) (not (<= (* b c) 1.4e+64))) (* 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) <= -7.2e+232) || !((b * c) <= 1.4e+64)) {
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) <= (-7.2d+232)) .or. (.not. ((b * c) <= 1.4d+64))) 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) <= -7.2e+232) || !((b * c) <= 1.4e+64)) {
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) <= -7.2e+232) or not ((b * c) <= 1.4e+64): 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) <= -7.2e+232) || !(Float64(b * c) <= 1.4e+64)) 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) <= -7.2e+232) || ~(((b * c) <= 1.4e+64)))
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], -7.2e+232], N[Not[LessEqual[N[(b * c), $MachinePrecision], 1.4e+64]], $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 -7.2 \cdot 10^{+232} \lor \neg \left(b \cdot c \leq 1.4 \cdot 10^{+64}\right):\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -7.19999999999999986e232 or 1.40000000000000012e64 < (*.f64 b c) Initial program 84.9%
Simplified90.9%
associate-*r*89.5%
distribute-rgt-out--85.0%
associate-+l-85.0%
associate-*r*86.4%
*-commutative86.4%
*-commutative86.4%
associate-*l*86.4%
fma-neg87.9%
Applied egg-rr87.9%
Taylor expanded in t around 0 90.9%
fma-def95.5%
cancel-sign-sub-inv95.5%
metadata-eval95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in b around inf 52.6%
if -7.19999999999999986e232 < (*.f64 b c) < 1.40000000000000012e64Initial program 87.3%
Simplified88.0%
Taylor expanded in j around inf 29.2%
Final simplification35.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 (* 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 86.7%
Simplified88.7%
associate-*r*89.9%
distribute-rgt-out--86.7%
associate-+l-86.7%
associate-*r*85.6%
*-commutative85.6%
*-commutative85.6%
associate-*l*85.6%
fma-neg86.0%
Applied egg-rr86.0%
Taylor expanded in t around 0 88.7%
fma-def89.9%
cancel-sign-sub-inv89.9%
metadata-eval89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in b around inf 17.5%
Final simplification17.5%
(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 2024041
(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)))