# Romberg-Integration relative error

How can I check if the relative error of two successive diagonal elements is smaller than e.g. $$10^{-3}$$?

$$\left\vert \frac{T_{1,2}-T_{1,3}}{T_{1,3}}\right\vert<0.001$$

for a Romberg Tableau of this form

$$\begin{array}{cccccc} T_{1,1}\\ &\backslash\\ T_{2,2}&-&T_{1,2}\\ &\backslash&&\backslash\\ T_{3,3}&-&T_{2,3}&-&T_{1,3}\\ &\backslash&&\backslash&&\backslash\\ \end{array}$$

I am using for $$h=\frac{b-a}{N_i}$$ with $$a$$, $$b$$ as integral limits and $$N_i=2^i$$, $$i=1,...$$ as Romberg sequence.

I am using the trapezoidal sum to compute

$$T_{i,1}=T(h_i)=\frac{h_i}{2}\left(f(a)+f(b)+\sum_{j=1}^{N_i-1}f(a+j\cdot h_i)\right)$$

and all other elements are computed with the following formula:

$$T_{(j,j+k)}(f)=T_{(j+1,j+k)}(f)+\frac{T_{(j+1,k+1)}(f)-T_{(j,j+k-1)}(f)}{\left(\frac{h_j}{h_{j+k}}\right)^2-1}$$