id summary reporter owner description type status milestone component version severity resolution keywords cc 6307 problem in bessel_jn phzwart@… John Maddock "In bessel_jn (math/special_functions/detail) line 75 reads: if((tools::max_value() - fabs(prev)) / fabs(fact) < fabs(current)) fact is defined in line 74: T fact = 2 * k / x; when k is 1 and x > 2 , fact < 1 resulting in ((tools::max_value() - fabs(prev)) / fabs(fact) to be bigger then tools::max_value(), resulkting in an error. I have change line 75 into if((tools::max_value() - fabs(prev)) < fabs(fact) * fabs(current)) and made the same change for line 100. With this fix, the code runs and produces (in my limited testing) the same numbers as octave does. I am not sure if it is a general fix though. The problem occurred on this architecture: Linux syrah.als.lbl.gov 2.6.35.14-97.fc14.x86_64 #1 SMP Sat Sep 17 00:15:37 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux svn diff gives this: =================================================================== --- bessel_jn.hpp (revision 76082) +++ bessel_jn.hpp (working copy) @@ -72,7 +72,7 @@ for (int k = 1; k < n; k++) { T fact = 2 * k / x; - if((tools::max_value() - fabs(prev)) / fabs(fact) < fabs(current)) + if((tools::max_value() - fabs(prev)) < fabs(fact) * fabs(current)) { scale /= current; prev /= current; @@ -97,7 +97,7 @@ for (int k = n; k > 0; k--) { T fact = 2 * k / x; - if((tools::max_value() - fabs(prev)) / fact < fabs(current)) + if((tools::max_value() - fabs(prev)) < fabs(fact) * fabs(current)) { prev /= current; scale /= current; " Bugs closed To Be Determined math Boost Development Trunk Showstopper fixed