Skip to content

cyl_bessel_j returns nan for large arguments on gcc #1278

@matwey

Description

@matwey

Hello, I am running gcc 14.2.1 (gcc 7 and 13 behaves consistently) and boost 1.87.

I've found that the following code returns nan when compiled with -O3 -funsafe-math-optimizations:

using value_type = double;

value_type x = 0x1.0p64;

using namespace boost::math;

std::cerr << cyl_bessel_j(0, x) << std::endl;
std::cerr << cyl_bessel_j(1, x) << std::endl;
std::cerr << cyl_bessel_j(2, x) << std::endl;

When I use clang with the same arguments, the result seems to be correct.

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