K_v(x)

I have just wasted about three hours of sunday afternoon trying to compute a modified bessel function of second kind of fractional order (also known as hyperbolic Bessel function). I hope that this tiny C++ snippet will be googlable, and it will save a few minutes of someone’s live:

#include <boost/math/special_functions/bessel.hpp>
#include

(…)

double v = 5.0/3.0; /* an order of Bessel function */
double x = 2.5; /* an argument of bessel function */
double r; /* will contain a value */

r = boost::math::cyl_bessel_k(v, x);
std::cout<<r<<std::endl;

Just in case someone is interested what is a modified Bessel function, this is an integral representation of Bessel funtion of order v:

You May Also Like

Confitura 2013 afterthoughts

Confitura, the biggest free-of-charge Java conference in Europe, took place on the 6th of July in Warsaw. TouK's presence was heavy, with 5 separate talks, all chosen in call for papers, no sponsored bullshit. We were sponsoring deck chairs during the...Confitura, the biggest free-of-charge Java conference in Europe, took place on the 6th of July in Warsaw. TouK's presence was heavy, with 5 separate talks, all chosen in call for papers, no sponsored bullshit. We were sponsoring deck chairs during the...