
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: y and z should be sorted in increasing order before calling this function.
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 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))
INFINITY)
(-
(- (* b c) (* t (- (* a 4.0) (* (* x y) (* 18.0 z)))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))assert(y < z);
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 * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = ((b * c) - (t * ((a * 4.0) - ((x * y) * (18.0 * z))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
}
return tmp;
}
assert y < z;
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 * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= Double.POSITIVE_INFINITY) {
tmp = ((b * c) - (t * ((a * 4.0) - ((x * y) * (18.0 * z))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if ((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= math.inf: tmp = ((b * c) - (t * ((a * 4.0) - ((x * y) * (18.0 * z))))) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) <= Inf) tmp = Float64(Float64(Float64(b * c) - Float64(t * Float64(Float64(a * 4.0) - Float64(Float64(x * y) * Float64(18.0 * z))))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= Inf)
tmp = ((b * c) - (t * ((a * 4.0) - ((x * y) * (18.0 * z))))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(b * c), $MachinePrecision] - N[(t * N[(N[(a * 4.0), $MachinePrecision] - N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq \infty:\\
\;\;\;\;\left(b \cdot c - t \cdot \left(a \cdot 4 - \left(x \cdot y\right) \cdot \left(18 \cdot z\right)\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(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 95.8%
Simplified94.1%
Taylor expanded in x around 0 94.1%
*-commutative94.1%
associate-*r*95.8%
associate-*l*95.8%
Simplified95.8%
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%
Simplified32.0%
Taylor expanded in x around inf 64.1%
Final simplification92.7%
NOTE: y and z should be sorted in increasing order before calling this function.
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 -5e+88) (not (<= t_1 2e+24)))
(- (+ (* b c) (* t (* a -4.0))) (+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(-
(+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(* 4.0 (* x i))))))assert(y < z);
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+88) || !(t_1 <= 2e+24)) {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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+88)) .or. (.not. (t_1 <= 2d+24))) then
tmp = ((b * c) + (t * (a * (-4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))) - (4.0d0 * (x * i))
end if
code = tmp
end function
assert y < z;
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+88) || !(t_1 <= 2e+24)) {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i));
}
return tmp;
}
[y, z] = sort([y, z]) [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+88) or not (t_1 <= 2e+24): tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i)) return tmp
y, z = sort([y, z]) 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+88) || !(t_1 <= 2e+24)) 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(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) - Float64(4.0 * Float64(x * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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+88) || ~((t_1 <= 2e+24)))
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)))) - (4.0 * (x * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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, -5e+88], N[Not[LessEqual[t$95$1, 2e+24]], $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], 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]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[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^{+88} \lor \neg \left(t_1 \leq 2 \cdot 10^{+24}\right):\\
\;\;\;\;\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}:\\
\;\;\;\;\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)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -4.99999999999999997e88 or 2e24 < (*.f64 (*.f64 j 27) k) Initial program 84.2%
Simplified85.2%
Taylor expanded in x around 0 85.2%
*-commutative85.2%
*-commutative85.2%
associate-*r*85.2%
Simplified85.2%
if -4.99999999999999997e88 < (*.f64 (*.f64 j 27) k) < 2e24Initial program 88.1%
Simplified90.2%
Taylor expanded in j around 0 89.6%
Final simplification87.8%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
(t_2 (* (* j 27.0) k)))
(if (<= t_2 -5e+88)
(- t_1 (* 27.0 (* j k)))
(if (<= t_2 2e+24)
(- t_1 (* 4.0 (* x i)))
(-
(+ (* b c) (* t (* a -4.0)))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))))))assert(y < z);
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 = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+88) {
tmp = t_1 - (27.0 * (j * k));
} else if (t_2 <= 2e+24) {
tmp = t_1 - (4.0 * (x * i));
} else {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = (b * c) + (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0)))
t_2 = (j * 27.0d0) * k
if (t_2 <= (-5d+88)) then
tmp = t_1 - (27.0d0 * (j * k))
else if (t_2 <= 2d+24) then
tmp = t_1 - (4.0d0 * (x * i))
else
tmp = ((b * c) + (t * (a * (-4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
end if
code = tmp
end function
assert y < z;
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 = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+88) {
tmp = t_1 - (27.0 * (j * k));
} else if (t_2 <= 2e+24) {
tmp = t_1 - (4.0 * (x * i));
} else {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0))) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -5e+88: tmp = t_1 - (27.0 * (j * k)) elif t_2 <= 2e+24: tmp = t_1 - (4.0 * (x * i)) else: tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0)))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -5e+88) tmp = Float64(t_1 - Float64(27.0 * Float64(j * k))); elseif (t_2 <= 2e+24) tmp = Float64(t_1 - Float64(4.0 * Float64(x * i))); 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
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + (t * ((18.0 * (x * (y * z))) - (a * 4.0)));
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -5e+88)
tmp = t_1 - (27.0 * (j * k));
elseif (t_2 <= 2e+24)
tmp = t_1 - (4.0 * (x * i));
else
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(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]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+88], N[(t$95$1 - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+24], N[(t$95$1 - N[(4.0 * N[(x * i), $MachinePrecision]), $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}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+88}:\\
\;\;\;\;t_1 - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+24}:\\
\;\;\;\;t_1 - 4 \cdot \left(x \cdot i\right)\\
\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 (*.f64 (*.f64 j 27) k) < -4.99999999999999997e88Initial program 88.8%
Simplified88.9%
Taylor expanded in x around 0 88.9%
*-commutative88.9%
associate-*r*93.3%
associate-*l*93.3%
Simplified93.3%
Taylor expanded in i around 0 84.9%
if -4.99999999999999997e88 < (*.f64 (*.f64 j 27) k) < 2e24Initial program 88.1%
Simplified90.2%
Taylor expanded in j around 0 89.6%
if 2e24 < (*.f64 (*.f64 j 27) k) Initial program 80.9%
Simplified82.5%
Taylor expanded in x around 0 85.8%
*-commutative85.8%
*-commutative85.8%
associate-*r*85.8%
Simplified85.8%
Final simplification87.8%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* 4.0 i)) (* j (* 27.0 k)))))
(if (or (<= t -2.2e-113) (not (<= t 1.22e-166)))
(- (- (* b c) (* t (- (* a 4.0) (* (* x 18.0) (* y z))))) t_1)
(- (+ (* b c) (* 18.0 (* x (* y (* z t))))) t_1))))assert(y < z);
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 * (4.0 * i)) + (j * (27.0 * k));
double tmp;
if ((t <= -2.2e-113) || !(t <= 1.22e-166)) {
tmp = ((b * c) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - t_1;
} else {
tmp = ((b * c) + (18.0 * (x * (y * (z * t))))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 * (4.0d0 * i)) + (j * (27.0d0 * k))
if ((t <= (-2.2d-113)) .or. (.not. (t <= 1.22d-166))) then
tmp = ((b * c) - (t * ((a * 4.0d0) - ((x * 18.0d0) * (y * z))))) - t_1
else
tmp = ((b * c) + (18.0d0 * (x * (y * (z * t))))) - t_1
end if
code = tmp
end function
assert y < z;
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 * (4.0 * i)) + (j * (27.0 * k));
double tmp;
if ((t <= -2.2e-113) || !(t <= 1.22e-166)) {
tmp = ((b * c) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - t_1;
} else {
tmp = ((b * c) + (18.0 * (x * (y * (z * t))))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (x * (4.0 * i)) + (j * (27.0 * k)) tmp = 0 if (t <= -2.2e-113) or not (t <= 1.22e-166): tmp = ((b * c) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - t_1 else: tmp = ((b * c) + (18.0 * (x * (y * (z * t))))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k))) tmp = 0.0 if ((t <= -2.2e-113) || !(t <= 1.22e-166)) tmp = Float64(Float64(Float64(b * c) - Float64(t * Float64(Float64(a * 4.0) - Float64(Float64(x * 18.0) * Float64(y * z))))) - t_1); else tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(x * Float64(y * Float64(z * t))))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (x * (4.0 * i)) + (j * (27.0 * k));
tmp = 0.0;
if ((t <= -2.2e-113) || ~((t <= 1.22e-166)))
tmp = ((b * c) - (t * ((a * 4.0) - ((x * 18.0) * (y * z))))) - t_1;
else
tmp = ((b * c) + (18.0 * (x * (y * (z * t))))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -2.2e-113], N[Not[LessEqual[t, 1.22e-166]], $MachinePrecision]], N[(N[(N[(b * c), $MachinePrecision] - N[(t * N[(N[(a * 4.0), $MachinePrecision] - N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(x * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{-113} \lor \neg \left(t \leq 1.22 \cdot 10^{-166}\right):\\
\;\;\;\;\left(b \cdot c - t \cdot \left(a \cdot 4 - \left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(x \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\right) - t_1\\
\end{array}
\end{array}
if t < -2.20000000000000004e-113 or 1.22e-166 < t Initial program 89.1%
Simplified91.7%
if -2.20000000000000004e-113 < t < 1.22e-166Initial program 78.0%
Simplified76.5%
Taylor expanded in x around 0 76.5%
*-commutative76.5%
associate-*r*78.0%
associate-*l*78.0%
Simplified78.0%
Taylor expanded in x around inf 75.0%
*-commutative75.0%
associate-*l*85.7%
associate-*l*95.1%
Simplified95.1%
Final simplification92.6%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (- (* -4.0 (+ (* x i) (* t a))) (* (* j 27.0) k))))
(if (<= (* b c) -6.4e+180)
(+ (* b c) (* -4.0 (* x i)))
(if (<= (* b c) -3.7e-131)
t_1
(if (<= (* b c) -3.6e-188)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= (* b c) 2.4e+135)
t_1
(+ (* b c) (* 18.0 (* (* y z) (* x t))))))))))assert(y < z);
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 = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
double tmp;
if ((b * c) <= -6.4e+180) {
tmp = (b * c) + (-4.0 * (x * i));
} else if ((b * c) <= -3.7e-131) {
tmp = t_1;
} else if ((b * c) <= -3.6e-188) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if ((b * c) <= 2.4e+135) {
tmp = t_1;
} else {
tmp = (b * c) + (18.0 * ((y * z) * (x * t)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = ((-4.0d0) * ((x * i) + (t * a))) - ((j * 27.0d0) * k)
if ((b * c) <= (-6.4d+180)) then
tmp = (b * c) + ((-4.0d0) * (x * i))
else if ((b * c) <= (-3.7d-131)) then
tmp = t_1
else if ((b * c) <= (-3.6d-188)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if ((b * c) <= 2.4d+135) then
tmp = t_1
else
tmp = (b * c) + (18.0d0 * ((y * z) * (x * t)))
end if
code = tmp
end function
assert y < z;
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 = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
double tmp;
if ((b * c) <= -6.4e+180) {
tmp = (b * c) + (-4.0 * (x * i));
} else if ((b * c) <= -3.7e-131) {
tmp = t_1;
} else if ((b * c) <= -3.6e-188) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if ((b * c) <= 2.4e+135) {
tmp = t_1;
} else {
tmp = (b * c) + (18.0 * ((y * z) * (x * t)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k) tmp = 0 if (b * c) <= -6.4e+180: tmp = (b * c) + (-4.0 * (x * i)) elif (b * c) <= -3.7e-131: tmp = t_1 elif (b * c) <= -3.6e-188: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif (b * c) <= 2.4e+135: tmp = t_1 else: tmp = (b * c) + (18.0 * ((y * z) * (x * t))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (Float64(b * c) <= -6.4e+180) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(x * i))); elseif (Float64(b * c) <= -3.7e-131) tmp = t_1; elseif (Float64(b * c) <= -3.6e-188) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (Float64(b * c) <= 2.4e+135) tmp = t_1; else tmp = Float64(Float64(b * c) + Float64(18.0 * Float64(Float64(y * z) * Float64(x * t)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
tmp = 0.0;
if ((b * c) <= -6.4e+180)
tmp = (b * c) + (-4.0 * (x * i));
elseif ((b * c) <= -3.7e-131)
tmp = t_1;
elseif ((b * c) <= -3.6e-188)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif ((b * c) <= 2.4e+135)
tmp = t_1;
else
tmp = (b * c) + (18.0 * ((y * z) * (x * t)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -6.4e+180], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -3.7e-131], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -3.6e-188], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.4e+135], t$95$1, N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i + t \cdot a\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;b \cdot c \leq -6.4 \cdot 10^{+180}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq -3.7 \cdot 10^{-131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -3.6 \cdot 10^{-188}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 2.4 \cdot 10^{+135}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + 18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -6.39999999999999987e180Initial program 80.7%
Simplified86.5%
Taylor expanded in x around inf 79.8%
*-commutative79.8%
associate-*r*79.8%
associate-*r*79.5%
associate-*l*79.6%
Simplified79.6%
Taylor expanded in j around 0 77.0%
Taylor expanded in x around 0 82.2%
Taylor expanded in t around 0 71.6%
if -6.39999999999999987e180 < (*.f64 b c) < -3.7000000000000002e-131 or -3.5999999999999997e-188 < (*.f64 b c) < 2.39999999999999997e135Initial program 87.2%
distribute-rgt-out--90.2%
associate-*r*89.0%
*-commutative89.0%
Applied egg-rr89.0%
Taylor expanded in x around 0 78.2%
Taylor expanded in b around 0 73.0%
cancel-sign-sub-inv73.0%
metadata-eval73.0%
distribute-lft-out73.0%
Simplified73.0%
if -3.7000000000000002e-131 < (*.f64 b c) < -3.5999999999999997e-188Initial program 83.8%
Simplified83.8%
Taylor expanded in x around inf 92.0%
if 2.39999999999999997e135 < (*.f64 b c) Initial program 89.1%
Simplified86.6%
Taylor expanded in x around inf 76.6%
*-commutative76.6%
associate-*r*76.5%
associate-*r*81.8%
associate-*l*81.8%
Simplified81.8%
Taylor expanded in j around 0 73.5%
Taylor expanded in i around 0 76.2%
pow176.2%
Applied egg-rr76.2%
unpow176.2%
associate-*r*78.6%
*-commutative78.6%
Simplified78.6%
Final simplification74.5%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* 4.0 i)) (* j (* 27.0 k)))))
(if (or (<= x -5e+28) (not (<= x 9.6e-5)))
(- (+ (* b c) (* 18.0 (* x (* y (* z t))))) t_1)
(- (+ (* b c) (* t (* a -4.0))) t_1))))assert(y < z);
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 * (4.0 * i)) + (j * (27.0 * k));
double tmp;
if ((x <= -5e+28) || !(x <= 9.6e-5)) {
tmp = ((b * c) + (18.0 * (x * (y * (z * t))))) - t_1;
} else {
tmp = ((b * c) + (t * (a * -4.0))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 * (4.0d0 * i)) + (j * (27.0d0 * k))
if ((x <= (-5d+28)) .or. (.not. (x <= 9.6d-5))) then
tmp = ((b * c) + (18.0d0 * (x * (y * (z * t))))) - t_1
else
tmp = ((b * c) + (t * (a * (-4.0d0)))) - t_1
end if
code = tmp
end function
assert y < z;
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 * (4.0 * i)) + (j * (27.0 * k));
double tmp;
if ((x <= -5e+28) || !(x <= 9.6e-5)) {
tmp = ((b * c) + (18.0 * (x * (y * (z * t))))) - t_1;
} else {
tmp = ((b * c) + (t * (a * -4.0))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (x * (4.0 * i)) + (j * (27.0 * k)) tmp = 0 if (x <= -5e+28) or not (x <= 9.6e-5): tmp = ((b * c) + (18.0 * (x * (y * (z * t))))) - t_1 else: tmp = ((b * c) + (t * (a * -4.0))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k))) tmp = 0.0 if ((x <= -5e+28) || !(x <= 9.6e-5)) tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(x * Float64(y * Float64(z * t))))) - t_1); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(a * -4.0))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (x * (4.0 * i)) + (j * (27.0 * k));
tmp = 0.0;
if ((x <= -5e+28) || ~((x <= 9.6e-5)))
tmp = ((b * c) + (18.0 * (x * (y * (z * t))))) - t_1;
else
tmp = ((b * c) + (t * (a * -4.0))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -5e+28], N[Not[LessEqual[x, 9.6e-5]], $MachinePrecision]], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(x * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\\
\mathbf{if}\;x \leq -5 \cdot 10^{+28} \lor \neg \left(x \leq 9.6 \cdot 10^{-5}\right):\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(x \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(a \cdot -4\right)\right) - t_1\\
\end{array}
\end{array}
if x < -4.99999999999999957e28 or 9.6000000000000002e-5 < x Initial program 77.9%
Simplified85.1%
Taylor expanded in x around 0 85.9%
*-commutative85.9%
associate-*r*83.5%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in x around inf 80.4%
*-commutative80.4%
associate-*l*85.7%
associate-*l*88.8%
Simplified88.8%
if -4.99999999999999957e28 < x < 9.6000000000000002e-5Initial program 94.5%
Simplified90.9%
Taylor expanded in x around 0 90.7%
*-commutative90.7%
*-commutative90.7%
associate-*r*90.7%
Simplified90.7%
Final simplification89.8%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (- (* b c) (* 27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+88)
t_1
(if (<= t_2 -2e-84)
(* x (* z (* y (* 18.0 t))))
(if (<= t_2 2e+149) (+ (* b c) (* -4.0 (* x i))) t_1)))))assert(y < z);
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 = (b * c) - (27.0 * (j * k));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+88) {
tmp = t_1;
} else if (t_2 <= -2e-84) {
tmp = x * (z * (y * (18.0 * t)));
} else if (t_2 <= 2e+149) {
tmp = (b * c) + (-4.0 * (x * i));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = (b * c) - (27.0d0 * (j * k))
t_2 = (j * 27.0d0) * k
if (t_2 <= (-2d+88)) then
tmp = t_1
else if (t_2 <= (-2d-84)) then
tmp = x * (z * (y * (18.0d0 * t)))
else if (t_2 <= 2d+149) then
tmp = (b * c) + ((-4.0d0) * (x * i))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
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 = (b * c) - (27.0 * (j * k));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+88) {
tmp = t_1;
} else if (t_2 <= -2e-84) {
tmp = x * (z * (y * (18.0 * t)));
} else if (t_2 <= 2e+149) {
tmp = (b * c) + (-4.0 * (x * i));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (27.0 * (j * k)) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -2e+88: tmp = t_1 elif t_2 <= -2e-84: tmp = x * (z * (y * (18.0 * t))) elif t_2 <= 2e+149: tmp = (b * c) + (-4.0 * (x * i)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+88) tmp = t_1; elseif (t_2 <= -2e-84) tmp = Float64(x * Float64(z * Float64(y * Float64(18.0 * t)))); elseif (t_2 <= 2e+149) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(x * i))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (27.0 * (j * k));
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -2e+88)
tmp = t_1;
elseif (t_2 <= -2e-84)
tmp = x * (z * (y * (18.0 * t)));
elseif (t_2 <= 2e+149)
tmp = (b * c) + (-4.0 * (x * i));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+88], t$95$1, If[LessEqual[t$95$2, -2e-84], N[(x * N[(z * N[(y * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+149], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-84}:\\
\;\;\;\;x \cdot \left(z \cdot \left(y \cdot \left(18 \cdot t\right)\right)\right)\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+149}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -1.99999999999999992e88 or 2.0000000000000001e149 < (*.f64 (*.f64 j 27) k) Initial program 83.4%
Simplified83.5%
Taylor expanded in x around 0 81.0%
Taylor expanded in a around 0 72.6%
if -1.99999999999999992e88 < (*.f64 (*.f64 j 27) k) < -2.0000000000000001e-84Initial program 85.4%
Simplified89.2%
Taylor expanded in x around 0 89.2%
*-commutative89.2%
associate-*r*89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in x around inf 70.6%
*-commutative70.6%
associate-*l*81.2%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in y around inf 40.7%
*-commutative40.7%
associate-*r*40.7%
associate-*r*47.9%
*-commutative47.9%
*-commutative47.9%
associate-*r*55.0%
*-commutative55.0%
associate-*r*51.3%
*-commutative51.3%
associate-*l*51.4%
*-commutative51.4%
associate-*r*51.4%
associate-*r*54.9%
*-commutative54.9%
Simplified54.9%
if -2.0000000000000001e-84 < (*.f64 (*.f64 j 27) k) < 2.0000000000000001e149Initial program 88.4%
Simplified90.5%
Taylor expanded in x around inf 73.7%
*-commutative73.7%
associate-*r*73.7%
associate-*r*73.6%
associate-*l*73.6%
Simplified73.6%
Taylor expanded in j around 0 69.7%
Taylor expanded in x around 0 73.2%
Taylor expanded in t around 0 57.0%
Final simplification62.0%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* 27.0 (* j k))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+88)
(- (* -4.0 (* t a)) t_1)
(if (<= t_2 -2e-84)
(* x (* z (* y (* 18.0 t))))
(if (<= t_2 2e+149) (+ (* b c) (* -4.0 (* x i))) (- (* b c) t_1))))))assert(y < z);
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 = 27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+88) {
tmp = (-4.0 * (t * a)) - t_1;
} else if (t_2 <= -2e-84) {
tmp = x * (z * (y * (18.0 * t)));
} else if (t_2 <= 2e+149) {
tmp = (b * c) + (-4.0 * (x * i));
} else {
tmp = (b * c) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = 27.0d0 * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-2d+88)) then
tmp = ((-4.0d0) * (t * a)) - t_1
else if (t_2 <= (-2d-84)) then
tmp = x * (z * (y * (18.0d0 * t)))
else if (t_2 <= 2d+149) then
tmp = (b * c) + ((-4.0d0) * (x * i))
else
tmp = (b * c) - t_1
end if
code = tmp
end function
assert y < z;
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 = 27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+88) {
tmp = (-4.0 * (t * a)) - t_1;
} else if (t_2 <= -2e-84) {
tmp = x * (z * (y * (18.0 * t)));
} else if (t_2 <= 2e+149) {
tmp = (b * c) + (-4.0 * (x * i));
} else {
tmp = (b * c) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -2e+88: tmp = (-4.0 * (t * a)) - t_1 elif t_2 <= -2e-84: tmp = x * (z * (y * (18.0 * t))) elif t_2 <= 2e+149: tmp = (b * c) + (-4.0 * (x * i)) else: tmp = (b * c) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+88) tmp = Float64(Float64(-4.0 * Float64(t * a)) - t_1); elseif (t_2 <= -2e-84) tmp = Float64(x * Float64(z * Float64(y * Float64(18.0 * t)))); elseif (t_2 <= 2e+149) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(x * i))); else tmp = Float64(Float64(b * c) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -2e+88)
tmp = (-4.0 * (t * a)) - t_1;
elseif (t_2 <= -2e-84)
tmp = x * (z * (y * (18.0 * t)));
elseif (t_2 <= 2e+149)
tmp = (b * c) + (-4.0 * (x * i));
else
tmp = (b * c) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+88], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$2, -2e-84], N[(x * N[(z * N[(y * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+149], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+88}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right) - t_1\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-84}:\\
\;\;\;\;x \cdot \left(z \cdot \left(y \cdot \left(18 \cdot t\right)\right)\right)\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+149}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -1.99999999999999992e88Initial program 89.1%
Simplified89.2%
Taylor expanded in x around 0 81.1%
Taylor expanded in b around 0 69.9%
if -1.99999999999999992e88 < (*.f64 (*.f64 j 27) k) < -2.0000000000000001e-84Initial program 85.4%
Simplified89.2%
Taylor expanded in x around 0 89.2%
*-commutative89.2%
associate-*r*89.2%
associate-*l*89.2%
Simplified89.2%
Taylor expanded in x around inf 70.6%
*-commutative70.6%
associate-*l*81.2%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in y around inf 40.7%
*-commutative40.7%
associate-*r*40.7%
associate-*r*47.9%
*-commutative47.9%
*-commutative47.9%
associate-*r*55.0%
*-commutative55.0%
associate-*r*51.3%
*-commutative51.3%
associate-*l*51.4%
*-commutative51.4%
associate-*r*51.4%
associate-*r*54.9%
*-commutative54.9%
Simplified54.9%
if -2.0000000000000001e-84 < (*.f64 (*.f64 j 27) k) < 2.0000000000000001e149Initial program 88.4%
Simplified90.5%
Taylor expanded in x around inf 73.7%
*-commutative73.7%
associate-*r*73.7%
associate-*r*73.6%
associate-*l*73.6%
Simplified73.6%
Taylor expanded in j around 0 69.7%
Taylor expanded in x around 0 73.2%
Taylor expanded in t around 0 57.0%
if 2.0000000000000001e149 < (*.f64 (*.f64 j 27) k) Initial program 76.8%
Simplified76.8%
Taylor expanded in x around 0 80.8%
Taylor expanded in a around 0 77.5%
Final simplification62.2%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* 27.0 (* j k))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+88)
(- (* -4.0 (* t a)) t_1)
(if (<= t_2 -2e-84)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= t_2 2e+149) (+ (* b c) (* -4.0 (* x i))) (- (* b c) t_1))))))assert(y < z);
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 = 27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+88) {
tmp = (-4.0 * (t * a)) - t_1;
} else if (t_2 <= -2e-84) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (t_2 <= 2e+149) {
tmp = (b * c) + (-4.0 * (x * i));
} else {
tmp = (b * c) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = 27.0d0 * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-2d+88)) then
tmp = ((-4.0d0) * (t * a)) - t_1
else if (t_2 <= (-2d-84)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (t_2 <= 2d+149) then
tmp = (b * c) + ((-4.0d0) * (x * i))
else
tmp = (b * c) - t_1
end if
code = tmp
end function
assert y < z;
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 = 27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+88) {
tmp = (-4.0 * (t * a)) - t_1;
} else if (t_2 <= -2e-84) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (t_2 <= 2e+149) {
tmp = (b * c) + (-4.0 * (x * i));
} else {
tmp = (b * c) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -2e+88: tmp = (-4.0 * (t * a)) - t_1 elif t_2 <= -2e-84: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif t_2 <= 2e+149: tmp = (b * c) + (-4.0 * (x * i)) else: tmp = (b * c) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+88) tmp = Float64(Float64(-4.0 * Float64(t * a)) - t_1); elseif (t_2 <= -2e-84) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (t_2 <= 2e+149) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(x * i))); else tmp = Float64(Float64(b * c) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -2e+88)
tmp = (-4.0 * (t * a)) - t_1;
elseif (t_2 <= -2e-84)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (t_2 <= 2e+149)
tmp = (b * c) + (-4.0 * (x * i));
else
tmp = (b * c) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+88], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$2, -2e-84], 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$2, 2e+149], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+88}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right) - t_1\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-84}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+149}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -1.99999999999999992e88Initial program 89.1%
Simplified89.2%
Taylor expanded in x around 0 81.1%
Taylor expanded in b around 0 69.9%
if -1.99999999999999992e88 < (*.f64 (*.f64 j 27) k) < -2.0000000000000001e-84Initial program 85.4%
Simplified89.2%
Taylor expanded in x around inf 70.8%
if -2.0000000000000001e-84 < (*.f64 (*.f64 j 27) k) < 2.0000000000000001e149Initial program 88.4%
Simplified90.5%
Taylor expanded in x around inf 73.7%
*-commutative73.7%
associate-*r*73.7%
associate-*r*73.6%
associate-*l*73.6%
Simplified73.6%
Taylor expanded in j around 0 69.7%
Taylor expanded in x around 0 73.2%
Taylor expanded in t around 0 57.0%
if 2.0000000000000001e149 < (*.f64 (*.f64 j 27) k) Initial program 76.8%
Simplified76.8%
Taylor expanded in x around 0 80.8%
Taylor expanded in a around 0 77.5%
Final simplification63.8%
NOTE: y and z should be sorted in increasing order before calling this function. 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 -2.2e+38) (not (<= x 0.052))) (- (+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))) (* 27.0 (* j k))) (- (+ (* b c) (* t (* a -4.0))) (+ (* x (* 4.0 i)) (* j (* 27.0 k))))))
assert(y < z);
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 <= -2.2e+38) || !(x <= 0.052)) {
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (27.0 * (j * k));
} else {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 <= (-2.2d+38)) .or. (.not. (x <= 0.052d0))) then
tmp = ((b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))) - (27.0d0 * (j * k))
else
tmp = ((b * c) + (t * (a * (-4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
end if
code = tmp
end function
assert y < z;
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 <= -2.2e+38) || !(x <= 0.052)) {
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (27.0 * (j * k));
} else {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -2.2e+38) or not (x <= 0.052): tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (27.0 * (j * k)) else: tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -2.2e+38) || !(x <= 0.052)) tmp = Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))) - Float64(27.0 * Float64(j * 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
y, z = num2cell(sort([y, z])){:}
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 <= -2.2e+38) || ~((x <= 0.052)))
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (27.0 * (j * k));
else
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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, -2.2e+38], N[Not[LessEqual[x, 0.052]], $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[(27.0 * N[(j * k), $MachinePrecision]), $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}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+38} \lor \neg \left(x \leq 0.052\right):\\
\;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\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 < -2.20000000000000006e38 or 0.0519999999999999976 < x Initial program 77.9%
Simplified85.1%
Taylor expanded in x around inf 80.4%
*-commutative80.4%
associate-*r*80.4%
associate-*r*78.1%
associate-*l*78.1%
Simplified78.1%
Taylor expanded in x around 0 85.8%
if -2.20000000000000006e38 < x < 0.0519999999999999976Initial program 94.5%
Simplified90.9%
Taylor expanded in x around 0 90.7%
*-commutative90.7%
*-commutative90.7%
associate-*r*90.7%
Simplified90.7%
Final simplification88.3%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))))))
(if (<= x -3.55e+25)
t_1
(if (<= x -3.3e-45)
(- (* -4.0 (+ (* x i) (* t a))) (* (* j 27.0) k))
(if (<= x -3.1e-104)
(+ (* b c) (* 18.0 (* t (* x (* y z)))))
(if (<= x 2.2e+18)
(- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))
t_1))))))assert(y < z);
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 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
double tmp;
if (x <= -3.55e+25) {
tmp = t_1;
} else if (x <= -3.3e-45) {
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
} else if (x <= -3.1e-104) {
tmp = (b * c) + (18.0 * (t * (x * (y * z))));
} else if (x <= 2.2e+18) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = (b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))
if (x <= (-3.55d+25)) then
tmp = t_1
else if (x <= (-3.3d-45)) then
tmp = ((-4.0d0) * ((x * i) + (t * a))) - ((j * 27.0d0) * k)
else if (x <= (-3.1d-104)) then
tmp = (b * c) + (18.0d0 * (t * (x * (y * z))))
else if (x <= 2.2d+18) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
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 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
double tmp;
if (x <= -3.55e+25) {
tmp = t_1;
} else if (x <= -3.3e-45) {
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
} else if (x <= -3.1e-104) {
tmp = (b * c) + (18.0 * (t * (x * (y * z))));
} else if (x <= 2.2e+18) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i))) tmp = 0 if x <= -3.55e+25: tmp = t_1 elif x <= -3.3e-45: tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k) elif x <= -3.1e-104: tmp = (b * c) + (18.0 * (t * (x * (y * z)))) elif x <= 2.2e+18: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = 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.55e+25) tmp = t_1; elseif (x <= -3.3e-45) tmp = Float64(Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) - Float64(Float64(j * 27.0) * k)); elseif (x <= -3.1e-104) tmp = Float64(Float64(b * c) + Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))); elseif (x <= 2.2e+18) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
tmp = 0.0;
if (x <= -3.55e+25)
tmp = t_1;
elseif (x <= -3.3e-45)
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
elseif (x <= -3.1e-104)
tmp = (b * c) + (18.0 * (t * (x * (y * z))));
elseif (x <= 2.2e+18)
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(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.55e+25], t$95$1, If[LessEqual[x, -3.3e-45], N[(N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.1e-104], N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e+18], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 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.55 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-45}:\\
\;\;\;\;-4 \cdot \left(x \cdot i + t \cdot a\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{-104}:\\
\;\;\;\;b \cdot c + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+18}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.5500000000000001e25 or 2.2e18 < x Initial program 77.2%
Simplified84.6%
Taylor expanded in x around inf 79.8%
*-commutative79.8%
associate-*r*79.8%
associate-*r*77.3%
associate-*l*77.3%
Simplified77.3%
Taylor expanded in j around 0 73.6%
Taylor expanded in x around 0 79.1%
if -3.5500000000000001e25 < x < -3.3000000000000001e-45Initial program 99.9%
distribute-rgt-out--99.9%
associate-*r*99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 92.9%
Taylor expanded in b around 0 88.7%
cancel-sign-sub-inv88.7%
metadata-eval88.7%
distribute-lft-out88.7%
Simplified88.7%
if -3.3000000000000001e-45 < x < -3.09999999999999976e-104Initial program 93.8%
Simplified88.1%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
associate-*r*76.6%
associate-*r*82.6%
associate-*l*82.5%
Simplified82.5%
Taylor expanded in j around 0 76.7%
Taylor expanded in i around 0 76.7%
if -3.09999999999999976e-104 < x < 2.2e18Initial program 94.1%
Simplified90.5%
Taylor expanded in x around 0 84.3%
Final simplification81.6%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))))))
(if (<= x -2.75e+26)
t_1
(if (<= x -7.5e-37)
(- (* -4.0 (+ (* x i) (* t a))) (* (* j 27.0) k))
(if (<= x -3.1e-104)
(- (+ (* b c) (* 18.0 (* t (* x (* y z))))) (* 4.0 (* x i)))
(if (<= x 1.22e+16)
(- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))
t_1))))))assert(y < z);
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 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
double tmp;
if (x <= -2.75e+26) {
tmp = t_1;
} else if (x <= -7.5e-37) {
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
} else if (x <= -3.1e-104) {
tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (4.0 * (x * i));
} else if (x <= 1.22e+16) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = (b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))
if (x <= (-2.75d+26)) then
tmp = t_1
else if (x <= (-7.5d-37)) then
tmp = ((-4.0d0) * ((x * i) + (t * a))) - ((j * 27.0d0) * k)
else if (x <= (-3.1d-104)) then
tmp = ((b * c) + (18.0d0 * (t * (x * (y * z))))) - (4.0d0 * (x * i))
else if (x <= 1.22d+16) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
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 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
double tmp;
if (x <= -2.75e+26) {
tmp = t_1;
} else if (x <= -7.5e-37) {
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
} else if (x <= -3.1e-104) {
tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (4.0 * (x * i));
} else if (x <= 1.22e+16) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i))) tmp = 0 if x <= -2.75e+26: tmp = t_1 elif x <= -7.5e-37: tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k) elif x <= -3.1e-104: tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (4.0 * (x * i)) elif x <= 1.22e+16: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))) tmp = 0.0 if (x <= -2.75e+26) tmp = t_1; elseif (x <= -7.5e-37) tmp = Float64(Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) - Float64(Float64(j * 27.0) * k)); elseif (x <= -3.1e-104) tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))) - Float64(4.0 * Float64(x * i))); elseif (x <= 1.22e+16) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
tmp = 0.0;
if (x <= -2.75e+26)
tmp = t_1;
elseif (x <= -7.5e-37)
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
elseif (x <= -3.1e-104)
tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (4.0 * (x * i));
elseif (x <= 1.22e+16)
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(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, -2.75e+26], t$95$1, If[LessEqual[x, -7.5e-37], N[(N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.1e-104], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.22e+16], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 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 -2.75 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-37}:\\
\;\;\;\;-4 \cdot \left(x \cdot i + t \cdot a\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{-104}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{+16}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.7499999999999998e26 or 1.22e16 < x Initial program 77.2%
Simplified84.6%
Taylor expanded in x around inf 79.8%
*-commutative79.8%
associate-*r*79.8%
associate-*r*77.3%
associate-*l*77.3%
Simplified77.3%
Taylor expanded in j around 0 73.6%
Taylor expanded in x around 0 79.1%
if -2.7499999999999998e26 < x < -7.5000000000000004e-37Initial program 99.9%
distribute-rgt-out--99.9%
associate-*r*99.9%
*-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in b around 0 94.9%
cancel-sign-sub-inv94.9%
metadata-eval94.9%
distribute-lft-out94.9%
Simplified94.9%
if -7.5000000000000004e-37 < x < -3.09999999999999976e-104Initial program 94.5%
Simplified89.3%
Taylor expanded in x around inf 79.2%
*-commutative79.2%
associate-*r*79.1%
associate-*r*84.4%
associate-*l*84.3%
Simplified84.3%
Taylor expanded in j around 0 79.2%
if -3.09999999999999976e-104 < x < 1.22e16Initial program 94.1%
Simplified90.5%
Taylor expanded in x around 0 84.3%
Final simplification82.0%
NOTE: y and z should be sorted in increasing order before calling this function. 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 -6.2e+44) (not (<= x 9.5e+116))) (+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))) (- (+ (* b c) (* t (* a -4.0))) (+ (* x (* 4.0 i)) (* j (* 27.0 k))))))
assert(y < z);
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 <= -6.2e+44) || !(x <= 9.5e+116)) {
tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
} else {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 <= (-6.2d+44)) .or. (.not. (x <= 9.5d+116))) then
tmp = (b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))
else
tmp = ((b * c) + (t * (a * (-4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
end if
code = tmp
end function
assert y < z;
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 <= -6.2e+44) || !(x <= 9.5e+116)) {
tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
} else {
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -6.2e+44) or not (x <= 9.5e+116): tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i))) else: tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -6.2e+44) || !(x <= 9.5e+116)) tmp = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(a * -4.0))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 <= -6.2e+44) || ~((x <= 9.5e+116)))
tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
else
tmp = ((b * c) + (t * (a * -4.0))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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, -6.2e+44], N[Not[LessEqual[x, 9.5e+116]], $MachinePrecision]], 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[(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}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+44} \lor \neg \left(x \leq 9.5 \cdot 10^{+116}\right):\\
\;\;\;\;b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(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 < -6.19999999999999991e44 or 9.5000000000000004e116 < x Initial program 73.1%
Simplified81.4%
Taylor expanded in x around inf 79.5%
*-commutative79.5%
associate-*r*79.5%
associate-*r*76.4%
associate-*l*76.4%
Simplified76.4%
Taylor expanded in j around 0 75.5%
Taylor expanded in x around 0 82.5%
if -6.19999999999999991e44 < x < 9.5000000000000004e116Initial program 94.3%
Simplified91.9%
Taylor expanded in x around 0 88.8%
*-commutative88.8%
*-commutative88.8%
associate-*r*88.8%
Simplified88.8%
Final simplification86.4%
NOTE: y and z should be sorted in increasing order before calling this function.
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))))
(if (<= (* b c) -8.5e+120)
(* b c)
(if (<= (* b c) -1.12e+58)
t_1
(if (<= (* b c) -2.6e-182)
(* x (* i -4.0))
(if (<= (* b c) 1.7e+135) t_1 (* b c)))))))assert(y < z);
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 tmp;
if ((b * c) <= -8.5e+120) {
tmp = b * c;
} else if ((b * c) <= -1.12e+58) {
tmp = t_1;
} else if ((b * c) <= -2.6e-182) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 1.7e+135) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 * (k * (-27.0d0))
if ((b * c) <= (-8.5d+120)) then
tmp = b * c
else if ((b * c) <= (-1.12d+58)) then
tmp = t_1
else if ((b * c) <= (-2.6d-182)) then
tmp = x * (i * (-4.0d0))
else if ((b * c) <= 1.7d+135) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
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 tmp;
if ((b * c) <= -8.5e+120) {
tmp = b * c;
} else if ((b * c) <= -1.12e+58) {
tmp = t_1;
} else if ((b * c) <= -2.6e-182) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 1.7e+135) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) tmp = 0 if (b * c) <= -8.5e+120: tmp = b * c elif (b * c) <= -1.12e+58: tmp = t_1 elif (b * c) <= -2.6e-182: tmp = x * (i * -4.0) elif (b * c) <= 1.7e+135: tmp = t_1 else: tmp = b * c return tmp
y, z = sort([y, z]) 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)) tmp = 0.0 if (Float64(b * c) <= -8.5e+120) tmp = Float64(b * c); elseif (Float64(b * c) <= -1.12e+58) tmp = t_1; elseif (Float64(b * c) <= -2.6e-182) tmp = Float64(x * Float64(i * -4.0)); elseif (Float64(b * c) <= 1.7e+135) tmp = t_1; else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
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);
tmp = 0.0;
if ((b * c) <= -8.5e+120)
tmp = b * c;
elseif ((b * c) <= -1.12e+58)
tmp = t_1;
elseif ((b * c) <= -2.6e-182)
tmp = x * (i * -4.0);
elseif ((b * c) <= 1.7e+135)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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]}, If[LessEqual[N[(b * c), $MachinePrecision], -8.5e+120], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.12e+58], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -2.6e-182], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.7e+135], t$95$1, N[(b * c), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;b \cdot c \leq -8.5 \cdot 10^{+120}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -1.12 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -2.6 \cdot 10^{-182}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 1.7 \cdot 10^{+135}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -8.50000000000000026e120 or 1.70000000000000005e135 < (*.f64 b c) Initial program 86.9%
Simplified88.3%
Taylor expanded in b around inf 57.5%
if -8.50000000000000026e120 < (*.f64 b c) < -1.12e58 or -2.60000000000000006e-182 < (*.f64 b c) < 1.70000000000000005e135Initial program 83.8%
Simplified87.0%
Taylor expanded in j around inf 35.6%
*-commutative35.6%
associate-*l*35.6%
Simplified35.6%
if -1.12e58 < (*.f64 b c) < -2.60000000000000006e-182Initial program 92.1%
Simplified90.2%
Taylor expanded in i around inf 40.7%
associate-*r*40.7%
*-commutative40.7%
Simplified40.7%
Final simplification43.7%
NOTE: y and z should be sorted in increasing order before calling this function.
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) -9.6e+120)
(* b c)
(if (<= (* b c) -1.08e+58)
(* (* j k) -27.0)
(if (<= (* b c) -3.1e-180)
(* x (* i -4.0))
(if (<= (* b c) 1.5e+135) (* j (* k -27.0)) (* b c))))))assert(y < z);
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) <= -9.6e+120) {
tmp = b * c;
} else if ((b * c) <= -1.08e+58) {
tmp = (j * k) * -27.0;
} else if ((b * c) <= -3.1e-180) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 1.5e+135) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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) <= (-9.6d+120)) then
tmp = b * c
else if ((b * c) <= (-1.08d+58)) then
tmp = (j * k) * (-27.0d0)
else if ((b * c) <= (-3.1d-180)) then
tmp = x * (i * (-4.0d0))
else if ((b * c) <= 1.5d+135) then
tmp = j * (k * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
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) <= -9.6e+120) {
tmp = b * c;
} else if ((b * c) <= -1.08e+58) {
tmp = (j * k) * -27.0;
} else if ((b * c) <= -3.1e-180) {
tmp = x * (i * -4.0);
} else if ((b * c) <= 1.5e+135) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -9.6e+120: tmp = b * c elif (b * c) <= -1.08e+58: tmp = (j * k) * -27.0 elif (b * c) <= -3.1e-180: tmp = x * (i * -4.0) elif (b * c) <= 1.5e+135: tmp = j * (k * -27.0) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -9.6e+120) tmp = Float64(b * c); elseif (Float64(b * c) <= -1.08e+58) tmp = Float64(Float64(j * k) * -27.0); elseif (Float64(b * c) <= -3.1e-180) tmp = Float64(x * Float64(i * -4.0)); elseif (Float64(b * c) <= 1.5e+135) tmp = Float64(j * Float64(k * -27.0)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
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) <= -9.6e+120)
tmp = b * c;
elseif ((b * c) <= -1.08e+58)
tmp = (j * k) * -27.0;
elseif ((b * c) <= -3.1e-180)
tmp = x * (i * -4.0);
elseif ((b * c) <= 1.5e+135)
tmp = j * (k * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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], -9.6e+120], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.08e+58], N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -3.1e-180], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.5e+135], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -9.6 \cdot 10^{+120}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -1.08 \cdot 10^{+58}:\\
\;\;\;\;\left(j \cdot k\right) \cdot -27\\
\mathbf{elif}\;b \cdot c \leq -3.1 \cdot 10^{-180}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 1.5 \cdot 10^{+135}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -9.60000000000000004e120 or 1.5e135 < (*.f64 b c) Initial program 86.9%
Simplified88.3%
Taylor expanded in b around inf 57.5%
if -9.60000000000000004e120 < (*.f64 b c) < -1.0799999999999999e58Initial program 84.6%
Simplified92.5%
Taylor expanded in j around inf 54.4%
*-commutative54.4%
Simplified54.4%
if -1.0799999999999999e58 < (*.f64 b c) < -3.0999999999999999e-180Initial program 92.1%
Simplified90.2%
Taylor expanded in i around inf 40.7%
associate-*r*40.7%
*-commutative40.7%
Simplified40.7%
if -3.0999999999999999e-180 < (*.f64 b c) < 1.5e135Initial program 83.7%
Simplified86.4%
Taylor expanded in j around inf 33.4%
*-commutative33.4%
associate-*l*33.4%
Simplified33.4%
Final simplification43.8%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* j k))))))
(if (<= c -1e-172)
t_1
(if (<= c 8.6e-6)
(- (* -4.0 (+ (* x i) (* t a))) (* (* j 27.0) k))
(if (<= c 2.9e+174) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) t_1)))))assert(y < z);
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 = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
double tmp;
if (c <= -1e-172) {
tmp = t_1;
} else if (c <= 8.6e-6) {
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
} else if (c <= 2.9e+174) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (j * k)))
if (c <= (-1d-172)) then
tmp = t_1
else if (c <= 8.6d-6) then
tmp = ((-4.0d0) * ((x * i) + (t * a))) - ((j * 27.0d0) * k)
else if (c <= 2.9d+174) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
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 = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
double tmp;
if (c <= -1e-172) {
tmp = t_1;
} else if (c <= 8.6e-6) {
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
} else if (c <= 2.9e+174) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k))) tmp = 0 if c <= -1e-172: tmp = t_1 elif c <= 8.6e-6: tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k) elif c <= 2.9e+174: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(j * k)))) tmp = 0.0 if (c <= -1e-172) tmp = t_1; elseif (c <= 8.6e-6) tmp = Float64(Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) - Float64(Float64(j * 27.0) * k)); elseif (c <= 2.9e+174) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
tmp = 0.0;
if (c <= -1e-172)
tmp = t_1;
elseif (c <= 8.6e-6)
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
elseif (c <= 2.9e+174)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1e-172], t$95$1, If[LessEqual[c, 8.6e-6], N[(N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.9e+174], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{if}\;c \leq -1 \cdot 10^{-172}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 8.6 \cdot 10^{-6}:\\
\;\;\;\;-4 \cdot \left(x \cdot i + t \cdot a\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;c \leq 2.9 \cdot 10^{+174}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c < -1e-172 or 2.9e174 < c Initial program 85.2%
Simplified88.5%
Taylor expanded in t around 0 66.8%
if -1e-172 < c < 8.60000000000000067e-6Initial program 88.4%
distribute-rgt-out--89.5%
associate-*r*86.3%
*-commutative86.3%
Applied egg-rr86.3%
Taylor expanded in x around 0 78.1%
Taylor expanded in b around 0 74.2%
cancel-sign-sub-inv74.2%
metadata-eval74.2%
distribute-lft-out74.2%
Simplified74.2%
if 8.60000000000000067e-6 < c < 2.9e174Initial program 85.5%
Simplified90.6%
Taylor expanded in x around inf 62.7%
Final simplification68.9%
NOTE: y and z should be sorted in increasing order before calling this function.
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 -3e+87)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= x -1.25e-44)
(- (* -4.0 (+ (* x i) (* t a))) (* (* j 27.0) k))
(if (<= x 5.2e+134)
(- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))
(* x (- (* i -4.0) (* (* y z) (* t -18.0))))))))assert(y < z);
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 <= -3e+87) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= -1.25e-44) {
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
} else if (x <= 5.2e+134) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else {
tmp = x * ((i * -4.0) - ((y * z) * (t * -18.0)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 <= (-3d+87)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (x <= (-1.25d-44)) then
tmp = ((-4.0d0) * ((x * i) + (t * a))) - ((j * 27.0d0) * k)
else if (x <= 5.2d+134) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
else
tmp = x * ((i * (-4.0d0)) - ((y * z) * (t * (-18.0d0))))
end if
code = tmp
end function
assert y < z;
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 <= -3e+87) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= -1.25e-44) {
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
} else if (x <= 5.2e+134) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else {
tmp = x * ((i * -4.0) - ((y * z) * (t * -18.0)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -3e+87: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif x <= -1.25e-44: tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k) elif x <= 5.2e+134: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) else: tmp = x * ((i * -4.0) - ((y * z) * (t * -18.0))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -3e+87) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (x <= -1.25e-44) tmp = Float64(Float64(-4.0 * Float64(Float64(x * i) + Float64(t * a))) - Float64(Float64(j * 27.0) * k)); elseif (x <= 5.2e+134) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(27.0 * Float64(j * k))); else tmp = Float64(x * Float64(Float64(i * -4.0) - Float64(Float64(y * z) * Float64(t * -18.0)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 <= -3e+87)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (x <= -1.25e-44)
tmp = (-4.0 * ((x * i) + (t * a))) - ((j * 27.0) * k);
elseif (x <= 5.2e+134)
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
else
tmp = x * ((i * -4.0) - ((y * z) * (t * -18.0)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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, -3e+87], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.25e-44], N[(N[(-4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e+134], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(i * -4.0), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] * N[(t * -18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+87}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-44}:\\
\;\;\;\;-4 \cdot \left(x \cdot i + t \cdot a\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+134}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(i \cdot -4 - \left(y \cdot z\right) \cdot \left(t \cdot -18\right)\right)\\
\end{array}
\end{array}
if x < -2.9999999999999999e87Initial program 71.1%
Simplified80.8%
Taylor expanded in x around inf 73.5%
if -2.9999999999999999e87 < x < -1.2500000000000001e-44Initial program 92.7%
distribute-rgt-out--92.7%
associate-*r*92.7%
*-commutative92.7%
Applied egg-rr92.7%
Taylor expanded in x around 0 82.0%
Taylor expanded in b around 0 75.3%
cancel-sign-sub-inv75.3%
metadata-eval75.3%
distribute-lft-out75.3%
Simplified75.3%
if -1.2500000000000001e-44 < x < 5.2000000000000003e134Initial program 93.2%
Simplified90.7%
Taylor expanded in x around 0 77.9%
if 5.2000000000000003e134 < x Initial program 72.1%
distribute-rgt-out--79.8%
associate-*r*82.4%
*-commutative82.4%
Applied egg-rr82.4%
Taylor expanded in x around -inf 77.6%
mul-1-neg77.6%
associate-*r*77.7%
Simplified77.7%
Final simplification76.9%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (<= c -2.36e-82)
(* b c)
(if (<= c 2.6e-49)
(* j (* k -27.0))
(if (<= c 1.08e+175) (* x (* t (* 18.0 (* y z)))) (* b c)))))assert(y < z);
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 (c <= -2.36e-82) {
tmp = b * c;
} else if (c <= 2.6e-49) {
tmp = j * (k * -27.0);
} else if (c <= 1.08e+175) {
tmp = x * (t * (18.0 * (y * z)));
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 (c <= (-2.36d-82)) then
tmp = b * c
else if (c <= 2.6d-49) then
tmp = j * (k * (-27.0d0))
else if (c <= 1.08d+175) then
tmp = x * (t * (18.0d0 * (y * z)))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
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 (c <= -2.36e-82) {
tmp = b * c;
} else if (c <= 2.6e-49) {
tmp = j * (k * -27.0);
} else if (c <= 1.08e+175) {
tmp = x * (t * (18.0 * (y * z)));
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if c <= -2.36e-82: tmp = b * c elif c <= 2.6e-49: tmp = j * (k * -27.0) elif c <= 1.08e+175: tmp = x * (t * (18.0 * (y * z))) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (c <= -2.36e-82) tmp = Float64(b * c); elseif (c <= 2.6e-49) tmp = Float64(j * Float64(k * -27.0)); elseif (c <= 1.08e+175) tmp = Float64(x * Float64(t * Float64(18.0 * Float64(y * z)))); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (c <= -2.36e-82)
tmp = b * c;
elseif (c <= 2.6e-49)
tmp = j * (k * -27.0);
elseif (c <= 1.08e+175)
tmp = x * (t * (18.0 * (y * z)));
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[c, -2.36e-82], N[(b * c), $MachinePrecision], If[LessEqual[c, 2.6e-49], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.08e+175], N[(x * N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.36 \cdot 10^{-82}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;c \leq 2.6 \cdot 10^{-49}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;c \leq 1.08 \cdot 10^{+175}:\\
\;\;\;\;x \cdot \left(t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if c < -2.3599999999999999e-82 or 1.08e175 < c Initial program 85.9%
Simplified91.0%
Taylor expanded in b around inf 43.1%
if -2.3599999999999999e-82 < c < 2.59999999999999995e-49Initial program 87.0%
Simplified84.2%
Taylor expanded in j around inf 33.5%
*-commutative33.5%
associate-*l*33.4%
Simplified33.4%
if 2.59999999999999995e-49 < c < 1.08e175Initial program 86.3%
Simplified90.4%
Taylor expanded in x around 0 90.4%
*-commutative90.4%
associate-*r*90.3%
associate-*l*90.3%
Simplified90.3%
Taylor expanded in x around inf 74.6%
*-commutative74.6%
associate-*l*80.3%
associate-*l*78.2%
Simplified78.2%
Taylor expanded in y around inf 29.4%
*-commutative29.4%
*-commutative29.4%
associate-*r*31.3%
associate-*r*29.5%
*-commutative29.5%
associate-*r*33.1%
*-commutative33.1%
associate-*r*33.1%
*-commutative33.1%
associate-*l*33.1%
associate-*l*33.2%
Simplified33.2%
Final simplification37.1%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (<= c -1.18e-82)
(* b c)
(if (<= c 5.2e-142)
(* j (* k -27.0))
(if (<= c 2.6e+174) (* x (* z (* y (* 18.0 t)))) (* b c)))))assert(y < z);
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 (c <= -1.18e-82) {
tmp = b * c;
} else if (c <= 5.2e-142) {
tmp = j * (k * -27.0);
} else if (c <= 2.6e+174) {
tmp = x * (z * (y * (18.0 * t)));
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 (c <= (-1.18d-82)) then
tmp = b * c
else if (c <= 5.2d-142) then
tmp = j * (k * (-27.0d0))
else if (c <= 2.6d+174) then
tmp = x * (z * (y * (18.0d0 * t)))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
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 (c <= -1.18e-82) {
tmp = b * c;
} else if (c <= 5.2e-142) {
tmp = j * (k * -27.0);
} else if (c <= 2.6e+174) {
tmp = x * (z * (y * (18.0 * t)));
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if c <= -1.18e-82: tmp = b * c elif c <= 5.2e-142: tmp = j * (k * -27.0) elif c <= 2.6e+174: tmp = x * (z * (y * (18.0 * t))) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (c <= -1.18e-82) tmp = Float64(b * c); elseif (c <= 5.2e-142) tmp = Float64(j * Float64(k * -27.0)); elseif (c <= 2.6e+174) tmp = Float64(x * Float64(z * Float64(y * Float64(18.0 * t)))); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (c <= -1.18e-82)
tmp = b * c;
elseif (c <= 5.2e-142)
tmp = j * (k * -27.0);
elseif (c <= 2.6e+174)
tmp = x * (z * (y * (18.0 * t)));
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[c, -1.18e-82], N[(b * c), $MachinePrecision], If[LessEqual[c, 5.2e-142], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.6e+174], N[(x * N[(z * N[(y * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.18 \cdot 10^{-82}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;c \leq 5.2 \cdot 10^{-142}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;c \leq 2.6 \cdot 10^{+174}:\\
\;\;\;\;x \cdot \left(z \cdot \left(y \cdot \left(18 \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if c < -1.1799999999999999e-82 or 2.5999999999999999e174 < c Initial program 85.9%
Simplified91.0%
Taylor expanded in b around inf 43.1%
if -1.1799999999999999e-82 < c < 5.1999999999999999e-142Initial program 86.1%
Simplified82.9%
Taylor expanded in j around inf 32.6%
*-commutative32.6%
associate-*l*32.6%
Simplified32.6%
if 5.1999999999999999e-142 < c < 2.5999999999999999e174Initial program 87.7%
Simplified91.0%
Taylor expanded in x around 0 91.0%
*-commutative91.0%
associate-*r*90.8%
associate-*l*90.8%
Simplified90.8%
Taylor expanded in x around inf 76.8%
*-commutative76.8%
associate-*l*82.7%
associate-*l*81.1%
Simplified81.1%
Taylor expanded in y around inf 28.6%
*-commutative28.6%
associate-*r*30.0%
associate-*r*28.6%
*-commutative28.6%
*-commutative28.6%
associate-*r*33.0%
*-commutative33.0%
associate-*r*31.5%
*-commutative31.5%
associate-*l*31.5%
*-commutative31.5%
associate-*r*31.5%
associate-*r*31.5%
*-commutative31.5%
Simplified31.5%
Final simplification36.4%
NOTE: y and z should be sorted in increasing order before calling this function. 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 (<= y -3.1e+149) (not (<= y 8.2e+14))) (* x (* z (* y (* 18.0 t)))) (+ (* b c) (* -4.0 (* x i)))))
assert(y < z);
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 ((y <= -3.1e+149) || !(y <= 8.2e+14)) {
tmp = x * (z * (y * (18.0 * t)));
} else {
tmp = (b * c) + (-4.0 * (x * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 ((y <= (-3.1d+149)) .or. (.not. (y <= 8.2d+14))) then
tmp = x * (z * (y * (18.0d0 * t)))
else
tmp = (b * c) + ((-4.0d0) * (x * i))
end if
code = tmp
end function
assert y < z;
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 ((y <= -3.1e+149) || !(y <= 8.2e+14)) {
tmp = x * (z * (y * (18.0 * t)));
} else {
tmp = (b * c) + (-4.0 * (x * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (y <= -3.1e+149) or not (y <= 8.2e+14): tmp = x * (z * (y * (18.0 * t))) else: tmp = (b * c) + (-4.0 * (x * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((y <= -3.1e+149) || !(y <= 8.2e+14)) tmp = Float64(x * Float64(z * Float64(y * Float64(18.0 * t)))); else tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(x * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((y <= -3.1e+149) || ~((y <= 8.2e+14)))
tmp = x * (z * (y * (18.0 * t)));
else
tmp = (b * c) + (-4.0 * (x * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[y, -3.1e+149], N[Not[LessEqual[y, 8.2e+14]], $MachinePrecision]], N[(x * N[(z * N[(y * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+149} \lor \neg \left(y \leq 8.2 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot \left(z \cdot \left(y \cdot \left(18 \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if y < -3.09999999999999987e149 or 8.2e14 < y Initial program 78.7%
Simplified77.8%
Taylor expanded in x around 0 77.8%
*-commutative77.8%
associate-*r*83.0%
associate-*l*83.0%
Simplified83.0%
Taylor expanded in x around inf 65.1%
*-commutative65.1%
associate-*l*72.0%
associate-*l*78.3%
Simplified78.3%
Taylor expanded in y around inf 37.4%
*-commutative37.4%
associate-*r*41.5%
associate-*r*44.5%
*-commutative44.5%
*-commutative44.5%
associate-*r*47.4%
*-commutative47.4%
associate-*r*44.3%
*-commutative44.3%
associate-*l*44.3%
*-commutative44.3%
associate-*r*44.3%
associate-*r*49.4%
*-commutative49.4%
Simplified49.4%
if -3.09999999999999987e149 < y < 8.2e14Initial program 90.8%
Simplified93.9%
Taylor expanded in x around inf 77.9%
*-commutative77.9%
associate-*r*77.9%
associate-*r*77.3%
associate-*l*77.3%
Simplified77.3%
Taylor expanded in j around 0 56.6%
Taylor expanded in x around 0 58.6%
Taylor expanded in t around 0 47.8%
Final simplification48.4%
NOTE: y and z should be sorted in increasing order before calling this function. 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) -1.9e+122) (* b c) (if (<= (* b c) 2.05e+135) (* j (* k -27.0)) (* b c))))
assert(y < z);
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) <= -1.9e+122) {
tmp = b * c;
} else if ((b * c) <= 2.05e+135) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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) <= (-1.9d+122)) then
tmp = b * c
else if ((b * c) <= 2.05d+135) then
tmp = j * (k * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
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) <= -1.9e+122) {
tmp = b * c;
} else if ((b * c) <= 2.05e+135) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -1.9e+122: tmp = b * c elif (b * c) <= 2.05e+135: tmp = j * (k * -27.0) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -1.9e+122) tmp = Float64(b * c); elseif (Float64(b * c) <= 2.05e+135) tmp = Float64(j * Float64(k * -27.0)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
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) <= -1.9e+122)
tmp = b * c;
elseif ((b * c) <= 2.05e+135)
tmp = j * (k * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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], -1.9e+122], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.05e+135], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1.9 \cdot 10^{+122}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 2.05 \cdot 10^{+135}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.8999999999999999e122 or 2.05e135 < (*.f64 b c) Initial program 86.9%
Simplified88.3%
Taylor expanded in b around inf 57.5%
if -1.8999999999999999e122 < (*.f64 b c) < 2.05e135Initial program 86.2%
Simplified87.9%
Taylor expanded in j around inf 31.3%
*-commutative31.3%
associate-*l*31.2%
Simplified31.2%
Final simplification39.8%
NOTE: y and z should be sorted in increasing order before calling this function. 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(y < z);
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: y and z should be sorted in increasing order before calling this function.
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 y < z;
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;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 86.4%
Simplified88.1%
Taylor expanded in b around inf 22.3%
Final simplification22.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 2023285
(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)))