id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 9183,quantile for poisson distribution - precision issue?,tan@…,John Maddock,"The following (there are others) returns an ""unexpected"" result: #define BOOST_MATH_DISCRETE_QUANTILE_POLICY integer_round_up // #define BOOST_MATH_DISCRETE_QUANTILE_POLICY real #include #include #include int main() { double m=54.3; double x=66.0; boost::math::poisson_distribution<> dist( m ); std::printf( ""\nqpois(ppois(66,54.3),54.3) = %d\n\n"", boost::math::quantile( dist, boost::math::cdf( dist, x ) ) ); return 0 } The ""expected"" answer is 66 but 67 is being returned. I am aware of Ticket 8308 (https://svn.boost.org/trac/boost/ticket/8308). I do not think R is ""rounding to the nearest"", and as far as I am aware, it has been consistent with quantile(p)=infimum {x|cdf(x)>=p} which is what ""we"" needed/expected. If we change the policy to give real output---on my Ubuntu 12.04 (Intel 14.0 C++ with g++ 4.7.3), the result is 6.600000000000001e+01. So I wonder if this is just a (finite) precision/rounding issue ... in that it is really 66 to some ""fuzz"". I have (also) tried this with revision 86054 of the trunk. Thank you!",Support Requests,closed,To Be Determined,math,Boost 1.54.0,Showstopper,fixed,,