
(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 20 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: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (* x (- (* 18.0 (* z (* y t))) (* 4.0 i)))))
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
t_1)
INFINITY)
(- (- (+ (* b c) t_2) (* 4.0 (* t a))) t_1)
(- t_2 t_1))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = x * ((18.0 * (z * (y * t))) - (4.0 * i));
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= ((double) INFINITY)) {
tmp = (((b * c) + t_2) - (4.0 * (t * a))) - t_1;
} else {
tmp = t_2 - t_1;
}
return tmp;
}
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = x * ((18.0 * (z * (y * t))) - (4.0 * i));
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= Double.POSITIVE_INFINITY) {
tmp = (((b * c) + t_2) - (4.0 * (t * a))) - t_1;
} else {
tmp = t_2 - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = x * ((18.0 * (z * (y * t))) - (4.0 * i)) tmp = 0 if ((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= math.inf: tmp = (((b * c) + t_2) - (4.0 * (t * a))) - t_1 else: tmp = t_2 - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))) 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)) - t_1) <= Inf) tmp = Float64(Float64(Float64(Float64(b * c) + t_2) - Float64(4.0 * Float64(t * a))) - t_1); else tmp = Float64(t_2 - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = x * ((18.0 * (z * (y * t))) - (4.0 * i));
tmp = 0.0;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= Inf)
tmp = (((b * c) + t_2) - (4.0 * (t * a))) - t_1;
else
tmp = t_2 - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, 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] - t$95$1), $MachinePrecision], Infinity], N[(N[(N[(N[(b * c), $MachinePrecision] + t$95$2), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$2 - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right)\\
\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) - t_1 \leq \infty:\\
\;\;\;\;\left(\left(b \cdot c + t_2\right) - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 - t_1\\
\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 94.4%
Taylor expanded in x around 0 95.3%
pow195.3%
Applied egg-rr95.3%
unpow195.3%
associate-*r*98.6%
Simplified98.6%
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%
Taylor expanded in x around 0 43.8%
Taylor expanded in x around inf 59.6%
pow143.8%
Applied egg-rr59.6%
unpow143.8%
associate-*r*46.9%
Simplified62.8%
Final simplification94.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= x -27000000.0)
(- (+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))) t_1)
(if (<= x 1.45e+156)
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(- (* x (- (* 18.0 (* z (* y t))) (* 4.0 i))) t_1)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (x <= -27000000.0) {
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - t_1;
} else if (x <= 1.45e+156) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (x <= (-27000000.0d0)) then
tmp = ((b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))) - t_1
else if (x <= 1.45d+156) then
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else
tmp = (x * ((18.0d0 * (z * (y * t))) - (4.0d0 * i))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (x <= -27000000.0) {
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - t_1;
} else if (x <= 1.45e+156) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if x <= -27000000.0: tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - t_1 elif x <= 1.45e+156: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (x <= -27000000.0) tmp = Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))) - t_1); elseif (x <= 1.45e+156) 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)))); else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (x <= -27000000.0)
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - t_1;
elseif (x <= 1.45e+156)
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[x, -27000000.0], N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 1.45e+156], 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], N[(N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -27000000:\\
\;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - t_1\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+156}:\\
\;\;\;\;\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)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right) - t_1\\
\end{array}
\end{array}
if x < -2.7e7Initial program 71.2%
Taylor expanded in x around 0 87.0%
Taylor expanded in a around 0 87.6%
if -2.7e7 < x < 1.45000000000000005e156Initial program 92.8%
Simplified92.2%
if 1.45000000000000005e156 < x Initial program 61.5%
Taylor expanded in x around 0 83.3%
Taylor expanded in x around inf 79.0%
pow183.3%
Applied egg-rr79.0%
unpow183.3%
associate-*r*86.0%
Simplified81.7%
Final simplification89.5%
NOTE: 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 (<= (* b c) -2.3e+63)
(* b c)
(if (<= (* b c) -6.2e-148)
(* j (* k -27.0))
(if (<= (* b c) -6.4e-282)
t_1
(if (<= (* b c) 2.2e-109)
(* (* j k) -27.0)
(if (<= (* b c) 7900.0)
(* t (* 18.0 (* z (* x y))))
(if (<= (* b c) 1.05e+42) t_1 (* b c)))))))))assert(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 ((b * c) <= -2.3e+63) {
tmp = b * c;
} else if ((b * c) <= -6.2e-148) {
tmp = j * (k * -27.0);
} else if ((b * c) <= -6.4e-282) {
tmp = t_1;
} else if ((b * c) <= 2.2e-109) {
tmp = (j * k) * -27.0;
} else if ((b * c) <= 7900.0) {
tmp = t * (18.0 * (z * (x * y)));
} else if ((b * c) <= 1.05e+42) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: 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 ((b * c) <= (-2.3d+63)) then
tmp = b * c
else if ((b * c) <= (-6.2d-148)) then
tmp = j * (k * (-27.0d0))
else if ((b * c) <= (-6.4d-282)) then
tmp = t_1
else if ((b * c) <= 2.2d-109) then
tmp = (j * k) * (-27.0d0)
else if ((b * c) <= 7900.0d0) then
tmp = t * (18.0d0 * (z * (x * y)))
else if ((b * c) <= 1.05d+42) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert 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 ((b * c) <= -2.3e+63) {
tmp = b * c;
} else if ((b * c) <= -6.2e-148) {
tmp = j * (k * -27.0);
} else if ((b * c) <= -6.4e-282) {
tmp = t_1;
} else if ((b * c) <= 2.2e-109) {
tmp = (j * k) * -27.0;
} else if ((b * c) <= 7900.0) {
tmp = t * (18.0 * (z * (x * y)));
} else if ((b * c) <= 1.05e+42) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (i * -4.0) tmp = 0 if (b * c) <= -2.3e+63: tmp = b * c elif (b * c) <= -6.2e-148: tmp = j * (k * -27.0) elif (b * c) <= -6.4e-282: tmp = t_1 elif (b * c) <= 2.2e-109: tmp = (j * k) * -27.0 elif (b * c) <= 7900.0: tmp = t * (18.0 * (z * (x * y))) elif (b * c) <= 1.05e+42: tmp = t_1 else: tmp = b * c return tmp
j, k = sort([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 (Float64(b * c) <= -2.3e+63) tmp = Float64(b * c); elseif (Float64(b * c) <= -6.2e-148) tmp = Float64(j * Float64(k * -27.0)); elseif (Float64(b * c) <= -6.4e-282) tmp = t_1; elseif (Float64(b * c) <= 2.2e-109) tmp = Float64(Float64(j * k) * -27.0); elseif (Float64(b * c) <= 7900.0) tmp = Float64(t * Float64(18.0 * Float64(z * Float64(x * y)))); elseif (Float64(b * c) <= 1.05e+42) tmp = t_1; else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([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 ((b * c) <= -2.3e+63)
tmp = b * c;
elseif ((b * c) <= -6.2e-148)
tmp = j * (k * -27.0);
elseif ((b * c) <= -6.4e-282)
tmp = t_1;
elseif ((b * c) <= 2.2e-109)
tmp = (j * k) * -27.0;
elseif ((b * c) <= 7900.0)
tmp = t * (18.0 * (z * (x * y)));
elseif ((b * c) <= 1.05e+42)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: 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[N[(b * c), $MachinePrecision], -2.3e+63], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -6.2e-148], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -6.4e-282], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 2.2e-109], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 7900.0], N[(t * N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.05e+42], t$95$1, N[(b * c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;b \cdot c \leq -2.3 \cdot 10^{+63}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -6.2 \cdot 10^{-148}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;b \cdot c \leq -6.4 \cdot 10^{-282}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 2.2 \cdot 10^{-109}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\mathbf{elif}\;b \cdot c \leq 7900:\\
\;\;\;\;t \cdot \left(18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 1.05 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -2.29999999999999993e63 or 1.04999999999999998e42 < (*.f64 b c) Initial program 76.9%
Simplified77.9%
Taylor expanded in b around inf 54.7%
if -2.29999999999999993e63 < (*.f64 b c) < -6.2000000000000003e-148Initial program 77.7%
Simplified87.8%
Taylor expanded in j around inf 39.1%
*-commutative39.1%
associate-*l*39.1%
Simplified39.1%
if -6.2000000000000003e-148 < (*.f64 b c) < -6.39999999999999966e-282 or 7900 < (*.f64 b c) < 1.04999999999999998e42Initial program 88.9%
Simplified89.0%
Taylor expanded in i around inf 49.2%
associate-*r*49.2%
*-commutative49.2%
Simplified49.2%
if -6.39999999999999966e-282 < (*.f64 b c) < 2.1999999999999999e-109Initial program 90.8%
Simplified90.8%
Taylor expanded in j around inf 40.1%
*-commutative40.1%
Simplified40.1%
if 2.1999999999999999e-109 < (*.f64 b c) < 7900Initial program 94.8%
Taylor expanded in x around 0 90.2%
Taylor expanded in a around 0 80.4%
Taylor expanded in t around inf 46.6%
*-commutative46.6%
associate-*l*46.6%
associate-*r*46.7%
*-commutative46.7%
Simplified46.7%
Final simplification47.4%
NOTE: 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) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))) (* 4.0 (* t a))) (* (* j 27.0) k)))
assert(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) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
NOTE: 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) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
end function
assert 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 * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return (((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - ((j * 27.0) * k)
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)) end
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = (((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - ((j * 27.0) * k);
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\left(\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k
\end{array}
Initial program 82.6%
Taylor expanded in x around 0 88.8%
Final simplification88.8%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)) (t_2 (- (* b c) t_1)))
(if (<= t_1 -2e+120)
t_2
(if (<= t_1 -5e-30)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= t_1 0.01) (- (* b c) (* 4.0 (* t a))) t_2)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) - t_1;
double tmp;
if (t_1 <= -2e+120) {
tmp = t_2;
} else if (t_1 <= -5e-30) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (t_1 <= 0.01) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (b * c) - t_1
if (t_1 <= (-2d+120)) then
tmp = t_2
else if (t_1 <= (-5d-30)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (t_1 <= 0.01d0) then
tmp = (b * c) - (4.0d0 * (t * a))
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) - t_1;
double tmp;
if (t_1 <= -2e+120) {
tmp = t_2;
} else if (t_1 <= -5e-30) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (t_1 <= 0.01) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (b * c) - t_1 tmp = 0 if t_1 <= -2e+120: tmp = t_2 elif t_1 <= -5e-30: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif t_1 <= 0.01: tmp = (b * c) - (4.0 * (t * a)) else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(b * c) - t_1) tmp = 0.0 if (t_1 <= -2e+120) tmp = t_2; elseif (t_1 <= -5e-30) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (t_1 <= 0.01) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (b * c) - t_1;
tmp = 0.0;
if (t_1 <= -2e+120)
tmp = t_2;
elseif (t_1 <= -5e-30)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (t_1 <= 0.01)
tmp = (b * c) - (4.0 * (t * a));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+120], t$95$2, If[LessEqual[t$95$1, -5e-30], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.01], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := b \cdot c - t_1\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+120}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-30}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;t_1 \leq 0.01:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -2e120 or 0.0100000000000000002 < (*.f64 (*.f64 j 27) k) Initial program 80.0%
Taylor expanded in x around 0 84.8%
Taylor expanded in b around inf 68.7%
if -2e120 < (*.f64 (*.f64 j 27) k) < -4.99999999999999972e-30Initial program 92.2%
Simplified92.2%
Taylor expanded in x around inf 59.3%
if -4.99999999999999972e-30 < (*.f64 (*.f64 j 27) k) < 0.0100000000000000002Initial program 82.9%
Taylor expanded in x around 0 56.8%
sub-neg56.8%
associate-*r*56.8%
associate-*r*56.8%
Applied egg-rr56.8%
Taylor expanded in j around 0 55.0%
Final simplification61.0%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (or (<= t_1 -2e+14) (not (<= t_1 0.01)))
(- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* j k))))
(- (+ (* b c) (* t (* a -4.0))) (* x (* 4.0 i))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if ((t_1 <= -2e+14) || !(t_1 <= 0.01)) {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
} else {
tmp = ((b * c) + (t * (a * -4.0))) - (x * (4.0 * i));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if ((t_1 <= (-2d+14)) .or. (.not. (t_1 <= 0.01d0))) then
tmp = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (j * k)))
else
tmp = ((b * c) + (t * (a * (-4.0d0)))) - (x * (4.0d0 * i))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if ((t_1 <= -2e+14) || !(t_1 <= 0.01)) {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
} else {
tmp = ((b * c) + (t * (a * -4.0))) - (x * (4.0 * i));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if (t_1 <= -2e+14) or not (t_1 <= 0.01): tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k))) else: tmp = ((b * c) + (t * (a * -4.0))) - (x * (4.0 * i)) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if ((t_1 <= -2e+14) || !(t_1 <= 0.01)) tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(j * k)))); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(a * -4.0))) - Float64(x * Float64(4.0 * i))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if ((t_1 <= -2e+14) || ~((t_1 <= 0.01)))
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
else
tmp = ((b * c) + (t * (a * -4.0))) - (x * (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+14], N[Not[LessEqual[t$95$1, 0.01]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+14} \lor \neg \left(t_1 \leq 0.01\right):\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(a \cdot -4\right)\right) - x \cdot \left(4 \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -2e14 or 0.0100000000000000002 < (*.f64 (*.f64 j 27) k) Initial program 81.7%
Simplified85.9%
Taylor expanded in t around 0 72.8%
if -2e14 < (*.f64 (*.f64 j 27) k) < 0.0100000000000000002Initial program 83.5%
Simplified85.0%
Taylor expanded in x around 0 76.8%
*-commutative76.8%
*-commutative76.8%
associate-*r*76.8%
Simplified76.8%
Taylor expanded in x around inf 74.6%
associate-*r*74.6%
*-commutative74.6%
Simplified74.6%
Final simplification73.7%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -5.7e-10) (not (<= x 1.2e+73))) (- (+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))) (* (* j 27.0) k)) (- (+ (* b c) (* t (* a -4.0))) (+ (* x (* 4.0 i)) (* j (* 27.0 k))))))
assert(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 <= -5.7e-10) || !(x <= 1.2e+73)) {
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-5.7d-10)) .or. (.not. (x <= 1.2d+73))) then
tmp = ((b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))) - ((j * 27.0d0) * k)
else
tmp = ((b * c) + (t * (a * (-4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -5.7e-10) || !(x <= 1.2e+73)) {
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - ((j * 27.0) * k);
} else {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -5.7e-10) or not (x <= 1.2e+73): tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - ((j * 27.0) * k) else: tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k))) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -5.7e-10) || !(x <= 1.2e+73)) tmp = Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(a * -4.0))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -5.7e-10) || ~((x <= 1.2e+73)))
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - ((j * 27.0) * k);
else
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -5.7e-10], N[Not[LessEqual[x, 1.2e+73]], $MachinePrecision]], N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(a * -4.0), $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}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.7 \cdot 10^{-10} \lor \neg \left(x \leq 1.2 \cdot 10^{+73}\right):\\
\;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(a \cdot -4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\end{array}
\end{array}
if x < -5.69999999999999996e-10 or 1.20000000000000001e73 < x Initial program 70.8%
Taylor expanded in x around 0 87.3%
Taylor expanded in a around 0 85.5%
if -5.69999999999999996e-10 < x < 1.20000000000000001e73Initial program 93.9%
Simplified92.5%
Taylor expanded in x around 0 91.0%
*-commutative91.0%
*-commutative91.0%
associate-*r*91.0%
Simplified91.0%
Final simplification88.3%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (- (* x (- (* 18.0 (* z (* y t))) (* 4.0 i))) t_1)))
(if (<= x -3.5e+49)
t_2
(if (<= x -5.4e-108)
(-
(+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(* 4.0 (* x i)))
(if (<= x 6.8e+74)
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) t_1)
t_2)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
double tmp;
if (x <= -3.5e+49) {
tmp = t_2;
} else if (x <= -5.4e-108) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i));
} else if (x <= 6.8e+74) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (x * ((18.0d0 * (z * (y * t))) - (4.0d0 * i))) - t_1
if (x <= (-3.5d+49)) then
tmp = t_2
else if (x <= (-5.4d-108)) then
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - (4.0d0 * (x * i))
else if (x <= 6.8d+74) then
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - t_1
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
double tmp;
if (x <= -3.5e+49) {
tmp = t_2;
} else if (x <= -5.4e-108) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i));
} else if (x <= 6.8e+74) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1 tmp = 0 if x <= -3.5e+49: tmp = t_2 elif x <= -5.4e-108: tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i)) elif x <= 6.8e+74: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1 else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))) - t_1) tmp = 0.0 if (x <= -3.5e+49) tmp = t_2; elseif (x <= -5.4e-108) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) - Float64(4.0 * Float64(x * i))); elseif (x <= 6.8e+74) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - t_1); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
tmp = 0.0;
if (x <= -3.5e+49)
tmp = t_2;
elseif (x <= -5.4e-108)
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i));
elseif (x <= 6.8e+74)
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[x, -3.5e+49], t$95$2, If[LessEqual[x, -5.4e-108], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.8e+74], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right) - t_1\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+49}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{-108}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+74}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.49999999999999975e49 or 6.7999999999999998e74 < x Initial program 71.6%
Taylor expanded in x around 0 89.8%
Taylor expanded in x around inf 78.1%
pow189.8%
Applied egg-rr78.1%
unpow189.8%
associate-*r*90.6%
Simplified78.9%
if -3.49999999999999975e49 < x < -5.4000000000000001e-108Initial program 82.5%
Simplified82.5%
Taylor expanded in j around 0 80.3%
if -5.4000000000000001e-108 < x < 6.7999999999999998e74Initial program 93.6%
Taylor expanded in y around 0 92.7%
distribute-lft-out92.7%
*-commutative92.7%
*-commutative92.7%
Simplified92.7%
Final simplification85.0%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))) (t_2 (* x (* i -4.0))))
(if (<= (* b c) -1.95e+63)
(* b c)
(if (<= (* b c) -2.7e-147)
t_1
(if (<= (* b c) -2.9e-275)
t_2
(if (<= (* b c) 2.9e-68)
t_1
(if (<= (* b c) 9.5e+41) t_2 (* b c))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = x * (i * -4.0);
double tmp;
if ((b * c) <= -1.95e+63) {
tmp = b * c;
} else if ((b * c) <= -2.7e-147) {
tmp = t_1;
} else if ((b * c) <= -2.9e-275) {
tmp = t_2;
} else if ((b * c) <= 2.9e-68) {
tmp = t_1;
} else if ((b * c) <= 9.5e+41) {
tmp = t_2;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = x * (i * (-4.0d0))
if ((b * c) <= (-1.95d+63)) then
tmp = b * c
else if ((b * c) <= (-2.7d-147)) then
tmp = t_1
else if ((b * c) <= (-2.9d-275)) then
tmp = t_2
else if ((b * c) <= 2.9d-68) then
tmp = t_1
else if ((b * c) <= 9.5d+41) then
tmp = t_2
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double t_2 = x * (i * -4.0);
double tmp;
if ((b * c) <= -1.95e+63) {
tmp = b * c;
} else if ((b * c) <= -2.7e-147) {
tmp = t_1;
} else if ((b * c) <= -2.9e-275) {
tmp = t_2;
} else if ((b * c) <= 2.9e-68) {
tmp = t_1;
} else if ((b * c) <= 9.5e+41) {
tmp = t_2;
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = x * (i * -4.0) tmp = 0 if (b * c) <= -1.95e+63: tmp = b * c elif (b * c) <= -2.7e-147: tmp = t_1 elif (b * c) <= -2.9e-275: tmp = t_2 elif (b * c) <= 2.9e-68: tmp = t_1 elif (b * c) <= 9.5e+41: tmp = t_2 else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(x * Float64(i * -4.0)) tmp = 0.0 if (Float64(b * c) <= -1.95e+63) tmp = Float64(b * c); elseif (Float64(b * c) <= -2.7e-147) tmp = t_1; elseif (Float64(b * c) <= -2.9e-275) tmp = t_2; elseif (Float64(b * c) <= 2.9e-68) tmp = t_1; elseif (Float64(b * c) <= 9.5e+41) tmp = t_2; else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = x * (i * -4.0);
tmp = 0.0;
if ((b * c) <= -1.95e+63)
tmp = b * c;
elseif ((b * c) <= -2.7e-147)
tmp = t_1;
elseif ((b * c) <= -2.9e-275)
tmp = t_2;
elseif ((b * c) <= 2.9e-68)
tmp = t_1;
elseif ((b * c) <= 9.5e+41)
tmp = t_2;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1.95e+63], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -2.7e-147], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -2.9e-275], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 2.9e-68], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 9.5e+41], t$95$2, N[(b * c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;b \cdot c \leq -1.95 \cdot 10^{+63}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -2.7 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -2.9 \cdot 10^{-275}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot c \leq 2.9 \cdot 10^{-68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 9.5 \cdot 10^{+41}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.95e63 or 9.4999999999999996e41 < (*.f64 b c) Initial program 76.9%
Simplified77.9%
Taylor expanded in b around inf 54.7%
if -1.95e63 < (*.f64 b c) < -2.6999999999999999e-147 or -2.9e-275 < (*.f64 b c) < 2.9e-68Initial program 85.5%
Simplified90.0%
Taylor expanded in j around inf 38.0%
*-commutative38.0%
associate-*l*38.1%
Simplified38.1%
if -2.6999999999999999e-147 < (*.f64 b c) < -2.9e-275 or 2.9e-68 < (*.f64 b c) < 9.4999999999999996e41Initial program 89.9%
Simplified92.6%
Taylor expanded in i around inf 43.7%
associate-*r*43.7%
*-commutative43.7%
Simplified43.7%
Final simplification45.8%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))))))
(if (<= x -3.05e+203)
t_2
(if (<= x -5.2e+68)
(- (* 18.0 (* x (* z (* y t)))) t_1)
(if (or (<= x -1.85e-75) (not (<= x 4.3e+73)))
t_2
(- (- (* b c) (* 4.0 (* t a))) t_1))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
double tmp;
if (x <= -3.05e+203) {
tmp = t_2;
} else if (x <= -5.2e+68) {
tmp = (18.0 * (x * (z * (y * t)))) - t_1;
} else if ((x <= -1.85e-75) || !(x <= 4.3e+73)) {
tmp = t_2;
} else {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))
if (x <= (-3.05d+203)) then
tmp = t_2
else if (x <= (-5.2d+68)) then
tmp = (18.0d0 * (x * (z * (y * t)))) - t_1
else if ((x <= (-1.85d-75)) .or. (.not. (x <= 4.3d+73))) then
tmp = t_2
else
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
double tmp;
if (x <= -3.05e+203) {
tmp = t_2;
} else if (x <= -5.2e+68) {
tmp = (18.0 * (x * (z * (y * t)))) - t_1;
} else if ((x <= -1.85e-75) || !(x <= 4.3e+73)) {
tmp = t_2;
} else {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i))) tmp = 0 if x <= -3.05e+203: tmp = t_2 elif x <= -5.2e+68: tmp = (18.0 * (x * (z * (y * t)))) - t_1 elif (x <= -1.85e-75) or not (x <= 4.3e+73): tmp = t_2 else: tmp = ((b * c) - (4.0 * (t * a))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))) tmp = 0.0 if (x <= -3.05e+203) tmp = t_2; elseif (x <= -5.2e+68) tmp = Float64(Float64(18.0 * Float64(x * Float64(z * Float64(y * t)))) - t_1); elseif ((x <= -1.85e-75) || !(x <= 4.3e+73)) tmp = t_2; else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
tmp = 0.0;
if (x <= -3.05e+203)
tmp = t_2;
elseif (x <= -5.2e+68)
tmp = (18.0 * (x * (z * (y * t)))) - t_1;
elseif ((x <= -1.85e-75) || ~((x <= 4.3e+73)))
tmp = t_2;
else
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.05e+203], t$95$2, If[LessEqual[x, -5.2e+68], N[(N[(18.0 * N[(x * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[Or[LessEqual[x, -1.85e-75], N[Not[LessEqual[x, 4.3e+73]], $MachinePrecision]], t$95$2, N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -3.05 \cdot 10^{+203}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{+68}:\\
\;\;\;\;18 \cdot \left(x \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) - t_1\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-75} \lor \neg \left(x \leq 4.3 \cdot 10^{+73}\right):\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\end{array}
\end{array}
if x < -3.05000000000000007e203 or -5.1999999999999996e68 < x < -1.85000000000000012e-75 or 4.30000000000000013e73 < x Initial program 74.0%
Taylor expanded in x around 0 87.8%
Taylor expanded in a around 0 82.6%
Taylor expanded in j around 0 78.9%
if -3.05000000000000007e203 < x < -5.1999999999999996e68Initial program 74.0%
Taylor expanded in x around 0 90.2%
Taylor expanded in y around inf 70.8%
associate-*r*70.8%
Simplified70.8%
Taylor expanded in t around 0 70.8%
*-commutative70.8%
associate-*l*76.9%
*-commutative76.9%
associate-*r*79.8%
*-commutative79.8%
Simplified79.8%
if -1.85000000000000012e-75 < x < 4.30000000000000013e73Initial program 93.8%
Taylor expanded in x around 0 81.2%
Final simplification80.0%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (or (<= x -2.15e-10) (not (<= x 5.5e+24)))
(- (* x (- (* 18.0 (* z (* y t))) (* 4.0 i))) t_1)
(- (- (* b c) (* 4.0 (* t a))) t_1))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if ((x <= -2.15e-10) || !(x <= 5.5e+24)) {
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
} else {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if ((x <= (-2.15d-10)) .or. (.not. (x <= 5.5d+24))) then
tmp = (x * ((18.0d0 * (z * (y * t))) - (4.0d0 * i))) - t_1
else
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if ((x <= -2.15e-10) || !(x <= 5.5e+24)) {
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
} else {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if (x <= -2.15e-10) or not (x <= 5.5e+24): tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1 else: tmp = ((b * c) - (4.0 * (t * a))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if ((x <= -2.15e-10) || !(x <= 5.5e+24)) tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))) - t_1); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if ((x <= -2.15e-10) || ~((x <= 5.5e+24)))
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
else
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[Or[LessEqual[x, -2.15e-10], N[Not[LessEqual[x, 5.5e+24]], $MachinePrecision]], N[(N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{-10} \lor \neg \left(x \leq 5.5 \cdot 10^{+24}\right):\\
\;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\end{array}
\end{array}
if x < -2.15000000000000007e-10 or 5.5000000000000002e24 < x Initial program 71.0%
Taylor expanded in x around 0 86.2%
Taylor expanded in x around inf 73.4%
pow186.2%
Applied egg-rr73.4%
unpow186.2%
associate-*r*89.6%
Simplified76.8%
if -2.15000000000000007e-10 < x < 5.5000000000000002e24Initial program 95.8%
Taylor expanded in x around 0 81.9%
Final simplification79.2%
NOTE: 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 (* t (* y z))) (* 4.0 i))))
(t_2 (* (* j 27.0) k)))
(if (<= x -1.92e-75)
(+ (* b c) t_1)
(if (<= x 6e+24) (- (- (* b c) (* 4.0 (* t a))) t_2) (- t_1 t_2)))))assert(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 * (t * (y * z))) - (4.0 * i));
double t_2 = (j * 27.0) * k;
double tmp;
if (x <= -1.92e-75) {
tmp = (b * c) + t_1;
} else if (x <= 6e+24) {
tmp = ((b * c) - (4.0 * (t * a))) - t_2;
} else {
tmp = t_1 - t_2;
}
return tmp;
}
NOTE: 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 = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
t_2 = (j * 27.0d0) * k
if (x <= (-1.92d-75)) then
tmp = (b * c) + t_1
else if (x <= 6d+24) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_2
else
tmp = t_1 - t_2
end if
code = tmp
end function
assert 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 * (t * (y * z))) - (4.0 * i));
double t_2 = (j * 27.0) * k;
double tmp;
if (x <= -1.92e-75) {
tmp = (b * c) + t_1;
} else if (x <= 6e+24) {
tmp = ((b * c) - (4.0 * (t * a))) - t_2;
} else {
tmp = t_1 - t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i)) t_2 = (j * 27.0) * k tmp = 0 if x <= -1.92e-75: tmp = (b * c) + t_1 elif x <= 6e+24: tmp = ((b * c) - (4.0 * (t * a))) - t_2 else: tmp = t_1 - t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (x <= -1.92e-75) tmp = Float64(Float64(b * c) + t_1); elseif (x <= 6e+24) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_2); else tmp = Float64(t_1 - t_2); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (x <= -1.92e-75)
tmp = (b * c) + t_1;
elseif (x <= 6e+24)
tmp = ((b * c) - (4.0 * (t * a))) - t_2;
else
tmp = t_1 - t_2;
end
tmp_2 = tmp;
end
NOTE: 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[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[x, -1.92e-75], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, 6e+24], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], N[(t$95$1 - t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -1.92 \cdot 10^{-75}:\\
\;\;\;\;b \cdot c + t_1\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+24}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 - t_2\\
\end{array}
\end{array}
if x < -1.92000000000000011e-75Initial program 76.0%
Taylor expanded in x around 0 87.9%
Taylor expanded in a around 0 85.5%
Taylor expanded in j around 0 73.6%
if -1.92000000000000011e-75 < x < 5.9999999999999999e24Initial program 95.1%
Taylor expanded in x around 0 83.4%
if 5.9999999999999999e24 < x Initial program 72.2%
Taylor expanded in x around 0 87.5%
Taylor expanded in x around inf 76.7%
Final simplification78.3%
NOTE: 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 4.3e+74) (- (+ (* b c) (* t (* a -4.0))) (+ (* x (* 4.0 i)) (* j (* 27.0 k)))) (- (* x (- (* 18.0 (* z (* y t))) (* 4.0 i))) (* (* j 27.0) k))))
assert(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 <= 4.3e+74) {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= 4.3d+74) then
tmp = ((b * c) + (t * (a * (-4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else
tmp = (x * ((18.0d0 * (z * (y * t))) - (4.0d0 * i))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 4.3e+74) {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - ((j * 27.0) * k);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= 4.3e+74: tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - ((j * 27.0) * k) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= 4.3e+74) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(a * -4.0))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))) - Float64(Float64(j * 27.0) * k)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= 4.3e+74)
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, 4.3e+74], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.3 \cdot 10^{+74}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(a \cdot -4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < 4.30000000000000001e74Initial program 85.9%
Simplified87.5%
Taylor expanded in x around 0 83.9%
*-commutative83.9%
*-commutative83.9%
associate-*r*83.9%
Simplified83.9%
if 4.30000000000000001e74 < x Initial program 70.1%
Taylor expanded in x around 0 88.6%
Taylor expanded in x around inf 79.0%
pow188.6%
Applied egg-rr79.0%
unpow188.6%
associate-*r*90.4%
Simplified80.8%
Final simplification83.3%
NOTE: 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 (* t (* y z))) (* 4.0 i)))))
(if (<= t -4.5e+230)
t_1
(if (<= t -3.3e+124)
(- (* t (* a -4.0)) (* (* j 27.0) k))
(if (<= t 1.36e+84)
(- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* j k))))
t_1)))))assert(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 * (t * (y * z))) - (4.0 * i));
double tmp;
if (t <= -4.5e+230) {
tmp = t_1;
} else if (t <= -3.3e+124) {
tmp = (t * (a * -4.0)) - ((j * 27.0) * k);
} else if (t <= 1.36e+84) {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: 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 * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
if (t <= (-4.5d+230)) then
tmp = t_1
else if (t <= (-3.3d+124)) then
tmp = (t * (a * (-4.0d0))) - ((j * 27.0d0) * k)
else if (t <= 1.36d+84) then
tmp = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (j * k)))
else
tmp = t_1
end if
code = tmp
end function
assert 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 * (t * (y * z))) - (4.0 * i));
double tmp;
if (t <= -4.5e+230) {
tmp = t_1;
} else if (t <= -3.3e+124) {
tmp = (t * (a * -4.0)) - ((j * 27.0) * k);
} else if (t <= 1.36e+84) {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i)) tmp = 0 if t <= -4.5e+230: tmp = t_1 elif t <= -3.3e+124: tmp = (t * (a * -4.0)) - ((j * 27.0) * k) elif t <= 1.36e+84: tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k))) else: tmp = t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) tmp = 0.0 if (t <= -4.5e+230) tmp = t_1; elseif (t <= -3.3e+124) tmp = Float64(Float64(t * Float64(a * -4.0)) - Float64(Float64(j * 27.0) * k)); elseif (t <= 1.36e+84) tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(j * k)))); else tmp = t_1; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
tmp = 0.0;
if (t <= -4.5e+230)
tmp = t_1;
elseif (t <= -3.3e+124)
tmp = (t * (a * -4.0)) - ((j * 27.0) * k);
elseif (t <= 1.36e+84)
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: 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[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+230], t$95$1, If[LessEqual[t, -3.3e+124], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.36e+84], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+230}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.3 \cdot 10^{+124}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;t \leq 1.36 \cdot 10^{+84}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.4999999999999999e230 or 1.3599999999999999e84 < t Initial program 76.5%
Simplified83.4%
Taylor expanded in x around inf 58.0%
if -4.4999999999999999e230 < t < -3.30000000000000015e124Initial program 94.3%
Taylor expanded in x around 0 94.3%
Taylor expanded in a around inf 88.9%
*-commutative88.9%
*-commutative88.9%
associate-*r*88.9%
Simplified88.9%
if -3.30000000000000015e124 < t < 1.3599999999999999e84Initial program 83.5%
Simplified85.2%
Taylor expanded in t around 0 74.6%
Final simplification71.7%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (or (<= t_1 -2e+14) (not (<= t_1 0.01)))
(- (* b c) t_1)
(- (* b c) (* 4.0 (* t a))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if ((t_1 <= -2e+14) || !(t_1 <= 0.01)) {
tmp = (b * c) - t_1;
} else {
tmp = (b * c) - (4.0 * (t * a));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if ((t_1 <= (-2d+14)) .or. (.not. (t_1 <= 0.01d0))) then
tmp = (b * c) - t_1
else
tmp = (b * c) - (4.0d0 * (t * a))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if ((t_1 <= -2e+14) || !(t_1 <= 0.01)) {
tmp = (b * c) - t_1;
} else {
tmp = (b * c) - (4.0 * (t * a));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if (t_1 <= -2e+14) or not (t_1 <= 0.01): tmp = (b * c) - t_1 else: tmp = (b * c) - (4.0 * (t * a)) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if ((t_1 <= -2e+14) || !(t_1 <= 0.01)) tmp = Float64(Float64(b * c) - t_1); else tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if ((t_1 <= -2e+14) || ~((t_1 <= 0.01)))
tmp = (b * c) - t_1;
else
tmp = (b * c) - (4.0 * (t * a));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+14], N[Not[LessEqual[t$95$1, 0.01]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+14} \lor \neg \left(t_1 \leq 0.01\right):\\
\;\;\;\;b \cdot c - t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -2e14 or 0.0100000000000000002 < (*.f64 (*.f64 j 27) k) Initial program 81.7%
Taylor expanded in x around 0 85.9%
Taylor expanded in b around inf 64.9%
if -2e14 < (*.f64 (*.f64 j 27) k) < 0.0100000000000000002Initial program 83.5%
Taylor expanded in x around 0 55.1%
sub-neg55.1%
associate-*r*55.1%
associate-*r*55.2%
Applied egg-rr55.2%
Taylor expanded in j around 0 53.5%
Final simplification58.8%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -5e-30)
(- (* 18.0 (* x (* z (* y t)))) t_1)
(if (<= t_1 0.01) (- (* b c) (* 4.0 (* t a))) (- (* b c) t_1)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -5e-30) {
tmp = (18.0 * (x * (z * (y * t)))) - t_1;
} else if (t_1 <= 0.01) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = (b * c) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-5d-30)) then
tmp = (18.0d0 * (x * (z * (y * t)))) - t_1
else if (t_1 <= 0.01d0) then
tmp = (b * c) - (4.0d0 * (t * a))
else
tmp = (b * c) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -5e-30) {
tmp = (18.0 * (x * (z * (y * t)))) - t_1;
} else if (t_1 <= 0.01) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = (b * c) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -5e-30: tmp = (18.0 * (x * (z * (y * t)))) - t_1 elif t_1 <= 0.01: tmp = (b * c) - (4.0 * (t * a)) else: tmp = (b * c) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -5e-30) tmp = Float64(Float64(18.0 * Float64(x * Float64(z * Float64(y * t)))) - t_1); elseif (t_1 <= 0.01) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); else tmp = Float64(Float64(b * c) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -5e-30)
tmp = (18.0 * (x * (z * (y * t)))) - t_1;
elseif (t_1 <= 0.01)
tmp = (b * c) - (4.0 * (t * a));
else
tmp = (b * c) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-30], N[(N[(18.0 * N[(x * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 0.01], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-30}:\\
\;\;\;\;18 \cdot \left(x \cdot \left(z \cdot \left(y \cdot t\right)\right)\right) - t_1\\
\mathbf{elif}\;t_1 \leq 0.01:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -4.99999999999999972e-30Initial program 78.8%
Taylor expanded in x around 0 86.4%
Taylor expanded in y around inf 62.7%
associate-*r*62.0%
Simplified62.0%
Taylor expanded in t around 0 62.7%
*-commutative62.7%
associate-*l*66.3%
*-commutative66.3%
associate-*r*67.8%
*-commutative67.8%
Simplified67.8%
if -4.99999999999999972e-30 < (*.f64 (*.f64 j 27) k) < 0.0100000000000000002Initial program 82.9%
Taylor expanded in x around 0 56.8%
sub-neg56.8%
associate-*r*56.8%
associate-*r*56.8%
Applied egg-rr56.8%
Taylor expanded in j around 0 55.0%
if 0.0100000000000000002 < (*.f64 (*.f64 j 27) k) Initial program 86.0%
Taylor expanded in x around 0 87.6%
Taylor expanded in b around inf 67.2%
Final simplification61.4%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= x 8.5e+74)
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) t_1)
(- (* x (- (* 18.0 (* z (* y t))) (* 4.0 i))) t_1))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (x <= 8.5e+74) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
} else {
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (x <= 8.5d+74) then
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - t_1
else
tmp = (x * ((18.0d0 * (z * (y * t))) - (4.0d0 * i))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (x <= 8.5e+74) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
} else {
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if x <= 8.5e+74: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1 else: tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (x <= 8.5e+74) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - t_1); else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(z * Float64(y * t))) - Float64(4.0 * i))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (x <= 8.5e+74)
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
else
tmp = (x * ((18.0 * (z * (y * t))) - (4.0 * i))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[x, 8.5e+74], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * N[(N[(18.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq 8.5 \cdot 10^{+74}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(y \cdot t\right)\right) - 4 \cdot i\right) - t_1\\
\end{array}
\end{array}
if x < 8.50000000000000028e74Initial program 85.9%
Taylor expanded in y around 0 83.9%
distribute-lft-out83.9%
*-commutative83.9%
*-commutative83.9%
Simplified83.9%
if 8.50000000000000028e74 < x Initial program 70.1%
Taylor expanded in x around 0 88.6%
Taylor expanded in x around inf 79.0%
pow188.6%
Applied egg-rr79.0%
unpow188.6%
associate-*r*90.4%
Simplified80.8%
Final simplification83.2%
NOTE: 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 -3.05e+203)
(* x (* i -4.0))
(if (<= x -4.3e+170)
(* j (* k -27.0))
(if (<= x -4.5e+103)
(* t (* 18.0 (* z (* x y))))
(if (<= x 9.2e+80)
(- (* b c) (* 4.0 (* t a)))
(* (* x (* y z)) (* 18.0 t)))))))assert(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 <= -3.05e+203) {
tmp = x * (i * -4.0);
} else if (x <= -4.3e+170) {
tmp = j * (k * -27.0);
} else if (x <= -4.5e+103) {
tmp = t * (18.0 * (z * (x * y)));
} else if (x <= 9.2e+80) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = (x * (y * z)) * (18.0 * t);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= (-3.05d+203)) then
tmp = x * (i * (-4.0d0))
else if (x <= (-4.3d+170)) then
tmp = j * (k * (-27.0d0))
else if (x <= (-4.5d+103)) then
tmp = t * (18.0d0 * (z * (x * y)))
else if (x <= 9.2d+80) then
tmp = (b * c) - (4.0d0 * (t * a))
else
tmp = (x * (y * z)) * (18.0d0 * t)
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -3.05e+203) {
tmp = x * (i * -4.0);
} else if (x <= -4.3e+170) {
tmp = j * (k * -27.0);
} else if (x <= -4.5e+103) {
tmp = t * (18.0 * (z * (x * y)));
} else if (x <= 9.2e+80) {
tmp = (b * c) - (4.0 * (t * a));
} else {
tmp = (x * (y * z)) * (18.0 * t);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -3.05e+203: tmp = x * (i * -4.0) elif x <= -4.3e+170: tmp = j * (k * -27.0) elif x <= -4.5e+103: tmp = t * (18.0 * (z * (x * y))) elif x <= 9.2e+80: tmp = (b * c) - (4.0 * (t * a)) else: tmp = (x * (y * z)) * (18.0 * t) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -3.05e+203) tmp = Float64(x * Float64(i * -4.0)); elseif (x <= -4.3e+170) tmp = Float64(j * Float64(k * -27.0)); elseif (x <= -4.5e+103) tmp = Float64(t * Float64(18.0 * Float64(z * Float64(x * y)))); elseif (x <= 9.2e+80) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); else tmp = Float64(Float64(x * Float64(y * z)) * Float64(18.0 * t)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= -3.05e+203)
tmp = x * (i * -4.0);
elseif (x <= -4.3e+170)
tmp = j * (k * -27.0);
elseif (x <= -4.5e+103)
tmp = t * (18.0 * (z * (x * y)));
elseif (x <= 9.2e+80)
tmp = (b * c) - (4.0 * (t * a));
else
tmp = (x * (y * z)) * (18.0 * t);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -3.05e+203], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.3e+170], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.5e+103], N[(t * N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.2e+80], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.05 \cdot 10^{+203}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;x \leq -4.3 \cdot 10^{+170}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+103}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+80}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z\right)\right) \cdot \left(18 \cdot t\right)\\
\end{array}
\end{array}
if x < -3.05000000000000007e203Initial program 72.8%
Simplified81.7%
Taylor expanded in i around inf 56.4%
associate-*r*56.4%
*-commutative56.4%
Simplified56.4%
if -3.05000000000000007e203 < x < -4.2999999999999999e170Initial program 75.1%
Simplified83.8%
Taylor expanded in j around inf 59.0%
*-commutative59.0%
associate-*l*59.3%
Simplified59.3%
if -4.2999999999999999e170 < x < -4.50000000000000001e103Initial program 77.6%
Taylor expanded in x around 0 92.3%
Taylor expanded in a around 0 92.6%
Taylor expanded in t around inf 48.4%
*-commutative48.4%
associate-*l*48.4%
associate-*r*48.4%
*-commutative48.4%
Simplified48.4%
if -4.50000000000000001e103 < x < 9.20000000000000016e80Initial program 89.4%
Taylor expanded in x around 0 74.8%
sub-neg74.8%
associate-*r*74.8%
associate-*r*74.8%
Applied egg-rr74.8%
Taylor expanded in j around 0 53.1%
if 9.20000000000000016e80 < x Initial program 69.5%
Taylor expanded in x around 0 88.4%
Taylor expanded in a around 0 83.2%
Taylor expanded in t around inf 52.3%
associate-*r*52.4%
Simplified52.4%
Final simplification53.3%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= (* b c) -2.3e+63) (* b c) (if (<= (* b c) 3.5e+42) (* j (* k -27.0)) (* b c))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -2.3e+63) {
tmp = b * c;
} else if ((b * c) <= 3.5e+42) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-2.3d+63)) then
tmp = b * c
else if ((b * c) <= 3.5d+42) then
tmp = j * (k * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -2.3e+63) {
tmp = b * c;
} else if ((b * c) <= 3.5e+42) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -2.3e+63: tmp = b * c elif (b * c) <= 3.5e+42: tmp = j * (k * -27.0) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -2.3e+63) tmp = Float64(b * c); elseif (Float64(b * c) <= 3.5e+42) tmp = Float64(j * Float64(k * -27.0)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= -2.3e+63)
tmp = b * c;
elseif ((b * c) <= 3.5e+42)
tmp = j * (k * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -2.3e+63], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3.5e+42], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -2.3 \cdot 10^{+63}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 3.5 \cdot 10^{+42}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -2.29999999999999993e63 or 3.50000000000000023e42 < (*.f64 b c) Initial program 77.6%
Simplified78.6%
Taylor expanded in b around inf 55.2%
if -2.29999999999999993e63 < (*.f64 b c) < 3.50000000000000023e42Initial program 86.1%
Simplified90.1%
Taylor expanded in j around inf 32.4%
*-commutative32.4%
associate-*l*33.0%
Simplified33.0%
Final simplification42.1%
NOTE: 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(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: 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 j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: 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}
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 82.6%
Simplified85.4%
Taylor expanded in b around inf 25.3%
Final simplification25.3%
(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 2023293
(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)))