bugGNU Octave - Bugs: bug #48316, besselj gives NaN for moderately...


bug #48316: besselj gives NaN for moderately large inputs (1e10)

Submitted by:  Colin Macdonald <cbm>
Submitted on:  Sun Jun 26 05:55:18 2016  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: Any

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Thu Jun 30 19:44:31 2016, comment #2:

Scipy appears to use a combination of the amos library and the cephes bessel functions (http://www.netlib.org/cephes/).

Mike Miller <mtmiller>
Project Administrator
Thu Jun 30 19:35:48 2016, comment #1:

Changing status to confirmed, and adding some details from the mailing list (http://thread.gmane.org/gmane.comp.gnu.octave.maintainers/46617).

The bessel functions come from the amos library (http://netlib.org/amos/) which is embedded in liboctave, so any numerical problems are inherited from that implementation.

Mike Miller <mtmiller>
Project Administrator
Sun Jun 26 05:55:18 2016, original submission:

Octave gives "besselj(1, 1e10)" as "NaN + NaNI".


Symbolic pkg, converted to double:

The relative accuracy is fine before blow-up:

(Ironically, I found this when I went looking for a function with good relative error behaviour even though it decays to zero! viz., #48307)

Colin Macdonald <cbm>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by cbm (Submitted the item)
  • -unavailable- added by cbm

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Nov 16 18:31:41 2016mtmillerOperating SystemOther=>Any
    Thu Jun 30 19:35:48 2016mtmillerStatusNone=>Confirmed
    Sun Jun 26 05:55:18 2016cbmCarbon-Copy-=>Added sebald

    Back to the top

    Powered by Savane 3.1-cleanup1