[suggestion] for gsl_sf_Ci_e (in specfunc/sinint.c)

Arvid Requate arvid@Physik.Uni-Bielefeld.DE
Wed Dec 19 13:20:00 GMT 2001


Hello,

while using the special function routine gsl_sf_Ci_e, I noticed
that given an argument of zero it aborts with an error, while mathematically it
should simply return zero.

Kind regards
	Arvid Requate

Diff against current CVS Version:
-----------8<--------------------8<------------------------8<-------------------
*** specfunc-old/sinint.c       Tue May 29 13:02:36 2001
--- specfunc/sinint.c   Tue May 29 13:09:52 2001
***************
*** 354,363 ****
  {
    /* CHECK_POINTER(result) */
  
!   if(x <= 0.0) {
      result->val = 0.0;
      result->err = 0.0;
      GSL_ERROR ("error", GSL_EDOM);
    }
    else if(x <= 4.0) {
      const double lx = log(x);
--- 354,368 ----
  {
    /* CHECK_POINTER(result) */
  
!   if(x < 0.0) {
      result->val = 0.0;
      result->err = 0.0;
      GSL_ERROR ("error", GSL_EDOM);
+   }
+   else if(x == 0.0) {
+     result->val = 0.0;
+     result->err = 0.0;
+     return GSL_SUCCESS;
    }
    else if(x <= 4.0) {
      const double lx = log(x);
-----------8<--------------------8<------------------------8<-------------------



More information about the Gsl-discuss mailing list