...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
#include <boost/math/special_functions/bessel_prime.hpp>
template <class T1, class T2> calculated-result-type cyl_bessel_j_prime(T1 v, T2 x); template <class T1, class T2, class Policy> calculated-result-type cyl_bessel_j_prime(T1 v, T2 x, const Policy&); template <class T1, class T2> calculated-result-type cyl_neumann_prime(T1 v, T2 x); template <class T1, class T2, class Policy> calculated-result-type cyl_neumann_prime(T1 v, T2 x, const Policy&); template <class T1, class T2> calculated-result-type cyl_bessel_i_prime(T1 v, T2 x); template <class T1, class T2, class Policy> calculated-result-type cyl_bessel_i_prime(T1 v, T2 x, const Policy&); template <class T1, class T2> calculated-result-type cyl_bessel_k_prime(T1 v, T2 x); template <class T1, class T2, class Policy> calculated-result-type cyl_bessel_k_prime(T1 v, T2 x, const Policy&); template <class T1, class T2> calculated-result-type sph_bessel_prime(T1 v, T2 x); template <class T1, class T2, class Policy> calculated-result-type sph_bessel_prime(T1 v, T2 x, const Policy&); template <class T1, class T2> calculated-result-type sph_neumann_prime(T1 v, T2 x); template <class T1, class T2, class Policy> calculated-result-type sph_neumann_prime(T1 v, T2 x, const Policy&);
These functions return the first derivative with respect to x of the corresponding Bessel function.
The return type of these functions is computed using the result type calculation rules when T1 and T2 are different types. The functions are also optimised for the relatively common case that T1 is an integer.
The final Policy argument is optional and can be used to control the behaviour of the function: how it handles errors, what level of precision to use etc. Refer to the policy documentation for more details.
The functions return the result of domain_error whenever the result is undefined or complex.
There are two sets of test values: spot values calculated using wolframalpha.com, and a much larger set of tests computed using a relation to the underlying Bessel functions that the implementation does not use.
The accuracy of these functions is broadly similar to the underlying Bessel functions. Refer to those functions for more information.
In the general case, the derivatives are calculated using the relations:
There are also a number of special cases, for large x we have:
And for small x: