Expand description
Kambe integrals I_n(z, eta) = integral_eta^infinity t^n exp(-z^2 t^2/2 + 1/(2t^2)) dt
with first-order bounds on their rounding errors.
kambe() runs the Kambe (1968) recurrence up from a base pair: closed forms for even
orders, the series for odd ones. Below the pair it takes the series over scaled
incomplete gamma functions or the downward recurrence, whichever bounds the error more
tightly. EvenKambe carries the even orders of one reciprocal point of a lattice
sum. SmallSplitKambe gives the integrals of the real-space terms of a lattice sum
at splits below every automatic one.
Upstream: intkambe of treams/special/_integrals.pyx. The rounding bounds, the
choice below the base pair and the small-split series are treams-rs extensions.
StructsΒ§
- Even
Kambe π - Even Kambe orders
I_2, I_0, I_-2, I_-4, ...of one argument from the closed-form pairI_-2, I_0and the Kambe recurrence, one step per order, as treams evaluates them: the orders of one reciprocal point of a 2D spherical or 1D cylindrical lattice sum, whose correlated errors those sums cancel (seelattice::Reduced). - Small
Split πKambe - Kambe integrals
I_n(z, eta)of the real-space terms of an Ewald sum at a split below every automatic one (Self::get), with the coefficientsc^j / j!of their series atc = 1 / (2 eta^2), which every integral at that split shares. There the closed-form pair and its recurrence (kambe_with_bound) cancel by up toe^Re(c)(each error function loses about|a|^2ulps toexp(-a^2)at its argumenta = (z eta -+ i / eta) / sqrt 2), while the series sums terms of one phase for realzandeta; its coefficients are rounded from double-double arithmetic, since recurred in double they carry the rounding ofcinto every integral alike.
ConstantsΒ§
- CLOSED_
ULPS π - Bound of the closed forms of
SmallSplitKambe, relative to their value in ulps, up to which they are taken without the series. - SERIES_
PEAK_ πLIMIT - Largest
|c|that sets the length of the Kambe series. Its termsc^j / j!peak at aboute^|c| / sqrt(2 pi |c|), which overflows beyond|c| = 715: no larger|c|gives a finite sum. - SERIES_
ULPS π - Relative rounding error, in ulps, of the terms of the Kambe series of
SmallSplitKambebeyond that of the exponential of their gamma functions: up to 22 against 40-digit quadrature (orders up to 28).
FunctionsΒ§
- base_
pair π - The base pair
I_-3, I_-1(odd, by the series) orI_-2, I_0(even, in closed form), with error bounds in units of epsilon. - even_
pair π I_-2andI_0in closed form by two complementary error functions, with the magnitude of their two terms as error bounds in units of epsilon.- even_
scale π - The factor
sqrt(pi / 8)of the closed form of the even base pair. - even_
terms π - The two terms of the closed form of the even base pair, and the argument with
Re z >= 0they take (even orders are even inz). - even_
values π I_-2andI_0from the terms ofeven_terms.- kambe π
- The Kambe integral
I_n(z, eta)without input checks. - kambe_
argument π - The argument
a = (z eta)^2 / 2of the incomplete gamma functions of the Kambe series, as the series evaluates it. Odd orders take the principal branch ofln a, which the 1D spherical lattice sums continue to another sheet where they need it. - kambe_
below_ πbase - Orders below the base pair from the series, which cancels by about
e^(|c| - Re c)for complexeta, or the downward recurrence from the base pair (as in treams), accurate while|1/eta^2|exceeds about|n|and|z|: the smaller error bound wins. A series whose predicted loss stays withinRECURRENCE_GROWTHis kept outright; otherwise odd orders sum their base pair in the same pass, and even orders keep a recurrence that grows by at mostRECURRENCE_GROWTHand try the series only where its predicted loss is belowRECURRENCE_GROWTHtimes the recurrenceβs growth. - kambe_
downward π - The Kambe (1968) recurrence
I_n = (n+3) I_(n+2) - z^2 I_(n+4) + eta^(n+3) e^(...)run downward from the base pair, with the first-order absolute error bound in units of epsilon propagated from the pair and each endpoint term. - kambe_
series π - Kambe integrals by expanding
exp(1/(2t^2)): witha = (z eta)^2 / 2,c = 1 / (2 eta^2)andR(d) = Gamma(d, a) / a^d(-1/dasa -> 0),I_n = eta^(n+1)/2 sum_j c^j/j! R((n+1)/2 - j), whose terms cancel by up toe^(|c| - Re c)for complexeta. Orders of one parity share one ladder ofR, each with the magnitude of its terms as its error bound. Even orders take the branchsqrt(a) = z eta / sqrt 2withRe z >= 0. - kambe_
series_ πwith kambe_serieswith the coefficientsc^j/j!fromtable, or recurred term by term.- kambe_
upward π - The Kambe recurrence run upward from the base pair to order
n, with error bounds in units of epsilon whereBOUNDasks for them (the endpoint terms countendpoint_ulps). - kambe_
with_ πbound kambewith a first-order bound on the absolute rounding error of its value in units of epsilon: from the series forI_-3andI_-1, below the base pair from the series or the downward recurrence thatkambetakes, and above the base pair propagated through the upward recurrence. Requires nonzeroeta, and nonzerozfrom order -1 up.- more_
accurate π - The value with the smaller error bound, unless the series overflowed.
- series_
terms π - The number of terms of the Kambe series at
c = 1 / (2 eta^2)after which each order stops: its terms peak nearj = |c|and soon fall below the rounding of the sum.