Skip to content

<random>: Consider using Boost.Math's lgamma() implementation #5914

Description

<random>'s poisson_distribution and binomial_distribution need a "log gamma" function. In #5891, I made them use the UCRT's C99 lgamma() instead of the STL's _XLgamma(). (While _XLgamma() had to be retained for bincompat, I replaced its terrible implementation with UCRT lgamma() too.)

Boost.Math has an even more accurate implementation of lgamma(). In theory, we could switch the STL's _XLgamma() over to wrapping Boost.Math, and then begin calling it again.

As _XLgamma() is compiled into the STL's original DLL and static LIB, I believe this is blocked by #362. We need the ability to change Boost.Math's standalone namespace to avoid conflicting with user Boost usage. This problem is annoying for Special Math but would be more severe if we introduced it into the STL's original static LIB.

Activity

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

    enhancementSomething can be improvedwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions