Bernoulli Numbers Implementation With More Precision and Boost.Test

I have further improved the implementation of 'bernoulli' function for Math.Bernoulli project idea of GSoC-2013. In my previous update, I made the return type generic. But, there was lack of precision as I had mentioned. For achieving greater accuracy, I implemented the Akiyama-Tanigawa algorithm using 'cpp_rational' data type. As there is no approximation in intermediate steps, it gives best accuracy. It can be casted to the data types of 'cpp_dec_float'. But, I think this implementation may be slower than the previous implementations. So, there is trade-off between running time and precision. We may implement 'bernoulli' function in two ways. If priority is running time than the accuracy of precision, then we can use previous implementation. If priority is the precision, then we can use this implementation. I have attached the 3 files. 1) bernoulli.hpp : It contains the function fr calculating bernoulli number. 2) example.cpp : It contains the program to test bernoulli.hpp 3) test.cpp : This is the Boost.Test comparing the values calculated by benoulli.hpp with some of the published values.

I have further improved the implementation of 'bernoulli' function for Math.Bernoulli project idea of GSoC-2013.
Good work. That is an interesting and creative approach. You have coded enough for now, and you might want to consider working on your proposal if you are interested in pursuing this project. Please remember in your proposal that the goals of the project extend significantly beyond the calculation of Bernoulli numbers. This is just a first step toward improvements of gamma, polygamma, and optionally Hurwitz-zeta. If you need help with the proposal, you may e-mail a draft to me or Paul or ask at the lists. Keep up the good work and good luck. Sincerely, Chris.
participants (2)
-
Christopher Kormanyos
-
Gaurav Deshmukh