AngouriMath
PolynomialSummation
Description
Summary
A summation whose summand is a polynomial in the index, written as a polynomial in the
bounds:sum(k, k, 1, n) is n^2/2 + n/2 .
bounds:
Remarks
otherwise stayed as written — so a symbolic bound had no answer at all, and neither did a
concrete range past a hundred terms. Both are the same gap: a sum of a polynomial has a
closed form, and computing it is cheaper than the expansion it replaces.
polynomial of degree
polynomial of that degree is determined by
are sums of
coefficients exactly, in rational arithmetic, with no table to carry and no identity to
get subtly wrong. Faulhaber's formula would give the same answer by a shorter route that
needs Bernoulli numbers, which the library does not have.
library answers an empty range with
identity holds exactly when
empty-range value as the other branch. Where the bounds are concrete the condition is
decidable and the piecewise collapses to a number.
reads a reversed range as the negated sum over the flipped one, under which the identity
is unconditional. This library defines an empty range as the operator's identity instead,
and the condition is what that choice costs.
Members
ClosedForm(AngouriMath.Entity,AngouriMath.Entity,AngouriMath.Entity,AngouriMath.Entity)
MethodEvaluate(PeterO.Numbers.ERational[],AngouriMath.Entity)
MethodMaxDegree
FieldPowerSum(System.Int32)
Method
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online