# On the Total Positivity and Accurate Computations of \(r\)-Bell Polynomial Bases
## 4 Accurate Computations with \(r\)-Bell Bases
Then, they can be used to test numerical algorithms and see how they perform on ill-conditioned or nearly singular matrices. It is well known that Hilbert matrices are strictly totally positive. In [19], the pivots and the multipliers of the Neville elimination of \(H\) are explicitly derived. It can be checked that \(BD(H_{n})=(BD(H_{n})_{i,j})_{1\leq i,j\leq n+1}\) is given by  
\[BD(H_{n})_{i,j}:= \begin{cases}\frac{(i-1)^{2}}{(i+j-1)(i+j-2)},&\text{if $i>j$,}\\ \frac{(i-1)^{1}}{(2i-1)(i-2)^{2}},&\text{if $i=j$,}\\ \frac{(i-1)^{2}}{(i+j-1)(i+j-2)},&\text{if $i<j$.}\end{cases}  \tag{49}\]  
Clearly, the computation of the factorization (5) of \(H_{n}\) does not require inaccurate cancellations, and so it can be computed to high relative accuracy. Using formula (39), it can be checked that the Gramian matrices \(G_{n}^{r}\) and \(\tilde{G}_{n}^{r}\) of the \(r\)-Bell bases of the first and second kind, respectively, with respect to the inner product (47), can be written as follows,  
\[G_{n}^{r}=L_{n}^{r}H_{n}(L_{n}^{r})^{T},\quad\tilde{G}_{n}^{r}=\bar{L}_{n}^{r }H_{n}(\bar{L}_{n}^{r})^{T}, \tag{50}\]  
where \(L_{n}^{r}\) (respectively, \(\bar{L}_{n}^{r}\)) is the \((n+1)\times(n+1)\)\(r\)-Stirling matrix of the first (respectively, second) kind. According to the reasoning in the proof of Theorem 4, the following result can be deduced. Theorem 4.2: _The Gramian matrices \(G_{n}^{r}\) and \(G_{n}^{r}\) of the \(r\)-Bell bases of the first and second kind, respectively, with respect to the inner product (47), are nonsingular and totally positive. Furthermore, \(G_{n}^{r}\), \(\tilde{G}_{n}^{r}\) and their bidiagonal decompositions (5) can be computed to high relative accuracy._  
Now, taking into account Algorithms 1 and 2, as well as Theorems 4-6, we provide the pseudocode of Algorithms 3-5 for computing, to high relative accuracy, the matrix form (11) of the bidiagonal decomposition of the collocation matrices \(B_{n}^{r}\), \(\tilde{B}_{n}^{r}\), Wronskian matrices \(W_{n}^{r}\), \(\tilde{W}_{n}^{r}\), and Gramian matrices \(G_{n}^{r}\), \(\tilde{G}_{n}^{r}\) of \(r\)-Bell bases of the first and second kind. Algorithm 3 requires \(BD(L_{n}^{r})\), \(BD(L_{n}^{r})\), and the bidiagonal decomposition of the Vandermonde matrix implemented in the MATLAB function \(\mathtt{TNVandBD}\) available in [30]. In addition, Algorithm 4 requires \(BD(L_{n}^{r})\), \(BD(L_{n}^{r})\), and the bidiagonal decomposition \(BD(W)\) (46) of the Wronskian matrix \(W\) of the monomial basis at \(x\). Moreover, Algorithm 5 requires \(BD(L_{n}^{r})\), \(BD(L_{n}^{r})\), and the bidiagonal decomposition \(BD(H)\) of the Hilbert matrix \(H\) implemented in the MATLAB function \(\mathtt{TNCauchyBD}\) available in [30]. Finally, let us observe that these three algorithms call the MATLAB function \(\mathtt{TNProduct}\) available in [30]. Let us recall that, given \(A=BD(F)\) and \(B=BD(G)\) to high relative accuracy, \(\mathtt{TNProduct}(A,B)\) computes \(BD(F\cdot G)\) to high relative accuracy. The computational cost of the mentioned function and mentioned algorithms is \(O(n^{3})\) arithmetic operations.