X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Fboost%2Fmath%2Fquadrature%2Ftanh_sinh.hpp;h=5c63e0466bdde4f36a77daf43f3cbcfdd4e236b0;hb=20effc670b57271cb089376d6d0800990e5218d5;hp=25c65111deac4a9033c66f03ddd3d06a429505d7;hpb=92f5a8d42d07f9929ae4fa7e01342fe8d96808a8;p=ceph.git diff --git a/ceph/src/boost/boost/math/quadrature/tanh_sinh.hpp b/ceph/src/boost/boost/math/quadrature/tanh_sinh.hpp index 25c65111d..5c63e0466 100644 --- a/ceph/src/boost/boost/math/quadrature/tanh_sinh.hpp +++ b/ceph/src/boost/boost/math/quadrature/tanh_sinh.hpp @@ -113,6 +113,10 @@ auto tanh_sinh::integrate(const F f, Real a, Real b, Real toleranc { *L1 *= 2; } + if (error) + { + *error *= 2; + } return Q; } @@ -140,14 +144,22 @@ auto tanh_sinh::integrate(const F f, Real a, Real b, Real toleranc { *L1 *= 2; } + if (error) + { + *error *= 2; + } return Q; } if ((boost::math::isfinite)(a) && (boost::math::isfinite)(b)) { - if (b <= a) + if (a == b) + { + return result_type(0); + } + if (b < a) { - return policies::raise_domain_error(function, "Arguments to integrate are in wrong order; integration over [a,b] must have b > a.", a, Policy()); + return -this->integrate(f, b, a, tolerance, error, L1, levels); } Real avg = (a + b)*half(); Real diff = (b - a)*half(); @@ -181,7 +193,7 @@ auto tanh_sinh::integrate(const F f, Real a, Real b, Real toleranc return f(diff * (avg_over_diff_m1 - zc)); position = a - diff * zc; } - if (z > 0.5) + else if (z > 0.5) { if(have_small_right) return f(diff * (avg_over_diff_p1 - zc)); @@ -199,6 +211,10 @@ auto tanh_sinh::integrate(const F f, Real a, Real b, Real toleranc { *L1 *= diff; } + if (error) + { + *error *= diff; + } return Q; } } @@ -237,6 +253,10 @@ auto tanh_sinh::integrate(const F f, Real a, Real b, Real toleranc { *L1 *= diff; } + if (error) + { + *error *= diff; + } return Q; } return policies::raise_domain_error(function, "The domain of integration is not sensible; please check the bounds.", a, Policy());