Follow-up Comment #1, bug #29606 (project gsl):

From: [email protected] Jason Detwiler 
To:  <[email protected]> 
Date: Tue, 21 Aug 2012 03:07:47 -0500 
Subject: [Bug-gsl] gsl_sf_coupling_6j still missing triad sum check 
 
Dear GNU developers,

I just re-encountered a two-year old bug in the calculation of
Wigner's 6-j (and, hence, 9-J) symbols. The original bug report is
here, from v1.13:

https://savannah.gnu.org/bugs/?29606

It is still unfixed in 1.15. The problem is that the routine fails to
check whether the each triad that passes the triangle selection also
have an even sum.I suggest fixing this by changing this block starting
at line 205 of specfunc/coupling.c from:

  else if(   triangle_selection_fails(two_ja, two_jb, two_jc)
          || triangle_selection_fails(two_ja, two_je, two_jf)
          || triangle_selection_fails(two_jb, two_jd, two_jf)
          || triangle_selection_fails(two_je, two_jd, two_jc)
     ) {
    result->val = 0.0;
    result->err = 0.0;
    return GSL_SUCCESS;
  }

to:

  else if(   triangle_selection_fails(two_ja, two_jb, two_jc)
          || ((two_ja + two_jb + two_jc) % 2)
          || triangle_selection_fails(two_ja, two_je, two_jf)
          || ((two_ja + two_je + two_jf) % 2)
          || triangle_selection_fails(two_jb, two_jd, two_jf)
          || ((two_jb + two_jd + two_jf) % 2)
          || triangle_selection_fails(two_je, two_jd, two_jc)
          || ((two_je + two_jd + two_jc) % 2)
     ) {
    result->val = 0.0;
    result->err = 0.0;
    return GSL_SUCCESS;
  }

Thank you,
Jason Detwiler

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29606>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


Reply via email to