Directory: boost/math/special_functions/
Files: ellint_2.hpp
Inside function ellint_e_imp in file ellint_2.hpp there is a special branch at 74 line for case when k = 1. It seems the original idea was that in this case the expression in the integral becomes sqrt(1 - sin(phi)^2). Using trigonometry, it simplifies to sqrt(cos(phi)^2) which is always non-negative. However, it is wrong to substitute that expression with just cos(phi) which can be negative. Therefore it is a mistake to just replace integral with sine function in that case and intergal suddenly loses its monotonically increasing property.