This is the mail archive of the
mailing list for the GCC project.
Re: Implementation of Zeta functions in libstdc++
- From: Ed Smith-Rowland <3dw4rd at verizon dot net>
- To: Florian Goth <CaptainSifff at gmx dot de>, gcc at gcc dot gnu dot org, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Sun, 03 Aug 2014 22:06:35 -0400
- Subject: Re: Implementation of Zeta functions in libstdc++
- Authentication-results: sourceware.org; auth=none
- References: <trinity-921ae830-2f58-4034-9628-55f4cd2d3e62-1407112116997 at 3capp-gmx-bs21>
On 08/03/2014 08:28 PM, Florian Goth wrote:
Thanks Ed for the kind reception of this idea.
To show what I have done so far I have set up a git repository here:
Obviously it is not yet in a state where it looks like sth. from the standard library; it still uses my conventions right now.
gives an example where the old implementation failed and which essentially led me to recode all this.
So, what do you think,
What it be nice to have that functionality in gcc and is it worthwhile to patch it up for the std library?
I would be willing to do the work and get a copyright assignment.
I fiddled with the code for the evaluation of the Riemann Zeta function.
By removing a lot of calls to special functions in the innermost loop I
could speed it up by about a factor of 3 on my machines(core2 + core-i7).
The commits are
and to clean things up:
The basic idea is to replace the evaluation of the binomial coefficient via exp(log(gamma(x)))
by a recursive relation of the binomial coefficient. This does not worsen the numerical stability since
all intermediate results are perfectly representable. Of course that hard boundary where the result of the binomial coefficient is not
representable anymore is still present.
Great work! Please continue your work. The polylog function would also
make a nice extension to the function library in it's own right.
Please begin you copyright assignment quickly - that can take a long
time to get through.
Finally, this is a C++ library issue so we should move our conversation