#include <gsl/gsl_sf_expint.h>
#include <gsl/gsl_errno.h>

/* function names generated by removing  "gsl_sf" from the beginning
   of the name.  Thus gsl_sf_expint_W0 goes to expint_W0. */


void expint_E1_e(const double *x, const int *len, double *val, double *err, int *status)
{
  int i;
  gsl_sf_result result;
  gsl_set_error_handler_off();
  
  for(i = 0; i< *len ; i++){
    status[i] = gsl_sf_expint_E1_e(x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;
  }
}  

void expint_E2_e(const double *x, const int *len, double *val, double *err, int *status)
{
  int i;
  gsl_sf_result result;
  gsl_set_error_handler_off();
  
  for(i = 0; i< *len ; i++){
    status[i] = gsl_sf_expint_E2_e(x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;
  }
}


void expint_En_e(const int *n, const double *x, const int *len, double *val, double *err, int *status)
{
  int i;
  gsl_sf_result result;
  gsl_set_error_handler_off();
  
  for(i = 0; i< *len ; i++){
	  status[i] = gsl_sf_expint_En_e(n[i], x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;
  }
}

void expint_Ei_e(const double *x, const int *len, double *val, double *err, int *status)
{
  int i;
  gsl_sf_result result;
  gsl_set_error_handler_off();
  
  for(i = 0; i< *len ; i++){
    status[i] = gsl_sf_expint_Ei_e(x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;
  }
}

void Shi_e(const double *x, const int *len, double *val, double *err, int *status)
{
  int i;
  gsl_sf_result result;
  gsl_set_error_handler_off();
  
  for(i = 0; i< *len ; i++){
    status[i] = gsl_sf_Shi_e(x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;
  }
}



void Chi_e(const double *x, const int *len, double *val, double *err, int *status)
{
  int i;
  gsl_sf_result result;
  gsl_set_error_handler_off();
  
  for(i = 0; i< *len ; i++){
    status[i] = gsl_sf_Chi_e(x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;
  }
}



void expint_3_e(const double *x, const int *len, double *val, double *err, int *status)
{
  int i;
  gsl_sf_result result;
  gsl_set_error_handler_off();
  
  for(i = 0; i< *len ; i++){
    status[i] = gsl_sf_expint_3_e(x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;
  }
}

void Si_e(const double *x, const int *len, double *val, double *err, int *status)
{
  int i;
  gsl_sf_result result;
  gsl_set_error_handler_off();
  
  for(i = 0; i< *len ; i++){
    status[i] = gsl_sf_Si_e(x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;
  }
}

void Ci_e(const double *x, const int *len, double *val, double *err, int *status)
{
  int i;
  gsl_sf_result result;
  gsl_set_error_handler_off();
  
  for(i = 0; i< *len ; i++){
    status[i] = gsl_sf_Ci_e(x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;
  }
}

void atanint_e(const double *x, const int *len, double *val, double *err, int *status)
{
  int i;
  gsl_sf_result result;
  gsl_set_error_handler_off();

  for(i = 0; i< *len ; i++){
    status[i] = gsl_sf_atanint_e(x[i] , &result) ;
    val[i] = result.val;
    err[i] = result.err;
  }
}



