Source-linked AI summary
A simple algorithm for the summation of alternating series
Eleonora Denich, Paolo Novati, Alvise Sommariva
TL;DR
The paper addresses summation of alternating series with analytic-function terms, where existing weighted-integral methods may require extra information about f and lack error analysis. It rewrites the series using Abel’s formula, applies the sinc rule, and derives an error estimate for automatic prescribed-accuracy computation. Numerical tests report machine-precision-scale accuracy and tolerance estimates that are usually slightly conservative.
Problem
Alternating-series summation methods can require additional information about f, while prior methods lack available error analysis.
Method
The paper rewrites the alternating series through Abel’s formula, applies the sinc (trapezoidal) rule, and uses an a-priori error estimate to select quadrature parameters automatically.
Results
Numerical tests reached absolute errors of the order of machine precision with about 60 evaluations, while automatic estimates were usually slightly smaller than the requested tolerance.
Takeaways & Limitations
The algorithm provides prescribed-accuracy alternating-series summation without requiring additional information about f, such as derivatives or singularity locations.
Takeaways & Limitations
The error estimate may be conservative when f(j) rapidly approaches zero, and the method is not claimed to minimize function evaluations.
Abstract
from arXiv · showhide
This paper deals with the computation of the sum of alternating series, whose general terms can be expressed by means of analytic functions. After rewriting the series as a weighted integral with the Abel weight, we employ the sinc (trapezoidal) rule and analyze the remainder term with respect to the number of quadrature points. We provide some numerical experiments to show the reliability of the derived error estimate and to test the algorithm for automatic summation with prescribed accuracy. All the Matlab codes used in the present paper can be found as open-source software at the authors' homepage.
1 Introduction
The paper targets alternating-series summation through weighted-integral reformulations, building on prior formulas and quadrature methods. It focuses on a sinc-rule approach to Abel’s formula with an error analysis for automatic prescribed-accuracy computation.
- Alternating-series summation methods commonly reformulate the problem as computing weighted integrals, under suitable hypotheses on f.
- Existing approaches use Abel, Plana, and Lindelöf formulas, Gaussian quadrature, contour integration, or orthogonal polynomials for related series.
- These methods can require additional information about f, such as a primitive or inverse Laplace transform, and generally lack error analysis.
- The paper analyzes the sinc rule applied to Abel’s formula and derives an accurate error analysis for automatic summation with prescribed accuracy.
- The paper presents its theoretical background, summation method and error analysis, numerical experiments, and open-source Matlab implementations.
2 General results
The paper develops error estimates for truncated trapezoidal approximation on the real line under analyticity assumptions. It balances discretization and truncation errors to optimize convergence for a fixed quadrature budget.
- The analysis assumes G is real-valued on the real axis and analytic in an infinite strip except for a conjugate pair of simple isolated singularities.
- The singularity distance d and residue ρ0 determine the asymptotic error behavior used in the quadrature analysis.
- The method chooses h, N, and M so discretization and truncation errors have the same exponential decay, yielding an approximation of the total error.
- For even G, the integral can be approximated using twice the trapezoidal rule applied to the nonnegative side.
- The truncated trapezoidal error is decomposed into discretization and left- and right-truncation components.
3 The trapezoidal rule for the computation of (2)
The paper applies Abel’s formula and the trapezoidal rule to alternating series under analytic and decay conditions. It uses singularity geometry and balanced error terms to select quadrature parameters, while noting that the resulting estimate can be conservative.
- Abel’s formula converts the alternating-series problem into an integral involving f under analyticity and exponential-decay conditions.
- Symmetry of the transformed integrand allows the integral to be evaluated with a trapezoidal rule over the real line.
- The transformed function has a removable singularity at zero, handled through a complex-step derivative approximation that remains stable for δ≈1e-100.
- For fixed h, convergence is mainly governed by the distance d of the nearest singularity from the real axis.
- Discarding the first series term can set d=1, after which the Section 2 error analysis applies to the shifted formulation.
- The error-balancing condition selects quadrature parameters by matching discretization and truncation behavior, but the estimate may be conservative when f(j) rapidly approaches zero.
4 Numerical experiments
The numerical experiments compare direct summation, the sinc trapezoidal rule, and Milovanovic methods on slowly convergent alternating series. They also test automatic summation against prescribed tolerances.
- Comparative tests: The tests compare absolute errors for direct summation, the sinc trapezoidal rule, and Milovanovic methods across several functions.The figures plot error against function evaluations; mil1, mil3, and mil5 require n + 1, n + 3, and n + 5 evaluations, respectively.
- Comparative tests: The tested series are slowly convergent, while the trapezoidal method reaches errors of the order of machine precision with about 60 evaluations.Its numerical error estimate is reported as particularly tight.
- Comparative tests: Milovanovic’s mil1, mil3, and mil5 methods generally use fewer functional evaluations than the trapezoidal approach but require a known primitive F.The comparison is made when the primitive F is available.
- Automatic summation: The automatic-summation experiments report total evaluations m and actual absolute error for tolerances 10^-4, 10^-8, and 10^-12.The method selects M using the error formula and a constant C.
- Automatic summation: In both automatic-summation examples, the estimates are accurate, with the actual error usually slightly below the requested tolerance.Reference solutions are used to compute the reported errors.
5 Conclusions
The paper presents a simple sinc-rule algorithm for alternating series representable through Abel’s formula, together with an a-priori error estimate and automatic accuracy control.
- Method and scope: The algorithm sums alternating series expressible through Abel’s formula using the sinc rule.The method is described as simple and does not claim to minimize function evaluations.
- Method and scope: An a-priori error estimate supports automatic evaluation of the series with prescribed accuracy.The estimate does not require derivatives or singularity locations of f.
- Method and scope: Unlike some alternatives, the method does not require additional information about the function f.The conclusion specifically contrasts this with methods requiring function-specific analysis.
A Matlab codes
The appendix provides the Matlab codes used for the numerical experiments and makes them available as open-source software.
- Code availability: The Matlab codes used in the numerical experiments can be downloaded as open-source software.The appendix describes these codes.
A.1 The routine sinc summation
The sinc summation routine accepts a function and tolerance, automatically selects the quadrature size, and returns the approximation and evaluation count.
- Routine interface: Given f and a tolerance tol, the routine computes the alternating-series sum using the sinc rule.The routine implements the paper’s automatic summation algorithm.
- Automatic selection: The routine automatically selects M from the error estimate using the constant C and requires M + 3 function evaluations.The code reports the number of required evaluations.
- Alternative mode: Given M instead, the routine computes the approximation and its error estimate.This provides an alternative fixed-quadrature-size mode.
A.2 The routine milovanovic summation
The milovanovic routine computes a Gaussian rule for the specified weight function and applies the resulting quadrature within the summation technique. Its formulation includes a Gaussian-rule remainder and implementation details based on Golub–Welsch and discretization.
- The method assumes that F, a primitive of f, is holomorphic in a specified right half-plane region.
- The summation formulation uses Gaussian-rule weights and nodes together with the remainder R_n.
- After A_m,n(f) is available, the procedure immediately obtains the subsequent summation quantity.
- The Gaussian rule is computed in Matlab using the Golub–Welsch algorithm.
- The recurrence coefficients are determined through discretization using the Stieltjes algorithm and Gauss–Legendre quadrature over two intervals.
- The routine first computes an n-point Gaussian rule with respect to w(x) = sinh(x) cosh^2(x).
A.3 The routines demo
The demo routine evaluates summation methods across increasing numbers of functional evaluations and compares absolute errors against a reference result. For sinc summation, it also displays the error estimate, while Table 1 varies the tolerance.
- The demo routine defines tests from a battery of examples and runs summation methods with increasing functional evaluations.
- Absolute errors are plotted with respect to a reference result.
- The sinc summation algorithm additionally displays its error estimate (17).
- The numerical results in Table 1 are obtained by calling the demo function.
- The demo routine is used while varying the tolerance.
- The routines apply sinc in the reported tables.