This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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<-------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]