# On the Total Positivity and Accurate Computations of \(r\)-Bell Polynomial Bases
## 4 Accurate Computations with \(r\)-Bell Bases
```
Require:\(n\), \(r\), \(x:=\{x_{i}\}_{i=1}^{n+1}\) such that \(0<x_{1}<\ldots<x_{n+1}\)
``` Ensure:\(BDB_{n}^{r}\) bidiagonal decomposition of \(B_{n}^{r}\) to high relative accuracy  
\(BDB_{n}^{r}\) bidiagonal decomposition of \(B_{n}^{r}\) to high relative accuracy  
\(BDL_{n}^{r}=BDL_{n}^{r}(n,r)\) (see Algorithm 1)  
\(BDL_{n}^{r}=BDL_{n}^{r}(n,r)\) (see Algorithm 2)  
\(BDV=\texttt{TNVandBD(x)}\)  
\(BDB_{n}^{r}=\texttt{TNProduct}(BDV,(BDL_{n}^{r})^{T})\)  
\(BDB_{n}^{r}=\texttt{TNProduct}(BDV,(BDL_{n}^{r})^{T})\) ```
**Algorithm 4** Computation to high relative accuracy of the bidiagonal decomposition of Wronskian matrices \(W_{n}^{r}\), \(\bar{W}_{n}^{r}\) of \(r\)-Bell bases of the first and second kind
``` Require:\(n\), \(r\), \(x\in(0,\infty)\)

```
Ensure:\(BDV_{n}^{r}\) bidiagonal decomposition of \(W_{n}^{r}\) to high relative accuracy  
\(BD\bar{W}_{n}^{r}\) bidiagonal decomposition of \(\bar{W}_{n}^{r}\) to high relative accuracy  
\(BDL_{n}^{r}=BDL_{n}^{r}(n,r)\) (see Algorithm 1)  
\(BDL_{n}^{r}=BDL_{n}^{r}(n,r)\) (see Algorithm 2)  
\(BDW=\texttt{BDW}(x)\)  
\(BDW_{n}^{r}=\texttt{TNProduct}(BDW,(BDL_{n}^{r})^{T})\)
```

**Algorithm 5** Computation to high relative accuracy of the bidiagonal decomposition of Gramian matrices \(G_{n}^{r}\), \(G_{n}^{r}\) of \(r\)-Bell bases of the first and second kind

## 5 Numerical Experiments

Some numerical tests are presented in this section, supporting the obtained theoretical results. We have considered different nonsingular strictly totally positive collocation matrices \(B_{n}^{r}\), \(\bar{B}_{n}^{r}\), Wronskian matrices \(W_{n}^{r}\), \(\bar{W}_{n}^{r}\), and Gramian matrices \(G_{n}^{r}\), \(\bar{G}_{n}^{r}\) of r-Bell bases of the first and second kind. Specifically, \(B_{n}\) with \(r=0\) and \(t=(i-1)/(n+1)\), \(i=1,\ldots,n+1\), and \(\bar{B}_{n}^{r}\), with \(r=1\) and \(t=1+(i-1)/(n+1)\), \(i=1,\ldots,n+1\), and with \(r=3\) and \(t=(i-1)/(n+1)\), \(i=1,\ldots,n+1\). In addition, \(W_{n}^{r}\) with \(r=5\) and \(t=60\) and, \(\bar{W}_{n}^{r}\) with \(r=4\) and \(t=50\). Finally, \(\bar{G}_{n}^{r}\) with \(r=n\), \(n=10,11,\ldots,20\). We have computed, with Mathematica, the 2-norm condition number, which is the ratio of the largest singular value to the smallest, of all considered matrices. This conditioning is depicted in Figure 1. It can be easily observed that the conditioning drastically increases with the size of the matrices. Due to the ill-conditioning of these matrices, standard routines do not obtain accurate solutions because they can suffer from inaccurate cancellations. Let us recall that if \(BD(A)\) can be obtained to high relative accuracy, then the MATLAB functions TNEigenValues, TNSingularValues, TNInverseExpand and TNSolve available in the software library TNTools in [30], take as input argument \(BD(A)\), and compute to high relative accuracy the eigenvalues and singular values of \(A\), the inverse matrix \(A^{-1}\) (using the algorithm presented in [22]) and even the solution of linear systems \(Ax=b\), for vectors \(b\) with alternating signs. In order to check the accuracy of our algorithms, we have performed several matrix computations using the mentioned routines available in [30], with the matrix form (11) of the bidiagonal factorization (5) as an input argument. The obtained approximations have been compared with the respective approximations obtained by traditional methods provided in Matlab \(R2022b\). In this context, the values provided by Wolfram Mathematica 13.1 with 100-digit arithmetic have been taken as the exact solution of the considered algebraic problem. For the sake of brevity, only a few of these experiments will be shown. The relative error of each approximation has also been computed in Mathematica with 100-digit arithmetic as \(e:=|y-\widetilde{y}|/|y|\), where \(y\) denotes the exact solution and \(\widetilde{y}\) the computed approximation. **Computation of eigenvalues and singular values**.