A C99 Implementation of the Clausen Sums
A C99 program is presented which calculates the Clausen sums for non-negative integer indices j and real arguments x. The implementation is split into three major cases. For large j, a direct, truncated summation of the sum is performed. For smaller j, the associate polynomial of x is evaluated if applicable; otherwise a Chebyshev series is constructed by repeated integration of a (truncated) Chebyshev representation of Cl_2(x), and evaluated.