
(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 28 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_1 INFINITY)
t_1
(+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
}
return tmp;
}
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i))) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(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]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + 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.6%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
Taylor expanded in x around 0 33.3%
Taylor expanded in j around 0 45.8%
Taylor expanded in a around 0 62.7%
Final simplification92.5%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (- (* b c) t_1))
(t_3 (+ (* b c) (* (+ (* t a) (* x i)) -4.0)))
(t_4 (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
(if (<= t_1 -1e+217)
(+ (* j (* k -27.0)) (* (* x i) -4.0))
(if (<= t_1 -8e+63)
t_3
(if (<= t_1 -2e+25)
t_2
(if (<= t_1 -5e-18)
t_4
(if (<= t_1 1e-68)
t_3
(if (<= t_1 2e+92)
t_4
(if (<= t_1 2e+164)
t_2
(if (<= t_1 2e+224)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(- (* t (* a -4.0)) t_1)))))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) - t_1;
double t_3 = (b * c) + (((t * a) + (x * i)) * -4.0);
double t_4 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t_1 <= -1e+217) {
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
} else if (t_1 <= -8e+63) {
tmp = t_3;
} else if (t_1 <= -2e+25) {
tmp = t_2;
} else if (t_1 <= -5e-18) {
tmp = t_4;
} else if (t_1 <= 1e-68) {
tmp = t_3;
} else if (t_1 <= 2e+92) {
tmp = t_4;
} else if (t_1 <= 2e+164) {
tmp = t_2;
} else if (t_1 <= 2e+224) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else {
tmp = (t * (a * -4.0)) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (b * c) - t_1
t_3 = (b * c) + (((t * a) + (x * i)) * (-4.0d0))
t_4 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
if (t_1 <= (-1d+217)) then
tmp = (j * (k * (-27.0d0))) + ((x * i) * (-4.0d0))
else if (t_1 <= (-8d+63)) then
tmp = t_3
else if (t_1 <= (-2d+25)) then
tmp = t_2
else if (t_1 <= (-5d-18)) then
tmp = t_4
else if (t_1 <= 1d-68) then
tmp = t_3
else if (t_1 <= 2d+92) then
tmp = t_4
else if (t_1 <= 2d+164) then
tmp = t_2
else if (t_1 <= 2d+224) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else
tmp = (t * (a * (-4.0d0))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) - t_1;
double t_3 = (b * c) + (((t * a) + (x * i)) * -4.0);
double t_4 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t_1 <= -1e+217) {
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
} else if (t_1 <= -8e+63) {
tmp = t_3;
} else if (t_1 <= -2e+25) {
tmp = t_2;
} else if (t_1 <= -5e-18) {
tmp = t_4;
} else if (t_1 <= 1e-68) {
tmp = t_3;
} else if (t_1 <= 2e+92) {
tmp = t_4;
} else if (t_1 <= 2e+164) {
tmp = t_2;
} else if (t_1 <= 2e+224) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else {
tmp = (t * (a * -4.0)) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (b * c) - t_1 t_3 = (b * c) + (((t * a) + (x * i)) * -4.0) t_4 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) tmp = 0 if t_1 <= -1e+217: tmp = (j * (k * -27.0)) + ((x * i) * -4.0) elif t_1 <= -8e+63: tmp = t_3 elif t_1 <= -2e+25: tmp = t_2 elif t_1 <= -5e-18: tmp = t_4 elif t_1 <= 1e-68: tmp = t_3 elif t_1 <= 2e+92: tmp = t_4 elif t_1 <= 2e+164: tmp = t_2 elif t_1 <= 2e+224: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) else: tmp = (t * (a * -4.0)) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(b * c) - t_1) t_3 = Float64(Float64(b * c) + Float64(Float64(Float64(t * a) + Float64(x * i)) * -4.0)) t_4 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) tmp = 0.0 if (t_1 <= -1e+217) tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(Float64(x * i) * -4.0)); elseif (t_1 <= -8e+63) tmp = t_3; elseif (t_1 <= -2e+25) tmp = t_2; elseif (t_1 <= -5e-18) tmp = t_4; elseif (t_1 <= 1e-68) tmp = t_3; elseif (t_1 <= 2e+92) tmp = t_4; elseif (t_1 <= 2e+164) tmp = t_2; elseif (t_1 <= 2e+224) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); else tmp = Float64(Float64(t * Float64(a * -4.0)) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (b * c) - t_1;
t_3 = (b * c) + (((t * a) + (x * i)) * -4.0);
t_4 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
tmp = 0.0;
if (t_1 <= -1e+217)
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
elseif (t_1 <= -8e+63)
tmp = t_3;
elseif (t_1 <= -2e+25)
tmp = t_2;
elseif (t_1 <= -5e-18)
tmp = t_4;
elseif (t_1 <= 1e-68)
tmp = t_3;
elseif (t_1 <= 2e+92)
tmp = t_4;
elseif (t_1 <= 2e+164)
tmp = t_2;
elseif (t_1 <= 2e+224)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
else
tmp = (t * (a * -4.0)) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] + N[(N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+217], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -8e+63], t$95$3, If[LessEqual[t$95$1, -2e+25], t$95$2, If[LessEqual[t$95$1, -5e-18], t$95$4, If[LessEqual[t$95$1, 1e-68], t$95$3, If[LessEqual[t$95$1, 2e+92], t$95$4, If[LessEqual[t$95$1, 2e+164], t$95$2, If[LessEqual[t$95$1, 2e+224], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := b \cdot c - t_1\\
t_3 := b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\
t_4 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+217}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\
\mathbf{elif}\;t_1 \leq -8 \cdot 10^{+63}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{+25}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-18}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_1 \leq 10^{-68}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+92}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+164}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+224}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -9.9999999999999996e216Initial program 92.7%
Simplified93.0%
Taylor expanded in t around 0 93.0%
associate-*r*93.0%
*-commutative93.0%
associate-*r*93.0%
*-commutative93.0%
associate-*r*92.9%
fma-udef92.9%
associate-*r*93.0%
*-commutative93.0%
associate-*r*93.0%
Simplified93.0%
Taylor expanded in b around 0 93.0%
mul-1-neg93.0%
associate-*r*93.0%
*-commutative93.0%
associate-*r*92.9%
distribute-neg-in92.9%
distribute-lft-neg-in92.9%
metadata-eval92.9%
distribute-rgt-neg-in92.9%
*-commutative92.9%
distribute-rgt-neg-in92.9%
metadata-eval92.9%
Simplified92.9%
if -9.9999999999999996e216 < (*.f64 (*.f64 j 27) k) < -8.00000000000000046e63 or -5.00000000000000036e-18 < (*.f64 (*.f64 j 27) k) < 1.00000000000000007e-68Initial program 89.9%
Taylor expanded in y around 0 78.4%
fma-neg78.5%
distribute-lft-out78.5%
distribute-lft-neg-in78.5%
metadata-eval78.5%
*-commutative78.5%
fma-def79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in j around 0 76.0%
if -8.00000000000000046e63 < (*.f64 (*.f64 j 27) k) < -2.00000000000000018e25 or 2.0000000000000001e92 < (*.f64 (*.f64 j 27) k) < 2e164Initial program 95.6%
Taylor expanded in x around 0 95.8%
Taylor expanded in b around inf 67.1%
if -2.00000000000000018e25 < (*.f64 (*.f64 j 27) k) < -5.00000000000000036e-18 or 1.00000000000000007e-68 < (*.f64 (*.f64 j 27) k) < 2.0000000000000001e92Initial program 80.4%
Taylor expanded in x around 0 78.3%
Taylor expanded in t around inf 73.1%
Taylor expanded in t around inf 70.9%
if 2e164 < (*.f64 (*.f64 j 27) k) < 1.99999999999999994e224Initial program 79.8%
Simplified80.0%
Taylor expanded in x around inf 71.0%
if 1.99999999999999994e224 < (*.f64 (*.f64 j 27) k) Initial program 71.0%
Taylor expanded in x around 0 71.0%
Taylor expanded in a around inf 90.3%
associate-*r*90.3%
Simplified90.3%
Final simplification77.8%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k))
(t_2 (+ (* b c) (* (+ (* t a) (* x i)) -4.0)))
(t_3 (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
(if (<= t_1 -1e+217)
(+ (* j (* k -27.0)) (* (* x i) -4.0))
(if (<= t_1 -8e+63)
t_2
(if (<= t_1 -2e+25)
(- (* b c) t_1)
(if (<= t_1 -5e-18)
t_3
(if (<= t_1 1e-68)
t_2
(if (<= t_1 5e+94)
t_3
(- (* t (* (* x y) (* 18.0 z))) t_1)))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) + (((t * a) + (x * i)) * -4.0);
double t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t_1 <= -1e+217) {
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
} else if (t_1 <= -8e+63) {
tmp = t_2;
} else if (t_1 <= -2e+25) {
tmp = (b * c) - t_1;
} else if (t_1 <= -5e-18) {
tmp = t_3;
} else if (t_1 <= 1e-68) {
tmp = t_2;
} else if (t_1 <= 5e+94) {
tmp = t_3;
} else {
tmp = (t * ((x * y) * (18.0 * z))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = (b * c) + (((t * a) + (x * i)) * (-4.0d0))
t_3 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
if (t_1 <= (-1d+217)) then
tmp = (j * (k * (-27.0d0))) + ((x * i) * (-4.0d0))
else if (t_1 <= (-8d+63)) then
tmp = t_2
else if (t_1 <= (-2d+25)) then
tmp = (b * c) - t_1
else if (t_1 <= (-5d-18)) then
tmp = t_3
else if (t_1 <= 1d-68) then
tmp = t_2
else if (t_1 <= 5d+94) then
tmp = t_3
else
tmp = (t * ((x * y) * (18.0d0 * z))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = (b * c) + (((t * a) + (x * i)) * -4.0);
double t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t_1 <= -1e+217) {
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
} else if (t_1 <= -8e+63) {
tmp = t_2;
} else if (t_1 <= -2e+25) {
tmp = (b * c) - t_1;
} else if (t_1 <= -5e-18) {
tmp = t_3;
} else if (t_1 <= 1e-68) {
tmp = t_2;
} else if (t_1 <= 5e+94) {
tmp = t_3;
} else {
tmp = (t * ((x * y) * (18.0 * z))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = (b * c) + (((t * a) + (x * i)) * -4.0) t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) tmp = 0 if t_1 <= -1e+217: tmp = (j * (k * -27.0)) + ((x * i) * -4.0) elif t_1 <= -8e+63: tmp = t_2 elif t_1 <= -2e+25: tmp = (b * c) - t_1 elif t_1 <= -5e-18: tmp = t_3 elif t_1 <= 1e-68: tmp = t_2 elif t_1 <= 5e+94: tmp = t_3 else: tmp = (t * ((x * y) * (18.0 * z))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(Float64(b * c) + Float64(Float64(Float64(t * a) + Float64(x * i)) * -4.0)) t_3 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) tmp = 0.0 if (t_1 <= -1e+217) tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(Float64(x * i) * -4.0)); elseif (t_1 <= -8e+63) tmp = t_2; elseif (t_1 <= -2e+25) tmp = Float64(Float64(b * c) - t_1); elseif (t_1 <= -5e-18) tmp = t_3; elseif (t_1 <= 1e-68) tmp = t_2; elseif (t_1 <= 5e+94) tmp = t_3; else tmp = Float64(Float64(t * Float64(Float64(x * y) * Float64(18.0 * z))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = (b * c) + (((t * a) + (x * i)) * -4.0);
t_3 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
tmp = 0.0;
if (t_1 <= -1e+217)
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
elseif (t_1 <= -8e+63)
tmp = t_2;
elseif (t_1 <= -2e+25)
tmp = (b * c) - t_1;
elseif (t_1 <= -5e-18)
tmp = t_3;
elseif (t_1 <= 1e-68)
tmp = t_2;
elseif (t_1 <= 5e+94)
tmp = t_3;
else
tmp = (t * ((x * y) * (18.0 * z))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] + N[(N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+217], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -8e+63], t$95$2, If[LessEqual[t$95$1, -2e+25], N[(N[(b * c), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, -5e-18], t$95$3, If[LessEqual[t$95$1, 1e-68], t$95$2, If[LessEqual[t$95$1, 5e+94], t$95$3, N[(N[(t * N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\
t_3 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+217}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\
\mathbf{elif}\;t_1 \leq -8 \cdot 10^{+63}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -2 \cdot 10^{+25}:\\
\;\;\;\;b \cdot c - t_1\\
\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-18}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq 10^{-68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+94}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -9.9999999999999996e216Initial program 92.7%
Simplified93.0%
Taylor expanded in t around 0 93.0%
associate-*r*93.0%
*-commutative93.0%
associate-*r*93.0%
*-commutative93.0%
associate-*r*92.9%
fma-udef92.9%
associate-*r*93.0%
*-commutative93.0%
associate-*r*93.0%
Simplified93.0%
Taylor expanded in b around 0 93.0%
mul-1-neg93.0%
associate-*r*93.0%
*-commutative93.0%
associate-*r*92.9%
distribute-neg-in92.9%
distribute-lft-neg-in92.9%
metadata-eval92.9%
distribute-rgt-neg-in92.9%
*-commutative92.9%
distribute-rgt-neg-in92.9%
metadata-eval92.9%
Simplified92.9%
if -9.9999999999999996e216 < (*.f64 (*.f64 j 27) k) < -8.00000000000000046e63 or -5.00000000000000036e-18 < (*.f64 (*.f64 j 27) k) < 1.00000000000000007e-68Initial program 89.9%
Taylor expanded in y around 0 78.4%
fma-neg78.5%
distribute-lft-out78.5%
distribute-lft-neg-in78.5%
metadata-eval78.5%
*-commutative78.5%
fma-def79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in j around 0 76.0%
if -8.00000000000000046e63 < (*.f64 (*.f64 j 27) k) < -2.00000000000000018e25Initial program 92.2%
Taylor expanded in x around 0 99.9%
Taylor expanded in b around inf 69.3%
if -2.00000000000000018e25 < (*.f64 (*.f64 j 27) k) < -5.00000000000000036e-18 or 1.00000000000000007e-68 < (*.f64 (*.f64 j 27) k) < 5.0000000000000001e94Initial program 80.9%
Taylor expanded in x around 0 78.8%
Taylor expanded in t around inf 71.3%
Taylor expanded in t around inf 69.2%
if 5.0000000000000001e94 < (*.f64 (*.f64 j 27) k) Initial program 78.3%
Taylor expanded in x around 0 76.5%
Taylor expanded in t around inf 77.8%
Taylor expanded in x around inf 75.9%
*-commutative75.9%
associate-*l*75.9%
associate-*r*77.7%
associate-*l*75.7%
Simplified75.7%
Final simplification76.4%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -2e+20)
(- (- (* b c) (* 4.0 (* x i))) t_1)
(if (<= t_1 -5e-18)
(* t (- (* 18.0 (* x (* y z))) (* a 4.0)))
(if (<= t_1 5e-86)
(+ (* b c) (* (+ (* t a) (* x i)) -4.0))
(if (<= t_1 5e-18)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= t_1 2e+102)
(- (- (* b c) (* 4.0 (* t a))) t_1)
(- (* t (* (* x y) (* 18.0 z))) t_1))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+20) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (t_1 <= -5e-18) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else if (t_1 <= 5e-86) {
tmp = (b * c) + (((t * a) + (x * i)) * -4.0);
} else if (t_1 <= 5e-18) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (t_1 <= 2e+102) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else {
tmp = (t * ((x * y) * (18.0 * z))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-2d+20)) then
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
else if (t_1 <= (-5d-18)) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else if (t_1 <= 5d-86) then
tmp = (b * c) + (((t * a) + (x * i)) * (-4.0d0))
else if (t_1 <= 5d-18) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (t_1 <= 2d+102) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else
tmp = (t * ((x * y) * (18.0d0 * z))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -2e+20) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (t_1 <= -5e-18) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else if (t_1 <= 5e-86) {
tmp = (b * c) + (((t * a) + (x * i)) * -4.0);
} else if (t_1 <= 5e-18) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (t_1 <= 2e+102) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else {
tmp = (t * ((x * y) * (18.0 * z))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -2e+20: tmp = ((b * c) - (4.0 * (x * i))) - t_1 elif t_1 <= -5e-18: tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) elif t_1 <= 5e-86: tmp = (b * c) + (((t * a) + (x * i)) * -4.0) elif t_1 <= 5e-18: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif t_1 <= 2e+102: tmp = ((b * c) - (4.0 * (t * a))) - t_1 else: tmp = (t * ((x * y) * (18.0 * z))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -2e+20) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); elseif (t_1 <= -5e-18) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); elseif (t_1 <= 5e-86) tmp = Float64(Float64(b * c) + Float64(Float64(Float64(t * a) + Float64(x * i)) * -4.0)); elseif (t_1 <= 5e-18) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (t_1 <= 2e+102) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); else tmp = Float64(Float64(t * Float64(Float64(x * y) * Float64(18.0 * z))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -2e+20)
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
elseif (t_1 <= -5e-18)
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
elseif (t_1 <= 5e-86)
tmp = (b * c) + (((t * a) + (x * i)) * -4.0);
elseif (t_1 <= 5e-18)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (t_1 <= 2e+102)
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
else
tmp = (t * ((x * y) * (18.0 * z))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+20], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, -5e-18], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-86], N[(N[(b * c), $MachinePrecision] + N[(N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-18], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+102], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(t * N[(N[(x * y), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+20}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{elif}\;t_1 \leq -5 \cdot 10^{-18}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-86}:\\
\;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{-18}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot z\right)\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -2e20Initial program 87.8%
Taylor expanded in t around 0 83.0%
if -2e20 < (*.f64 (*.f64 j 27) k) < -5.00000000000000036e-18Initial program 90.8%
Taylor expanded in x around 0 74.2%
Taylor expanded in t around inf 90.8%
Taylor expanded in t around inf 90.8%
if -5.00000000000000036e-18 < (*.f64 (*.f64 j 27) k) < 4.9999999999999999e-86Initial program 92.9%
Taylor expanded in y around 0 80.9%
fma-neg80.9%
distribute-lft-out80.9%
distribute-lft-neg-in80.9%
metadata-eval80.9%
*-commutative80.9%
fma-def81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in j around 0 78.9%
if 4.9999999999999999e-86 < (*.f64 (*.f64 j 27) k) < 5.00000000000000036e-18Initial program 73.8%
Simplified73.8%
Taylor expanded in x around inf 74.7%
if 5.00000000000000036e-18 < (*.f64 (*.f64 j 27) k) < 1.99999999999999995e102Initial program 79.5%
Taylor expanded in x around 0 65.4%
if 1.99999999999999995e102 < (*.f64 (*.f64 j 27) k) Initial program 77.9%
Taylor expanded in x around 0 76.0%
Taylor expanded in t around inf 79.4%
Taylor expanded in x around inf 77.4%
*-commutative77.4%
associate-*l*77.4%
associate-*r*79.2%
associate-*l*77.2%
Simplified77.2%
Final simplification78.8%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (* 4.0 i)))
(t_2
(- (+ (* b c) (* (* 18.0 (* y z)) (* x t))) (+ t_1 (* j (* 27.0 k)))))
(t_3 (* (* j 27.0) k)))
(if (<= t_3 -5e+33)
t_2
(if (<= t_3 2e+92)
(- (+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0)))) t_1)
(if (<= t_3 2e+232)
t_2
(- (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) t_3))))))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);
double t_2 = ((b * c) + ((18.0 * (y * z)) * (x * t))) - (t_1 + (j * (27.0 * k)));
double t_3 = (j * 27.0) * k;
double tmp;
if (t_3 <= -5e+33) {
tmp = t_2;
} else if (t_3 <= 2e+92) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1;
} else if (t_3 <= 2e+232) {
tmp = t_2;
} else {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_3;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * (4.0d0 * i)
t_2 = ((b * c) + ((18.0d0 * (y * z)) * (x * t))) - (t_1 + (j * (27.0d0 * k)))
t_3 = (j * 27.0d0) * k
if (t_3 <= (-5d+33)) then
tmp = t_2
else if (t_3 <= 2d+92) then
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - t_1
else if (t_3 <= 2d+232) then
tmp = t_2
else
tmp = (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))) - t_3
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (4.0 * i);
double t_2 = ((b * c) + ((18.0 * (y * z)) * (x * t))) - (t_1 + (j * (27.0 * k)));
double t_3 = (j * 27.0) * k;
double tmp;
if (t_3 <= -5e+33) {
tmp = t_2;
} else if (t_3 <= 2e+92) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1;
} else if (t_3 <= 2e+232) {
tmp = t_2;
} else {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_3;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (4.0 * i) t_2 = ((b * c) + ((18.0 * (y * z)) * (x * t))) - (t_1 + (j * (27.0 * k))) t_3 = (j * 27.0) * k tmp = 0 if t_3 <= -5e+33: tmp = t_2 elif t_3 <= 2e+92: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1 elif t_3 <= 2e+232: tmp = t_2 else: tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_3 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(4.0 * i)) t_2 = Float64(Float64(Float64(b * c) + Float64(Float64(18.0 * Float64(y * z)) * Float64(x * t))) - Float64(t_1 + Float64(j * Float64(27.0 * k)))) t_3 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_3 <= -5e+33) tmp = t_2; elseif (t_3 <= 2e+92) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - t_1); elseif (t_3 <= 2e+232) tmp = t_2; else tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) - t_3); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * (4.0 * i);
t_2 = ((b * c) + ((18.0 * (y * z)) * (x * t))) - (t_1 + (j * (27.0 * k)));
t_3 = (j * 27.0) * k;
tmp = 0.0;
if (t_3 <= -5e+33)
tmp = t_2;
elseif (t_3 <= 2e+92)
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - t_1;
elseif (t_3 <= 2e+232)
tmp = t_2;
else
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_3;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * c), $MachinePrecision] + N[(N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+33], t$95$2, If[LessEqual[t$95$3, 2e+92], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$3, 2e+232], t$95$2, N[(N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(4 \cdot i\right)\\
t_2 := \left(b \cdot c + \left(18 \cdot \left(y \cdot z\right)\right) \cdot \left(x \cdot t\right)\right) - \left(t_1 + j \cdot \left(27 \cdot k\right)\right)\\
t_3 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{+33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 2 \cdot 10^{+92}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - t_1\\
\mathbf{elif}\;t_3 \leq 2 \cdot 10^{+232}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - t_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -4.99999999999999973e33 or 2.0000000000000001e92 < (*.f64 (*.f64 j 27) k) < 2.00000000000000011e232Initial program 89.4%
Simplified89.6%
Taylor expanded in x around inf 85.9%
*-commutative85.9%
associate-*r*87.2%
associate-*l*87.2%
*-commutative87.2%
*-commutative87.2%
Simplified87.2%
if -4.99999999999999973e33 < (*.f64 (*.f64 j 27) k) < 2.0000000000000001e92Initial program 88.5%
Simplified91.4%
Taylor expanded in x around inf 90.1%
associate-*r*90.1%
*-commutative90.1%
Simplified90.1%
if 2.00000000000000011e232 < (*.f64 (*.f64 j 27) k) Initial program 70.1%
Taylor expanded in x around 0 70.1%
Taylor expanded in t around inf 90.1%
Final simplification89.2%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 4.0 (* t a))))
(t_2 (* (* j 27.0) k))
(t_3 (- (* b c) t_2)))
(if (<= t_2 -2e+25)
t_3
(if (<= t_2 -5e-18)
(* 18.0 (* t (* x (* y z))))
(if (<= t_2 -1e-44)
t_1
(if (<= t_2 2e-57)
(- (* b c) (* x (* 4.0 i)))
(if (<= t_2 2e+92) t_1 t_3)))))))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 * (t * a));
double t_2 = (j * 27.0) * k;
double t_3 = (b * c) - t_2;
double tmp;
if (t_2 <= -2e+25) {
tmp = t_3;
} else if (t_2 <= -5e-18) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (t_2 <= -1e-44) {
tmp = t_1;
} else if (t_2 <= 2e-57) {
tmp = (b * c) - (x * (4.0 * i));
} else if (t_2 <= 2e+92) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (b * c) - (4.0d0 * (t * a))
t_2 = (j * 27.0d0) * k
t_3 = (b * c) - t_2
if (t_2 <= (-2d+25)) then
tmp = t_3
else if (t_2 <= (-5d-18)) then
tmp = 18.0d0 * (t * (x * (y * z)))
else if (t_2 <= (-1d-44)) then
tmp = t_1
else if (t_2 <= 2d-57) then
tmp = (b * c) - (x * (4.0d0 * i))
else if (t_2 <= 2d+92) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * (t * a));
double t_2 = (j * 27.0) * k;
double t_3 = (b * c) - t_2;
double tmp;
if (t_2 <= -2e+25) {
tmp = t_3;
} else if (t_2 <= -5e-18) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (t_2 <= -1e-44) {
tmp = t_1;
} else if (t_2 <= 2e-57) {
tmp = (b * c) - (x * (4.0 * i));
} else if (t_2 <= 2e+92) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (4.0 * (t * a)) t_2 = (j * 27.0) * k t_3 = (b * c) - t_2 tmp = 0 if t_2 <= -2e+25: tmp = t_3 elif t_2 <= -5e-18: tmp = 18.0 * (t * (x * (y * z))) elif t_2 <= -1e-44: tmp = t_1 elif t_2 <= 2e-57: tmp = (b * c) - (x * (4.0 * i)) elif t_2 <= 2e+92: tmp = t_1 else: tmp = t_3 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) t_2 = Float64(Float64(j * 27.0) * k) t_3 = Float64(Float64(b * c) - t_2) tmp = 0.0 if (t_2 <= -2e+25) tmp = t_3; elseif (t_2 <= -5e-18) tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))); elseif (t_2 <= -1e-44) tmp = t_1; elseif (t_2 <= 2e-57) tmp = Float64(Float64(b * c) - Float64(x * Float64(4.0 * i))); elseif (t_2 <= 2e+92) tmp = t_1; else tmp = t_3; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (4.0 * (t * a));
t_2 = (j * 27.0) * k;
t_3 = (b * c) - t_2;
tmp = 0.0;
if (t_2 <= -2e+25)
tmp = t_3;
elseif (t_2 <= -5e-18)
tmp = 18.0 * (t * (x * (y * z)));
elseif (t_2 <= -1e-44)
tmp = t_1;
elseif (t_2 <= 2e-57)
tmp = (b * c) - (x * (4.0 * i));
elseif (t_2 <= 2e+92)
tmp = t_1;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+25], t$95$3, If[LessEqual[t$95$2, -5e-18], N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-44], t$95$1, If[LessEqual[t$95$2, 2e-57], N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+92], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(t \cdot a\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
t_3 := b \cdot c - t_2\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+25}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq -5 \cdot 10^{-18}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;t_2 \leq -1 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{-57}:\\
\;\;\;\;b \cdot c - x \cdot \left(4 \cdot i\right)\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -2.00000000000000018e25 or 2.0000000000000001e92 < (*.f64 (*.f64 j 27) k) Initial program 83.3%
Taylor expanded in x around 0 81.7%
Taylor expanded in b around inf 69.5%
if -2.00000000000000018e25 < (*.f64 (*.f64 j 27) k) < -5.00000000000000036e-18Initial program 91.6%
Simplified91.6%
Taylor expanded in x around inf 54.7%
Taylor expanded in t around inf 64.0%
if -5.00000000000000036e-18 < (*.f64 (*.f64 j 27) k) < -9.99999999999999953e-45 or 1.99999999999999991e-57 < (*.f64 (*.f64 j 27) k) < 2.0000000000000001e92Initial program 80.4%
Taylor expanded in x around 0 83.6%
Taylor expanded in j around 0 80.6%
Taylor expanded in b around inf 58.3%
if -9.99999999999999953e-45 < (*.f64 (*.f64 j 27) k) < 1.99999999999999991e-57Initial program 91.2%
Simplified93.4%
Taylor expanded in t around 0 55.7%
associate-*r*55.7%
*-commutative55.7%
associate-*r*55.7%
*-commutative55.7%
associate-*r*55.7%
fma-udef55.7%
associate-*r*55.7%
*-commutative55.7%
associate-*r*55.7%
Simplified55.7%
Taylor expanded in x around inf 53.7%
associate-*r*53.7%
*-commutative53.7%
*-commutative53.7%
Simplified53.7%
Final simplification61.5%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= (* j 27.0) -1e-91)
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(if (<= (* j 27.0) 2e+76)
(-
(-
(+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))))
(* 4.0 (* t a)))
(* (* j 27.0) k))
(* j (* k -27.0)))))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 ((j * 27.0) <= -1e-91) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if ((j * 27.0) <= 2e+76) {
tmp = (((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - ((j * 27.0) * k);
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((j * 27.0d0) <= (-1d-91)) then
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else if ((j * 27.0d0) <= 2d+76) then
tmp = (((b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
else
tmp = j * (k * (-27.0d0))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((j * 27.0) <= -1e-91) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else if ((j * 27.0) <= 2e+76) {
tmp = (((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - ((j * 27.0) * k);
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (j * 27.0) <= -1e-91: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k))) elif (j * 27.0) <= 2e+76: tmp = (((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - ((j * 27.0) * k) else: tmp = j * (k * -27.0) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(j * 27.0) <= -1e-91) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); elseif (Float64(j * 27.0) <= 2e+76) tmp = Float64(Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(j * Float64(k * -27.0)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((j * 27.0) <= -1e-91)
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
elseif ((j * 27.0) <= 2e+76)
tmp = (((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a))) - ((j * 27.0) * k);
else
tmp = j * (k * -27.0);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(j * 27.0), $MachinePrecision], -1e-91], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(j * 27.0), $MachinePrecision], 2e+76], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;j \cdot 27 \leq -1 \cdot 10^{-91}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{elif}\;j \cdot 27 \leq 2 \cdot 10^{+76}:\\
\;\;\;\;\left(\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if (*.f64 j 27) < -1.00000000000000002e-91Initial program 92.2%
Simplified89.3%
if -1.00000000000000002e-91 < (*.f64 j 27) < 2.0000000000000001e76Initial program 87.0%
Taylor expanded in x around 0 91.1%
if 2.0000000000000001e76 < (*.f64 j 27) Initial program 76.4%
Simplified84.2%
Taylor expanded in j around inf 47.0%
*-commutative47.0%
associate-*l*47.1%
Simplified47.1%
Final simplification81.7%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -5e+33)
(- (- (* b c) (* 4.0 (* x i))) t_1)
(if (<= t_1 2e+102)
(-
(+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))))
(* 4.0 (* t a)))
(- (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) t_1)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -5e+33) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (t_1 <= 2e+102) {
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a));
} else {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-5d+33)) then
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
else if (t_1 <= 2d+102) then
tmp = ((b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))) - (4.0d0 * (t * a))
else
tmp = (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -5e+33) {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
} else if (t_1 <= 2e+102) {
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a));
} else {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -5e+33: tmp = ((b * c) - (4.0 * (x * i))) - t_1 elif t_1 <= 2e+102: tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a)) else: tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -5e+33) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); elseif (t_1 <= 2e+102) tmp = Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i)))) - Float64(4.0 * Float64(t * a))); else tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -5e+33)
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
elseif (t_1 <= 2e+102)
tmp = ((b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)))) - (4.0 * (t * a));
else
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+33], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 2e+102], N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+33}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\right) - 4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -4.99999999999999973e33Initial program 88.9%
Taylor expanded in t around 0 82.1%
if -4.99999999999999973e33 < (*.f64 (*.f64 j 27) k) < 1.99999999999999995e102Initial program 88.6%
Taylor expanded in x around 0 91.0%
Taylor expanded in j around 0 88.6%
if 1.99999999999999995e102 < (*.f64 (*.f64 j 27) k) Initial program 77.9%
Taylor expanded in x around 0 76.0%
Taylor expanded in t around inf 79.4%
Final simplification85.4%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -4e+224)
(* j (* k -27.0))
(if (<= t_1 2e+102)
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(* x (* 4.0 i)))
(- (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) t_1)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -4e+224) {
tmp = j * (k * -27.0);
} else if (t_1 <= 2e+102) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (x * (4.0 * i));
} else {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-4d+224)) then
tmp = j * (k * (-27.0d0))
else if (t_1 <= 2d+102) then
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - (x * (4.0d0 * i))
else
tmp = (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -4e+224) {
tmp = j * (k * -27.0);
} else if (t_1 <= 2e+102) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (x * (4.0 * i));
} else {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -4e+224: tmp = j * (k * -27.0) elif t_1 <= 2e+102: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (x * (4.0 * i)) else: tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -4e+224) tmp = Float64(j * Float64(k * -27.0)); elseif (t_1 <= 2e+102) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - Float64(x * Float64(4.0 * i))); else tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -4e+224)
tmp = j * (k * -27.0);
elseif (t_1 <= 2e+102)
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (x * (4.0 * i));
else
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+224], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+102], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+224}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - x \cdot \left(4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -3.99999999999999988e224Initial program 92.2%
Simplified92.4%
Taylor expanded in j around inf 96.1%
*-commutative96.1%
associate-*l*96.0%
Simplified96.0%
if -3.99999999999999988e224 < (*.f64 (*.f64 j 27) k) < 1.99999999999999995e102Initial program 88.2%
Simplified91.2%
Taylor expanded in x around inf 86.5%
associate-*r*86.5%
*-commutative86.5%
Simplified86.5%
if 1.99999999999999995e102 < (*.f64 (*.f64 j 27) k) Initial program 77.9%
Taylor expanded in x around 0 76.0%
Taylor expanded in t around inf 79.4%
Final simplification86.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -4e+224)
(* j (* k -27.0))
(if (<= t_1 2e+102)
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(* x (* 4.0 i)))
(- (- (* t (* (* z (* x y)) (- -18.0))) (* t (* a 4.0))) t_1)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -4e+224) {
tmp = j * (k * -27.0);
} else if (t_1 <= 2e+102) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (x * (4.0 * i));
} else {
tmp = ((t * ((z * (x * y)) * -(-18.0))) - (t * (a * 4.0))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-4d+224)) then
tmp = j * (k * (-27.0d0))
else if (t_1 <= 2d+102) then
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - (x * (4.0d0 * i))
else
tmp = ((t * ((z * (x * y)) * -(-18.0d0))) - (t * (a * 4.0d0))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -4e+224) {
tmp = j * (k * -27.0);
} else if (t_1 <= 2e+102) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (x * (4.0 * i));
} else {
tmp = ((t * ((z * (x * y)) * -(-18.0))) - (t * (a * 4.0))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -4e+224: tmp = j * (k * -27.0) elif t_1 <= 2e+102: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (x * (4.0 * i)) else: tmp = ((t * ((z * (x * y)) * -(-18.0))) - (t * (a * 4.0))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -4e+224) tmp = Float64(j * Float64(k * -27.0)); elseif (t_1 <= 2e+102) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - Float64(x * Float64(4.0 * i))); else tmp = Float64(Float64(Float64(t * Float64(Float64(z * Float64(x * y)) * Float64(-(-18.0)))) - Float64(t * Float64(a * 4.0))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -4e+224)
tmp = j * (k * -27.0);
elseif (t_1 <= 2e+102)
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - (x * (4.0 * i));
else
tmp = ((t * ((z * (x * y)) * -(-18.0))) - (t * (a * 4.0))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+224], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+102], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] * (--18.0)), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+224}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - x \cdot \left(4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \left(\left(z \cdot \left(x \cdot y\right)\right) \cdot \left(--18\right)\right) - t \cdot \left(a \cdot 4\right)\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -3.99999999999999988e224Initial program 92.2%
Simplified92.4%
Taylor expanded in j around inf 96.1%
*-commutative96.1%
associate-*l*96.0%
Simplified96.0%
if -3.99999999999999988e224 < (*.f64 (*.f64 j 27) k) < 1.99999999999999995e102Initial program 88.2%
Simplified91.2%
Taylor expanded in x around inf 86.5%
associate-*r*86.5%
*-commutative86.5%
Simplified86.5%
if 1.99999999999999995e102 < (*.f64 (*.f64 j 27) k) Initial program 77.9%
Taylor expanded in t around -inf 79.4%
associate-*r*79.4%
neg-mul-179.4%
cancel-sign-sub-inv79.4%
*-commutative79.4%
metadata-eval79.4%
Simplified79.4%
distribute-rgt-in79.4%
associate-*r*81.2%
Applied egg-rr81.2%
Final simplification86.4%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= (* (* j 27.0) k) 2e+295)
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(* j (* k -27.0))))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 (((j * 27.0) * k) <= 2e+295) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (((j * 27.0d0) * k) <= 2d+295) then
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else
tmp = j * (k * (-27.0d0))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((j * 27.0) * k) <= 2e+295) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if ((j * 27.0) * k) <= 2e+295: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = j * (k * -27.0) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(j * 27.0) * k) <= 2e+295) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(j * Float64(k * -27.0)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (((j * 27.0) * k) <= 2e+295)
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = j * (k * -27.0);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision], 2e+295], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(j \cdot 27\right) \cdot k \leq 2 \cdot 10^{+295}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < 2e295Initial program 89.1%
Simplified91.0%
if 2e295 < (*.f64 (*.f64 j 27) k) Initial program 62.7%
Simplified66.7%
Taylor expanded in j around inf 87.9%
*-commutative87.9%
associate-*l*87.9%
Simplified87.9%
Final simplification90.7%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* t (* x (* y z)))))
(t_2 (* t (* a -4.0)))
(t_3 (* j (* k -27.0)))
(t_4 (* (* x i) -4.0)))
(if (<= j -1.4e+55)
t_3
(if (<= j -1.4e+29)
t_2
(if (<= j -1.85e-31)
(* b c)
(if (<= j -8.2e-126)
t_1
(if (<= j -1.35e-182)
t_4
(if (<= j -5.8e-207)
t_2
(if (<= j -8e-243)
t_1
(if (<= j 4e-306) t_4 (if (<= j 1.4e+85) t_1 t_3)))))))))))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 = 18.0 * (t * (x * (y * z)));
double t_2 = t * (a * -4.0);
double t_3 = j * (k * -27.0);
double t_4 = (x * i) * -4.0;
double tmp;
if (j <= -1.4e+55) {
tmp = t_3;
} else if (j <= -1.4e+29) {
tmp = t_2;
} else if (j <= -1.85e-31) {
tmp = b * c;
} else if (j <= -8.2e-126) {
tmp = t_1;
} else if (j <= -1.35e-182) {
tmp = t_4;
} else if (j <= -5.8e-207) {
tmp = t_2;
} else if (j <= -8e-243) {
tmp = t_1;
} else if (j <= 4e-306) {
tmp = t_4;
} else if (j <= 1.4e+85) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = 18.0d0 * (t * (x * (y * z)))
t_2 = t * (a * (-4.0d0))
t_3 = j * (k * (-27.0d0))
t_4 = (x * i) * (-4.0d0)
if (j <= (-1.4d+55)) then
tmp = t_3
else if (j <= (-1.4d+29)) then
tmp = t_2
else if (j <= (-1.85d-31)) then
tmp = b * c
else if (j <= (-8.2d-126)) then
tmp = t_1
else if (j <= (-1.35d-182)) then
tmp = t_4
else if (j <= (-5.8d-207)) then
tmp = t_2
else if (j <= (-8d-243)) then
tmp = t_1
else if (j <= 4d-306) then
tmp = t_4
else if (j <= 1.4d+85) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (t * (x * (y * z)));
double t_2 = t * (a * -4.0);
double t_3 = j * (k * -27.0);
double t_4 = (x * i) * -4.0;
double tmp;
if (j <= -1.4e+55) {
tmp = t_3;
} else if (j <= -1.4e+29) {
tmp = t_2;
} else if (j <= -1.85e-31) {
tmp = b * c;
} else if (j <= -8.2e-126) {
tmp = t_1;
} else if (j <= -1.35e-182) {
tmp = t_4;
} else if (j <= -5.8e-207) {
tmp = t_2;
} else if (j <= -8e-243) {
tmp = t_1;
} else if (j <= 4e-306) {
tmp = t_4;
} else if (j <= 1.4e+85) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * (t * (x * (y * z))) t_2 = t * (a * -4.0) t_3 = j * (k * -27.0) t_4 = (x * i) * -4.0 tmp = 0 if j <= -1.4e+55: tmp = t_3 elif j <= -1.4e+29: tmp = t_2 elif j <= -1.85e-31: tmp = b * c elif j <= -8.2e-126: tmp = t_1 elif j <= -1.35e-182: tmp = t_4 elif j <= -5.8e-207: tmp = t_2 elif j <= -8e-243: tmp = t_1 elif j <= 4e-306: tmp = t_4 elif j <= 1.4e+85: tmp = t_1 else: tmp = t_3 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))) t_2 = Float64(t * Float64(a * -4.0)) t_3 = Float64(j * Float64(k * -27.0)) t_4 = Float64(Float64(x * i) * -4.0) tmp = 0.0 if (j <= -1.4e+55) tmp = t_3; elseif (j <= -1.4e+29) tmp = t_2; elseif (j <= -1.85e-31) tmp = Float64(b * c); elseif (j <= -8.2e-126) tmp = t_1; elseif (j <= -1.35e-182) tmp = t_4; elseif (j <= -5.8e-207) tmp = t_2; elseif (j <= -8e-243) tmp = t_1; elseif (j <= 4e-306) tmp = t_4; elseif (j <= 1.4e+85) tmp = t_1; else tmp = t_3; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * (t * (x * (y * z)));
t_2 = t * (a * -4.0);
t_3 = j * (k * -27.0);
t_4 = (x * i) * -4.0;
tmp = 0.0;
if (j <= -1.4e+55)
tmp = t_3;
elseif (j <= -1.4e+29)
tmp = t_2;
elseif (j <= -1.85e-31)
tmp = b * c;
elseif (j <= -8.2e-126)
tmp = t_1;
elseif (j <= -1.35e-182)
tmp = t_4;
elseif (j <= -5.8e-207)
tmp = t_2;
elseif (j <= -8e-243)
tmp = t_1;
elseif (j <= 4e-306)
tmp = t_4;
elseif (j <= 1.4e+85)
tmp = t_1;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[j, -1.4e+55], t$95$3, If[LessEqual[j, -1.4e+29], t$95$2, If[LessEqual[j, -1.85e-31], N[(b * c), $MachinePrecision], If[LessEqual[j, -8.2e-126], t$95$1, If[LessEqual[j, -1.35e-182], t$95$4, If[LessEqual[j, -5.8e-207], t$95$2, If[LessEqual[j, -8e-243], t$95$1, If[LessEqual[j, 4e-306], t$95$4, If[LessEqual[j, 1.4e+85], t$95$1, t$95$3]]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
t_2 := t \cdot \left(a \cdot -4\right)\\
t_3 := j \cdot \left(k \cdot -27\right)\\
t_4 := \left(x \cdot i\right) \cdot -4\\
\mathbf{if}\;j \leq -1.4 \cdot 10^{+55}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;j \leq -1.4 \cdot 10^{+29}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -1.85 \cdot 10^{-31}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq -8.2 \cdot 10^{-126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -1.35 \cdot 10^{-182}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;j \leq -5.8 \cdot 10^{-207}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -8 \cdot 10^{-243}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq 4 \cdot 10^{-306}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;j \leq 1.4 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if j < -1.4e55 or 1.4e85 < j Initial program 84.1%
Simplified85.6%
Taylor expanded in j around inf 51.6%
*-commutative51.6%
associate-*l*51.6%
Simplified51.6%
if -1.4e55 < j < -1.4e29 or -1.35e-182 < j < -5.80000000000000022e-207Initial program 99.7%
Taylor expanded in y around 0 90.3%
fma-neg90.3%
distribute-lft-out90.3%
distribute-lft-neg-in90.3%
metadata-eval90.3%
*-commutative90.3%
fma-def90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 56.9%
associate-*r*56.9%
Simplified56.9%
if -1.4e29 < j < -1.8499999999999999e-31Initial program 84.0%
Simplified83.9%
Taylor expanded in b around inf 26.9%
if -1.8499999999999999e-31 < j < -8.1999999999999995e-126 or -5.80000000000000022e-207 < j < -7.99999999999999996e-243 or 4.00000000000000011e-306 < j < 1.4e85Initial program 88.1%
Simplified91.7%
Taylor expanded in x around inf 52.4%
Taylor expanded in t around inf 37.3%
if -8.1999999999999995e-126 < j < -1.35e-182 or -7.99999999999999996e-243 < j < 4.00000000000000011e-306Initial program 85.9%
Simplified85.9%
Taylor expanded in i around inf 53.5%
*-commutative53.5%
Simplified53.5%
Final simplification44.7%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* (* y z) (* x t))))
(t_2 (* t (* a -4.0)))
(t_3 (* j (* k -27.0)))
(t_4 (* (* x i) -4.0)))
(if (<= j -4.2e+50)
t_3
(if (<= j -3e+29)
t_2
(if (<= j -2.9e-31)
(* b c)
(if (<= j -9e-126)
t_1
(if (<= j -6.6e-183)
t_4
(if (<= j -6e-207)
t_2
(if (<= j -5.2e-243)
(* 18.0 (* t (* x (* y z))))
(if (<= j 6.3e-307) t_4 (if (<= j 2e+80) t_1 t_3)))))))))))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 = 18.0 * ((y * z) * (x * t));
double t_2 = t * (a * -4.0);
double t_3 = j * (k * -27.0);
double t_4 = (x * i) * -4.0;
double tmp;
if (j <= -4.2e+50) {
tmp = t_3;
} else if (j <= -3e+29) {
tmp = t_2;
} else if (j <= -2.9e-31) {
tmp = b * c;
} else if (j <= -9e-126) {
tmp = t_1;
} else if (j <= -6.6e-183) {
tmp = t_4;
} else if (j <= -6e-207) {
tmp = t_2;
} else if (j <= -5.2e-243) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (j <= 6.3e-307) {
tmp = t_4;
} else if (j <= 2e+80) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = 18.0d0 * ((y * z) * (x * t))
t_2 = t * (a * (-4.0d0))
t_3 = j * (k * (-27.0d0))
t_4 = (x * i) * (-4.0d0)
if (j <= (-4.2d+50)) then
tmp = t_3
else if (j <= (-3d+29)) then
tmp = t_2
else if (j <= (-2.9d-31)) then
tmp = b * c
else if (j <= (-9d-126)) then
tmp = t_1
else if (j <= (-6.6d-183)) then
tmp = t_4
else if (j <= (-6d-207)) then
tmp = t_2
else if (j <= (-5.2d-243)) then
tmp = 18.0d0 * (t * (x * (y * z)))
else if (j <= 6.3d-307) then
tmp = t_4
else if (j <= 2d+80) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * ((y * z) * (x * t));
double t_2 = t * (a * -4.0);
double t_3 = j * (k * -27.0);
double t_4 = (x * i) * -4.0;
double tmp;
if (j <= -4.2e+50) {
tmp = t_3;
} else if (j <= -3e+29) {
tmp = t_2;
} else if (j <= -2.9e-31) {
tmp = b * c;
} else if (j <= -9e-126) {
tmp = t_1;
} else if (j <= -6.6e-183) {
tmp = t_4;
} else if (j <= -6e-207) {
tmp = t_2;
} else if (j <= -5.2e-243) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (j <= 6.3e-307) {
tmp = t_4;
} else if (j <= 2e+80) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * ((y * z) * (x * t)) t_2 = t * (a * -4.0) t_3 = j * (k * -27.0) t_4 = (x * i) * -4.0 tmp = 0 if j <= -4.2e+50: tmp = t_3 elif j <= -3e+29: tmp = t_2 elif j <= -2.9e-31: tmp = b * c elif j <= -9e-126: tmp = t_1 elif j <= -6.6e-183: tmp = t_4 elif j <= -6e-207: tmp = t_2 elif j <= -5.2e-243: tmp = 18.0 * (t * (x * (y * z))) elif j <= 6.3e-307: tmp = t_4 elif j <= 2e+80: tmp = t_1 else: tmp = t_3 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t))) t_2 = Float64(t * Float64(a * -4.0)) t_3 = Float64(j * Float64(k * -27.0)) t_4 = Float64(Float64(x * i) * -4.0) tmp = 0.0 if (j <= -4.2e+50) tmp = t_3; elseif (j <= -3e+29) tmp = t_2; elseif (j <= -2.9e-31) tmp = Float64(b * c); elseif (j <= -9e-126) tmp = t_1; elseif (j <= -6.6e-183) tmp = t_4; elseif (j <= -6e-207) tmp = t_2; elseif (j <= -5.2e-243) tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))); elseif (j <= 6.3e-307) tmp = t_4; elseif (j <= 2e+80) tmp = t_1; else tmp = t_3; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * ((y * z) * (x * t));
t_2 = t * (a * -4.0);
t_3 = j * (k * -27.0);
t_4 = (x * i) * -4.0;
tmp = 0.0;
if (j <= -4.2e+50)
tmp = t_3;
elseif (j <= -3e+29)
tmp = t_2;
elseif (j <= -2.9e-31)
tmp = b * c;
elseif (j <= -9e-126)
tmp = t_1;
elseif (j <= -6.6e-183)
tmp = t_4;
elseif (j <= -6e-207)
tmp = t_2;
elseif (j <= -5.2e-243)
tmp = 18.0 * (t * (x * (y * z)));
elseif (j <= 6.3e-307)
tmp = t_4;
elseif (j <= 2e+80)
tmp = t_1;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[j, -4.2e+50], t$95$3, If[LessEqual[j, -3e+29], t$95$2, If[LessEqual[j, -2.9e-31], N[(b * c), $MachinePrecision], If[LessEqual[j, -9e-126], t$95$1, If[LessEqual[j, -6.6e-183], t$95$4, If[LessEqual[j, -6e-207], t$95$2, If[LessEqual[j, -5.2e-243], N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 6.3e-307], t$95$4, If[LessEqual[j, 2e+80], t$95$1, t$95$3]]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\
t_2 := t \cdot \left(a \cdot -4\right)\\
t_3 := j \cdot \left(k \cdot -27\right)\\
t_4 := \left(x \cdot i\right) \cdot -4\\
\mathbf{if}\;j \leq -4.2 \cdot 10^{+50}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;j \leq -3 \cdot 10^{+29}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -2.9 \cdot 10^{-31}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq -9 \cdot 10^{-126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -6.6 \cdot 10^{-183}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;j \leq -6 \cdot 10^{-207}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -5.2 \cdot 10^{-243}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;j \leq 6.3 \cdot 10^{-307}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;j \leq 2 \cdot 10^{+80}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if j < -4.1999999999999999e50 or 2e80 < j Initial program 84.1%
Simplified85.6%
Taylor expanded in j around inf 51.6%
*-commutative51.6%
associate-*l*51.6%
Simplified51.6%
if -4.1999999999999999e50 < j < -2.9999999999999999e29 or -6.5999999999999999e-183 < j < -5.9999999999999999e-207Initial program 99.7%
Taylor expanded in y around 0 90.3%
fma-neg90.3%
distribute-lft-out90.3%
distribute-lft-neg-in90.3%
metadata-eval90.3%
*-commutative90.3%
fma-def90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 56.9%
associate-*r*56.9%
Simplified56.9%
if -2.9999999999999999e29 < j < -2.9000000000000001e-31Initial program 84.0%
Simplified83.9%
Taylor expanded in b around inf 26.9%
if -2.9000000000000001e-31 < j < -9.0000000000000005e-126 or 6.3000000000000003e-307 < j < 2e80Initial program 89.1%
Taylor expanded in x around 0 91.1%
Taylor expanded in t around inf 62.3%
Taylor expanded in t around inf 52.7%
Taylor expanded in x around inf 35.0%
associate-*r*36.8%
Simplified36.8%
if -9.0000000000000005e-126 < j < -6.5999999999999999e-183 or -5.1999999999999995e-243 < j < 6.3000000000000003e-307Initial program 85.2%
Simplified85.2%
Taylor expanded in i around inf 51.2%
*-commutative51.2%
Simplified51.2%
if -5.9999999999999999e-207 < j < -5.1999999999999995e-243Initial program 80.1%
Simplified89.9%
Taylor expanded in x around inf 71.0%
Taylor expanded in t around inf 57.6%
Final simplification45.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (* a -4.0))) (t_2 (* j (* k -27.0))) (t_3 (* (* x i) -4.0)))
(if (<= j -4.2e+50)
t_2
(if (<= j -1.45e+29)
t_1
(if (<= j -2.3e-31)
(* b c)
(if (<= j -7.5e-126)
(* t (* 18.0 (* y (* x z))))
(if (<= j -3.1e-183)
t_3
(if (<= j -4.9e-207)
t_1
(if (<= j -5.5e-243)
(* 18.0 (* t (* x (* y z))))
(if (<= j 3.2e-306)
t_3
(if (<= j 5.8e+76)
(* 18.0 (* (* y z) (* x t)))
t_2)))))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double t_2 = j * (k * -27.0);
double t_3 = (x * i) * -4.0;
double tmp;
if (j <= -4.2e+50) {
tmp = t_2;
} else if (j <= -1.45e+29) {
tmp = t_1;
} else if (j <= -2.3e-31) {
tmp = b * c;
} else if (j <= -7.5e-126) {
tmp = t * (18.0 * (y * (x * z)));
} else if (j <= -3.1e-183) {
tmp = t_3;
} else if (j <= -4.9e-207) {
tmp = t_1;
} else if (j <= -5.5e-243) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (j <= 3.2e-306) {
tmp = t_3;
} else if (j <= 5.8e+76) {
tmp = 18.0 * ((y * z) * (x * t));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t * (a * (-4.0d0))
t_2 = j * (k * (-27.0d0))
t_3 = (x * i) * (-4.0d0)
if (j <= (-4.2d+50)) then
tmp = t_2
else if (j <= (-1.45d+29)) then
tmp = t_1
else if (j <= (-2.3d-31)) then
tmp = b * c
else if (j <= (-7.5d-126)) then
tmp = t * (18.0d0 * (y * (x * z)))
else if (j <= (-3.1d-183)) then
tmp = t_3
else if (j <= (-4.9d-207)) then
tmp = t_1
else if (j <= (-5.5d-243)) then
tmp = 18.0d0 * (t * (x * (y * z)))
else if (j <= 3.2d-306) then
tmp = t_3
else if (j <= 5.8d+76) then
tmp = 18.0d0 * ((y * z) * (x * t))
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double t_2 = j * (k * -27.0);
double t_3 = (x * i) * -4.0;
double tmp;
if (j <= -4.2e+50) {
tmp = t_2;
} else if (j <= -1.45e+29) {
tmp = t_1;
} else if (j <= -2.3e-31) {
tmp = b * c;
} else if (j <= -7.5e-126) {
tmp = t * (18.0 * (y * (x * z)));
} else if (j <= -3.1e-183) {
tmp = t_3;
} else if (j <= -4.9e-207) {
tmp = t_1;
} else if (j <= -5.5e-243) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (j <= 3.2e-306) {
tmp = t_3;
} else if (j <= 5.8e+76) {
tmp = 18.0 * ((y * z) * (x * t));
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * (a * -4.0) t_2 = j * (k * -27.0) t_3 = (x * i) * -4.0 tmp = 0 if j <= -4.2e+50: tmp = t_2 elif j <= -1.45e+29: tmp = t_1 elif j <= -2.3e-31: tmp = b * c elif j <= -7.5e-126: tmp = t * (18.0 * (y * (x * z))) elif j <= -3.1e-183: tmp = t_3 elif j <= -4.9e-207: tmp = t_1 elif j <= -5.5e-243: tmp = 18.0 * (t * (x * (y * z))) elif j <= 3.2e-306: tmp = t_3 elif j <= 5.8e+76: tmp = 18.0 * ((y * z) * (x * t)) else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(a * -4.0)) t_2 = Float64(j * Float64(k * -27.0)) t_3 = Float64(Float64(x * i) * -4.0) tmp = 0.0 if (j <= -4.2e+50) tmp = t_2; elseif (j <= -1.45e+29) tmp = t_1; elseif (j <= -2.3e-31) tmp = Float64(b * c); elseif (j <= -7.5e-126) tmp = Float64(t * Float64(18.0 * Float64(y * Float64(x * z)))); elseif (j <= -3.1e-183) tmp = t_3; elseif (j <= -4.9e-207) tmp = t_1; elseif (j <= -5.5e-243) tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))); elseif (j <= 3.2e-306) tmp = t_3; elseif (j <= 5.8e+76) tmp = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t))); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * (a * -4.0);
t_2 = j * (k * -27.0);
t_3 = (x * i) * -4.0;
tmp = 0.0;
if (j <= -4.2e+50)
tmp = t_2;
elseif (j <= -1.45e+29)
tmp = t_1;
elseif (j <= -2.3e-31)
tmp = b * c;
elseif (j <= -7.5e-126)
tmp = t * (18.0 * (y * (x * z)));
elseif (j <= -3.1e-183)
tmp = t_3;
elseif (j <= -4.9e-207)
tmp = t_1;
elseif (j <= -5.5e-243)
tmp = 18.0 * (t * (x * (y * z)));
elseif (j <= 3.2e-306)
tmp = t_3;
elseif (j <= 5.8e+76)
tmp = 18.0 * ((y * z) * (x * t));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[j, -4.2e+50], t$95$2, If[LessEqual[j, -1.45e+29], t$95$1, If[LessEqual[j, -2.3e-31], N[(b * c), $MachinePrecision], If[LessEqual[j, -7.5e-126], N[(t * N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -3.1e-183], t$95$3, If[LessEqual[j, -4.9e-207], t$95$1, If[LessEqual[j, -5.5e-243], N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.2e-306], t$95$3, If[LessEqual[j, 5.8e+76], N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
t_3 := \left(x \cdot i\right) \cdot -4\\
\mathbf{if}\;j \leq -4.2 \cdot 10^{+50}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -1.45 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -2.3 \cdot 10^{-31}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq -7.5 \cdot 10^{-126}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;j \leq -3.1 \cdot 10^{-183}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;j \leq -4.9 \cdot 10^{-207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -5.5 \cdot 10^{-243}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;j \leq 3.2 \cdot 10^{-306}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;j \leq 5.8 \cdot 10^{+76}:\\
\;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if j < -4.1999999999999999e50 or 5.8000000000000003e76 < j Initial program 84.1%
Simplified85.6%
Taylor expanded in j around inf 51.6%
*-commutative51.6%
associate-*l*51.6%
Simplified51.6%
if -4.1999999999999999e50 < j < -1.45e29 or -3.1e-183 < j < -4.9e-207Initial program 99.7%
Taylor expanded in y around 0 90.3%
fma-neg90.3%
distribute-lft-out90.3%
distribute-lft-neg-in90.3%
metadata-eval90.3%
*-commutative90.3%
fma-def90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 56.9%
associate-*r*56.9%
Simplified56.9%
if -1.45e29 < j < -2.2999999999999998e-31Initial program 84.0%
Simplified83.9%
Taylor expanded in b around inf 26.9%
if -2.2999999999999998e-31 < j < -7.49999999999999976e-126Initial program 93.2%
Taylor expanded in x around 0 74.1%
Taylor expanded in t around inf 60.6%
Taylor expanded in t around inf 54.6%
Taylor expanded in x around inf 34.6%
*-commutative34.6%
associate-*l*34.6%
Simplified34.6%
if -7.49999999999999976e-126 < j < -3.1e-183 or -5.50000000000000004e-243 < j < 3.19999999999999971e-306Initial program 85.2%
Simplified85.2%
Taylor expanded in i around inf 51.2%
*-commutative51.2%
Simplified51.2%
if -4.9e-207 < j < -5.50000000000000004e-243Initial program 80.1%
Simplified89.9%
Taylor expanded in x around inf 71.0%
Taylor expanded in t around inf 57.6%
if 3.19999999999999971e-306 < j < 5.8000000000000003e76Initial program 88.3%
Taylor expanded in x around 0 94.1%
Taylor expanded in t around inf 62.5%
Taylor expanded in t around inf 52.4%
Taylor expanded in x around inf 35.0%
associate-*r*37.2%
Simplified37.2%
Final simplification45.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (* a -4.0))) (t_2 (* j (* k -27.0))) (t_3 (* (* x i) -4.0)))
(if (<= j -1.8e+55)
t_2
(if (<= j -3e+29)
t_1
(if (<= j -2.5e-31)
(* b c)
(if (<= j -8.2e-126)
(* t (* 18.0 (* y (* x z))))
(if (<= j -2.3e-183)
t_3
(if (<= j -2.9e-207)
t_1
(if (<= j -5.2e-243)
(* (* x (* y z)) (* 18.0 t))
(if (<= j 6.2e-307)
t_3
(if (<= j 1.45e+77)
(* 18.0 (* (* y z) (* x t)))
t_2)))))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double t_2 = j * (k * -27.0);
double t_3 = (x * i) * -4.0;
double tmp;
if (j <= -1.8e+55) {
tmp = t_2;
} else if (j <= -3e+29) {
tmp = t_1;
} else if (j <= -2.5e-31) {
tmp = b * c;
} else if (j <= -8.2e-126) {
tmp = t * (18.0 * (y * (x * z)));
} else if (j <= -2.3e-183) {
tmp = t_3;
} else if (j <= -2.9e-207) {
tmp = t_1;
} else if (j <= -5.2e-243) {
tmp = (x * (y * z)) * (18.0 * t);
} else if (j <= 6.2e-307) {
tmp = t_3;
} else if (j <= 1.45e+77) {
tmp = 18.0 * ((y * z) * (x * t));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t * (a * (-4.0d0))
t_2 = j * (k * (-27.0d0))
t_3 = (x * i) * (-4.0d0)
if (j <= (-1.8d+55)) then
tmp = t_2
else if (j <= (-3d+29)) then
tmp = t_1
else if (j <= (-2.5d-31)) then
tmp = b * c
else if (j <= (-8.2d-126)) then
tmp = t * (18.0d0 * (y * (x * z)))
else if (j <= (-2.3d-183)) then
tmp = t_3
else if (j <= (-2.9d-207)) then
tmp = t_1
else if (j <= (-5.2d-243)) then
tmp = (x * (y * z)) * (18.0d0 * t)
else if (j <= 6.2d-307) then
tmp = t_3
else if (j <= 1.45d+77) then
tmp = 18.0d0 * ((y * z) * (x * t))
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double t_2 = j * (k * -27.0);
double t_3 = (x * i) * -4.0;
double tmp;
if (j <= -1.8e+55) {
tmp = t_2;
} else if (j <= -3e+29) {
tmp = t_1;
} else if (j <= -2.5e-31) {
tmp = b * c;
} else if (j <= -8.2e-126) {
tmp = t * (18.0 * (y * (x * z)));
} else if (j <= -2.3e-183) {
tmp = t_3;
} else if (j <= -2.9e-207) {
tmp = t_1;
} else if (j <= -5.2e-243) {
tmp = (x * (y * z)) * (18.0 * t);
} else if (j <= 6.2e-307) {
tmp = t_3;
} else if (j <= 1.45e+77) {
tmp = 18.0 * ((y * z) * (x * t));
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * (a * -4.0) t_2 = j * (k * -27.0) t_3 = (x * i) * -4.0 tmp = 0 if j <= -1.8e+55: tmp = t_2 elif j <= -3e+29: tmp = t_1 elif j <= -2.5e-31: tmp = b * c elif j <= -8.2e-126: tmp = t * (18.0 * (y * (x * z))) elif j <= -2.3e-183: tmp = t_3 elif j <= -2.9e-207: tmp = t_1 elif j <= -5.2e-243: tmp = (x * (y * z)) * (18.0 * t) elif j <= 6.2e-307: tmp = t_3 elif j <= 1.45e+77: tmp = 18.0 * ((y * z) * (x * t)) else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(a * -4.0)) t_2 = Float64(j * Float64(k * -27.0)) t_3 = Float64(Float64(x * i) * -4.0) tmp = 0.0 if (j <= -1.8e+55) tmp = t_2; elseif (j <= -3e+29) tmp = t_1; elseif (j <= -2.5e-31) tmp = Float64(b * c); elseif (j <= -8.2e-126) tmp = Float64(t * Float64(18.0 * Float64(y * Float64(x * z)))); elseif (j <= -2.3e-183) tmp = t_3; elseif (j <= -2.9e-207) tmp = t_1; elseif (j <= -5.2e-243) tmp = Float64(Float64(x * Float64(y * z)) * Float64(18.0 * t)); elseif (j <= 6.2e-307) tmp = t_3; elseif (j <= 1.45e+77) tmp = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t))); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * (a * -4.0);
t_2 = j * (k * -27.0);
t_3 = (x * i) * -4.0;
tmp = 0.0;
if (j <= -1.8e+55)
tmp = t_2;
elseif (j <= -3e+29)
tmp = t_1;
elseif (j <= -2.5e-31)
tmp = b * c;
elseif (j <= -8.2e-126)
tmp = t * (18.0 * (y * (x * z)));
elseif (j <= -2.3e-183)
tmp = t_3;
elseif (j <= -2.9e-207)
tmp = t_1;
elseif (j <= -5.2e-243)
tmp = (x * (y * z)) * (18.0 * t);
elseif (j <= 6.2e-307)
tmp = t_3;
elseif (j <= 1.45e+77)
tmp = 18.0 * ((y * z) * (x * t));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[j, -1.8e+55], t$95$2, If[LessEqual[j, -3e+29], t$95$1, If[LessEqual[j, -2.5e-31], N[(b * c), $MachinePrecision], If[LessEqual[j, -8.2e-126], N[(t * N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -2.3e-183], t$95$3, If[LessEqual[j, -2.9e-207], t$95$1, If[LessEqual[j, -5.2e-243], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(18.0 * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 6.2e-307], t$95$3, If[LessEqual[j, 1.45e+77], N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
t_3 := \left(x \cdot i\right) \cdot -4\\
\mathbf{if}\;j \leq -1.8 \cdot 10^{+55}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -3 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -2.5 \cdot 10^{-31}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq -8.2 \cdot 10^{-126}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;j \leq -2.3 \cdot 10^{-183}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;j \leq -2.9 \cdot 10^{-207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -5.2 \cdot 10^{-243}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z\right)\right) \cdot \left(18 \cdot t\right)\\
\mathbf{elif}\;j \leq 6.2 \cdot 10^{-307}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;j \leq 1.45 \cdot 10^{+77}:\\
\;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if j < -1.79999999999999994e55 or 1.4500000000000001e77 < j Initial program 84.1%
Simplified85.6%
Taylor expanded in j around inf 51.6%
*-commutative51.6%
associate-*l*51.6%
Simplified51.6%
if -1.79999999999999994e55 < j < -2.9999999999999999e29 or -2.30000000000000016e-183 < j < -2.90000000000000011e-207Initial program 99.7%
Taylor expanded in y around 0 90.3%
fma-neg90.3%
distribute-lft-out90.3%
distribute-lft-neg-in90.3%
metadata-eval90.3%
*-commutative90.3%
fma-def90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 56.9%
associate-*r*56.9%
Simplified56.9%
if -2.9999999999999999e29 < j < -2.5e-31Initial program 84.0%
Simplified83.9%
Taylor expanded in b around inf 26.9%
if -2.5e-31 < j < -8.1999999999999995e-126Initial program 93.2%
Taylor expanded in x around 0 74.1%
Taylor expanded in t around inf 60.6%
Taylor expanded in t around inf 54.6%
Taylor expanded in x around inf 34.6%
*-commutative34.6%
associate-*l*34.6%
Simplified34.6%
if -8.1999999999999995e-126 < j < -2.30000000000000016e-183 or -5.1999999999999995e-243 < j < 6.1999999999999996e-307Initial program 85.2%
Simplified85.2%
Taylor expanded in i around inf 51.2%
*-commutative51.2%
Simplified51.2%
if -2.90000000000000011e-207 < j < -5.1999999999999995e-243Initial program 80.1%
Simplified89.9%
Taylor expanded in x around inf 71.0%
Taylor expanded in t around inf 57.6%
associate-*r*57.8%
Simplified57.8%
if 6.1999999999999996e-307 < j < 1.4500000000000001e77Initial program 88.3%
Taylor expanded in x around 0 94.1%
Taylor expanded in t around inf 62.5%
Taylor expanded in t around inf 52.4%
Taylor expanded in x around inf 35.0%
associate-*r*37.2%
Simplified37.2%
Final simplification45.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (* a -4.0))) (t_2 (* j (* k -27.0))) (t_3 (* (* x i) -4.0)))
(if (<= j -7.5e+50)
t_2
(if (<= j -1.8e+29)
t_1
(if (<= j -2.7e-31)
(* b c)
(if (<= j -7.5e-126)
(* t (* 18.0 (* y (* x z))))
(if (<= j -3.8e-183)
t_3
(if (<= j -3.9e-207)
t_1
(if (<= j -6e-243)
(* (* x y) (* z (* 18.0 t)))
(if (<= j 1.18e-306)
t_3
(if (<= j 3.8e+79)
(* 18.0 (* (* y z) (* x t)))
t_2)))))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double t_2 = j * (k * -27.0);
double t_3 = (x * i) * -4.0;
double tmp;
if (j <= -7.5e+50) {
tmp = t_2;
} else if (j <= -1.8e+29) {
tmp = t_1;
} else if (j <= -2.7e-31) {
tmp = b * c;
} else if (j <= -7.5e-126) {
tmp = t * (18.0 * (y * (x * z)));
} else if (j <= -3.8e-183) {
tmp = t_3;
} else if (j <= -3.9e-207) {
tmp = t_1;
} else if (j <= -6e-243) {
tmp = (x * y) * (z * (18.0 * t));
} else if (j <= 1.18e-306) {
tmp = t_3;
} else if (j <= 3.8e+79) {
tmp = 18.0 * ((y * z) * (x * t));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t * (a * (-4.0d0))
t_2 = j * (k * (-27.0d0))
t_3 = (x * i) * (-4.0d0)
if (j <= (-7.5d+50)) then
tmp = t_2
else if (j <= (-1.8d+29)) then
tmp = t_1
else if (j <= (-2.7d-31)) then
tmp = b * c
else if (j <= (-7.5d-126)) then
tmp = t * (18.0d0 * (y * (x * z)))
else if (j <= (-3.8d-183)) then
tmp = t_3
else if (j <= (-3.9d-207)) then
tmp = t_1
else if (j <= (-6d-243)) then
tmp = (x * y) * (z * (18.0d0 * t))
else if (j <= 1.18d-306) then
tmp = t_3
else if (j <= 3.8d+79) then
tmp = 18.0d0 * ((y * z) * (x * t))
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double t_2 = j * (k * -27.0);
double t_3 = (x * i) * -4.0;
double tmp;
if (j <= -7.5e+50) {
tmp = t_2;
} else if (j <= -1.8e+29) {
tmp = t_1;
} else if (j <= -2.7e-31) {
tmp = b * c;
} else if (j <= -7.5e-126) {
tmp = t * (18.0 * (y * (x * z)));
} else if (j <= -3.8e-183) {
tmp = t_3;
} else if (j <= -3.9e-207) {
tmp = t_1;
} else if (j <= -6e-243) {
tmp = (x * y) * (z * (18.0 * t));
} else if (j <= 1.18e-306) {
tmp = t_3;
} else if (j <= 3.8e+79) {
tmp = 18.0 * ((y * z) * (x * t));
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * (a * -4.0) t_2 = j * (k * -27.0) t_3 = (x * i) * -4.0 tmp = 0 if j <= -7.5e+50: tmp = t_2 elif j <= -1.8e+29: tmp = t_1 elif j <= -2.7e-31: tmp = b * c elif j <= -7.5e-126: tmp = t * (18.0 * (y * (x * z))) elif j <= -3.8e-183: tmp = t_3 elif j <= -3.9e-207: tmp = t_1 elif j <= -6e-243: tmp = (x * y) * (z * (18.0 * t)) elif j <= 1.18e-306: tmp = t_3 elif j <= 3.8e+79: tmp = 18.0 * ((y * z) * (x * t)) else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(a * -4.0)) t_2 = Float64(j * Float64(k * -27.0)) t_3 = Float64(Float64(x * i) * -4.0) tmp = 0.0 if (j <= -7.5e+50) tmp = t_2; elseif (j <= -1.8e+29) tmp = t_1; elseif (j <= -2.7e-31) tmp = Float64(b * c); elseif (j <= -7.5e-126) tmp = Float64(t * Float64(18.0 * Float64(y * Float64(x * z)))); elseif (j <= -3.8e-183) tmp = t_3; elseif (j <= -3.9e-207) tmp = t_1; elseif (j <= -6e-243) tmp = Float64(Float64(x * y) * Float64(z * Float64(18.0 * t))); elseif (j <= 1.18e-306) tmp = t_3; elseif (j <= 3.8e+79) tmp = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t))); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * (a * -4.0);
t_2 = j * (k * -27.0);
t_3 = (x * i) * -4.0;
tmp = 0.0;
if (j <= -7.5e+50)
tmp = t_2;
elseif (j <= -1.8e+29)
tmp = t_1;
elseif (j <= -2.7e-31)
tmp = b * c;
elseif (j <= -7.5e-126)
tmp = t * (18.0 * (y * (x * z)));
elseif (j <= -3.8e-183)
tmp = t_3;
elseif (j <= -3.9e-207)
tmp = t_1;
elseif (j <= -6e-243)
tmp = (x * y) * (z * (18.0 * t));
elseif (j <= 1.18e-306)
tmp = t_3;
elseif (j <= 3.8e+79)
tmp = 18.0 * ((y * z) * (x * t));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[j, -7.5e+50], t$95$2, If[LessEqual[j, -1.8e+29], t$95$1, If[LessEqual[j, -2.7e-31], N[(b * c), $MachinePrecision], If[LessEqual[j, -7.5e-126], N[(t * N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -3.8e-183], t$95$3, If[LessEqual[j, -3.9e-207], t$95$1, If[LessEqual[j, -6e-243], N[(N[(x * y), $MachinePrecision] * N[(z * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.18e-306], t$95$3, If[LessEqual[j, 3.8e+79], N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
t_3 := \left(x \cdot i\right) \cdot -4\\
\mathbf{if}\;j \leq -7.5 \cdot 10^{+50}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -1.8 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -2.7 \cdot 10^{-31}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq -7.5 \cdot 10^{-126}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;j \leq -3.8 \cdot 10^{-183}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;j \leq -3.9 \cdot 10^{-207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -6 \cdot 10^{-243}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\
\mathbf{elif}\;j \leq 1.18 \cdot 10^{-306}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;j \leq 3.8 \cdot 10^{+79}:\\
\;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if j < -7.4999999999999999e50 or 3.8000000000000002e79 < j Initial program 84.1%
Simplified85.6%
Taylor expanded in j around inf 51.6%
*-commutative51.6%
associate-*l*51.6%
Simplified51.6%
if -7.4999999999999999e50 < j < -1.79999999999999988e29 or -3.7999999999999996e-183 < j < -3.90000000000000021e-207Initial program 99.7%
Taylor expanded in y around 0 90.3%
fma-neg90.3%
distribute-lft-out90.3%
distribute-lft-neg-in90.3%
metadata-eval90.3%
*-commutative90.3%
fma-def90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 56.9%
associate-*r*56.9%
Simplified56.9%
if -1.79999999999999988e29 < j < -2.70000000000000014e-31Initial program 84.0%
Simplified83.9%
Taylor expanded in b around inf 26.9%
if -2.70000000000000014e-31 < j < -7.49999999999999976e-126Initial program 93.2%
Taylor expanded in x around 0 74.1%
Taylor expanded in t around inf 60.6%
Taylor expanded in t around inf 54.6%
Taylor expanded in x around inf 34.6%
*-commutative34.6%
associate-*l*34.6%
Simplified34.6%
if -7.49999999999999976e-126 < j < -3.7999999999999996e-183 or -6.0000000000000002e-243 < j < 1.17999999999999999e-306Initial program 85.2%
Simplified85.2%
Taylor expanded in i around inf 51.2%
*-commutative51.2%
Simplified51.2%
if -3.90000000000000021e-207 < j < -6.0000000000000002e-243Initial program 80.1%
Simplified89.9%
Taylor expanded in x around inf 71.0%
Taylor expanded in t around inf 57.6%
associate-*r*57.8%
associate-*r*57.6%
*-commutative57.6%
associate-*l*57.5%
Simplified57.5%
if 1.17999999999999999e-306 < j < 3.8000000000000002e79Initial program 88.3%
Taylor expanded in x around 0 94.1%
Taylor expanded in t around inf 62.5%
Taylor expanded in t around inf 52.4%
Taylor expanded in x around inf 35.0%
associate-*r*37.2%
Simplified37.2%
Final simplification45.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* x (* 4.0 i)))))
(if (<= j -5.3e+131)
(* -27.0 (* j k))
(if (<= j -2.4e-55)
t_1
(if (<= j -1.15e-114)
(* t (* 18.0 (* y (* x z))))
(if (<= j 2.5e-208)
t_1
(if (<= j 2.15e-158)
(* 18.0 (* (* y z) (* x t)))
(if (<= j 3.6e-75)
t_1
(if (<= j 2.8e+78)
(* (* x y) (* z (* 18.0 t)))
(* j (* k -27.0)))))))))))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 * (4.0 * i));
double tmp;
if (j <= -5.3e+131) {
tmp = -27.0 * (j * k);
} else if (j <= -2.4e-55) {
tmp = t_1;
} else if (j <= -1.15e-114) {
tmp = t * (18.0 * (y * (x * z)));
} else if (j <= 2.5e-208) {
tmp = t_1;
} else if (j <= 2.15e-158) {
tmp = 18.0 * ((y * z) * (x * t));
} else if (j <= 3.6e-75) {
tmp = t_1;
} else if (j <= 2.8e+78) {
tmp = (x * y) * (z * (18.0 * t));
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) - (x * (4.0d0 * i))
if (j <= (-5.3d+131)) then
tmp = (-27.0d0) * (j * k)
else if (j <= (-2.4d-55)) then
tmp = t_1
else if (j <= (-1.15d-114)) then
tmp = t * (18.0d0 * (y * (x * z)))
else if (j <= 2.5d-208) then
tmp = t_1
else if (j <= 2.15d-158) then
tmp = 18.0d0 * ((y * z) * (x * t))
else if (j <= 3.6d-75) then
tmp = t_1
else if (j <= 2.8d+78) then
tmp = (x * y) * (z * (18.0d0 * t))
else
tmp = j * (k * (-27.0d0))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (x * (4.0 * i));
double tmp;
if (j <= -5.3e+131) {
tmp = -27.0 * (j * k);
} else if (j <= -2.4e-55) {
tmp = t_1;
} else if (j <= -1.15e-114) {
tmp = t * (18.0 * (y * (x * z)));
} else if (j <= 2.5e-208) {
tmp = t_1;
} else if (j <= 2.15e-158) {
tmp = 18.0 * ((y * z) * (x * t));
} else if (j <= 3.6e-75) {
tmp = t_1;
} else if (j <= 2.8e+78) {
tmp = (x * y) * (z * (18.0 * t));
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (x * (4.0 * i)) tmp = 0 if j <= -5.3e+131: tmp = -27.0 * (j * k) elif j <= -2.4e-55: tmp = t_1 elif j <= -1.15e-114: tmp = t * (18.0 * (y * (x * z))) elif j <= 2.5e-208: tmp = t_1 elif j <= 2.15e-158: tmp = 18.0 * ((y * z) * (x * t)) elif j <= 3.6e-75: tmp = t_1 elif j <= 2.8e+78: tmp = (x * y) * (z * (18.0 * t)) else: tmp = j * (k * -27.0) return tmp
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(4.0 * i))) tmp = 0.0 if (j <= -5.3e+131) tmp = Float64(-27.0 * Float64(j * k)); elseif (j <= -2.4e-55) tmp = t_1; elseif (j <= -1.15e-114) tmp = Float64(t * Float64(18.0 * Float64(y * Float64(x * z)))); elseif (j <= 2.5e-208) tmp = t_1; elseif (j <= 2.15e-158) tmp = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t))); elseif (j <= 3.6e-75) tmp = t_1; elseif (j <= 2.8e+78) tmp = Float64(Float64(x * y) * Float64(z * Float64(18.0 * t))); else tmp = Float64(j * Float64(k * -27.0)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (x * (4.0 * i));
tmp = 0.0;
if (j <= -5.3e+131)
tmp = -27.0 * (j * k);
elseif (j <= -2.4e-55)
tmp = t_1;
elseif (j <= -1.15e-114)
tmp = t * (18.0 * (y * (x * z)));
elseif (j <= 2.5e-208)
tmp = t_1;
elseif (j <= 2.15e-158)
tmp = 18.0 * ((y * z) * (x * t));
elseif (j <= 3.6e-75)
tmp = t_1;
elseif (j <= 2.8e+78)
tmp = (x * y) * (z * (18.0 * t));
else
tmp = j * (k * -27.0);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -5.3e+131], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -2.4e-55], t$95$1, If[LessEqual[j, -1.15e-114], N[(t * N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 2.5e-208], t$95$1, If[LessEqual[j, 2.15e-158], N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.6e-75], t$95$1, If[LessEqual[j, 2.8e+78], N[(N[(x * y), $MachinePrecision] * N[(z * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - x \cdot \left(4 \cdot i\right)\\
\mathbf{if}\;j \leq -5.3 \cdot 10^{+131}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;j \leq -2.4 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -1.15 \cdot 10^{-114}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;j \leq 2.5 \cdot 10^{-208}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq 2.15 \cdot 10^{-158}:\\
\;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\
\mathbf{elif}\;j \leq 3.6 \cdot 10^{-75}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq 2.8 \cdot 10^{+78}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \left(z \cdot \left(18 \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if j < -5.2999999999999997e131Initial program 94.3%
Simplified86.3%
Taylor expanded in j around inf 61.6%
*-commutative61.6%
Simplified61.6%
if -5.2999999999999997e131 < j < -2.39999999999999991e-55 or -1.15e-114 < j < 2.49999999999999981e-208 or 2.1499999999999998e-158 < j < 3.6e-75Initial program 87.0%
Simplified91.6%
Taylor expanded in t around 0 57.3%
associate-*r*57.3%
*-commutative57.3%
associate-*r*57.3%
*-commutative57.3%
associate-*r*56.4%
fma-udef56.4%
associate-*r*57.3%
*-commutative57.3%
associate-*r*57.3%
Simplified57.3%
Taylor expanded in x around inf 48.3%
associate-*r*48.3%
*-commutative48.3%
*-commutative48.3%
Simplified48.3%
if -2.39999999999999991e-55 < j < -1.15e-114Initial program 99.8%
Taylor expanded in x around 0 75.6%
Taylor expanded in t around inf 75.2%
Taylor expanded in t around inf 63.5%
Taylor expanded in x around inf 38.7%
*-commutative38.7%
associate-*l*38.7%
Simplified38.7%
if 2.49999999999999981e-208 < j < 2.1499999999999998e-158Initial program 73.6%
Taylor expanded in x around 0 93.2%
Taylor expanded in t around inf 61.4%
Taylor expanded in t around inf 48.9%
Taylor expanded in x around inf 28.8%
associate-*r*34.9%
Simplified34.9%
if 3.6e-75 < j < 2.8000000000000001e78Initial program 93.8%
Simplified90.7%
Taylor expanded in x around inf 44.9%
Taylor expanded in t around inf 29.6%
associate-*r*29.6%
associate-*r*29.6%
*-commutative29.6%
associate-*l*32.5%
Simplified32.5%
if 2.8000000000000001e78 < j Initial program 76.4%
Simplified84.2%
Taylor expanded in j around inf 47.0%
*-commutative47.0%
associate-*l*47.1%
Simplified47.1%
Final simplification47.2%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))
(if (<= x -3.6e+219)
t_1
(if (<= x -7e+187)
(+ (* b c) (* (+ (* t a) (* x i)) -4.0))
(if (or (<= x -1.9e+78) (not (<= x 2.5e+55)))
t_1
(- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k)))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -3.6e+219) {
tmp = t_1;
} else if (x <= -7e+187) {
tmp = (b * c) + (((t * a) + (x * i)) * -4.0);
} else if ((x <= -1.9e+78) || !(x <= 2.5e+55)) {
tmp = t_1;
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
if (x <= (-3.6d+219)) then
tmp = t_1
else if (x <= (-7d+187)) then
tmp = (b * c) + (((t * a) + (x * i)) * (-4.0d0))
else if ((x <= (-1.9d+78)) .or. (.not. (x <= 2.5d+55))) then
tmp = t_1
else
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -3.6e+219) {
tmp = t_1;
} else if (x <= -7e+187) {
tmp = (b * c) + (((t * a) + (x * i)) * -4.0);
} else if ((x <= -1.9e+78) || !(x <= 2.5e+55)) {
tmp = t_1;
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i)) tmp = 0 if x <= -3.6e+219: tmp = t_1 elif x <= -7e+187: tmp = (b * c) + (((t * a) + (x * i)) * -4.0) elif (x <= -1.9e+78) or not (x <= 2.5e+55): tmp = t_1 else: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -3.6e+219) tmp = t_1; elseif (x <= -7e+187) tmp = Float64(Float64(b * c) + Float64(Float64(Float64(t * a) + Float64(x * i)) * -4.0)); elseif ((x <= -1.9e+78) || !(x <= 2.5e+55)) tmp = t_1; else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
tmp = 0.0;
if (x <= -3.6e+219)
tmp = t_1;
elseif (x <= -7e+187)
tmp = (b * c) + (((t * a) + (x * i)) * -4.0);
elseif ((x <= -1.9e+78) || ~((x <= 2.5e+55)))
tmp = t_1;
else
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e+219], t$95$1, If[LessEqual[x, -7e+187], N[(N[(b * c), $MachinePrecision] + N[(N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.9e+78], N[Not[LessEqual[x, 2.5e+55]], $MachinePrecision]], t$95$1, N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+219}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -7 \cdot 10^{+187}:\\
\;\;\;\;b \cdot c + \left(t \cdot a + x \cdot i\right) \cdot -4\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{+78} \lor \neg \left(x \leq 2.5 \cdot 10^{+55}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -3.60000000000000006e219 or -6.9999999999999995e187 < x < -1.9e78 or 2.50000000000000023e55 < x Initial program 77.5%
Simplified82.0%
Taylor expanded in x around inf 78.1%
if -3.60000000000000006e219 < x < -6.9999999999999995e187Initial program 83.4%
Taylor expanded in y around 0 100.0%
fma-neg100.0%
distribute-lft-out100.0%
distribute-lft-neg-in100.0%
metadata-eval100.0%
*-commutative100.0%
fma-def100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in j around 0 100.0%
if -1.9e78 < x < 2.50000000000000023e55Initial program 91.7%
Taylor expanded in x around 0 71.7%
Final simplification74.6%
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.15e-91) (not (<= t 4.9e-59)))
(- (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) t_1)
(- (- (* b c) (* 4.0 (* x i))) t_1))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if ((t <= -1.15e-91) || !(t <= 4.9e-59)) {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
} else {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if ((t <= (-1.15d-91)) .or. (.not. (t <= 4.9d-59))) then
tmp = (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))) - t_1
else
tmp = ((b * c) - (4.0d0 * (x * i))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if ((t <= -1.15e-91) || !(t <= 4.9e-59)) {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
} else {
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if (t <= -1.15e-91) or not (t <= 4.9e-59): tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1 else: tmp = ((b * c) - (4.0 * (x * i))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if ((t <= -1.15e-91) || !(t <= 4.9e-59)) tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) - t_1); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if ((t <= -1.15e-91) || ~((t <= 4.9e-59)))
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
else
tmp = ((b * c) - (4.0 * (x * i))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[Or[LessEqual[t, -1.15e-91], N[Not[LessEqual[t, 4.9e-59]], $MachinePrecision]], N[(N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{-91} \lor \neg \left(t \leq 4.9 \cdot 10^{-59}\right):\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\end{array}
\end{array}
if t < -1.14999999999999998e-91 or 4.89999999999999977e-59 < t Initial program 85.2%
Taylor expanded in x around 0 84.4%
Taylor expanded in t around inf 77.3%
if -1.14999999999999998e-91 < t < 4.89999999999999977e-59Initial program 88.6%
Taylor expanded in t around 0 86.8%
Final simplification81.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (or (<= t -5e-38) (not (<= t 1.95e+34)))
(- (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) t_1)
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) t_1))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if ((t <= -5e-38) || !(t <= 1.95e+34)) {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if ((t <= (-5d-38)) .or. (.not. (t <= 1.95d+34))) then
tmp = (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))) - t_1
else
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if ((t <= -5e-38) || !(t <= 1.95e+34)) {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if (t <= -5e-38) or not (t <= 1.95e+34): tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1 else: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if ((t <= -5e-38) || !(t <= 1.95e+34)) tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) - t_1); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if ((t <= -5e-38) || ~((t <= 1.95e+34)))
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
else
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[Or[LessEqual[t, -5e-38], N[Not[LessEqual[t, 1.95e+34]], $MachinePrecision]], N[(N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t \leq -5 \cdot 10^{-38} \lor \neg \left(t \leq 1.95 \cdot 10^{+34}\right):\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_1\\
\end{array}
\end{array}
if t < -5.00000000000000033e-38 or 1.9500000000000001e34 < t Initial program 85.2%
Taylor expanded in x around 0 81.8%
Taylor expanded in t around inf 79.4%
if -5.00000000000000033e-38 < t < 1.9500000000000001e34Initial program 87.9%
Taylor expanded in y around 0 87.3%
distribute-lft-out87.3%
*-commutative87.3%
*-commutative87.3%
Simplified87.3%
Final simplification83.4%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -750000000.0) (not (<= x 2.7e+53))) (+ (* b c) (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))) (- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -750000000.0) || !(x <= 2.7e+53)) {
tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-750000000.0d0)) .or. (.not. (x <= 2.7d+53))) then
tmp = (b * c) + (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i)))
else
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert 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 <= -750000000.0) || !(x <= 2.7e+53)) {
tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -750000000.0) or not (x <= 2.7e+53): tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i))) else: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -750000000.0) || !(x <= 2.7e+53)) 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(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -750000000.0) || ~((x <= 2.7e+53)))
tmp = (b * c) + (x * ((18.0 * (t * (y * z))) - (4.0 * i)));
else
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: 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, -750000000.0], N[Not[LessEqual[x, 2.7e+53]], $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[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -750000000 \lor \neg \left(x \leq 2.7 \cdot 10^{+53}\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 - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -7.5e8 or 2.70000000000000019e53 < x Initial program 80.4%
Taylor expanded in x around 0 91.9%
Taylor expanded in j around 0 83.3%
Taylor expanded in a around 0 81.1%
if -7.5e8 < x < 2.70000000000000019e53Initial program 91.4%
Taylor expanded in x around 0 74.1%
Final simplification77.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
(if (<= t -3.3e-12)
t_1
(if (<= t 1.15e-210)
(+ (* j (* k -27.0)) (* (* x i) -4.0))
(if (<= t 1.15e+17) (- (* b c) (* (* j 27.0) k)) t_1)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -3.3e-12) {
tmp = t_1;
} else if (t <= 1.15e-210) {
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
} else if (t <= 1.15e+17) {
tmp = (b * c) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
if (t <= (-3.3d-12)) then
tmp = t_1
else if (t <= 1.15d-210) then
tmp = (j * (k * (-27.0d0))) + ((x * i) * (-4.0d0))
else if (t <= 1.15d+17) then
tmp = (b * c) - ((j * 27.0d0) * k)
else
tmp = t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -3.3e-12) {
tmp = t_1;
} else if (t <= 1.15e-210) {
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
} else if (t <= 1.15e+17) {
tmp = (b * c) - ((j * 27.0) * k);
} else {
tmp = t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) tmp = 0 if t <= -3.3e-12: tmp = t_1 elif t <= 1.15e-210: tmp = (j * (k * -27.0)) + ((x * i) * -4.0) elif t <= 1.15e+17: tmp = (b * c) - ((j * 27.0) * k) else: tmp = t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -3.3e-12) tmp = t_1; elseif (t <= 1.15e-210) tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(Float64(x * i) * -4.0)); elseif (t <= 1.15e+17) tmp = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k)); else tmp = t_1; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -3.3e-12)
tmp = t_1;
elseif (t <= 1.15e-210)
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
elseif (t <= 1.15e+17)
tmp = (b * c) - ((j * 27.0) * k);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.3e-12], t$95$1, If[LessEqual[t, 1.15e-210], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e+17], N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-210}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+17}:\\
\;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.3000000000000001e-12 or 1.15e17 < t Initial program 84.9%
Taylor expanded in x around 0 82.2%
Taylor expanded in t around inf 78.8%
Taylor expanded in t around inf 66.9%
if -3.3000000000000001e-12 < t < 1.15e-210Initial program 84.4%
Simplified85.7%
Taylor expanded in t around 0 82.1%
associate-*r*82.1%
*-commutative82.1%
associate-*r*82.1%
*-commutative82.1%
associate-*r*82.1%
fma-udef84.6%
associate-*r*84.6%
*-commutative84.6%
associate-*r*84.6%
Simplified84.6%
Taylor expanded in b around 0 62.5%
mul-1-neg62.5%
associate-*r*62.5%
*-commutative62.5%
associate-*r*62.5%
distribute-neg-in62.5%
distribute-lft-neg-in62.5%
metadata-eval62.5%
distribute-rgt-neg-in62.5%
*-commutative62.5%
distribute-rgt-neg-in62.5%
metadata-eval62.5%
Simplified62.5%
if 1.15e-210 < t < 1.15e17Initial program 94.1%
Taylor expanded in x around 0 92.2%
Taylor expanded in b around inf 68.1%
Final simplification65.8%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= (* b c) -6.4e+135) (not (<= (* b c) 2.2e-65))) (- (* b c) (* (* j 27.0) k)) (+ (* j (* k -27.0)) (* (* x i) -4.0))))
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) <= -6.4e+135) || !((b * c) <= 2.2e-65)) {
tmp = (b * c) - ((j * 27.0) * k);
} else {
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (((b * c) <= (-6.4d+135)) .or. (.not. ((b * c) <= 2.2d-65))) then
tmp = (b * c) - ((j * 27.0d0) * k)
else
tmp = (j * (k * (-27.0d0))) + ((x * i) * (-4.0d0))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((b * c) <= -6.4e+135) || !((b * c) <= 2.2e-65)) {
tmp = (b * c) - ((j * 27.0) * k);
} else {
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if ((b * c) <= -6.4e+135) or not ((b * c) <= 2.2e-65): tmp = (b * c) - ((j * 27.0) * k) else: tmp = (j * (k * -27.0)) + ((x * i) * -4.0) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((Float64(b * c) <= -6.4e+135) || !(Float64(b * c) <= 2.2e-65)) tmp = Float64(Float64(b * c) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(j * Float64(k * -27.0)) + Float64(Float64(x * i) * -4.0)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (((b * c) <= -6.4e+135) || ~(((b * c) <= 2.2e-65)))
tmp = (b * c) - ((j * 27.0) * k);
else
tmp = (j * (k * -27.0)) + ((x * i) * -4.0);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[N[(b * c), $MachinePrecision], -6.4e+135], N[Not[LessEqual[N[(b * c), $MachinePrecision], 2.2e-65]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -6.4 \cdot 10^{+135} \lor \neg \left(b \cdot c \leq 2.2 \cdot 10^{-65}\right):\\
\;\;\;\;b \cdot c - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right) + \left(x \cdot i\right) \cdot -4\\
\end{array}
\end{array}
if (*.f64 b c) < -6.3999999999999995e135 or 2.20000000000000021e-65 < (*.f64 b c) Initial program 82.5%
Taylor expanded in x around 0 86.7%
Taylor expanded in b around inf 63.6%
if -6.3999999999999995e135 < (*.f64 b c) < 2.20000000000000021e-65Initial program 89.1%
Simplified91.9%
Taylor expanded in t around 0 59.0%
associate-*r*59.0%
*-commutative59.0%
associate-*r*59.0%
*-commutative59.0%
associate-*r*58.3%
fma-udef59.0%
associate-*r*59.6%
*-commutative59.6%
associate-*r*59.6%
Simplified59.6%
Taylor expanded in b around 0 54.8%
mul-1-neg54.8%
associate-*r*54.8%
*-commutative54.8%
associate-*r*54.2%
distribute-neg-in54.2%
distribute-lft-neg-in54.2%
metadata-eval54.2%
distribute-rgt-neg-in54.2%
*-commutative54.2%
distribute-rgt-neg-in54.2%
metadata-eval54.2%
Simplified54.2%
Final simplification57.8%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (* a -4.0))) (t_2 (* j (* k -27.0))))
(if (<= j -4.7e+50)
t_2
(if (<= j -1.4e+29)
t_1
(if (<= j -1.85e-16)
(* b c)
(if (<= j -8e-126)
t_1
(if (<= j 2.4e-176)
(* (* x i) -4.0)
(if (<= j 2.2e+40) (* b c) t_2))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double t_2 = j * (k * -27.0);
double tmp;
if (j <= -4.7e+50) {
tmp = t_2;
} else if (j <= -1.4e+29) {
tmp = t_1;
} else if (j <= -1.85e-16) {
tmp = b * c;
} else if (j <= -8e-126) {
tmp = t_1;
} else if (j <= 2.4e-176) {
tmp = (x * i) * -4.0;
} else if (j <= 2.2e+40) {
tmp = b * c;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * (a * (-4.0d0))
t_2 = j * (k * (-27.0d0))
if (j <= (-4.7d+50)) then
tmp = t_2
else if (j <= (-1.4d+29)) then
tmp = t_1
else if (j <= (-1.85d-16)) then
tmp = b * c
else if (j <= (-8d-126)) then
tmp = t_1
else if (j <= 2.4d-176) then
tmp = (x * i) * (-4.0d0)
else if (j <= 2.2d+40) then
tmp = b * c
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double t_2 = j * (k * -27.0);
double tmp;
if (j <= -4.7e+50) {
tmp = t_2;
} else if (j <= -1.4e+29) {
tmp = t_1;
} else if (j <= -1.85e-16) {
tmp = b * c;
} else if (j <= -8e-126) {
tmp = t_1;
} else if (j <= 2.4e-176) {
tmp = (x * i) * -4.0;
} else if (j <= 2.2e+40) {
tmp = b * c;
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * (a * -4.0) t_2 = j * (k * -27.0) tmp = 0 if j <= -4.7e+50: tmp = t_2 elif j <= -1.4e+29: tmp = t_1 elif j <= -1.85e-16: tmp = b * c elif j <= -8e-126: tmp = t_1 elif j <= 2.4e-176: tmp = (x * i) * -4.0 elif j <= 2.2e+40: tmp = b * c else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(a * -4.0)) t_2 = Float64(j * Float64(k * -27.0)) tmp = 0.0 if (j <= -4.7e+50) tmp = t_2; elseif (j <= -1.4e+29) tmp = t_1; elseif (j <= -1.85e-16) tmp = Float64(b * c); elseif (j <= -8e-126) tmp = t_1; elseif (j <= 2.4e-176) tmp = Float64(Float64(x * i) * -4.0); elseif (j <= 2.2e+40) tmp = Float64(b * c); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * (a * -4.0);
t_2 = j * (k * -27.0);
tmp = 0.0;
if (j <= -4.7e+50)
tmp = t_2;
elseif (j <= -1.4e+29)
tmp = t_1;
elseif (j <= -1.85e-16)
tmp = b * c;
elseif (j <= -8e-126)
tmp = t_1;
elseif (j <= 2.4e-176)
tmp = (x * i) * -4.0;
elseif (j <= 2.2e+40)
tmp = b * c;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -4.7e+50], t$95$2, If[LessEqual[j, -1.4e+29], t$95$1, If[LessEqual[j, -1.85e-16], N[(b * c), $MachinePrecision], If[LessEqual[j, -8e-126], t$95$1, If[LessEqual[j, 2.4e-176], N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[j, 2.2e+40], N[(b * c), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;j \leq -4.7 \cdot 10^{+50}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;j \leq -1.4 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -1.85 \cdot 10^{-16}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq -8 \cdot 10^{-126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq 2.4 \cdot 10^{-176}:\\
\;\;\;\;\left(x \cdot i\right) \cdot -4\\
\mathbf{elif}\;j \leq 2.2 \cdot 10^{+40}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if j < -4.69999999999999974e50 or 2.1999999999999999e40 < j Initial program 84.3%
Simplified85.7%
Taylor expanded in j around inf 48.4%
*-commutative48.4%
associate-*l*48.5%
Simplified48.5%
if -4.69999999999999974e50 < j < -1.4e29 or -1.85e-16 < j < -7.9999999999999996e-126Initial program 95.6%
Taylor expanded in y around 0 79.6%
fma-neg79.6%
distribute-lft-out79.6%
distribute-lft-neg-in79.6%
metadata-eval79.6%
*-commutative79.6%
fma-def79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in t around inf 37.4%
associate-*r*37.4%
Simplified37.4%
if -1.4e29 < j < -1.85e-16 or 2.40000000000000006e-176 < j < 2.1999999999999999e40Initial program 89.6%
Simplified89.5%
Taylor expanded in b around inf 26.6%
if -7.9999999999999996e-126 < j < 2.40000000000000006e-176Initial program 84.5%
Simplified89.2%
Taylor expanded in i around inf 32.0%
*-commutative32.0%
Simplified32.0%
Final simplification38.5%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 4.0 (* t a)))))
(if (<= j -1.8e+112)
(* -27.0 (* j k))
(if (<= j 3.25e-208)
t_1
(if (<= j 2.15e-158)
(* 18.0 (* (* y z) (* x t)))
(if (<= j 8.2e+42) t_1 (* j (* k -27.0))))))))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 * (t * a));
double tmp;
if (j <= -1.8e+112) {
tmp = -27.0 * (j * k);
} else if (j <= 3.25e-208) {
tmp = t_1;
} else if (j <= 2.15e-158) {
tmp = 18.0 * ((y * z) * (x * t));
} else if (j <= 8.2e+42) {
tmp = t_1;
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) - (4.0d0 * (t * a))
if (j <= (-1.8d+112)) then
tmp = (-27.0d0) * (j * k)
else if (j <= 3.25d-208) then
tmp = t_1
else if (j <= 2.15d-158) then
tmp = 18.0d0 * ((y * z) * (x * t))
else if (j <= 8.2d+42) then
tmp = t_1
else
tmp = j * (k * (-27.0d0))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * (t * a));
double tmp;
if (j <= -1.8e+112) {
tmp = -27.0 * (j * k);
} else if (j <= 3.25e-208) {
tmp = t_1;
} else if (j <= 2.15e-158) {
tmp = 18.0 * ((y * z) * (x * t));
} else if (j <= 8.2e+42) {
tmp = t_1;
} else {
tmp = j * (k * -27.0);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (4.0 * (t * a)) tmp = 0 if j <= -1.8e+112: tmp = -27.0 * (j * k) elif j <= 3.25e-208: tmp = t_1 elif j <= 2.15e-158: tmp = 18.0 * ((y * z) * (x * t)) elif j <= 8.2e+42: tmp = t_1 else: tmp = j * (k * -27.0) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) tmp = 0.0 if (j <= -1.8e+112) tmp = Float64(-27.0 * Float64(j * k)); elseif (j <= 3.25e-208) tmp = t_1; elseif (j <= 2.15e-158) tmp = Float64(18.0 * Float64(Float64(y * z) * Float64(x * t))); elseif (j <= 8.2e+42) tmp = t_1; else tmp = Float64(j * Float64(k * -27.0)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (4.0 * (t * a));
tmp = 0.0;
if (j <= -1.8e+112)
tmp = -27.0 * (j * k);
elseif (j <= 3.25e-208)
tmp = t_1;
elseif (j <= 2.15e-158)
tmp = 18.0 * ((y * z) * (x * t));
elseif (j <= 8.2e+42)
tmp = t_1;
else
tmp = j * (k * -27.0);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.8e+112], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.25e-208], t$95$1, If[LessEqual[j, 2.15e-158], N[(18.0 * N[(N[(y * z), $MachinePrecision] * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 8.2e+42], t$95$1, N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;j \leq -1.8 \cdot 10^{+112}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;j \leq 3.25 \cdot 10^{-208}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq 2.15 \cdot 10^{-158}:\\
\;\;\;\;18 \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot t\right)\right)\\
\mathbf{elif}\;j \leq 8.2 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if j < -1.8e112Initial program 92.7%
Simplified87.5%
Taylor expanded in j around inf 56.7%
*-commutative56.7%
Simplified56.7%
if -1.8e112 < j < 3.2499999999999999e-208 or 2.1499999999999998e-158 < j < 8.2000000000000001e42Initial program 89.8%
Taylor expanded in x around 0 89.2%
Taylor expanded in j around 0 79.3%
Taylor expanded in b around inf 40.6%
if 3.2499999999999999e-208 < j < 2.1499999999999998e-158Initial program 73.6%
Taylor expanded in x around 0 93.2%
Taylor expanded in t around inf 61.4%
Taylor expanded in t around inf 48.9%
Taylor expanded in x around inf 28.8%
associate-*r*34.9%
Simplified34.9%
if 8.2000000000000001e42 < j Initial program 77.6%
Simplified84.4%
Taylor expanded in j around inf 41.5%
*-commutative41.5%
associate-*l*41.6%
Simplified41.6%
Final simplification43.4%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k -27.0))))
(if (<= j -9.2e+51)
t_1
(if (<= j -1.16e-14)
(* b c)
(if (<= j 1.5e-176)
(* (* x i) -4.0)
(if (<= j 4.8e+50) (* b c) t_1))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double tmp;
if (j <= -9.2e+51) {
tmp = t_1;
} else if (j <= -1.16e-14) {
tmp = b * c;
} else if (j <= 1.5e-176) {
tmp = (x * i) * -4.0;
} else if (j <= 4.8e+50) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
if (j <= (-9.2d+51)) then
tmp = t_1
else if (j <= (-1.16d-14)) then
tmp = b * c
else if (j <= 1.5d-176) then
tmp = (x * i) * (-4.0d0)
else if (j <= 4.8d+50) then
tmp = b * c
else
tmp = t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * -27.0);
double tmp;
if (j <= -9.2e+51) {
tmp = t_1;
} else if (j <= -1.16e-14) {
tmp = b * c;
} else if (j <= 1.5e-176) {
tmp = (x * i) * -4.0;
} else if (j <= 4.8e+50) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) tmp = 0 if j <= -9.2e+51: tmp = t_1 elif j <= -1.16e-14: tmp = b * c elif j <= 1.5e-176: tmp = (x * i) * -4.0 elif j <= 4.8e+50: tmp = b * c else: tmp = t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) tmp = 0.0 if (j <= -9.2e+51) tmp = t_1; elseif (j <= -1.16e-14) tmp = Float64(b * c); elseif (j <= 1.5e-176) tmp = Float64(Float64(x * i) * -4.0); elseif (j <= 4.8e+50) tmp = Float64(b * c); else tmp = t_1; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
tmp = 0.0;
if (j <= -9.2e+51)
tmp = t_1;
elseif (j <= -1.16e-14)
tmp = b * c;
elseif (j <= 1.5e-176)
tmp = (x * i) * -4.0;
elseif (j <= 4.8e+50)
tmp = b * c;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -9.2e+51], t$95$1, If[LessEqual[j, -1.16e-14], N[(b * c), $MachinePrecision], If[LessEqual[j, 1.5e-176], N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision], If[LessEqual[j, 4.8e+50], N[(b * c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
\mathbf{if}\;j \leq -9.2 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \leq -1.16 \cdot 10^{-14}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;j \leq 1.5 \cdot 10^{-176}:\\
\;\;\;\;\left(x \cdot i\right) \cdot -4\\
\mathbf{elif}\;j \leq 4.8 \cdot 10^{+50}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if j < -9.2000000000000002e51 or 4.8000000000000004e50 < j Initial program 84.1%
Simplified85.5%
Taylor expanded in j around inf 48.9%
*-commutative48.9%
associate-*l*48.9%
Simplified48.9%
if -9.2000000000000002e51 < j < -1.16000000000000007e-14 or 1.5e-176 < j < 4.8000000000000004e50Initial program 90.5%
Simplified90.4%
Taylor expanded in b around inf 24.3%
if -1.16000000000000007e-14 < j < 1.5e-176Initial program 86.9%
Simplified91.6%
Taylor expanded in i around inf 32.3%
*-commutative32.3%
Simplified32.3%
Final simplification37.5%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= (* b c) -2.7e+135) (* b c) (if (<= (* b c) 1e+71) (* (* x i) -4.0) (* b c))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -2.7e+135) {
tmp = b * c;
} else if ((b * c) <= 1e+71) {
tmp = (x * i) * -4.0;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-2.7d+135)) then
tmp = b * c
else if ((b * c) <= 1d+71) then
tmp = (x * i) * (-4.0d0)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -2.7e+135) {
tmp = b * c;
} else if ((b * c) <= 1e+71) {
tmp = (x * i) * -4.0;
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -2.7e+135: tmp = b * c elif (b * c) <= 1e+71: tmp = (x * i) * -4.0 else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -2.7e+135) tmp = Float64(b * c); elseif (Float64(b * c) <= 1e+71) tmp = Float64(Float64(x * i) * -4.0); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= -2.7e+135)
tmp = b * c;
elseif ((b * c) <= 1e+71)
tmp = (x * i) * -4.0;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -2.7e+135], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1e+71], N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -2.7 \cdot 10^{+135}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 10^{+71}:\\
\;\;\;\;\left(x \cdot i\right) \cdot -4\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -2.69999999999999985e135 or 1e71 < (*.f64 b c) Initial program 83.2%
Simplified84.4%
Taylor expanded in b around inf 46.2%
if -2.69999999999999985e135 < (*.f64 b c) < 1e71Initial program 88.2%
Simplified90.8%
Taylor expanded in i around inf 29.5%
*-commutative29.5%
Simplified29.5%
Final simplification34.9%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = b * c
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 86.6%
Simplified88.7%
Taylor expanded in b around inf 19.5%
Final simplification19.5%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
(t_2
(-
(- (* (* 18.0 t) (* (* x y) z)) t_1)
(- (* (* k j) 27.0) (* c b)))))
(if (< t -1.6210815397541398e-69)
t_2
(if (< t 165.68027943805222)
(+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((a * t) + (i * x)) * 4.0d0
t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
if (t < (-1.6210815397541398d-69)) then
tmp = t_2
else if (t < 165.68027943805222d0) then
tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((a * t) + (i * x)) * 4.0 t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)) tmp = 0 if t < -1.6210815397541398e-69: tmp = t_2 elif t < 165.68027943805222: tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0) t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b))) tmp = 0.0 if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = ((a * t) + (i * x)) * 4.0; t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)); tmp = 0.0; if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023271
(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)))