Boost logo

Boost :

Subject: Re: [boost] GSoC : Boost.Math Bernoulli Numbers
From: Gaurav Deshmukh (gauravdeshmukh42_at_[hidden])
Date: 2013-04-26 14:31:04

Hi Chris,

Thank you for your encouragement.

I have tried to change my implementation of 'bernoulli' function according
to your suggestions.

>1)You should reserve the known size of the vector with
>its known size (n) up front using the reserve() member.
>It has better performance than successively calling
>push_back() on an unreserved vector.

I have initialized the vector size at its declaration using constructor.
 std::vector<float_type> arr(n+1);

>2) You have an implementation for cpp_dec_float.
>Very good. But please try to make a template solution.

I have made the return type generic.
I tested it for float,double and cpp_dec_foat. As the precision of 'float'
is least, it gives least accurate answer by Akiyama-Tanigawa algorithm.
'Double' gives accuracy upto 6 decimal points for n<16. However,
'cpp_dec_float' gives more accuracy. But, still accuracy is not 100% by
Akiyama-Tanigawa algorithm. After 10 decimal points, generally there is
mismatch in published values and values calculated by this algorithm.

I have attached the modified files.

Thank You,
Gaurav Deshmukh

Boost list run by bdawes at, gregod at, cpdaniel at, john at