Opened 6 years ago

Closed 4 years ago

#810 closed defect (fixed)

J1(x) returns NaN for x << 0

Reported by: pkienzle Owned by:
Priority: minor Milestone: SasView Next Release +1
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing


The cephes math function for J1 in lib/sas_J1.c returns NaN for values of x << 0.

Mathematica says J1(-x) = -J1(x) ( The series expansion as given in the DLMF ( supports this.

The code in sas_J1.c is the same as that in the cephes library, so rather than a translation error, it appears to be an error in the cephes library itself.

Change History (1)

comment:1 Changed 4 years ago by pkienzle

  • Resolution set to fixed
  • Status changed from new to closed

This looks like it has been fixed.

The code in sasmodels/models/lib/sas_J1.c says:

    // 2017-05-18 PAK - mathematica and mpmath use J1(-x) = -J1(x)
Note: See TracTickets for help on using tickets.