pyexpint/expint.cpp
/**
 * Algorithm for the generalized exponential integral with integer nu
 */
Algorithm for the generalized exponential integral with integer nu
Algorithm for the generalized exponential integral with integer nu
double expint_n(const int n, const double x)
{
  int iflag = 0;
  double result = 0.0;
  expint_n_special_cases(n, x, &iflag, &result);
  if (iflag) return result;
  if (x <= 1.5 && n < 20)
    return expint_series_n(n, x);
  else if (x <= 2.0 && n <= 10)
    return expint_series_n_x_le_2(n, x);
  else if (n >= x)
    return expint_large_v(n, x);
  else
    return expint_large_x(n, x);
}
double expint_n ( const int n , const double x ) { int iflag = 0 ; double result = 0.0 ; expint_n_special_cases ( n , x , & iflag , & result ) ; if ( iflag ) return result ; if ( x <= 1.5 && n < 20 ) return expint_series_n ( n , x ) ; else if ( x <= 2.0 && n <= 10 ) return expint_series_n_x_le_2 ( n , x ) ; else if ( n >= x ) return expint_large_v ( n , x ) ; else return expint_large_x ( n , x ) ; }
Algorithm for the generalized exponential integral with integer nu
Algorithm for the generalized exponential integral with integer nu
// special cases // small x // use series expansion in terms of E1(x) to avoid many iterations // laguerre series