/// Complete elliptic integrals of the third kind. double comp_ellint_3(double k, double nu) { //double phi = M_PI / 2.0; const gsl_mode_t mode = GSL_PREC_DOUBLE; gsl_sf_result result; //int stat = gsl_sf_ellint_P_e(phi, k, nu, mode, &result); int stat = gsl_sf_ellint_Pcomp_e(k, nu, mode, &result); if (stat != GSL_SUCCESS) { std::ostringstream msg("Error in comp_ellint_3:"); msg << " k=" << k << " nu=" << nu; throw std::runtime_error(msg.str()); } else return result.val; }
/** * C++ version of gsl_sf_ellint_Pcomp_e(). * @param k A real number * @param n A real number * @param mode The mode * @param result The result as a @c gsl::sf::result object * @return Error code on failure */ inline int Pcomp_e( double k, double n, mode_t mode, result& result ){ return gsl_sf_ellint_Pcomp_e( k, n, mode, &result ); }