Skip to content

Spurious underflow in cyl_bessel_k #1229

Closed

Description

@jzmaddock

cyl_bessel_k(100, 746) returns zero when evaluating at double precision (with no extended long double type), but the result should be 9.49147e-66.

Underflow occurs in k0 and k1 prior to iteration. The problem is also present if v is perturbed to be a non-integer in which case CF2_ik underflows.

Reduced test case from #1228.

Activity

  1. NAThompson commented on Sep 1, 2026

    @NAThompson
    Collaborator

    @jzmaddock : On wolfram alpha I get ~3e-323, which is a denormal.

  2. jzmaddock commented on Sep 2, 2026

    @jzmaddock
    CollaboratorAuthor

    Correction, try:

    cyl_bessel_k(-1000, 746)

    We underflow to zero, wolfram gives 3.365e-67.

  3. added 2 commits that reference this issue on Sep 4, 2026
    35acb9c
    6dc527e
  4. added a commit that references this issue on Sep 11, 2026
    c69941b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions