Skip to content

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

  • Fixed procf function to accept any Real type for the s parameter instead of Float64
  • The previous s::Float64 type constraint caused a MethodError when using BigFloat with λ >= 6 (which triggers the ad_rand algorithm)
  • Added tests for BigFloat support to prevent regression

Testing

Tested interface compatibility with:

  • BigFloat: Now works correctly for all λ values (both count_rand for λ < 6 and ad_rand for λ >= 6)
  • JLArrays: Broadcasting works correctly - pois_rand.(JLArray([5.0, 10.0, 15.0])) returns a JLArray{Int64, 1}
  • Float32, Float16, Rational, Int: All work correctly
  • JET type stability analysis passes for both Float64 and BigFloat

Changes

  1. src/PoissonRandom.jl:85: Changed s::Float64 to s::Real in procf function signature
  2. test/runtests.jl: Added @testset "BigFloat support" with tests for:
    • count_rand with BigFloat (λ < 6)
    • ad_rand with BigFloat (λ >= 6)
    • Statistical validity with BigFloat

All existing tests continue to pass.

cc @ChrisRackauckas

🤖 Generated with Claude Code

claude and others added 2 commits December 30, 2025 06:36
The `procf` function had a hardcoded `s::Float64` type constraint that
caused a MethodError when using BigFloat with λ >= 6 (which uses the
ad_rand algorithm). Changed to `s::Real` to support arbitrary precision.

Added BigFloat tests to prevent regression.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas merged commit b31f223 into SciML:master Dec 30, 2025
11 of 13 checks passed
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.

3 participants