Hello,
I’m using the tanh-sinh integrator to integrate a simple function f(x) = 0.26*x from 3.0 to 4.0.
The exact result is 0.91. With the integrator I’m getting a result accurate to only 10^-18 with cpp_bin_float_100 multiprecision.
typedef boost::multiprecision::cpp_bin_float_100 Real;
int main(int argc, char **argv)
{
using namespace boost::math::quadrature;
using namespace std::placeholders;
tanh_sinh<Real> integrator;
auto f2 = [](Real x) {
Real a = 0.26;
return x*a;
};
std::cout << std::setprecision(std::numeric_limits<Real>::max_digits10)
<< "Comp.: " << integrator.integrate(f2, (Real) 3.0, (Real) 4.0) << std::endl;
return 0;
}