Lines Matching refs:Real
33 typedef typename Complex::value_type Real; in test_complex_bessel() typedef
37 auto bessel_integrand = [&n, &z](Real theta)->Complex in test_complex_bessel()
41 Real t1 = sin(theta); in test_complex_bessel()
42 Real t2 = - n*theta; in test_complex_bessel()
44 return cos(arg)/pi<Real>(); in test_complex_bessel()
49 Real a = 0; in test_complex_bessel()
50 Real b = pi<Real>(); in test_complex_bessel()
51 Complex Jnz = trapezoidal<decltype(bessel_integrand), Real>(bessel_integrand, a, b); in test_complex_bessel()
55 …Real Jnzx = boost::lexical_cast<Real>("1.257674591970511077630764085052638490387449039392695959943… in test_complex_bessel()
56 …Real Jnzy = boost::lexical_cast<Real>("2.318771368505683055818032722011594415038779144567369903204… in test_complex_bessel()
57 Real tol = 10*std::numeric_limits<Real>::epsilon(); in test_complex_bessel()
66 typedef typename Complex::value_type Real; in test_I0_complex() typedef
69 auto I0 = [&z](Real theta)->Complex in test_I0_complex()
73 return exp(z*cos(theta))/pi<Real>(); in test_I0_complex()
78 Real a = 0; in test_I0_complex()
79 Real b = pi<Real>(); in test_I0_complex()
80 Complex I0z = trapezoidal<decltype(I0), Real>(I0, a, b); in test_I0_complex()
84 …Real I0zx = boost::lexical_cast<Real>("-1.24923487960742219637619681391438589436703710701063561548… in test_I0_complex()
85 …Real I0zy = boost::lexical_cast<Real>("0.947983792057734776114060623981442199525094227418764823692… in test_I0_complex()
86 Real tol = 10*std::numeric_limits<Real>::epsilon(); in test_I0_complex()
96 typedef typename Complex::value_type Real; in test_erfc() typedef
100 auto erfc = [&z](Real theta)->Complex in test_erfc()
104 Real t = tan(theta/2); in test_erfc()
106 return exp(arg)/two_pi<Real>(); in test_erfc()
111 Real a = -pi<Real>(); in test_erfc()
112 Real b = pi<Real>(); in test_erfc()
113 …Complex erfcz = trapezoidal<decltype(erfc), Real>(erfc, a, b, boost::math::tools::root_epsilon<Rea… in test_erfc()
117 …Real erfczx = boost::lexical_cast<Real>("-0.003606342725651750912911828205419142355329285365950566… in test_erfc()
118 …Real erfczy = boost::lexical_cast<Real>("-0.011259006028815025076400915631648224853665159881988216… in test_erfc()
119 Real tol = 5000*std::numeric_limits<Real>::epsilon(); in test_erfc()
125 template<class Real>
128 …y the adaptive trapezoidal routine on type " << boost::typeindex::type_id<Real>().pretty_name() <… in test_constant()
130 auto f = [](Real)->Real { return boost::math::constants::half<Real>(); }; in test_constant() argument
131 Real Q = trapezoidal<decltype(f), Real>(f, (Real) 0.0, (Real) 10.0); in test_constant()
132 BOOST_CHECK_CLOSE(Q, 5.0, 100*std::numeric_limits<Real>::epsilon()); in test_constant()
133 Q = trapezoidal<decltype(f), Real>(f, (Real) 10.0, (Real) 0.0); in test_constant()
134 BOOST_CHECK_CLOSE(Q, -5.0, 100*std::numeric_limits<Real>::epsilon()); in test_constant()
136 Q = trapezoidal<decltype(f), Real>(f, (Real) 10.0, (Real) 10.0); in test_constant()
137 BOOST_CHECK_CLOSE(Q, Real(0), 100*std::numeric_limits<Real>::epsilon()); in test_constant()
141 template<class Real>
146 …ated correctly by trapezoidal rule on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_rational_periodic()
148 auto f = [](Real x)->Real { return 1/(5 - 4*cos(x)); }; in test_rational_periodic()
150 Real tol = 100*boost::math::tools::epsilon<Real>(); in test_rational_periodic()
151 Real Q = trapezoidal(f, (Real) 0.0, two_pi<Real>(), tol); in test_rational_periodic()
153 BOOST_CHECK_CLOSE_FRACTION(Q, two_pi<Real>()*third<Real>(), 10*tol); in test_rational_periodic()
156 template<class Real>
159 …ated correctly by trapezoidal rule on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_bump_function()
160 auto f = [](Real x)->Real { in test_bump_function()
163 return (Real) 0; in test_bump_function()
165 return (Real) exp(-(Real) 1/(1-x*x)); in test_bump_function()
167 Real tol = boost::math::tools::epsilon<Real>(); in test_bump_function()
168 Real Q = trapezoidal(f, (Real) -1, (Real) 1, tol); in test_bump_function()
170 …Real Q_exp = boost::lexical_cast<Real>("0.44399381616807943782304892117055266376120178904569749730… in test_bump_function()
174 template<class Real>
177 …ated correctly by trapezoidal rule on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_zero_function()
178 auto f = [](Real)->Real { return (Real) 0;}; in test_zero_function() argument
179 Real tol = 100* boost::math::tools::epsilon<Real>(); in test_zero_function()
180 Real Q = trapezoidal(f, (Real) -1, (Real) 1, tol); in test_zero_function()
184 template<class Real>
187 … correctly by the trapezoidal rule on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_sinsq()
188 auto f = [](Real x)->Real { return sin(10*x)*sin(10*x); }; in test_sinsq()
189 Real tol = 100* boost::math::tools::epsilon<Real>(); in test_sinsq()
190 Real Q = trapezoidal(f, (Real) 0, (Real) boost::math::constants::pi<Real>(), tol); in test_sinsq()
191 BOOST_CHECK_CLOSE_FRACTION(Q, boost::math::constants::half_pi<Real>(), tol); in test_sinsq()
195 template<class Real>
199 … trapezoidal rule, even if slowly, on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_slowly_converging()
201 auto f = [](Real x)->Real { using std::sqrt; return sqrt(1 - x*x); }; in test_slowly_converging()
203 Real tol = sqrt(sqrt(boost::math::tools::epsilon<Real>())); in test_slowly_converging()
204 Real error_estimate; in test_slowly_converging()
205 Real Q = trapezoidal(f, (Real) 0, (Real) 1, tol, 15, &error_estimate); in test_slowly_converging()
206 BOOST_CHECK_CLOSE_FRACTION(Q, boost::math::constants::half_pi<Real>()/2, 10*tol); in test_slowly_converging()
209 template<class Real>
216 … correctly by the trapezoidal rule on type " << boost::typeindex::type_id<Real>().pretty_name() <<… in test_rational_sin()
217 Real a = 5; in test_rational_sin()
218 auto f = [=](Real x)->Real { using std::sin; Real t = a + sin(x); return 1.0f / (t*t); }; in test_rational_sin()
220 Real expected = two_pi<Real>()*a/pow(a*a - 1, 3*half<Real>()); in test_rational_sin()
221 Real tol = 100* boost::math::tools::epsilon<Real>(); in test_rational_sin()
222 Real Q = trapezoidal(f, (Real) 0, (Real) boost::math::constants::two_pi<Real>(), tol); in test_rational_sin()