The Best Algorithm No One Knows About
getkerf.wordpress.com
getkerf.wordpress.com
qu1real = -nreal + 1.0 + Nreal
will behave poorly if N > 2^52 or so. The cited paper refers to this in the Appendix, mentioning that "Roughly log10(N) + 1 digits of precision will suffice", so 20 decimal digits worth versus the 15 available in doubles.