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
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