
(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 27 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(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 2e+273)
t_1
(if (<= t_1 INFINITY)
(fma
x
(fma 18.0 (* t (* y z)) (* i -4.0))
(fma t (* a -4.0) (fma b c (* k (* j -27.0)))))
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double 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 <= 2e+273) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma(x, fma(18.0, (t * (y * z)), (i * -4.0)), fma(t, (a * -4.0), fma(b, c, (k * (j * -27.0)))));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) 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 <= 2e+273) tmp = t_1; elseif (t_1 <= Inf) tmp = fma(x, fma(18.0, Float64(t * Float64(y * z)), Float64(i * -4.0)), fma(t, Float64(a * -4.0), fma(b, c, Float64(k * Float64(j * -27.0))))); else tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(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, 2e+273], t$95$1, If[LessEqual[t$95$1, Infinity], N[(x * N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision] + N[(b * c + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
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 2 \cdot 10^{+273}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(18, t \cdot \left(y \cdot z\right), i \cdot -4\right), \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, k \cdot \left(j \cdot -27\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\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)) < 1.99999999999999989e273Initial program 98.7%
if 1.99999999999999989e273 < (-.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 86.2%
Simplified97.3%
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%
sub-neg0.0%
associate-+l-0.0%
sub-neg0.0%
sub-neg0.0%
distribute-rgt-out--20.0%
associate-*l*24.0%
distribute-lft-neg-in24.0%
cancel-sign-sub24.0%
associate-*l*24.0%
associate-*l*24.0%
Simplified24.0%
Taylor expanded in x around inf 72.4%
Final simplification95.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_1 INFINITY) t_1 (* x (- (* 18.0 (* y (* z t))) (* 4.0 i))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\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 94.9%
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%
sub-neg0.0%
associate-+l-0.0%
sub-neg0.0%
sub-neg0.0%
distribute-rgt-out--20.0%
associate-*l*24.0%
distribute-lft-neg-in24.0%
cancel-sign-sub24.0%
associate-*l*24.0%
associate-*l*24.0%
Simplified24.0%
Taylor expanded in x around inf 72.4%
Final simplification92.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 27.0 (* j k)))))
(if (<= (* j 27.0) -1e+221)
t_1
(if (<= (* j 27.0) -4e+207)
(* x (* 18.0 (* y (* z t))))
(if (<= (* j 27.0) -4e+103)
t_1
(if (<= (* j 27.0) -4e-266)
(- (* b c) (* (* x 4.0) i))
(if (<= (* j 27.0) 1e-230)
(* x (* 18.0 (* t (* y z))))
(if (<= (* j 27.0) 5e-180)
(- (* b c) (* 4.0 (* t a)))
(if (<= (* j 27.0) 1e-95)
(* 18.0 (* y (* t (* x z))))
t_1)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (j * k));
double tmp;
if ((j * 27.0) <= -1e+221) {
tmp = t_1;
} else if ((j * 27.0) <= -4e+207) {
tmp = x * (18.0 * (y * (z * t)));
} else if ((j * 27.0) <= -4e+103) {
tmp = t_1;
} else if ((j * 27.0) <= -4e-266) {
tmp = (b * c) - ((x * 4.0) * i);
} else if ((j * 27.0) <= 1e-230) {
tmp = x * (18.0 * (t * (y * z)));
} else if ((j * 27.0) <= 5e-180) {
tmp = (b * c) - (4.0 * (t * a));
} else if ((j * 27.0) <= 1e-95) {
tmp = 18.0 * (y * (t * (x * z)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) - (27.0d0 * (j * k))
if ((j * 27.0d0) <= (-1d+221)) then
tmp = t_1
else if ((j * 27.0d0) <= (-4d+207)) then
tmp = x * (18.0d0 * (y * (z * t)))
else if ((j * 27.0d0) <= (-4d+103)) then
tmp = t_1
else if ((j * 27.0d0) <= (-4d-266)) then
tmp = (b * c) - ((x * 4.0d0) * i)
else if ((j * 27.0d0) <= 1d-230) then
tmp = x * (18.0d0 * (t * (y * z)))
else if ((j * 27.0d0) <= 5d-180) then
tmp = (b * c) - (4.0d0 * (t * a))
else if ((j * 27.0d0) <= 1d-95) then
tmp = 18.0d0 * (y * (t * (x * z)))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (j * k));
double tmp;
if ((j * 27.0) <= -1e+221) {
tmp = t_1;
} else if ((j * 27.0) <= -4e+207) {
tmp = x * (18.0 * (y * (z * t)));
} else if ((j * 27.0) <= -4e+103) {
tmp = t_1;
} else if ((j * 27.0) <= -4e-266) {
tmp = (b * c) - ((x * 4.0) * i);
} else if ((j * 27.0) <= 1e-230) {
tmp = x * (18.0 * (t * (y * z)));
} else if ((j * 27.0) <= 5e-180) {
tmp = (b * c) - (4.0 * (t * a));
} else if ((j * 27.0) <= 1e-95) {
tmp = 18.0 * (y * (t * (x * z)));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (27.0 * (j * k)) tmp = 0 if (j * 27.0) <= -1e+221: tmp = t_1 elif (j * 27.0) <= -4e+207: tmp = x * (18.0 * (y * (z * t))) elif (j * 27.0) <= -4e+103: tmp = t_1 elif (j * 27.0) <= -4e-266: tmp = (b * c) - ((x * 4.0) * i) elif (j * 27.0) <= 1e-230: tmp = x * (18.0 * (t * (y * z))) elif (j * 27.0) <= 5e-180: tmp = (b * c) - (4.0 * (t * a)) elif (j * 27.0) <= 1e-95: tmp = 18.0 * (y * (t * (x * z))) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (Float64(j * 27.0) <= -1e+221) tmp = t_1; elseif (Float64(j * 27.0) <= -4e+207) tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); elseif (Float64(j * 27.0) <= -4e+103) tmp = t_1; elseif (Float64(j * 27.0) <= -4e-266) tmp = Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)); elseif (Float64(j * 27.0) <= 1e-230) tmp = Float64(x * Float64(18.0 * Float64(t * Float64(y * z)))); elseif (Float64(j * 27.0) <= 5e-180) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (Float64(j * 27.0) <= 1e-95) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (27.0 * (j * k));
tmp = 0.0;
if ((j * 27.0) <= -1e+221)
tmp = t_1;
elseif ((j * 27.0) <= -4e+207)
tmp = x * (18.0 * (y * (z * t)));
elseif ((j * 27.0) <= -4e+103)
tmp = t_1;
elseif ((j * 27.0) <= -4e-266)
tmp = (b * c) - ((x * 4.0) * i);
elseif ((j * 27.0) <= 1e-230)
tmp = x * (18.0 * (t * (y * z)));
elseif ((j * 27.0) <= 5e-180)
tmp = (b * c) - (4.0 * (t * a));
elseif ((j * 27.0) <= 1e-95)
tmp = 18.0 * (y * (t * (x * z)));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(j * 27.0), $MachinePrecision], -1e+221], t$95$1, If[LessEqual[N[(j * 27.0), $MachinePrecision], -4e+207], N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(j * 27.0), $MachinePrecision], -4e+103], t$95$1, If[LessEqual[N[(j * 27.0), $MachinePrecision], -4e-266], N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(j * 27.0), $MachinePrecision], 1e-230], N[(x * N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(j * 27.0), $MachinePrecision], 5e-180], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(j * 27.0), $MachinePrecision], 1e-95], N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;j \cdot 27 \leq -1 \cdot 10^{+221}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \cdot 27 \leq -4 \cdot 10^{+207}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{elif}\;j \cdot 27 \leq -4 \cdot 10^{+103}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;j \cdot 27 \leq -4 \cdot 10^{-266}:\\
\;\;\;\;b \cdot c - \left(x \cdot 4\right) \cdot i\\
\mathbf{elif}\;j \cdot 27 \leq 10^{-230}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;j \cdot 27 \leq 5 \cdot 10^{-180}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;j \cdot 27 \leq 10^{-95}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 j 27) < -1e221 or -4.0000000000000002e207 < (*.f64 j 27) < -4e103 or 9.99999999999999989e-96 < (*.f64 j 27) Initial program 85.5%
sub-neg85.5%
associate-+l-85.5%
sub-neg85.5%
sub-neg85.5%
distribute-rgt-out--85.5%
associate-*l*83.8%
distribute-lft-neg-in83.8%
cancel-sign-sub83.8%
associate-*l*83.8%
associate-*l*83.9%
Simplified83.9%
Taylor expanded in t around 0 65.1%
Taylor expanded in i around 0 57.5%
*-commutative57.5%
Simplified57.5%
if -1e221 < (*.f64 j 27) < -4.0000000000000002e207Initial program 83.3%
sub-neg83.3%
associate-+l-83.3%
sub-neg83.3%
sub-neg83.3%
distribute-rgt-out--100.0%
associate-*l*100.0%
distribute-lft-neg-in100.0%
cancel-sign-sub100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 83.6%
Taylor expanded in y around inf 83.6%
if -4e103 < (*.f64 j 27) < -3.9999999999999999e-266Initial program 86.0%
sub-neg86.0%
associate-+l-86.0%
sub-neg86.0%
sub-neg86.0%
distribute-rgt-out--88.6%
associate-*l*89.9%
distribute-lft-neg-in89.9%
cancel-sign-sub89.9%
associate-*l*89.9%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in t around 0 69.1%
Taylor expanded in i around inf 60.2%
*-commutative60.2%
associate-*r*60.2%
Simplified60.2%
if -3.9999999999999999e-266 < (*.f64 j 27) < 1.00000000000000005e-230Initial program 83.9%
sub-neg83.9%
associate-+l-83.9%
sub-neg83.9%
sub-neg83.9%
distribute-rgt-out--87.9%
associate-*l*80.6%
distribute-lft-neg-in80.6%
cancel-sign-sub80.6%
associate-*l*80.6%
associate-*l*80.6%
Simplified80.6%
Taylor expanded in x around inf 57.3%
Taylor expanded in y around inf 33.6%
*-commutative33.6%
associate-*l*37.6%
Simplified37.6%
if 1.00000000000000005e-230 < (*.f64 j 27) < 5.0000000000000001e-180Initial program 93.5%
Taylor expanded in x around 0 69.6%
Taylor expanded in x around 0 48.7%
Taylor expanded in j around 0 39.3%
if 5.0000000000000001e-180 < (*.f64 j 27) < 9.99999999999999989e-96Initial program 79.9%
Simplified80.3%
Taylor expanded in a around 0 86.3%
Taylor expanded in i around 0 72.9%
Taylor expanded in y around inf 54.0%
Final simplification55.6%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= z -2.2e-103)
(-
(+ (* b c) (* 18.0 (* y (* t (* x z)))))
(+ (* 4.0 (* x i)) (* 27.0 (* j k))))
(if (<= z 1.9e+92)
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -2.2e-103) {
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - ((4.0 * (x * i)) + (27.0 * (j * k)));
} else if (z <= 1.9e+92) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (z <= (-2.2d-103)) then
tmp = ((b * c) + (18.0d0 * (y * (t * (x * z))))) - ((4.0d0 * (x * i)) + (27.0d0 * (j * k)))
else if (z <= 1.9d+92) then
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -2.2e-103) {
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - ((4.0 * (x * i)) + (27.0 * (j * k)));
} else if (z <= 1.9e+92) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if z <= -2.2e-103: tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - ((4.0 * (x * i)) + (27.0 * (j * k))) elif z <= 1.9e+92: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (z <= -2.2e-103) tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z))))) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(j * k)))); elseif (z <= 1.9e+92) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (z <= -2.2e-103)
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - ((4.0 * (x * i)) + (27.0 * (j * k)));
elseif (z <= 1.9e+92)
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[z, -2.2e-103], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+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] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-103}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;z \leq 1.9 \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) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\right)\\
\end{array}
\end{array}
if z < -2.1999999999999999e-103Initial program 84.0%
sub-neg84.0%
associate-+l-84.0%
sub-neg84.0%
sub-neg84.0%
distribute-rgt-out--85.2%
associate-*l*77.5%
distribute-lft-neg-in77.5%
cancel-sign-sub77.5%
associate-*l*77.5%
associate-*l*77.5%
Simplified77.5%
Taylor expanded in a around 0 77.6%
if -2.1999999999999999e-103 < z < 1.9e92Initial program 90.0%
sub-neg90.0%
associate-+l-90.0%
sub-neg90.0%
sub-neg90.0%
distribute-rgt-out--90.8%
associate-*l*94.9%
distribute-lft-neg-in94.9%
cancel-sign-sub94.9%
associate-*l*94.9%
associate-*l*94.9%
Simplified94.9%
if 1.9e92 < z Initial program 77.4%
Simplified77.5%
Taylor expanded in a around 0 83.6%
Final simplification86.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* j k)))))
(t_2 (+ (* 18.0 (* y (* t (* x z)))) (* -27.0 (* j k))))
(t_3 (- (* b c) (* 4.0 (+ (* x i) (* t a))))))
(if (<= y -3.1e+209)
t_2
(if (<= y -3e+176)
t_3
(if (<= y -3.4e+136)
t_2
(if (<= y -8e+113)
t_3
(if (<= y -4.9e+82)
t_1
(if (<= y -5.3e+20)
(* t (- (* a (- 4.0)) (* -18.0 (* y (* x z)))))
(if (<= y 1.45e-145) t_1 t_2)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
double t_2 = (18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k));
double t_3 = (b * c) - (4.0 * ((x * i) + (t * a)));
double tmp;
if (y <= -3.1e+209) {
tmp = t_2;
} else if (y <= -3e+176) {
tmp = t_3;
} else if (y <= -3.4e+136) {
tmp = t_2;
} else if (y <= -8e+113) {
tmp = t_3;
} else if (y <= -4.9e+82) {
tmp = t_1;
} else if (y <= -5.3e+20) {
tmp = t * ((a * -4.0) - (-18.0 * (y * (x * z))));
} else if (y <= 1.45e-145) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (j * k)))
t_2 = (18.0d0 * (y * (t * (x * z)))) + ((-27.0d0) * (j * k))
t_3 = (b * c) - (4.0d0 * ((x * i) + (t * a)))
if (y <= (-3.1d+209)) then
tmp = t_2
else if (y <= (-3d+176)) then
tmp = t_3
else if (y <= (-3.4d+136)) then
tmp = t_2
else if (y <= (-8d+113)) then
tmp = t_3
else if (y <= (-4.9d+82)) then
tmp = t_1
else if (y <= (-5.3d+20)) then
tmp = t * ((a * -4.0d0) - ((-18.0d0) * (y * (x * z))))
else if (y <= 1.45d-145) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
double t_2 = (18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k));
double t_3 = (b * c) - (4.0 * ((x * i) + (t * a)));
double tmp;
if (y <= -3.1e+209) {
tmp = t_2;
} else if (y <= -3e+176) {
tmp = t_3;
} else if (y <= -3.4e+136) {
tmp = t_2;
} else if (y <= -8e+113) {
tmp = t_3;
} else if (y <= -4.9e+82) {
tmp = t_1;
} else if (y <= -5.3e+20) {
tmp = t * ((a * -4.0) - (-18.0 * (y * (x * z))));
} else if (y <= 1.45e-145) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k))) t_2 = (18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k)) t_3 = (b * c) - (4.0 * ((x * i) + (t * a))) tmp = 0 if y <= -3.1e+209: tmp = t_2 elif y <= -3e+176: tmp = t_3 elif y <= -3.4e+136: tmp = t_2 elif y <= -8e+113: tmp = t_3 elif y <= -4.9e+82: tmp = t_1 elif y <= -5.3e+20: tmp = t * ((a * -4.0) - (-18.0 * (y * (x * z)))) elif y <= 1.45e-145: tmp = t_1 else: tmp = t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(j * k)))) t_2 = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) + Float64(-27.0 * Float64(j * k))) t_3 = Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(x * i) + Float64(t * a)))) tmp = 0.0 if (y <= -3.1e+209) tmp = t_2; elseif (y <= -3e+176) tmp = t_3; elseif (y <= -3.4e+136) tmp = t_2; elseif (y <= -8e+113) tmp = t_3; elseif (y <= -4.9e+82) tmp = t_1; elseif (y <= -5.3e+20) tmp = Float64(t * Float64(Float64(a * Float64(-4.0)) - Float64(-18.0 * Float64(y * Float64(x * z))))); elseif (y <= 1.45e-145) tmp = t_1; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - ((4.0 * (x * i)) + (27.0 * (j * k)));
t_2 = (18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k));
t_3 = (b * c) - (4.0 * ((x * i) + (t * a)));
tmp = 0.0;
if (y <= -3.1e+209)
tmp = t_2;
elseif (y <= -3e+176)
tmp = t_3;
elseif (y <= -3.4e+136)
tmp = t_2;
elseif (y <= -8e+113)
tmp = t_3;
elseif (y <= -4.9e+82)
tmp = t_1;
elseif (y <= -5.3e+20)
tmp = t * ((a * -4.0) - (-18.0 * (y * (x * z))));
elseif (y <= 1.45e-145)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e+209], t$95$2, If[LessEqual[y, -3e+176], t$95$3, If[LessEqual[y, -3.4e+136], t$95$2, If[LessEqual[y, -8e+113], t$95$3, If[LessEqual[y, -4.9e+82], t$95$1, If[LessEqual[y, -5.3e+20], N[(t * N[(N[(a * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e-145], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(j \cdot k\right)\right)\\
t_2 := 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) + -27 \cdot \left(j \cdot k\right)\\
t_3 := b \cdot c - 4 \cdot \left(x \cdot i + t \cdot a\right)\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+209}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -3 \cdot 10^{+176}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -3.4 \cdot 10^{+136}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+113}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -4.9 \cdot 10^{+82}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.3 \cdot 10^{+20}:\\
\;\;\;\;t \cdot \left(a \cdot \left(-4\right) - -18 \cdot \left(y \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-145}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -3.1000000000000001e209 or -3e176 < y < -3.39999999999999997e136 or 1.44999999999999992e-145 < y Initial program 81.0%
Simplified81.2%
Taylor expanded in a around 0 80.2%
Taylor expanded in i around 0 70.4%
Taylor expanded in c around 0 58.5%
if -3.1000000000000001e209 < y < -3e176 or -3.39999999999999997e136 < y < -8e113Initial program 71.4%
Taylor expanded in x around 0 64.6%
Taylor expanded in j around 0 71.8%
distribute-lft-out71.8%
*-commutative71.8%
Simplified71.8%
if -8e113 < y < -4.9000000000000001e82 or -5.3e20 < y < 1.44999999999999992e-145Initial program 92.7%
sub-neg92.7%
associate-+l-92.7%
sub-neg92.7%
sub-neg92.7%
distribute-rgt-out--93.6%
associate-*l*93.6%
distribute-lft-neg-in93.6%
cancel-sign-sub93.6%
associate-*l*93.6%
associate-*l*93.6%
Simplified93.6%
Taylor expanded in t around 0 73.8%
if -4.9000000000000001e82 < y < -5.3e20Initial program 85.2%
Simplified99.7%
Taylor expanded in t around -inf 85.2%
Final simplification66.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= (* j 27.0) -4e+213)
(* -27.0 (* j k))
(if (<= (* j 27.0) -4e-266)
(- (* b c) (* (* x 4.0) i))
(if (<= (* j 27.0) 1e-230)
(* x (* 18.0 (* t (* y z))))
(if (<= (* j 27.0) 5e-180)
(- (* b c) (* 4.0 (* t a)))
(if (<= (* j 27.0) 1e-95)
(* 18.0 (* y (* t (* x z))))
(* (* j 27.0) (- k))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((j * 27.0) <= -4e+213) {
tmp = -27.0 * (j * k);
} else if ((j * 27.0) <= -4e-266) {
tmp = (b * c) - ((x * 4.0) * i);
} else if ((j * 27.0) <= 1e-230) {
tmp = x * (18.0 * (t * (y * z)));
} else if ((j * 27.0) <= 5e-180) {
tmp = (b * c) - (4.0 * (t * a));
} else if ((j * 27.0) <= 1e-95) {
tmp = 18.0 * (y * (t * (x * z)));
} else {
tmp = (j * 27.0) * -k;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((j * 27.0d0) <= (-4d+213)) then
tmp = (-27.0d0) * (j * k)
else if ((j * 27.0d0) <= (-4d-266)) then
tmp = (b * c) - ((x * 4.0d0) * i)
else if ((j * 27.0d0) <= 1d-230) then
tmp = x * (18.0d0 * (t * (y * z)))
else if ((j * 27.0d0) <= 5d-180) then
tmp = (b * c) - (4.0d0 * (t * a))
else if ((j * 27.0d0) <= 1d-95) then
tmp = 18.0d0 * (y * (t * (x * z)))
else
tmp = (j * 27.0d0) * -k
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((j * 27.0) <= -4e+213) {
tmp = -27.0 * (j * k);
} else if ((j * 27.0) <= -4e-266) {
tmp = (b * c) - ((x * 4.0) * i);
} else if ((j * 27.0) <= 1e-230) {
tmp = x * (18.0 * (t * (y * z)));
} else if ((j * 27.0) <= 5e-180) {
tmp = (b * c) - (4.0 * (t * a));
} else if ((j * 27.0) <= 1e-95) {
tmp = 18.0 * (y * (t * (x * z)));
} else {
tmp = (j * 27.0) * -k;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (j * 27.0) <= -4e+213: tmp = -27.0 * (j * k) elif (j * 27.0) <= -4e-266: tmp = (b * c) - ((x * 4.0) * i) elif (j * 27.0) <= 1e-230: tmp = x * (18.0 * (t * (y * z))) elif (j * 27.0) <= 5e-180: tmp = (b * c) - (4.0 * (t * a)) elif (j * 27.0) <= 1e-95: tmp = 18.0 * (y * (t * (x * z))) else: tmp = (j * 27.0) * -k return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(j * 27.0) <= -4e+213) tmp = Float64(-27.0 * Float64(j * k)); elseif (Float64(j * 27.0) <= -4e-266) tmp = Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)); elseif (Float64(j * 27.0) <= 1e-230) tmp = Float64(x * Float64(18.0 * Float64(t * Float64(y * z)))); elseif (Float64(j * 27.0) <= 5e-180) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); elseif (Float64(j * 27.0) <= 1e-95) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))); else tmp = Float64(Float64(j * 27.0) * Float64(-k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((j * 27.0) <= -4e+213)
tmp = -27.0 * (j * k);
elseif ((j * 27.0) <= -4e-266)
tmp = (b * c) - ((x * 4.0) * i);
elseif ((j * 27.0) <= 1e-230)
tmp = x * (18.0 * (t * (y * z)));
elseif ((j * 27.0) <= 5e-180)
tmp = (b * c) - (4.0 * (t * a));
elseif ((j * 27.0) <= 1e-95)
tmp = 18.0 * (y * (t * (x * z)));
else
tmp = (j * 27.0) * -k;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(j * 27.0), $MachinePrecision], -4e+213], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(j * 27.0), $MachinePrecision], -4e-266], N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(j * 27.0), $MachinePrecision], 1e-230], N[(x * N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(j * 27.0), $MachinePrecision], 5e-180], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(j * 27.0), $MachinePrecision], 1e-95], N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * 27.0), $MachinePrecision] * (-k)), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;j \cdot 27 \leq -4 \cdot 10^{+213}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;j \cdot 27 \leq -4 \cdot 10^{-266}:\\
\;\;\;\;b \cdot c - \left(x \cdot 4\right) \cdot i\\
\mathbf{elif}\;j \cdot 27 \leq 10^{-230}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;j \cdot 27 \leq 5 \cdot 10^{-180}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;j \cdot 27 \leq 10^{-95}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot 27\right) \cdot \left(-k\right)\\
\end{array}
\end{array}
if (*.f64 j 27) < -3.99999999999999994e213Initial program 94.9%
sub-neg94.9%
+-commutative94.9%
associate-*l*95.0%
distribute-rgt-neg-in95.0%
fma-def95.0%
*-commutative95.0%
distribute-rgt-neg-in95.0%
metadata-eval95.0%
sub-neg95.0%
+-commutative95.0%
associate-*l*95.0%
distribute-rgt-neg-in95.0%
Simplified100.0%
Taylor expanded in j around inf 61.3%
if -3.99999999999999994e213 < (*.f64 j 27) < -3.9999999999999999e-266Initial program 85.6%
sub-neg85.6%
associate-+l-85.6%
sub-neg85.6%
sub-neg85.6%
distribute-rgt-out--88.7%
associate-*l*89.8%
distribute-lft-neg-in89.8%
cancel-sign-sub89.8%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in t around 0 67.1%
Taylor expanded in i around inf 55.9%
*-commutative55.9%
associate-*r*55.9%
Simplified55.9%
if -3.9999999999999999e-266 < (*.f64 j 27) < 1.00000000000000005e-230Initial program 83.9%
sub-neg83.9%
associate-+l-83.9%
sub-neg83.9%
sub-neg83.9%
distribute-rgt-out--87.9%
associate-*l*80.6%
distribute-lft-neg-in80.6%
cancel-sign-sub80.6%
associate-*l*80.6%
associate-*l*80.6%
Simplified80.6%
Taylor expanded in x around inf 57.3%
Taylor expanded in y around inf 33.6%
*-commutative33.6%
associate-*l*37.6%
Simplified37.6%
if 1.00000000000000005e-230 < (*.f64 j 27) < 5.0000000000000001e-180Initial program 93.5%
Taylor expanded in x around 0 69.6%
Taylor expanded in x around 0 48.7%
Taylor expanded in j around 0 39.3%
if 5.0000000000000001e-180 < (*.f64 j 27) < 9.99999999999999989e-96Initial program 79.9%
Simplified80.3%
Taylor expanded in a around 0 86.3%
Taylor expanded in i around 0 72.9%
Taylor expanded in y around inf 54.0%
if 9.99999999999999989e-96 < (*.f64 j 27) Initial program 83.4%
Taylor expanded in x around 0 75.1%
Taylor expanded in x around 0 65.1%
Taylor expanded in c around 0 54.3%
Taylor expanded in a around 0 40.4%
*-commutative40.4%
*-commutative40.4%
*-commutative40.4%
associate-*r*40.4%
Simplified40.4%
Final simplification48.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* 18.0 (* y (* t (* x z)))) (* -27.0 (* j k))))
(t_2 (- (* b c) (* 4.0 (+ (* x i) (* t a))))))
(if (<= y -2.9e+206)
t_1
(if (<= y -1.45e+177)
t_2
(if (<= y -3.6e+136)
t_1
(if (<= y -3.8e-65)
t_2
(if (<= y -1.35e-112)
(- (* 27.0 (* k (- j))) (* 4.0 (* t a)))
(if (<= y 4.2e-104) t_2 t_1))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k));
double t_2 = (b * c) - (4.0 * ((x * i) + (t * a)));
double tmp;
if (y <= -2.9e+206) {
tmp = t_1;
} else if (y <= -1.45e+177) {
tmp = t_2;
} else if (y <= -3.6e+136) {
tmp = t_1;
} else if (y <= -3.8e-65) {
tmp = t_2;
} else if (y <= -1.35e-112) {
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
} else if (y <= 4.2e-104) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (18.0d0 * (y * (t * (x * z)))) + ((-27.0d0) * (j * k))
t_2 = (b * c) - (4.0d0 * ((x * i) + (t * a)))
if (y <= (-2.9d+206)) then
tmp = t_1
else if (y <= (-1.45d+177)) then
tmp = t_2
else if (y <= (-3.6d+136)) then
tmp = t_1
else if (y <= (-3.8d-65)) then
tmp = t_2
else if (y <= (-1.35d-112)) then
tmp = (27.0d0 * (k * -j)) - (4.0d0 * (t * a))
else if (y <= 4.2d-104) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k));
double t_2 = (b * c) - (4.0 * ((x * i) + (t * a)));
double tmp;
if (y <= -2.9e+206) {
tmp = t_1;
} else if (y <= -1.45e+177) {
tmp = t_2;
} else if (y <= -3.6e+136) {
tmp = t_1;
} else if (y <= -3.8e-65) {
tmp = t_2;
} else if (y <= -1.35e-112) {
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
} else if (y <= 4.2e-104) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k)) t_2 = (b * c) - (4.0 * ((x * i) + (t * a))) tmp = 0 if y <= -2.9e+206: tmp = t_1 elif y <= -1.45e+177: tmp = t_2 elif y <= -3.6e+136: tmp = t_1 elif y <= -3.8e-65: tmp = t_2 elif y <= -1.35e-112: tmp = (27.0 * (k * -j)) - (4.0 * (t * a)) elif y <= 4.2e-104: tmp = t_2 else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) + Float64(-27.0 * Float64(j * k))) t_2 = Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(x * i) + Float64(t * a)))) tmp = 0.0 if (y <= -2.9e+206) tmp = t_1; elseif (y <= -1.45e+177) tmp = t_2; elseif (y <= -3.6e+136) tmp = t_1; elseif (y <= -3.8e-65) tmp = t_2; elseif (y <= -1.35e-112) tmp = Float64(Float64(27.0 * Float64(k * Float64(-j))) - Float64(4.0 * Float64(t * a))); elseif (y <= 4.2e-104) tmp = t_2; else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k));
t_2 = (b * c) - (4.0 * ((x * i) + (t * a)));
tmp = 0.0;
if (y <= -2.9e+206)
tmp = t_1;
elseif (y <= -1.45e+177)
tmp = t_2;
elseif (y <= -3.6e+136)
tmp = t_1;
elseif (y <= -3.8e-65)
tmp = t_2;
elseif (y <= -1.35e-112)
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
elseif (y <= 4.2e-104)
tmp = t_2;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e+206], t$95$1, If[LessEqual[y, -1.45e+177], t$95$2, If[LessEqual[y, -3.6e+136], t$95$1, If[LessEqual[y, -3.8e-65], t$95$2, If[LessEqual[y, -1.35e-112], N[(N[(27.0 * N[(k * (-j)), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-104], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) + -27 \cdot \left(j \cdot k\right)\\
t_2 := b \cdot c - 4 \cdot \left(x \cdot i + t \cdot a\right)\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+206}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{+177}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-112}:\\
\;\;\;\;27 \cdot \left(k \cdot \left(-j\right)\right) - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-104}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.9e206 or -1.45000000000000007e177 < y < -3.60000000000000006e136 or 4.19999999999999997e-104 < y Initial program 79.6%
Simplified79.9%
Taylor expanded in a around 0 80.6%
Taylor expanded in i around 0 71.8%
Taylor expanded in c around 0 59.8%
if -2.9e206 < y < -1.45000000000000007e177 or -3.60000000000000006e136 < y < -3.8000000000000002e-65 or -1.35e-112 < y < 4.19999999999999997e-104Initial program 91.3%
Taylor expanded in x around 0 85.9%
Taylor expanded in j around 0 66.8%
distribute-lft-out66.8%
*-commutative66.8%
Simplified66.8%
if -3.8000000000000002e-65 < y < -1.35e-112Initial program 84.3%
Taylor expanded in x around 0 85.4%
Taylor expanded in x around 0 70.4%
Taylor expanded in c around 0 62.9%
Final simplification63.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* j k))))
(if (<= z -7e-34)
(+ (* b c) (+ (* 18.0 (* y (* t (* x z)))) t_1))
(if (<= z 4.3e+103)
(- (- (- (* b c) (* 4.0 (* t a))) (* (* x 4.0) i)) (* (* j 27.0) k))
(+ (* b c) (+ t_1 (* x (+ (* 18.0 (* y (* z t))) (* i -4.0)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double tmp;
if (z <= -7e-34) {
tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + t_1);
} else if (z <= 4.3e+103) {
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = (b * c) + (t_1 + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
if (z <= (-7d-34)) then
tmp = (b * c) + ((18.0d0 * (y * (t * (x * z)))) + t_1)
else if (z <= 4.3d+103) then
tmp = (((b * c) - (4.0d0 * (t * a))) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
else
tmp = (b * c) + (t_1 + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double tmp;
if (z <= -7e-34) {
tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + t_1);
} else if (z <= 4.3e+103) {
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = (b * c) + (t_1 + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) tmp = 0 if z <= -7e-34: tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + t_1) elif z <= 4.3e+103: tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k) else: tmp = (b * c) + (t_1 + (x * ((18.0 * (y * (z * t))) + (i * -4.0)))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) tmp = 0.0 if (z <= -7e-34) tmp = Float64(Float64(b * c) + Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) + t_1)); elseif (z <= 4.3e+103) tmp = Float64(Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(b * c) + Float64(t_1 + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
tmp = 0.0;
if (z <= -7e-34)
tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + t_1);
elseif (z <= 4.3e+103)
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
else
tmp = (b * c) + (t_1 + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e-34], N[(N[(b * c), $MachinePrecision] + N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e+103], N[(N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(t$95$1 + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{-34}:\\
\;\;\;\;b \cdot c + \left(18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) + t_1\right)\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+103}:\\
\;\;\;\;\left(\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + \left(t_1 + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\right)\\
\end{array}
\end{array}
if z < -7e-34Initial program 85.7%
Simplified82.0%
Taylor expanded in a around 0 76.0%
Taylor expanded in i around 0 70.5%
if -7e-34 < z < 4.29999999999999969e103Initial program 88.8%
Taylor expanded in x around 0 89.7%
if 4.29999999999999969e103 < z Initial program 75.9%
Simplified76.0%
Taylor expanded in a around 0 82.6%
Final simplification82.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= z -1.15e-100)
(-
(+ (* b c) (* 18.0 (* y (* t (* x z)))))
(+ (* 4.0 (* x i)) (* 27.0 (* j k))))
(if (<= z 1e+108)
(- (- (- (* b c) (* 4.0 (* t a))) (* (* x 4.0) i)) (* (* j 27.0) k))
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -1.15e-100) {
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - ((4.0 * (x * i)) + (27.0 * (j * k)));
} else if (z <= 1e+108) {
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (z <= (-1.15d-100)) then
tmp = ((b * c) + (18.0d0 * (y * (t * (x * z))))) - ((4.0d0 * (x * i)) + (27.0d0 * (j * k)))
else if (z <= 1d+108) then
tmp = (((b * c) - (4.0d0 * (t * a))) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
else
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0)))))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -1.15e-100) {
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - ((4.0 * (x * i)) + (27.0 * (j * k)));
} else if (z <= 1e+108) {
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if z <= -1.15e-100: tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - ((4.0 * (x * i)) + (27.0 * (j * k))) elif z <= 1e+108: tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k) else: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (z <= -1.15e-100) tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z))))) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(j * k)))); elseif (z <= 1e+108) tmp = Float64(Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0))))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (z <= -1.15e-100)
tmp = ((b * c) + (18.0 * (y * (t * (x * z))))) - ((4.0 * (x * i)) + (27.0 * (j * k)));
elseif (z <= 1e+108)
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
else
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[z, -1.15e-100], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+108], N[(N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-100}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;z \leq 10^{+108}:\\
\;\;\;\;\left(\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\right)\\
\end{array}
\end{array}
if z < -1.14999999999999997e-100Initial program 84.0%
sub-neg84.0%
associate-+l-84.0%
sub-neg84.0%
sub-neg84.0%
distribute-rgt-out--85.2%
associate-*l*77.5%
distribute-lft-neg-in77.5%
cancel-sign-sub77.5%
associate-*l*77.5%
associate-*l*77.5%
Simplified77.5%
Taylor expanded in a around 0 77.6%
if -1.14999999999999997e-100 < z < 1e108Initial program 90.2%
Taylor expanded in x around 0 89.6%
if 1e108 < z Initial program 75.9%
Simplified76.0%
Taylor expanded in a around 0 82.6%
Final simplification84.3%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 27.0 (* j k))))
(t_2 (* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))))
(if (<= x -1e+36)
t_2
(if (<= x -2.35e-160)
t_1
(if (<= x 7.6e-255)
(- (* 27.0 (* k (- j))) (* 4.0 (* t a)))
(if (<= x 1.5e-18)
t_1
(if (<= x 2.7e+36)
(* 18.0 (* (* z t) (* x y)))
(if (<= x 3.2e+77) t_1 t_2))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (j * k));
double t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -1e+36) {
tmp = t_2;
} else if (x <= -2.35e-160) {
tmp = t_1;
} else if (x <= 7.6e-255) {
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
} else if (x <= 1.5e-18) {
tmp = t_1;
} else if (x <= 2.7e+36) {
tmp = 18.0 * ((z * t) * (x * y));
} else if (x <= 3.2e+77) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) - (27.0d0 * (j * k))
t_2 = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
if (x <= (-1d+36)) then
tmp = t_2
else if (x <= (-2.35d-160)) then
tmp = t_1
else if (x <= 7.6d-255) then
tmp = (27.0d0 * (k * -j)) - (4.0d0 * (t * a))
else if (x <= 1.5d-18) then
tmp = t_1
else if (x <= 2.7d+36) then
tmp = 18.0d0 * ((z * t) * (x * y))
else if (x <= 3.2d+77) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (j * k));
double t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
double tmp;
if (x <= -1e+36) {
tmp = t_2;
} else if (x <= -2.35e-160) {
tmp = t_1;
} else if (x <= 7.6e-255) {
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
} else if (x <= 1.5e-18) {
tmp = t_1;
} else if (x <= 2.7e+36) {
tmp = 18.0 * ((z * t) * (x * y));
} else if (x <= 3.2e+77) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (27.0 * (j * k)) t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i)) tmp = 0 if x <= -1e+36: tmp = t_2 elif x <= -2.35e-160: tmp = t_1 elif x <= 7.6e-255: tmp = (27.0 * (k * -j)) - (4.0 * (t * a)) elif x <= 1.5e-18: tmp = t_1 elif x <= 2.7e+36: tmp = 18.0 * ((z * t) * (x * y)) elif x <= 3.2e+77: tmp = t_1 else: tmp = t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) t_2 = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -1e+36) tmp = t_2; elseif (x <= -2.35e-160) tmp = t_1; elseif (x <= 7.6e-255) tmp = Float64(Float64(27.0 * Float64(k * Float64(-j))) - Float64(4.0 * Float64(t * a))); elseif (x <= 1.5e-18) tmp = t_1; elseif (x <= 2.7e+36) tmp = Float64(18.0 * Float64(Float64(z * t) * Float64(x * y))); elseif (x <= 3.2e+77) tmp = t_1; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (27.0 * (j * k));
t_2 = x * ((18.0 * (t * (y * z))) - (4.0 * i));
tmp = 0.0;
if (x <= -1e+36)
tmp = t_2;
elseif (x <= -2.35e-160)
tmp = t_1;
elseif (x <= 7.6e-255)
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
elseif (x <= 1.5e-18)
tmp = t_1;
elseif (x <= 2.7e+36)
tmp = 18.0 * ((z * t) * (x * y));
elseif (x <= 3.2e+77)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e+36], t$95$2, If[LessEqual[x, -2.35e-160], t$95$1, If[LessEqual[x, 7.6e-255], N[(N[(27.0 * N[(k * (-j)), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-18], t$95$1, If[LessEqual[x, 2.7e+36], N[(18.0 * N[(N[(z * t), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.2e+77], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -1 \cdot 10^{+36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.35 \cdot 10^{-160}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-255}:\\
\;\;\;\;27 \cdot \left(k \cdot \left(-j\right)\right) - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+36}:\\
\;\;\;\;18 \cdot \left(\left(z \cdot t\right) \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+77}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.00000000000000004e36 or 3.2000000000000002e77 < x Initial program 75.9%
sub-neg75.9%
associate-+l-75.9%
sub-neg75.9%
sub-neg75.9%
distribute-rgt-out--77.7%
associate-*l*83.1%
distribute-lft-neg-in83.1%
cancel-sign-sub83.1%
associate-*l*83.1%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in x around inf 72.9%
pow172.9%
Applied egg-rr72.9%
unpow172.9%
*-commutative72.9%
associate-*l*73.0%
Simplified73.0%
if -1.00000000000000004e36 < x < -2.3499999999999999e-160 or 7.6e-255 < x < 1.49999999999999991e-18 or 2.7000000000000001e36 < x < 3.2000000000000002e77Initial program 95.5%
sub-neg95.5%
associate-+l-95.5%
sub-neg95.5%
sub-neg95.5%
distribute-rgt-out--96.6%
associate-*l*89.3%
distribute-lft-neg-in89.3%
cancel-sign-sub89.3%
associate-*l*89.3%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in t around 0 74.8%
Taylor expanded in i around 0 64.7%
*-commutative64.7%
Simplified64.7%
if -2.3499999999999999e-160 < x < 7.6e-255Initial program 92.9%
Taylor expanded in x around 0 94.0%
Taylor expanded in x around 0 85.9%
Taylor expanded in c around 0 67.2%
if 1.49999999999999991e-18 < x < 2.7000000000000001e36Initial program 70.7%
Simplified70.6%
Taylor expanded in a around 0 69.9%
Taylor expanded in i around 0 69.9%
Taylor expanded in y around inf 57.8%
*-commutative57.8%
associate-*r*57.8%
associate-*l*57.8%
Simplified57.8%
Final simplification68.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* b c) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0))))))
(if (<= x -1.05e-34)
t_1
(if (<= x 1.5e-254)
(- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))
(if (<= x 1.05e+83)
(+ (* b c) (+ (* 18.0 (* y (* t (* x z)))) (* -27.0 (* j k))))
t_1)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
double tmp;
if (x <= -1.05e-34) {
tmp = t_1;
} else if (x <= 1.5e-254) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else if (x <= 1.05e+83) {
tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0))))
if (x <= (-1.05d-34)) then
tmp = t_1
else if (x <= 1.5d-254) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
else if (x <= 1.05d+83) then
tmp = (b * c) + ((18.0d0 * (y * (t * (x * z)))) + ((-27.0d0) * (j * k)))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
double tmp;
if (x <= -1.05e-34) {
tmp = t_1;
} else if (x <= 1.5e-254) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else if (x <= 1.05e+83) {
tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))) tmp = 0 if x <= -1.05e-34: tmp = t_1 elif x <= 1.5e-254: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) elif x <= 1.05e+83: tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k))) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0)))) tmp = 0.0 if (x <= -1.05e-34) tmp = t_1; elseif (x <= 1.5e-254) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(27.0 * Float64(j * k))); elseif (x <= 1.05e+83) tmp = Float64(Float64(b * c) + Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) + Float64(-27.0 * Float64(j * k)))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
tmp = 0.0;
if (x <= -1.05e-34)
tmp = t_1;
elseif (x <= 1.5e-254)
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
elseif (x <= 1.05e+83)
tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k)));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e-34], t$95$1, If[LessEqual[x, 1.5e-254], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e+83], N[(N[(b * c), $MachinePrecision] + N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{-34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-254}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+83}:\\
\;\;\;\;b \cdot c + \left(18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) + -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.05e-34 or 1.05000000000000001e83 < x Initial program 77.8%
Simplified91.2%
Taylor expanded in a around 0 86.8%
Taylor expanded in k around 0 80.8%
if -1.05e-34 < x < 1.50000000000000006e-254Initial program 94.0%
sub-neg94.0%
associate-+l-94.0%
sub-neg94.0%
sub-neg94.0%
distribute-rgt-out--95.5%
associate-*l*87.1%
distribute-lft-neg-in87.1%
cancel-sign-sub87.1%
associate-*l*87.1%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in x around 0 84.3%
if 1.50000000000000006e-254 < x < 1.05000000000000001e83Initial program 92.0%
Simplified84.3%
Taylor expanded in a around 0 76.4%
Taylor expanded in i around 0 80.3%
Final simplification81.6%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= z -1.2e-34)
(+ (* b c) (+ (* 18.0 (* y (* t (* x z)))) (* -27.0 (* j k))))
(if (<= z 5.8e+116)
(- (- (- (* b c) (* 4.0 (* t a))) (* (* x 4.0) i)) (* (* j 27.0) k))
(+ (* b c) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -1.2e-34) {
tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k)));
} else if (z <= 5.8e+116) {
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (z <= (-1.2d-34)) then
tmp = (b * c) + ((18.0d0 * (y * (t * (x * z)))) + ((-27.0d0) * (j * k)))
else if (z <= 5.8d+116) then
tmp = (((b * c) - (4.0d0 * (t * a))) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
else
tmp = (b * c) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0))))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -1.2e-34) {
tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k)));
} else if (z <= 5.8e+116) {
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
} else {
tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if z <= -1.2e-34: tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k))) elif z <= 5.8e+116: tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k) else: tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (z <= -1.2e-34) tmp = Float64(Float64(b * c) + Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) + Float64(-27.0 * Float64(j * k)))); elseif (z <= 5.8e+116) tmp = Float64(Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (z <= -1.2e-34)
tmp = (b * c) + ((18.0 * (y * (t * (x * z)))) + (-27.0 * (j * k)));
elseif (z <= 5.8e+116)
tmp = (((b * c) - (4.0 * (t * a))) - ((x * 4.0) * i)) - ((j * 27.0) * k);
else
tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[z, -1.2e-34], N[(N[(b * c), $MachinePrecision] + N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+116], N[(N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-34}:\\
\;\;\;\;b \cdot c + \left(18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) + -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{+116}:\\
\;\;\;\;\left(\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\\
\end{array}
\end{array}
if z < -1.19999999999999996e-34Initial program 85.7%
Simplified82.0%
Taylor expanded in a around 0 76.0%
Taylor expanded in i around 0 70.5%
if -1.19999999999999996e-34 < z < 5.8000000000000003e116Initial program 88.9%
Taylor expanded in x around 0 89.8%
if 5.8000000000000003e116 < z Initial program 75.4%
Simplified75.5%
Taylor expanded in a around 0 82.2%
Taylor expanded in k around 0 73.5%
Final simplification81.3%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 4.0 (+ (* x i) (* t a)))))
(t_2 (- (* b c) (* 27.0 (* j k)))))
(if (<= k -1.65e-94)
t_2
(if (<= k 2.5e-216)
t_1
(if (<= k 1.7e-58)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= k 1.9e+84)
t_1
(if (<= k 1.95e+110)
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))
(if (<= k 3.5e+214)
(- (* 27.0 (* k (- j))) (* 4.0 (* t a)))
t_2))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * ((x * i) + (t * a)));
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (k <= -1.65e-94) {
tmp = t_2;
} else if (k <= 2.5e-216) {
tmp = t_1;
} else if (k <= 1.7e-58) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (k <= 1.9e+84) {
tmp = t_1;
} else if (k <= 1.95e+110) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else if (k <= 3.5e+214) {
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) - (4.0d0 * ((x * i) + (t * a)))
t_2 = (b * c) - (27.0d0 * (j * k))
if (k <= (-1.65d-94)) then
tmp = t_2
else if (k <= 2.5d-216) then
tmp = t_1
else if (k <= 1.7d-58) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (k <= 1.9d+84) then
tmp = t_1
else if (k <= 1.95d+110) then
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
else if (k <= 3.5d+214) then
tmp = (27.0d0 * (k * -j)) - (4.0d0 * (t * a))
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * ((x * i) + (t * a)));
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (k <= -1.65e-94) {
tmp = t_2;
} else if (k <= 2.5e-216) {
tmp = t_1;
} else if (k <= 1.7e-58) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (k <= 1.9e+84) {
tmp = t_1;
} else if (k <= 1.95e+110) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else if (k <= 3.5e+214) {
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (4.0 * ((x * i) + (t * a))) t_2 = (b * c) - (27.0 * (j * k)) tmp = 0 if k <= -1.65e-94: tmp = t_2 elif k <= 2.5e-216: tmp = t_1 elif k <= 1.7e-58: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif k <= 1.9e+84: tmp = t_1 elif k <= 1.95e+110: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) elif k <= 3.5e+214: tmp = (27.0 * (k * -j)) - (4.0 * (t * a)) else: tmp = t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(x * i) + Float64(t * a)))) t_2 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (k <= -1.65e-94) tmp = t_2; elseif (k <= 2.5e-216) tmp = t_1; elseif (k <= 1.7e-58) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (k <= 1.9e+84) tmp = t_1; elseif (k <= 1.95e+110) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); elseif (k <= 3.5e+214) tmp = Float64(Float64(27.0 * Float64(k * Float64(-j))) - Float64(4.0 * Float64(t * a))); else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (4.0 * ((x * i) + (t * a)));
t_2 = (b * c) - (27.0 * (j * k));
tmp = 0.0;
if (k <= -1.65e-94)
tmp = t_2;
elseif (k <= 2.5e-216)
tmp = t_1;
elseif (k <= 1.7e-58)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (k <= 1.9e+84)
tmp = t_1;
elseif (k <= 1.95e+110)
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
elseif (k <= 3.5e+214)
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(x * i), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -1.65e-94], t$95$2, If[LessEqual[k, 2.5e-216], t$95$1, If[LessEqual[k, 1.7e-58], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.9e+84], t$95$1, If[LessEqual[k, 1.95e+110], N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 3.5e+214], N[(N[(27.0 * N[(k * (-j)), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(x \cdot i + t \cdot a\right)\\
t_2 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;k \leq -1.65 \cdot 10^{-94}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;k \leq 2.5 \cdot 10^{-216}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 1.7 \cdot 10^{-58}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;k \leq 1.9 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 1.95 \cdot 10^{+110}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;k \leq 3.5 \cdot 10^{+214}:\\
\;\;\;\;27 \cdot \left(k \cdot \left(-j\right)\right) - 4 \cdot \left(t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if k < -1.6500000000000001e-94 or 3.5e214 < k Initial program 86.6%
sub-neg86.6%
associate-+l-86.6%
sub-neg86.6%
sub-neg86.6%
distribute-rgt-out--87.6%
associate-*l*86.8%
distribute-lft-neg-in86.8%
cancel-sign-sub86.8%
associate-*l*86.8%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in t around 0 73.0%
Taylor expanded in i around 0 56.8%
*-commutative56.8%
Simplified56.8%
if -1.6500000000000001e-94 < k < 2.5000000000000001e-216 or 1.69999999999999987e-58 < k < 1.9e84Initial program 88.1%
Taylor expanded in x around 0 76.7%
Taylor expanded in j around 0 66.4%
distribute-lft-out66.4%
*-commutative66.4%
Simplified66.4%
if 2.5000000000000001e-216 < k < 1.69999999999999987e-58Initial program 78.5%
sub-neg78.5%
associate-+l-78.5%
sub-neg78.5%
sub-neg78.5%
distribute-rgt-out--78.5%
associate-*l*73.3%
distribute-lft-neg-in73.3%
cancel-sign-sub73.3%
associate-*l*73.3%
associate-*l*73.3%
Simplified73.3%
Taylor expanded in x around inf 59.9%
pow159.9%
Applied egg-rr59.9%
unpow159.9%
*-commutative59.9%
associate-*l*62.8%
Simplified62.8%
if 1.9e84 < k < 1.9500000000000002e110Initial program 88.4%
sub-neg88.4%
associate-+l-88.4%
sub-neg88.4%
sub-neg88.4%
distribute-rgt-out--88.4%
associate-*l*88.4%
distribute-lft-neg-in88.4%
cancel-sign-sub88.4%
associate-*l*88.4%
associate-*l*88.4%
Simplified88.4%
Taylor expanded in x around inf 72.1%
if 1.9500000000000002e110 < k < 3.5e214Initial program 81.8%
Taylor expanded in x around 0 90.9%
Taylor expanded in x around 0 91.3%
Taylor expanded in c around 0 86.7%
Final simplification63.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* y (* t (* x z))))))
(if (<= b -4e+175)
(* b c)
(if (<= b -1.38e+122)
(* -4.0 (* t a))
(if (<= b -1.12e-111)
t_1
(if (<= b -1.25e-202)
(* (* j 27.0) (- k))
(if (<= b -1.3e-272)
(* x (* i -4.0))
(if (<= b 9e-233)
(* j (* k -27.0))
(if (<= b 4.9e-164)
t_1
(if (<= b 3.8e+20) (* -27.0 (* j k)) (* b c)))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (y * (t * (x * z)));
double tmp;
if (b <= -4e+175) {
tmp = b * c;
} else if (b <= -1.38e+122) {
tmp = -4.0 * (t * a);
} else if (b <= -1.12e-111) {
tmp = t_1;
} else if (b <= -1.25e-202) {
tmp = (j * 27.0) * -k;
} else if (b <= -1.3e-272) {
tmp = x * (i * -4.0);
} else if (b <= 9e-233) {
tmp = j * (k * -27.0);
} else if (b <= 4.9e-164) {
tmp = t_1;
} else if (b <= 3.8e+20) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = 18.0d0 * (y * (t * (x * z)))
if (b <= (-4d+175)) then
tmp = b * c
else if (b <= (-1.38d+122)) then
tmp = (-4.0d0) * (t * a)
else if (b <= (-1.12d-111)) then
tmp = t_1
else if (b <= (-1.25d-202)) then
tmp = (j * 27.0d0) * -k
else if (b <= (-1.3d-272)) then
tmp = x * (i * (-4.0d0))
else if (b <= 9d-233) then
tmp = j * (k * (-27.0d0))
else if (b <= 4.9d-164) then
tmp = t_1
else if (b <= 3.8d+20) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (y * (t * (x * z)));
double tmp;
if (b <= -4e+175) {
tmp = b * c;
} else if (b <= -1.38e+122) {
tmp = -4.0 * (t * a);
} else if (b <= -1.12e-111) {
tmp = t_1;
} else if (b <= -1.25e-202) {
tmp = (j * 27.0) * -k;
} else if (b <= -1.3e-272) {
tmp = x * (i * -4.0);
} else if (b <= 9e-233) {
tmp = j * (k * -27.0);
} else if (b <= 4.9e-164) {
tmp = t_1;
} else if (b <= 3.8e+20) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * (y * (t * (x * z))) tmp = 0 if b <= -4e+175: tmp = b * c elif b <= -1.38e+122: tmp = -4.0 * (t * a) elif b <= -1.12e-111: tmp = t_1 elif b <= -1.25e-202: tmp = (j * 27.0) * -k elif b <= -1.3e-272: tmp = x * (i * -4.0) elif b <= 9e-233: tmp = j * (k * -27.0) elif b <= 4.9e-164: tmp = t_1 elif b <= 3.8e+20: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) tmp = 0.0 if (b <= -4e+175) tmp = Float64(b * c); elseif (b <= -1.38e+122) tmp = Float64(-4.0 * Float64(t * a)); elseif (b <= -1.12e-111) tmp = t_1; elseif (b <= -1.25e-202) tmp = Float64(Float64(j * 27.0) * Float64(-k)); elseif (b <= -1.3e-272) tmp = Float64(x * Float64(i * -4.0)); elseif (b <= 9e-233) tmp = Float64(j * Float64(k * -27.0)); elseif (b <= 4.9e-164) tmp = t_1; elseif (b <= 3.8e+20) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * (y * (t * (x * z)));
tmp = 0.0;
if (b <= -4e+175)
tmp = b * c;
elseif (b <= -1.38e+122)
tmp = -4.0 * (t * a);
elseif (b <= -1.12e-111)
tmp = t_1;
elseif (b <= -1.25e-202)
tmp = (j * 27.0) * -k;
elseif (b <= -1.3e-272)
tmp = x * (i * -4.0);
elseif (b <= 9e-233)
tmp = j * (k * -27.0);
elseif (b <= 4.9e-164)
tmp = t_1;
elseif (b <= 3.8e+20)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4e+175], N[(b * c), $MachinePrecision], If[LessEqual[b, -1.38e+122], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.12e-111], t$95$1, If[LessEqual[b, -1.25e-202], N[(N[(j * 27.0), $MachinePrecision] * (-k)), $MachinePrecision], If[LessEqual[b, -1.3e-272], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9e-233], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.9e-164], t$95$1, If[LessEqual[b, 3.8e+20], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{if}\;b \leq -4 \cdot 10^{+175}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -1.38 \cdot 10^{+122}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \leq -1.12 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.25 \cdot 10^{-202}:\\
\;\;\;\;\left(j \cdot 27\right) \cdot \left(-k\right)\\
\mathbf{elif}\;b \leq -1.3 \cdot 10^{-272}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;b \leq 9 \cdot 10^{-233}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;b \leq 4.9 \cdot 10^{-164}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+20}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -3.9999999999999997e175 or 3.8e20 < b Initial program 84.1%
Simplified87.5%
Taylor expanded in a around 0 78.4%
Taylor expanded in c around inf 48.9%
if -3.9999999999999997e175 < b < -1.37999999999999992e122Initial program 64.2%
Taylor expanded in x around 0 82.3%
Taylor expanded in a around inf 37.2%
*-commutative37.2%
Simplified37.2%
if -1.37999999999999992e122 < b < -1.12000000000000009e-111 or 9.0000000000000004e-233 < b < 4.8999999999999996e-164Initial program 86.7%
Simplified83.7%
Taylor expanded in a around 0 82.7%
Taylor expanded in i around 0 74.4%
Taylor expanded in y around inf 39.9%
if -1.12000000000000009e-111 < b < -1.24999999999999993e-202Initial program 75.0%
Taylor expanded in x around 0 93.8%
Taylor expanded in x around 0 75.5%
Taylor expanded in c around 0 75.4%
Taylor expanded in a around 0 51.1%
*-commutative51.1%
*-commutative51.1%
*-commutative51.1%
associate-*r*51.2%
Simplified51.2%
if -1.24999999999999993e-202 < b < -1.29999999999999996e-272Initial program 92.6%
sub-neg92.6%
associate-+l-92.6%
sub-neg92.6%
sub-neg92.6%
distribute-rgt-out--92.6%
associate-*l*86.0%
distribute-lft-neg-in86.0%
cancel-sign-sub86.0%
associate-*l*86.0%
associate-*l*86.1%
Simplified86.1%
Taylor expanded in x around inf 51.7%
Taylor expanded in y around 0 37.4%
if -1.29999999999999996e-272 < b < 9.0000000000000004e-233Initial program 91.2%
sub-neg91.2%
+-commutative91.2%
associate-*l*91.3%
distribute-rgt-neg-in91.3%
fma-def91.3%
*-commutative91.3%
distribute-rgt-neg-in91.3%
metadata-eval91.3%
sub-neg91.3%
+-commutative91.3%
associate-*l*91.3%
distribute-rgt-neg-in91.3%
Simplified86.9%
Taylor expanded in j around inf 32.2%
associate-*r*32.2%
*-commutative32.2%
*-commutative32.2%
*-commutative32.2%
Simplified32.2%
if 4.8999999999999996e-164 < b < 3.8e20Initial program 92.1%
sub-neg92.1%
+-commutative92.1%
associate-*l*92.1%
distribute-rgt-neg-in92.1%
fma-def92.1%
*-commutative92.1%
distribute-rgt-neg-in92.1%
metadata-eval92.1%
sub-neg92.1%
+-commutative92.1%
associate-*l*92.1%
distribute-rgt-neg-in92.1%
Simplified89.7%
Taylor expanded in j around inf 25.9%
Final simplification40.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 27.0 (* j k))))
(if (<= x -1.45e+61)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= x -4.55e-156)
(- (* b c) (+ (* 4.0 (* x i)) t_1))
(if (<= x -6.2e-176)
(- (* 4.0 (- (* t (- a)) (* x i))) (* (* j 27.0) k))
(if (<= x 4.5e+82)
(- (+ (* b c) (* -4.0 (* t a))) t_1)
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double tmp;
if (x <= -1.45e+61) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= -4.55e-156) {
tmp = (b * c) - ((4.0 * (x * i)) + t_1);
} else if (x <= -6.2e-176) {
tmp = (4.0 * ((t * -a) - (x * i))) - ((j * 27.0) * k);
} else if (x <= 4.5e+82) {
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
if (x <= (-1.45d+61)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (x <= (-4.55d-156)) then
tmp = (b * c) - ((4.0d0 * (x * i)) + t_1)
else if (x <= (-6.2d-176)) then
tmp = (4.0d0 * ((t * -a) - (x * i))) - ((j * 27.0d0) * k)
else if (x <= 4.5d+82) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - t_1
else
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double tmp;
if (x <= -1.45e+61) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= -4.55e-156) {
tmp = (b * c) - ((4.0 * (x * i)) + t_1);
} else if (x <= -6.2e-176) {
tmp = (4.0 * ((t * -a) - (x * i))) - ((j * 27.0) * k);
} else if (x <= 4.5e+82) {
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) tmp = 0 if x <= -1.45e+61: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif x <= -4.55e-156: tmp = (b * c) - ((4.0 * (x * i)) + t_1) elif x <= -6.2e-176: tmp = (4.0 * ((t * -a) - (x * i))) - ((j * 27.0) * k) elif x <= 4.5e+82: tmp = ((b * c) + (-4.0 * (t * a))) - t_1 else: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) tmp = 0.0 if (x <= -1.45e+61) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (x <= -4.55e-156) tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + t_1)); elseif (x <= -6.2e-176) tmp = Float64(Float64(4.0 * Float64(Float64(t * Float64(-a)) - Float64(x * i))) - Float64(Float64(j * 27.0) * k)); elseif (x <= 4.5e+82) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - t_1); else tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
tmp = 0.0;
if (x <= -1.45e+61)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (x <= -4.55e-156)
tmp = (b * c) - ((4.0 * (x * i)) + t_1);
elseif (x <= -6.2e-176)
tmp = (4.0 * ((t * -a) - (x * i))) - ((j * 27.0) * k);
elseif (x <= 4.5e+82)
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
else
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+61], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.55e-156], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.2e-176], N[(N[(4.0 * N[(N[(t * (-a)), $MachinePrecision] - N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e+82], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+61}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;x \leq -4.55 \cdot 10^{-156}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + t_1\right)\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-176}:\\
\;\;\;\;4 \cdot \left(t \cdot \left(-a\right) - x \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+82}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if x < -1.45e61Initial program 79.8%
sub-neg79.8%
associate-+l-79.8%
sub-neg79.8%
sub-neg79.8%
distribute-rgt-out--81.6%
associate-*l*83.5%
distribute-lft-neg-in83.5%
cancel-sign-sub83.5%
associate-*l*83.5%
associate-*l*83.4%
Simplified83.4%
Taylor expanded in x around inf 81.3%
pow181.3%
Applied egg-rr81.3%
unpow181.3%
*-commutative81.3%
associate-*l*83.0%
Simplified83.0%
if -1.45e61 < x < -4.55000000000000014e-156Initial program 91.7%
sub-neg91.7%
associate-+l-91.7%
sub-neg91.7%
sub-neg91.7%
distribute-rgt-out--93.7%
associate-*l*89.8%
distribute-lft-neg-in89.8%
cancel-sign-sub89.8%
associate-*l*89.8%
associate-*l*89.8%
Simplified89.8%
Taylor expanded in t around 0 74.1%
if -4.55000000000000014e-156 < x < -6.19999999999999983e-176Initial program 87.5%
Taylor expanded in x around 0 87.5%
Taylor expanded in c around 0 89.0%
mul-1-neg89.0%
distribute-lft-out89.0%
*-commutative89.0%
Simplified89.0%
if -6.19999999999999983e-176 < x < 4.4999999999999997e82Initial program 92.8%
sub-neg92.8%
associate-+l-92.8%
sub-neg92.8%
sub-neg92.8%
distribute-rgt-out--94.8%
associate-*l*85.9%
distribute-lft-neg-in85.9%
cancel-sign-sub85.9%
associate-*l*85.9%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in x around 0 79.2%
if 4.4999999999999997e82 < x Initial program 71.6%
sub-neg71.6%
associate-+l-71.6%
sub-neg71.6%
sub-neg71.6%
distribute-rgt-out--73.7%
associate-*l*83.8%
distribute-lft-neg-in83.8%
cancel-sign-sub83.8%
associate-*l*83.8%
associate-*l*83.8%
Simplified83.8%
Taylor expanded in x around inf 67.3%
Final simplification77.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= b -3.2e+175)
(* b c)
(if (<= b -1.6e+121)
(* -4.0 (* t a))
(if (<= b -1.5e-115)
(* 18.0 (* y (* t (* x z))))
(if (<= b -1.4e-202)
(* (* j 27.0) (- k))
(if (<= b -6.6e-273)
(* x (* i -4.0))
(if (<= b 7.2e-162)
(* 18.0 (* (* z t) (* x y)))
(if (<= b 8.8e+18) (* -27.0 (* j k)) (* b c)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -3.2e+175) {
tmp = b * c;
} else if (b <= -1.6e+121) {
tmp = -4.0 * (t * a);
} else if (b <= -1.5e-115) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (b <= -1.4e-202) {
tmp = (j * 27.0) * -k;
} else if (b <= -6.6e-273) {
tmp = x * (i * -4.0);
} else if (b <= 7.2e-162) {
tmp = 18.0 * ((z * t) * (x * y));
} else if (b <= 8.8e+18) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (b <= (-3.2d+175)) then
tmp = b * c
else if (b <= (-1.6d+121)) then
tmp = (-4.0d0) * (t * a)
else if (b <= (-1.5d-115)) then
tmp = 18.0d0 * (y * (t * (x * z)))
else if (b <= (-1.4d-202)) then
tmp = (j * 27.0d0) * -k
else if (b <= (-6.6d-273)) then
tmp = x * (i * (-4.0d0))
else if (b <= 7.2d-162) then
tmp = 18.0d0 * ((z * t) * (x * y))
else if (b <= 8.8d+18) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -3.2e+175) {
tmp = b * c;
} else if (b <= -1.6e+121) {
tmp = -4.0 * (t * a);
} else if (b <= -1.5e-115) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (b <= -1.4e-202) {
tmp = (j * 27.0) * -k;
} else if (b <= -6.6e-273) {
tmp = x * (i * -4.0);
} else if (b <= 7.2e-162) {
tmp = 18.0 * ((z * t) * (x * y));
} else if (b <= 8.8e+18) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if b <= -3.2e+175: tmp = b * c elif b <= -1.6e+121: tmp = -4.0 * (t * a) elif b <= -1.5e-115: tmp = 18.0 * (y * (t * (x * z))) elif b <= -1.4e-202: tmp = (j * 27.0) * -k elif b <= -6.6e-273: tmp = x * (i * -4.0) elif b <= 7.2e-162: tmp = 18.0 * ((z * t) * (x * y)) elif b <= 8.8e+18: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (b <= -3.2e+175) tmp = Float64(b * c); elseif (b <= -1.6e+121) tmp = Float64(-4.0 * Float64(t * a)); elseif (b <= -1.5e-115) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))); elseif (b <= -1.4e-202) tmp = Float64(Float64(j * 27.0) * Float64(-k)); elseif (b <= -6.6e-273) tmp = Float64(x * Float64(i * -4.0)); elseif (b <= 7.2e-162) tmp = Float64(18.0 * Float64(Float64(z * t) * Float64(x * y))); elseif (b <= 8.8e+18) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (b <= -3.2e+175)
tmp = b * c;
elseif (b <= -1.6e+121)
tmp = -4.0 * (t * a);
elseif (b <= -1.5e-115)
tmp = 18.0 * (y * (t * (x * z)));
elseif (b <= -1.4e-202)
tmp = (j * 27.0) * -k;
elseif (b <= -6.6e-273)
tmp = x * (i * -4.0);
elseif (b <= 7.2e-162)
tmp = 18.0 * ((z * t) * (x * y));
elseif (b <= 8.8e+18)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[b, -3.2e+175], N[(b * c), $MachinePrecision], If[LessEqual[b, -1.6e+121], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.5e-115], N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.4e-202], N[(N[(j * 27.0), $MachinePrecision] * (-k)), $MachinePrecision], If[LessEqual[b, -6.6e-273], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.2e-162], N[(18.0 * N[(N[(z * t), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.8e+18], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.2 \cdot 10^{+175}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -1.6 \cdot 10^{+121}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \leq -1.5 \cdot 10^{-115}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;b \leq -1.4 \cdot 10^{-202}:\\
\;\;\;\;\left(j \cdot 27\right) \cdot \left(-k\right)\\
\mathbf{elif}\;b \leq -6.6 \cdot 10^{-273}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;b \leq 7.2 \cdot 10^{-162}:\\
\;\;\;\;18 \cdot \left(\left(z \cdot t\right) \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 8.8 \cdot 10^{+18}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -3.20000000000000022e175 or 8.8e18 < b Initial program 84.3%
Simplified87.7%
Taylor expanded in a around 0 77.5%
Taylor expanded in c around inf 48.3%
if -3.20000000000000022e175 < b < -1.6e121Initial program 64.2%
Taylor expanded in x around 0 82.3%
Taylor expanded in a around inf 37.2%
*-commutative37.2%
Simplified37.2%
if -1.6e121 < b < -1.5000000000000001e-115Initial program 84.2%
Simplified79.7%
Taylor expanded in a around 0 80.2%
Taylor expanded in i around 0 75.8%
Taylor expanded in y around inf 33.6%
if -1.5000000000000001e-115 < b < -1.4000000000000001e-202Initial program 75.0%
Taylor expanded in x around 0 93.8%
Taylor expanded in x around 0 75.5%
Taylor expanded in c around 0 75.4%
Taylor expanded in a around 0 51.1%
*-commutative51.1%
*-commutative51.1%
*-commutative51.1%
associate-*r*51.2%
Simplified51.2%
if -1.4000000000000001e-202 < b < -6.5999999999999998e-273Initial program 93.0%
sub-neg93.0%
associate-+l-93.0%
sub-neg93.0%
sub-neg93.0%
distribute-rgt-out--93.0%
associate-*l*86.8%
distribute-lft-neg-in86.8%
cancel-sign-sub86.8%
associate-*l*86.8%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in x around inf 48.6%
Taylor expanded in y around 0 35.0%
if -6.5999999999999998e-273 < b < 7.1999999999999996e-162Initial program 91.2%
Simplified93.3%
Taylor expanded in a around 0 84.7%
Taylor expanded in i around 0 68.5%
Taylor expanded in y around inf 40.1%
*-commutative40.1%
associate-*r*38.1%
associate-*l*36.6%
Simplified36.6%
if 7.1999999999999996e-162 < b < 8.8e18Initial program 91.8%
sub-neg91.8%
+-commutative91.8%
associate-*l*91.8%
distribute-rgt-neg-in91.8%
fma-def91.8%
*-commutative91.8%
distribute-rgt-neg-in91.8%
metadata-eval91.8%
sub-neg91.8%
+-commutative91.8%
associate-*l*91.8%
distribute-rgt-neg-in91.8%
Simplified89.4%
Taylor expanded in j around inf 26.6%
Final simplification39.6%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* j k))) (t_2 (- (* b c) (* 4.0 (* t a)))))
(if (<= y -5.3e+206)
(* 18.0 (* (* z t) (* x y)))
(if (<= y -2.35e+176)
t_2
(if (<= y -5.8e+135)
t_1
(if (<= y -5.2e-65)
t_2
(if (<= y -2.55e-135)
t_1
(if (<= y 1.45e-145) t_2 (* 18.0 (* y (* t (* x z))))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (b * c) - (4.0 * (t * a));
double tmp;
if (y <= -5.3e+206) {
tmp = 18.0 * ((z * t) * (x * y));
} else if (y <= -2.35e+176) {
tmp = t_2;
} else if (y <= -5.8e+135) {
tmp = t_1;
} else if (y <= -5.2e-65) {
tmp = t_2;
} else if (y <= -2.55e-135) {
tmp = t_1;
} else if (y <= 1.45e-145) {
tmp = t_2;
} else {
tmp = 18.0 * (y * (t * (x * z)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = (b * c) - (4.0d0 * (t * a))
if (y <= (-5.3d+206)) then
tmp = 18.0d0 * ((z * t) * (x * y))
else if (y <= (-2.35d+176)) then
tmp = t_2
else if (y <= (-5.8d+135)) then
tmp = t_1
else if (y <= (-5.2d-65)) then
tmp = t_2
else if (y <= (-2.55d-135)) then
tmp = t_1
else if (y <= 1.45d-145) then
tmp = t_2
else
tmp = 18.0d0 * (y * (t * (x * z)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (b * c) - (4.0 * (t * a));
double tmp;
if (y <= -5.3e+206) {
tmp = 18.0 * ((z * t) * (x * y));
} else if (y <= -2.35e+176) {
tmp = t_2;
} else if (y <= -5.8e+135) {
tmp = t_1;
} else if (y <= -5.2e-65) {
tmp = t_2;
} else if (y <= -2.55e-135) {
tmp = t_1;
} else if (y <= 1.45e-145) {
tmp = t_2;
} else {
tmp = 18.0 * (y * (t * (x * z)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = (b * c) - (4.0 * (t * a)) tmp = 0 if y <= -5.3e+206: tmp = 18.0 * ((z * t) * (x * y)) elif y <= -2.35e+176: tmp = t_2 elif y <= -5.8e+135: tmp = t_1 elif y <= -5.2e-65: tmp = t_2 elif y <= -2.55e-135: tmp = t_1 elif y <= 1.45e-145: tmp = t_2 else: tmp = 18.0 * (y * (t * (x * z))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) tmp = 0.0 if (y <= -5.3e+206) tmp = Float64(18.0 * Float64(Float64(z * t) * Float64(x * y))); elseif (y <= -2.35e+176) tmp = t_2; elseif (y <= -5.8e+135) tmp = t_1; elseif (y <= -5.2e-65) tmp = t_2; elseif (y <= -2.55e-135) tmp = t_1; elseif (y <= 1.45e-145) tmp = t_2; else tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
t_2 = (b * c) - (4.0 * (t * a));
tmp = 0.0;
if (y <= -5.3e+206)
tmp = 18.0 * ((z * t) * (x * y));
elseif (y <= -2.35e+176)
tmp = t_2;
elseif (y <= -5.8e+135)
tmp = t_1;
elseif (y <= -5.2e-65)
tmp = t_2;
elseif (y <= -2.55e-135)
tmp = t_1;
elseif (y <= 1.45e-145)
tmp = t_2;
else
tmp = 18.0 * (y * (t * (x * z)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.3e+206], N[(18.0 * N[(N[(z * t), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.35e+176], t$95$2, If[LessEqual[y, -5.8e+135], t$95$1, If[LessEqual[y, -5.2e-65], t$95$2, If[LessEqual[y, -2.55e-135], t$95$1, If[LessEqual[y, 1.45e-145], t$95$2, N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;y \leq -5.3 \cdot 10^{+206}:\\
\;\;\;\;18 \cdot \left(\left(z \cdot t\right) \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;y \leq -2.35 \cdot 10^{+176}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{+135}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.55 \cdot 10^{-135}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-145}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if y < -5.29999999999999992e206Initial program 80.1%
Simplified65.2%
Taylor expanded in a around 0 73.2%
Taylor expanded in i around 0 88.3%
Taylor expanded in y around inf 63.6%
*-commutative63.6%
associate-*r*63.7%
associate-*l*63.6%
Simplified63.6%
if -5.29999999999999992e206 < y < -2.34999999999999991e176 or -5.7999999999999997e135 < y < -5.20000000000000019e-65 or -2.5500000000000001e-135 < y < 1.44999999999999992e-145Initial program 90.1%
Taylor expanded in x around 0 86.6%
Taylor expanded in x around 0 69.5%
Taylor expanded in j around 0 47.9%
if -2.34999999999999991e176 < y < -5.7999999999999997e135 or -5.20000000000000019e-65 < y < -2.5500000000000001e-135Initial program 89.1%
sub-neg89.1%
+-commutative89.1%
associate-*l*89.2%
distribute-rgt-neg-in89.2%
fma-def89.2%
*-commutative89.2%
distribute-rgt-neg-in89.2%
metadata-eval89.2%
sub-neg89.2%
+-commutative89.2%
associate-*l*89.2%
distribute-rgt-neg-in89.2%
Simplified85.6%
Taylor expanded in j around inf 54.6%
if 1.44999999999999992e-145 < y Initial program 80.6%
Simplified86.1%
Taylor expanded in a around 0 80.4%
Taylor expanded in i around 0 63.0%
Taylor expanded in y around inf 39.0%
Final simplification47.0%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* -27.0 (* j k)) (* -4.0 (* x i)))))
(if (<= b -7.7e+177)
(- (* b c) (* (* x 4.0) i))
(if (<= b -1.06e+126)
(- (* 27.0 (* k (- j))) (* 4.0 (* t a)))
(if (<= b 2e-220)
t_1
(if (<= b 4.2e-164)
(* 18.0 (* (* z t) (* x y)))
(if (<= b 3.2e+15) t_1 (- (* b c) (* 27.0 (* j k))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (-27.0 * (j * k)) + (-4.0 * (x * i));
double tmp;
if (b <= -7.7e+177) {
tmp = (b * c) - ((x * 4.0) * i);
} else if (b <= -1.06e+126) {
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
} else if (b <= 2e-220) {
tmp = t_1;
} else if (b <= 4.2e-164) {
tmp = 18.0 * ((z * t) * (x * y));
} else if (b <= 3.2e+15) {
tmp = t_1;
} else {
tmp = (b * c) - (27.0 * (j * k));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = ((-27.0d0) * (j * k)) + ((-4.0d0) * (x * i))
if (b <= (-7.7d+177)) then
tmp = (b * c) - ((x * 4.0d0) * i)
else if (b <= (-1.06d+126)) then
tmp = (27.0d0 * (k * -j)) - (4.0d0 * (t * a))
else if (b <= 2d-220) then
tmp = t_1
else if (b <= 4.2d-164) then
tmp = 18.0d0 * ((z * t) * (x * y))
else if (b <= 3.2d+15) then
tmp = t_1
else
tmp = (b * c) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (-27.0 * (j * k)) + (-4.0 * (x * i));
double tmp;
if (b <= -7.7e+177) {
tmp = (b * c) - ((x * 4.0) * i);
} else if (b <= -1.06e+126) {
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
} else if (b <= 2e-220) {
tmp = t_1;
} else if (b <= 4.2e-164) {
tmp = 18.0 * ((z * t) * (x * y));
} else if (b <= 3.2e+15) {
tmp = t_1;
} else {
tmp = (b * c) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (-27.0 * (j * k)) + (-4.0 * (x * i)) tmp = 0 if b <= -7.7e+177: tmp = (b * c) - ((x * 4.0) * i) elif b <= -1.06e+126: tmp = (27.0 * (k * -j)) - (4.0 * (t * a)) elif b <= 2e-220: tmp = t_1 elif b <= 4.2e-164: tmp = 18.0 * ((z * t) * (x * y)) elif b <= 3.2e+15: tmp = t_1 else: tmp = (b * c) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(-27.0 * Float64(j * k)) + Float64(-4.0 * Float64(x * i))) tmp = 0.0 if (b <= -7.7e+177) tmp = Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)); elseif (b <= -1.06e+126) tmp = Float64(Float64(27.0 * Float64(k * Float64(-j))) - Float64(4.0 * Float64(t * a))); elseif (b <= 2e-220) tmp = t_1; elseif (b <= 4.2e-164) tmp = Float64(18.0 * Float64(Float64(z * t) * Float64(x * y))); elseif (b <= 3.2e+15) tmp = t_1; else tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (-27.0 * (j * k)) + (-4.0 * (x * i));
tmp = 0.0;
if (b <= -7.7e+177)
tmp = (b * c) - ((x * 4.0) * i);
elseif (b <= -1.06e+126)
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
elseif (b <= 2e-220)
tmp = t_1;
elseif (b <= 4.2e-164)
tmp = 18.0 * ((z * t) * (x * y));
elseif (b <= 3.2e+15)
tmp = t_1;
else
tmp = (b * c) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -7.7e+177], N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.06e+126], N[(N[(27.0 * N[(k * (-j)), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-220], t$95$1, If[LessEqual[b, 4.2e-164], N[(18.0 * N[(N[(z * t), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.2e+15], t$95$1, N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right) + -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;b \leq -7.7 \cdot 10^{+177}:\\
\;\;\;\;b \cdot c - \left(x \cdot 4\right) \cdot i\\
\mathbf{elif}\;b \leq -1.06 \cdot 10^{+126}:\\
\;\;\;\;27 \cdot \left(k \cdot \left(-j\right)\right) - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-220}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 4.2 \cdot 10^{-164}:\\
\;\;\;\;18 \cdot \left(\left(z \cdot t\right) \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if b < -7.6999999999999997e177Initial program 82.1%
sub-neg82.1%
associate-+l-82.1%
sub-neg82.1%
sub-neg82.1%
distribute-rgt-out--82.1%
associate-*l*82.1%
distribute-lft-neg-in82.1%
cancel-sign-sub82.1%
associate-*l*82.1%
associate-*l*82.1%
Simplified82.1%
Taylor expanded in t around 0 65.2%
Taylor expanded in i around inf 61.4%
*-commutative61.4%
associate-*r*61.4%
Simplified61.4%
if -7.6999999999999997e177 < b < -1.0600000000000001e126Initial program 70.7%
Taylor expanded in x around 0 80.5%
Taylor expanded in x around 0 70.7%
Taylor expanded in c around 0 60.8%
if -1.0600000000000001e126 < b < 1.99999999999999998e-220 or 4.1999999999999998e-164 < b < 3.2e15Initial program 86.9%
sub-neg86.9%
+-commutative86.9%
associate-*l*86.9%
distribute-rgt-neg-in86.9%
fma-def86.9%
*-commutative86.9%
distribute-rgt-neg-in86.9%
metadata-eval86.9%
sub-neg86.9%
+-commutative86.9%
associate-*l*86.9%
distribute-rgt-neg-in86.9%
Simplified86.5%
Taylor expanded in t around 0 61.6%
Taylor expanded in c around 0 52.5%
if 1.99999999999999998e-220 < b < 4.1999999999999998e-164Initial program 90.2%
Simplified94.8%
Taylor expanded in a around 0 95.1%
Taylor expanded in i around 0 81.9%
Taylor expanded in y around inf 58.8%
*-commutative58.8%
associate-*r*54.1%
associate-*l*51.6%
Simplified51.6%
if 3.2e15 < b Initial program 85.2%
sub-neg85.2%
associate-+l-85.2%
sub-neg85.2%
sub-neg85.2%
distribute-rgt-out--86.9%
associate-*l*87.0%
distribute-lft-neg-in87.0%
cancel-sign-sub87.0%
associate-*l*87.0%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in t around 0 70.5%
Taylor expanded in i around 0 60.6%
*-commutative60.6%
Simplified60.6%
Final simplification55.6%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 27.0 (* j k))))
(t_2 (* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))))
(if (<= x -2.9e+34)
t_2
(if (<= x -1.4e-160)
t_1
(if (<= x 2.7e-255)
(- (* 27.0 (* k (- j))) (* 4.0 (* t a)))
(if (<= x 4.8e-25) t_1 t_2))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (j * k));
double t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -2.9e+34) {
tmp = t_2;
} else if (x <= -1.4e-160) {
tmp = t_1;
} else if (x <= 2.7e-255) {
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
} else if (x <= 4.8e-25) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) - (27.0d0 * (j * k))
t_2 = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
if (x <= (-2.9d+34)) then
tmp = t_2
else if (x <= (-1.4d-160)) then
tmp = t_1
else if (x <= 2.7d-255) then
tmp = (27.0d0 * (k * -j)) - (4.0d0 * (t * a))
else if (x <= 4.8d-25) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (27.0 * (j * k));
double t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
double tmp;
if (x <= -2.9e+34) {
tmp = t_2;
} else if (x <= -1.4e-160) {
tmp = t_1;
} else if (x <= 2.7e-255) {
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
} else if (x <= 4.8e-25) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (27.0 * (j * k)) t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i)) tmp = 0 if x <= -2.9e+34: tmp = t_2 elif x <= -1.4e-160: tmp = t_1 elif x <= 2.7e-255: tmp = (27.0 * (k * -j)) - (4.0 * (t * a)) elif x <= 4.8e-25: tmp = t_1 else: tmp = t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) t_2 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))) tmp = 0.0 if (x <= -2.9e+34) tmp = t_2; elseif (x <= -1.4e-160) tmp = t_1; elseif (x <= 2.7e-255) tmp = Float64(Float64(27.0 * Float64(k * Float64(-j))) - Float64(4.0 * Float64(t * a))); elseif (x <= 4.8e-25) tmp = t_1; else tmp = t_2; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (27.0 * (j * k));
t_2 = x * ((18.0 * (y * (z * t))) - (4.0 * i));
tmp = 0.0;
if (x <= -2.9e+34)
tmp = t_2;
elseif (x <= -1.4e-160)
tmp = t_1;
elseif (x <= 2.7e-255)
tmp = (27.0 * (k * -j)) - (4.0 * (t * a));
elseif (x <= 4.8e-25)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9e+34], t$95$2, If[LessEqual[x, -1.4e-160], t$95$1, If[LessEqual[x, 2.7e-255], N[(N[(27.0 * N[(k * (-j)), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.8e-25], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+34}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-160}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-255}:\\
\;\;\;\;27 \cdot \left(k \cdot \left(-j\right)\right) - 4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-25}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -2.9000000000000001e34 or 4.80000000000000018e-25 < x Initial program 76.5%
sub-neg76.5%
associate-+l-76.5%
sub-neg76.5%
sub-neg76.5%
distribute-rgt-out--78.8%
associate-*l*83.5%
distribute-lft-neg-in83.5%
cancel-sign-sub83.5%
associate-*l*83.5%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in x around inf 69.7%
if -2.9000000000000001e34 < x < -1.40000000000000008e-160 or 2.70000000000000016e-255 < x < 4.80000000000000018e-25Initial program 95.3%
sub-neg95.3%
associate-+l-95.3%
sub-neg95.3%
sub-neg95.3%
distribute-rgt-out--96.4%
associate-*l*88.7%
distribute-lft-neg-in88.7%
cancel-sign-sub88.7%
associate-*l*88.7%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in t around 0 73.4%
Taylor expanded in i around 0 62.7%
*-commutative62.7%
Simplified62.7%
if -1.40000000000000008e-160 < x < 2.70000000000000016e-255Initial program 92.9%
Taylor expanded in x around 0 94.0%
Taylor expanded in x around 0 85.9%
Taylor expanded in c around 0 67.2%
Final simplification66.9%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -6e-36) (not (<= x 8.5e+76))) (+ (* b c) (* x (+ (* 18.0 (* y (* z t))) (* i -4.0)))) (- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -6e-36) || !(x <= 8.5e+76)) {
tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
} else {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-6d-36)) .or. (.not. (x <= 8.5d+76))) then
tmp = (b * c) + (x * ((18.0d0 * (y * (z * t))) + (i * (-4.0d0))))
else
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -6e-36) || !(x <= 8.5e+76)) {
tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
} else {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -6e-36) or not (x <= 8.5e+76): tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0))) else: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -6e-36) || !(x <= 8.5e+76)) tmp = Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) + Float64(i * -4.0)))); else tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -6e-36) || ~((x <= 8.5e+76)))
tmp = (b * c) + (x * ((18.0 * (y * (z * t))) + (i * -4.0)));
else
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -6e-36], N[Not[LessEqual[x, 8.5e+76]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-36} \lor \neg \left(x \leq 8.5 \cdot 10^{+76}\right):\\
\;\;\;\;b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if x < -6.0000000000000003e-36 or 8.49999999999999992e76 < x Initial program 77.8%
Simplified91.2%
Taylor expanded in a around 0 86.8%
Taylor expanded in k around 0 80.8%
if -6.0000000000000003e-36 < x < 8.49999999999999992e76Initial program 93.1%
sub-neg93.1%
associate-+l-93.1%
sub-neg93.1%
sub-neg93.1%
distribute-rgt-out--94.6%
associate-*l*86.5%
distribute-lft-neg-in86.5%
cancel-sign-sub86.5%
associate-*l*86.5%
associate-*l*86.6%
Simplified86.6%
Taylor expanded in x around 0 78.7%
Final simplification79.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -4.2e+61)
(* x (- (* 18.0 (* t (* y z))) (* 4.0 i)))
(if (<= x 1.65e+78)
(- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -4.2e+61) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= 1.65e+78) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= (-4.2d+61)) then
tmp = x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))
else if (x <= 1.65d+78) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
else
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -4.2e+61) {
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
} else if (x <= 1.65e+78) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -4.2e+61: tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i)) elif x <= 1.65e+78: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) else: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -4.2e+61) tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))); elseif (x <= 1.65e+78) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(27.0 * Float64(j * k))); else tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= -4.2e+61)
tmp = x * ((18.0 * (t * (y * z))) - (4.0 * i));
elseif (x <= 1.65e+78)
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
else
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -4.2e+61], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e+78], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+61}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right)\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+78}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\end{array}
\end{array}
if x < -4.2000000000000002e61Initial program 79.8%
sub-neg79.8%
associate-+l-79.8%
sub-neg79.8%
sub-neg79.8%
distribute-rgt-out--81.6%
associate-*l*83.5%
distribute-lft-neg-in83.5%
cancel-sign-sub83.5%
associate-*l*83.5%
associate-*l*83.4%
Simplified83.4%
Taylor expanded in x around inf 81.3%
pow181.3%
Applied egg-rr81.3%
unpow181.3%
*-commutative81.3%
associate-*l*83.0%
Simplified83.0%
if -4.2000000000000002e61 < x < 1.65e78Initial program 92.1%
sub-neg92.1%
associate-+l-92.1%
sub-neg92.1%
sub-neg92.1%
distribute-rgt-out--94.1%
associate-*l*87.2%
distribute-lft-neg-in87.2%
cancel-sign-sub87.2%
associate-*l*87.2%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in x around 0 75.4%
if 1.65e78 < x Initial program 71.6%
sub-neg71.6%
associate-+l-71.6%
sub-neg71.6%
sub-neg71.6%
distribute-rgt-out--73.7%
associate-*l*83.8%
distribute-lft-neg-in83.8%
cancel-sign-sub83.8%
associate-*l*83.8%
associate-*l*83.8%
Simplified83.8%
Taylor expanded in x around inf 67.3%
Final simplification75.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* j k))) (t_2 (* x (* i -4.0))))
(if (<= b -4e+175)
(* b c)
(if (<= b -3.7e+121)
(* -4.0 (* t a))
(if (<= b -3.3e-53)
t_2
(if (<= b -3.2e-202)
t_1
(if (<= b -7e-273) t_2 (if (<= b 5.8e+17) t_1 (* b c)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = x * (i * -4.0);
double tmp;
if (b <= -4e+175) {
tmp = b * c;
} else if (b <= -3.7e+121) {
tmp = -4.0 * (t * a);
} else if (b <= -3.3e-53) {
tmp = t_2;
} else if (b <= -3.2e-202) {
tmp = t_1;
} else if (b <= -7e-273) {
tmp = t_2;
} else if (b <= 5.8e+17) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = x * (i * (-4.0d0))
if (b <= (-4d+175)) then
tmp = b * c
else if (b <= (-3.7d+121)) then
tmp = (-4.0d0) * (t * a)
else if (b <= (-3.3d-53)) then
tmp = t_2
else if (b <= (-3.2d-202)) then
tmp = t_1
else if (b <= (-7d-273)) then
tmp = t_2
else if (b <= 5.8d+17) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = x * (i * -4.0);
double tmp;
if (b <= -4e+175) {
tmp = b * c;
} else if (b <= -3.7e+121) {
tmp = -4.0 * (t * a);
} else if (b <= -3.3e-53) {
tmp = t_2;
} else if (b <= -3.2e-202) {
tmp = t_1;
} else if (b <= -7e-273) {
tmp = t_2;
} else if (b <= 5.8e+17) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = x * (i * -4.0) tmp = 0 if b <= -4e+175: tmp = b * c elif b <= -3.7e+121: tmp = -4.0 * (t * a) elif b <= -3.3e-53: tmp = t_2 elif b <= -3.2e-202: tmp = t_1 elif b <= -7e-273: tmp = t_2 elif b <= 5.8e+17: tmp = t_1 else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(x * Float64(i * -4.0)) tmp = 0.0 if (b <= -4e+175) tmp = Float64(b * c); elseif (b <= -3.7e+121) tmp = Float64(-4.0 * Float64(t * a)); elseif (b <= -3.3e-53) tmp = t_2; elseif (b <= -3.2e-202) tmp = t_1; elseif (b <= -7e-273) tmp = t_2; elseif (b <= 5.8e+17) tmp = t_1; else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
t_2 = x * (i * -4.0);
tmp = 0.0;
if (b <= -4e+175)
tmp = b * c;
elseif (b <= -3.7e+121)
tmp = -4.0 * (t * a);
elseif (b <= -3.3e-53)
tmp = t_2;
elseif (b <= -3.2e-202)
tmp = t_1;
elseif (b <= -7e-273)
tmp = t_2;
elseif (b <= 5.8e+17)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4e+175], N[(b * c), $MachinePrecision], If[LessEqual[b, -3.7e+121], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.3e-53], t$95$2, If[LessEqual[b, -3.2e-202], t$95$1, If[LessEqual[b, -7e-273], t$95$2, If[LessEqual[b, 5.8e+17], t$95$1, N[(b * c), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;b \leq -4 \cdot 10^{+175}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -3.7 \cdot 10^{+121}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \leq -3.3 \cdot 10^{-53}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -3.2 \cdot 10^{-202}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -7 \cdot 10^{-273}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -3.9999999999999997e175 or 5.8e17 < b Initial program 84.3%
Simplified87.7%
Taylor expanded in a around 0 77.5%
Taylor expanded in c around inf 48.3%
if -3.9999999999999997e175 < b < -3.70000000000000013e121Initial program 64.2%
Taylor expanded in x around 0 82.3%
Taylor expanded in a around inf 37.2%
*-commutative37.2%
Simplified37.2%
if -3.70000000000000013e121 < b < -3.30000000000000004e-53 or -3.2000000000000001e-202 < b < -6.99999999999999984e-273Initial program 88.1%
sub-neg88.1%
associate-+l-88.1%
sub-neg88.1%
sub-neg88.1%
distribute-rgt-out--92.0%
associate-*l*86.4%
distribute-lft-neg-in86.4%
cancel-sign-sub86.4%
associate-*l*86.4%
associate-*l*86.4%
Simplified86.4%
Taylor expanded in x around inf 45.1%
Taylor expanded in y around 0 23.6%
if -3.30000000000000004e-53 < b < -3.2000000000000001e-202 or -6.99999999999999984e-273 < b < 5.8e17Initial program 87.8%
sub-neg87.8%
+-commutative87.8%
associate-*l*87.8%
distribute-rgt-neg-in87.8%
fma-def87.8%
*-commutative87.8%
distribute-rgt-neg-in87.8%
metadata-eval87.8%
sub-neg87.8%
+-commutative87.8%
associate-*l*87.8%
distribute-rgt-neg-in87.8%
Simplified88.0%
Taylor expanded in j around inf 31.7%
Final simplification36.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (* i -4.0))))
(if (<= b -3.2e+175)
(* b c)
(if (<= b -1.02e+121)
(* -4.0 (* t a))
(if (<= b -3.3e-53)
t_1
(if (<= b -3.4e-202)
(* (* j 27.0) (- k))
(if (<= b -6.5e-273)
t_1
(if (<= b 1.45e+19) (* -27.0 (* j k)) (* b c)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (i * -4.0);
double tmp;
if (b <= -3.2e+175) {
tmp = b * c;
} else if (b <= -1.02e+121) {
tmp = -4.0 * (t * a);
} else if (b <= -3.3e-53) {
tmp = t_1;
} else if (b <= -3.4e-202) {
tmp = (j * 27.0) * -k;
} else if (b <= -6.5e-273) {
tmp = t_1;
} else if (b <= 1.45e+19) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = x * (i * (-4.0d0))
if (b <= (-3.2d+175)) then
tmp = b * c
else if (b <= (-1.02d+121)) then
tmp = (-4.0d0) * (t * a)
else if (b <= (-3.3d-53)) then
tmp = t_1
else if (b <= (-3.4d-202)) then
tmp = (j * 27.0d0) * -k
else if (b <= (-6.5d-273)) then
tmp = t_1
else if (b <= 1.45d+19) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * (i * -4.0);
double tmp;
if (b <= -3.2e+175) {
tmp = b * c;
} else if (b <= -1.02e+121) {
tmp = -4.0 * (t * a);
} else if (b <= -3.3e-53) {
tmp = t_1;
} else if (b <= -3.4e-202) {
tmp = (j * 27.0) * -k;
} else if (b <= -6.5e-273) {
tmp = t_1;
} else if (b <= 1.45e+19) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (i * -4.0) tmp = 0 if b <= -3.2e+175: tmp = b * c elif b <= -1.02e+121: tmp = -4.0 * (t * a) elif b <= -3.3e-53: tmp = t_1 elif b <= -3.4e-202: tmp = (j * 27.0) * -k elif b <= -6.5e-273: tmp = t_1 elif b <= 1.45e+19: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(i * -4.0)) tmp = 0.0 if (b <= -3.2e+175) tmp = Float64(b * c); elseif (b <= -1.02e+121) tmp = Float64(-4.0 * Float64(t * a)); elseif (b <= -3.3e-53) tmp = t_1; elseif (b <= -3.4e-202) tmp = Float64(Float64(j * 27.0) * Float64(-k)); elseif (b <= -6.5e-273) tmp = t_1; elseif (b <= 1.45e+19) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * (i * -4.0);
tmp = 0.0;
if (b <= -3.2e+175)
tmp = b * c;
elseif (b <= -1.02e+121)
tmp = -4.0 * (t * a);
elseif (b <= -3.3e-53)
tmp = t_1;
elseif (b <= -3.4e-202)
tmp = (j * 27.0) * -k;
elseif (b <= -6.5e-273)
tmp = t_1;
elseif (b <= 1.45e+19)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.2e+175], N[(b * c), $MachinePrecision], If[LessEqual[b, -1.02e+121], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.3e-53], t$95$1, If[LessEqual[b, -3.4e-202], N[(N[(j * 27.0), $MachinePrecision] * (-k)), $MachinePrecision], If[LessEqual[b, -6.5e-273], t$95$1, If[LessEqual[b, 1.45e+19], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(i \cdot -4\right)\\
\mathbf{if}\;b \leq -3.2 \cdot 10^{+175}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -1.02 \cdot 10^{+121}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \leq -3.3 \cdot 10^{-53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -3.4 \cdot 10^{-202}:\\
\;\;\;\;\left(j \cdot 27\right) \cdot \left(-k\right)\\
\mathbf{elif}\;b \leq -6.5 \cdot 10^{-273}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{+19}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -3.20000000000000022e175 or 1.45e19 < b Initial program 84.3%
Simplified87.7%
Taylor expanded in a around 0 77.5%
Taylor expanded in c around inf 48.3%
if -3.20000000000000022e175 < b < -1.02000000000000005e121Initial program 64.2%
Taylor expanded in x around 0 82.3%
Taylor expanded in a around inf 37.2%
*-commutative37.2%
Simplified37.2%
if -1.02000000000000005e121 < b < -3.30000000000000004e-53 or -3.40000000000000012e-202 < b < -6.49999999999999979e-273Initial program 88.1%
sub-neg88.1%
associate-+l-88.1%
sub-neg88.1%
sub-neg88.1%
distribute-rgt-out--92.0%
associate-*l*86.4%
distribute-lft-neg-in86.4%
cancel-sign-sub86.4%
associate-*l*86.4%
associate-*l*86.4%
Simplified86.4%
Taylor expanded in x around inf 45.1%
Taylor expanded in y around 0 23.6%
if -3.30000000000000004e-53 < b < -3.40000000000000012e-202Initial program 75.3%
Taylor expanded in x around 0 79.4%
Taylor expanded in x around 0 63.1%
Taylor expanded in c around 0 63.1%
Taylor expanded in a around 0 43.0%
*-commutative43.0%
*-commutative43.0%
*-commutative43.0%
associate-*r*43.0%
Simplified43.0%
if -6.49999999999999979e-273 < b < 1.45e19Initial program 91.5%
sub-neg91.5%
+-commutative91.5%
associate-*l*91.5%
distribute-rgt-neg-in91.5%
fma-def91.5%
*-commutative91.5%
distribute-rgt-neg-in91.5%
metadata-eval91.5%
sub-neg91.5%
+-commutative91.5%
associate-*l*91.5%
distribute-rgt-neg-in91.5%
Simplified89.1%
Taylor expanded in j around inf 28.3%
Final simplification36.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= c -5e-37)
(- (* b c) (* (* x 4.0) i))
(if (<= c 3.4e+78)
(+ (* -27.0 (* j k)) (* -4.0 (* x i)))
(- (* b c) (* 4.0 (* t a))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (c <= -5e-37) {
tmp = (b * c) - ((x * 4.0) * i);
} else if (c <= 3.4e+78) {
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
} else {
tmp = (b * c) - (4.0 * (t * a));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (c <= (-5d-37)) then
tmp = (b * c) - ((x * 4.0d0) * i)
else if (c <= 3.4d+78) then
tmp = ((-27.0d0) * (j * k)) + ((-4.0d0) * (x * i))
else
tmp = (b * c) - (4.0d0 * (t * a))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (c <= -5e-37) {
tmp = (b * c) - ((x * 4.0) * i);
} else if (c <= 3.4e+78) {
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
} else {
tmp = (b * c) - (4.0 * (t * a));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if c <= -5e-37: tmp = (b * c) - ((x * 4.0) * i) elif c <= 3.4e+78: tmp = (-27.0 * (j * k)) + (-4.0 * (x * i)) else: tmp = (b * c) - (4.0 * (t * a)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (c <= -5e-37) tmp = Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i)); elseif (c <= 3.4e+78) tmp = Float64(Float64(-27.0 * Float64(j * k)) + Float64(-4.0 * Float64(x * i))); else tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (c <= -5e-37)
tmp = (b * c) - ((x * 4.0) * i);
elseif (c <= 3.4e+78)
tmp = (-27.0 * (j * k)) + (-4.0 * (x * i));
else
tmp = (b * c) - (4.0 * (t * a));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[c, -5e-37], N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.4e+78], N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -5 \cdot 10^{-37}:\\
\;\;\;\;b \cdot c - \left(x \cdot 4\right) \cdot i\\
\mathbf{elif}\;c \leq 3.4 \cdot 10^{+78}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right) + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\
\end{array}
\end{array}
if c < -4.9999999999999997e-37Initial program 82.4%
sub-neg82.4%
associate-+l-82.4%
sub-neg82.4%
sub-neg82.4%
distribute-rgt-out--83.9%
associate-*l*85.4%
distribute-lft-neg-in85.4%
cancel-sign-sub85.4%
associate-*l*85.4%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in t around 0 68.5%
Taylor expanded in i around inf 59.6%
*-commutative59.6%
associate-*r*59.6%
Simplified59.6%
if -4.9999999999999997e-37 < c < 3.40000000000000007e78Initial program 87.9%
sub-neg87.9%
+-commutative87.9%
associate-*l*87.9%
distribute-rgt-neg-in87.9%
fma-def87.9%
*-commutative87.9%
distribute-rgt-neg-in87.9%
metadata-eval87.9%
sub-neg87.9%
+-commutative87.9%
associate-*l*87.9%
distribute-rgt-neg-in87.9%
Simplified87.4%
Taylor expanded in t around 0 57.5%
Taylor expanded in c around 0 52.4%
if 3.40000000000000007e78 < c Initial program 84.1%
Taylor expanded in x around 0 80.7%
Taylor expanded in x around 0 75.5%
Taylor expanded in j around 0 64.0%
Final simplification56.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* j k))))
(if (<= b -1.55e+178)
(* b c)
(if (<= b -6.2e-209)
t_1
(if (<= b -2.2e-289)
(* -4.0 (* t a))
(if (<= b 2.45e+19) t_1 (* b c)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double tmp;
if (b <= -1.55e+178) {
tmp = b * c;
} else if (b <= -6.2e-209) {
tmp = t_1;
} else if (b <= -2.2e-289) {
tmp = -4.0 * (t * a);
} else if (b <= 2.45e+19) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
if (b <= (-1.55d+178)) then
tmp = b * c
else if (b <= (-6.2d-209)) then
tmp = t_1
else if (b <= (-2.2d-289)) then
tmp = (-4.0d0) * (t * a)
else if (b <= 2.45d+19) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double tmp;
if (b <= -1.55e+178) {
tmp = b * c;
} else if (b <= -6.2e-209) {
tmp = t_1;
} else if (b <= -2.2e-289) {
tmp = -4.0 * (t * a);
} else if (b <= 2.45e+19) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) tmp = 0 if b <= -1.55e+178: tmp = b * c elif b <= -6.2e-209: tmp = t_1 elif b <= -2.2e-289: tmp = -4.0 * (t * a) elif b <= 2.45e+19: tmp = t_1 else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) tmp = 0.0 if (b <= -1.55e+178) tmp = Float64(b * c); elseif (b <= -6.2e-209) tmp = t_1; elseif (b <= -2.2e-289) tmp = Float64(-4.0 * Float64(t * a)); elseif (b <= 2.45e+19) tmp = t_1; else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
tmp = 0.0;
if (b <= -1.55e+178)
tmp = b * c;
elseif (b <= -6.2e-209)
tmp = t_1;
elseif (b <= -2.2e-289)
tmp = -4.0 * (t * a);
elseif (b <= 2.45e+19)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.55e+178], N[(b * c), $MachinePrecision], If[LessEqual[b, -6.2e-209], t$95$1, If[LessEqual[b, -2.2e-289], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.45e+19], t$95$1, N[(b * c), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;b \leq -1.55 \cdot 10^{+178}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -6.2 \cdot 10^{-209}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -2.2 \cdot 10^{-289}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \leq 2.45 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -1.54999999999999996e178 or 2.45e19 < b Initial program 84.3%
Simplified87.7%
Taylor expanded in a around 0 77.5%
Taylor expanded in c around inf 48.3%
if -1.54999999999999996e178 < b < -6.2e-209 or -2.2e-289 < b < 2.45e19Initial program 85.7%
sub-neg85.7%
+-commutative85.7%
associate-*l*85.7%
distribute-rgt-neg-in85.7%
fma-def85.7%
*-commutative85.7%
distribute-rgt-neg-in85.7%
metadata-eval85.7%
sub-neg85.7%
+-commutative85.7%
associate-*l*85.7%
distribute-rgt-neg-in85.7%
Simplified85.9%
Taylor expanded in j around inf 29.1%
if -6.2e-209 < b < -2.2e-289Initial program 93.0%
Taylor expanded in x around 0 87.3%
Taylor expanded in a around inf 47.4%
*-commutative47.4%
Simplified47.4%
Final simplification36.9%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= b -6.4e+176) (not (<= b 6.3e+15))) (* b c) (* -27.0 (* j k))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b <= -6.4e+176) || !(b <= 6.3e+15)) {
tmp = b * c;
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b <= (-6.4d+176)) .or. (.not. (b <= 6.3d+15))) then
tmp = b * c
else
tmp = (-27.0d0) * (j * k)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b <= -6.4e+176) || !(b <= 6.3e+15)) {
tmp = b * c;
} else {
tmp = -27.0 * (j * k);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b <= -6.4e+176) or not (b <= 6.3e+15): tmp = b * c else: tmp = -27.0 * (j * k) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((b <= -6.4e+176) || !(b <= 6.3e+15)) tmp = Float64(b * c); else tmp = Float64(-27.0 * Float64(j * k)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b <= -6.4e+176) || ~((b <= 6.3e+15)))
tmp = b * c;
else
tmp = -27.0 * (j * k);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[b, -6.4e+176], N[Not[LessEqual[b, 6.3e+15]], $MachinePrecision]], N[(b * c), $MachinePrecision], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.4 \cdot 10^{+176} \lor \neg \left(b \leq 6.3 \cdot 10^{+15}\right):\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if b < -6.3999999999999996e176 or 6.3e15 < b Initial program 84.3%
Simplified87.7%
Taylor expanded in a around 0 77.5%
Taylor expanded in c around inf 48.3%
if -6.3999999999999996e176 < b < 6.3e15Initial program 86.3%
sub-neg86.3%
+-commutative86.3%
associate-*l*86.4%
distribute-rgt-neg-in86.4%
fma-def86.4%
*-commutative86.4%
distribute-rgt-neg-in86.4%
metadata-eval86.4%
sub-neg86.4%
+-commutative86.4%
associate-*l*86.4%
distribute-rgt-neg-in86.4%
Simplified86.5%
Taylor expanded in j around inf 28.4%
Final simplification35.4%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = b * c
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 85.6%
Simplified88.0%
Taylor expanded in a around 0 78.6%
Taylor expanded in c around inf 23.9%
Final simplification23.9%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
(t_2
(-
(- (* (* 18.0 t) (* (* x y) z)) t_1)
(- (* (* k j) 27.0) (* c b)))))
(if (< t -1.6210815397541398e-69)
t_2
(if (< t 165.68027943805222)
(+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((a * t) + (i * x)) * 4.0d0
t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
if (t < (-1.6210815397541398d-69)) then
tmp = t_2
else if (t < 165.68027943805222d0) then
tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((a * t) + (i * x)) * 4.0 t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)) tmp = 0 if t < -1.6210815397541398e-69: tmp = t_2 elif t < 165.68027943805222: tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0) t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b))) tmp = 0.0 if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = ((a * t) + (i * x)) * 4.0; t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)); tmp = 0.0; if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023257
(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)))