please use boost::math::constants::pi<double>() instead of M_PI