Skip to content

Disable fast math#971

Open
lbittarello wants to merge 2 commits intomainfrom
lb-fast-math-1
Open

Disable fast math#971
lbittarello wants to merge 2 commits intomainfrom
lb-fast-math-1

Conversation

@lbittarello
Copy link
Member

@lbittarello lbittarello commented Feb 6, 2026

In certain systems, our compiled functions occasionally produce nonsense when inputs are invalid. For example, glum.TweedieDistribution(1.5).deviance([0], [0]) might put out -2 instead of NaN. It turns out that fast math causes the compiler to make assumptions that break down when inputs are invalid.

This PR proposes two changes:

  • Disable fast math to improve accuracy.
  • Add the cpow flag, so that exponentiation doesn't generate complex numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant