pyexpint/expint.cpp
/**
 * Special cases for generalized exponential integral with double nu.
 * iflag return 1 if special case is detected, otherwise 0.
 */
Special cases for generalized exponential integral with double nu.
iflag return 1 if special case is detected, otherwise 0.
Special cases for generalized exponential integral with double nu . iflag return 1 if special case is detected otherwise 0 .
void expint_v_special_cases(const double v, const double x, int *iflag,
    double *result) 
{
  double sqrt_x;
  if (x == 0.0) 
  {
    if (v <= 1.0)   
      *result = INF;
    else
      *result = 1.0 / (v - 1.0);
    *iflag = 1;
  }
  if (v == 0.5 && x < 10.0) 
  {
    sqrt_x = sqrt(x);
    *result = SQRT_PI * erfc(sqrt_x) / sqrt_x;
    *iflag = 1;
  }
}
void expint_v_special_cases ( const double v , const double x , int * iflag , double * result ) { double sqrt_x ; if ( x == 0.0 ) { if ( v <= 1.0 ) * result = INF ; else * result = 1.0 / ( v - 1.0 ) ; * iflag = 1 ; } if ( v == 0.5 && x < 10.0 ) { sqrt_x = sqrt ( x ) ; * result = SQRT_PI * erfc ( sqrt_x ) / sqrt_x ; * iflag = 1 ; } }
Special cases for generalized exponential integral with double nu.
Special cases for generalized exponential integral with double nu .
// x == 0 // exponential integral is not defined // case v = 1/2 // x >= 10 some loss of digits is observed