Romberg Tables combine trapezoidal estimates on nested grids with extrapolation that cancels leading error terms. Refining the grid and extrapolating across grid levels are separate operations. The table records both, allowing a smooth-function model to extract more information from equally spaced samples without treating every new column as a new set of measurements.
Begin with a trapezoid over the full interval using its two endpoints. Halve the step size to add midpoint samples, then halve it again to add the points between the existing positions. Every coarser grid lies inside the finer grid. The new trapezoidal estimate can therefore reuse the previous sum and add only the newly introduced sample contributions.
For a sampled-data interface, the finest grid is supplied in advance. SciPy's documented romb function expects two to the k plus one equally spaced samples along the chosen axis. It receives sample values and a constant spacing dx, not an arbitrary array of coordinate locations. Matching the array length alone does not establish that the samples actually have the required geometry.

For a sufficiently smooth function under the relevant trapezoidal error expansion, the estimate T at step h has leading error proportional to h squared. The estimate at half the step has one quarter of that leading error. Thus four times the finer estimate minus the coarser estimate, divided by three, cancels that term.
Later columns repeat the idea for higher even powers. In a usual table convention, an entry in column j equals the preceding entry in its row plus the difference from the corresponding previous-row entry divided by the quantity (4^j−1). The denominator refers to the error-scaling factor, not to the number of samples newly added at that level.
Use the independent function x to the fourth on zero through one, with sample spacing one quarter. The five sampled values are zero, one divided by two hundred fifty-six, one divided by sixteen, eighty-one divided by two hundred fifty-six, and one. The exact integral is one fifth, providing an external check for this constructed polynomial.
The trapezoidal estimates with one, two and four subintervals are one half, nine over thirty-two, and one hundred thirteen over five hundred twelve. The first extrapolated column gives five over twenty-four and seventy-seven over three hundred eighty-four. The next extrapolation combines those values using a denominator of fifteen and gives exactly one fifth in rational arithmetic.

The cancellation argument assumes an appropriate smooth error expansion. Discontinuities, singular behavior, unresolved oscillation and noisy samples can invalidate the expected pattern. Two nearby extrapolated numbers do not prove that an arbitrary unknown function has been integrated to that many digits. The values in the example come from a known exact polynomial, not a noisy measurement.
Floating-point arithmetic also introduces rounding and cancellation in the table. Exact equality in our rational derivation does not imply bit-for-bit equality for every floating-point implementation. Increasing the table depth indefinitely is not a general remedy for data that violate the sampling or smoothness assumptions.
The spacing dx multiplies the trapezoidal estimates and therefore the final result. Forgetting to supply a nonunit spacing changes the represented integral even if the sample values are correct. If the values represent a physical quantity, the integrated units include the coordinate unit carried by dx. The number of array entries alone does not provide that physical spacing.
For multidimensional input, the axis parameter specifies which ordered sample dimension is integrated. Other dimensions describe independent slices, rather than extra positions along the same interval. The optional displayed table is a diagnostic presentation of extrapolation values; the function's documented return is the integrated result, not a separately validated absolute-error bound.
Five samples give four subintervals and support three grid levels, including the coarsest one. An arbitrary four-sample vector gives three subintervals and does not meet the power-of-two nesting requirement, even if its spacing is uniform.
The algorithm discussed here organizes samples that already exist on a nested uniform grid. An adaptive integrator can instead request new function evaluations in selected regions. Those are different interfaces with different available information. The site's numerical integration principles and technical features connect those distinctions.
Primary sources: the current SciPy romb interface documentation and the original sample checks, nested trapezoids and extrapolation implementation. Both figures are original AI-assisted grid and exact-arithmetic diagrams. They do not present a measured signal, an accuracy benchmark or an unconditional convergence guarantee.