id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 7290,complex acos is occasionally wrong,Stephen Montgomery-Smith ,John Maddock,"I am finding that the acos function is getting some of them wrong. For example, your program evaluates acos(1.00000002785941 + I*5.72464869028403e-200) as 0 - I*0.000236048349018331 whereas it should be 2.42520172707401e-196 - I*0.000236048349018331. Looking at http://www.boost.org/doc/libs/1_51_0/boost/math/complex/acos.hpp, I am somewhat sure that the mistake is in the last line of this code fragment: // // This is the Hull et al exception handling code from Fig 6 of their paper: // if(y <= (std::numeric_limits::epsilon() * std::fabs(xm1))) { if(x < one) { real = std::acos(x); imag = y / std::sqrt(xp1*(one-x)); } else { real = 0; For asin, setting real = half_pi does just fine. But for acos, real should be something extremely small, but definitely not 0.",Bugs,closed,To Be Determined,math,Boost 1.52.0,Problem,fixed,,