bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] Re: bug in gsl_sf_legendre_sphPlm_array


From: Brian Gough
Subject: [Bug-gsl] Re: bug in gsl_sf_legendre_sphPlm_array
Date: Mon, 11 Oct 2004 15:14:23 +0100

MAGNEVILLE Christophe writes:
 > > Thanks for the email.  Can you send an example program which
 > > reproduces the problem using a known result --- either analytically, or
 > > computed to high precision using a symbolic algebra program.  Thanks.
 > 
 > I already gave you an example program in my bug-report mail.
 > In case you missed it, please find the code below:
 > 

Thanks, I've logged the problem (an internal underflow) in our BUGS
file.

Incidentally, it helps if any example programs include the necessary
header files, as this is more reproducible and saves us having to add
them manually.

-- 
Brian Gough


----------------------------------------------------------------------
BUG#26 - underflow in gsl_sf_legendre_sphPlm_array

there is a potential underflow in legendre_poly.c in the lines

      lnpre = -0.25*M_LNPI + 0.5 * (lnpoch.val + m*lncirc.val);
      y_mm   = sqrt((2.0+1.0/m)/(4.0*M_PI)) * sgn * exp(lnpre);

for large negative values of lnpre.

  #include <math.h>
  #include <stdio.h>
  #include <gsl/gsl_sf.h>

  int main (void) {
   int lmax=2000, l=1997, m=796;
   double Xlm[2005];
   double cx = 0.921;
   int status = gsl_sf_legendre_sphPlm_array(lmax,m,cx,Xlm);
   double v = Xlm[l-m];
   printf("cx= %.5e l=%d m=%d  Plm=%.18e status=%d\n",cx,l,m,v, status);
  }

----------------------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]