/// Dawson integral. double dawson(double x) { gsl_sf_result result; int stat = gsl_sf_dawson_e(x, &result); if (stat != GSL_SUCCESS) { std::ostringstream msg("Error in dawson:"); msg << " x=" << x; throw std::runtime_error(msg.str()); } else return result.val; }
double gsl_sf_dawson(double x) { EVAL_RESULT(gsl_sf_dawson_e(x, &result)); }
static VALUE Dawson_dawson_e(VALUE self, VALUE x) { int ret; gsl_sf_result r; ret = gsl_sf_dawson_e(NUM2DBL(x), &r); return RESULT(&r); }
/** * C++ version of gsl_sf_dawson_e(). * Dawson's integral: * * Exp[-x^2] Integral[ Exp[t^2], {t,0,x}] * @param x A real number * @param result The result as a @c gsl::sf::result object * @return Error code on failure */ inline int dawson_e( double x, result& result ){ return gsl_sf_dawson_e( x, &result ); }