pyexpint/expint.cpp
/**
 * Special cases for generalized exponential integral with integer nu.
 * iflag return 1 if special case is detected, otherwise 0.
 */
Special cases for generalized exponential integral with integer nu.
iflag return 1 if special case is detected, otherwise 0.
Special cases for generalized exponential integral with integer nu . iflag return 1 if special case is detected otherwise 0 .
void expint_n_special_cases(const int n, const double x, int *iflag,
    double *result) 
{
  if (x == 0.0) 
  {
    if (n <= 1) 
      *result = INF;
    else
      *result =  1.0 / (n - 1);
    *iflag = 1;
  }
  if (n == 0) 
  {
    *result = exp(-x) / x;
    *iflag = 1;
  }
  if (n == 1) 
  {
    if (x > 0.9 && x < 10.0) 
    {
      *result = expinte1(x);
      *iflag = 1;
    }
  }
}
void expint_n_special_cases ( const int n , const double x , int * iflag , double * result ) { if ( x == 0.0 ) { if ( n <= 1 ) * result = INF ; else * result = 1.0 / ( n - 1 ) ; * iflag = 1 ; } if ( n == 0 ) { * result = exp ( - x ) / x ; * iflag = 1 ; } if ( n == 1 ) { if ( x > 0.9 && x < 10.0 ) { * result = expinte1 ( x ) ; * iflag = 1 ; } } }
Special cases for generalized exponential integral with integer nu.
Special cases for generalized exponential integral with integer nu .
// x == 0 // exponential integral is not defined // case n == 0 // case n == 1