summaryrefslogtreecommitdiff
path: root/boost/math/special_functions/ellint_3.hpp
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
commit08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/math/special_functions/ellint_3.hpp
parentbb4dd8289b351fae6b55e303f189127a394a1edd (diff)
downloadboost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/math/special_functions/ellint_3.hpp')
-rw-r--r--boost/math/special_functions/ellint_3.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/boost/math/special_functions/ellint_3.hpp b/boost/math/special_functions/ellint_3.hpp
index f63bb2d4b0..ac7e68c17f 100644
--- a/boost/math/special_functions/ellint_3.hpp
+++ b/boost/math/special_functions/ellint_3.hpp
@@ -18,6 +18,7 @@
#pragma once
#endif
+#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/special_functions/ellint_rf.hpp>
#include <boost/math/special_functions/ellint_rj.hpp>
#include <boost/math/special_functions/ellint_1.hpp>
@@ -26,6 +27,7 @@
#include <boost/math/constants/constants.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/tools/workaround.hpp>
+#include <boost/math/special_functions/round.hpp>
// Elliptic integrals (complete and incomplete) of the third kind
// Carlson, Numerische Mathematik, vol 33, 1 (1979)
@@ -182,14 +184,14 @@ T ellint_pi_imp(T v, T phi, T k, T vc, const Policy& pol)
}
else
{
- T rphi = boost::math::tools::fmod_workaround(T(fabs(phi)), T(constants::pi<T>() / 2));
- T m = floor((2 * fabs(phi)) / constants::pi<T>());
+ T rphi = boost::math::tools::fmod_workaround(T(fabs(phi)), T(constants::half_pi<T>()));
+ T m = boost::math::round((fabs(phi) - rphi) / constants::half_pi<T>());
int sign = 1;
if(boost::math::tools::fmod_workaround(m, T(2)) > 0.5)
{
m += 1;
sign = -1;
- rphi = constants::pi<T>() / 2 - rphi;
+ rphi = constants::half_pi<T>() - rphi;
}
T sinp = sin(rphi);
T cosp = cos(rphi);