Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix promotions with irrationals #259

Merged
merged 3 commits into from
Sep 25, 2023
Merged

Fix promotions with irrationals #259

merged 3 commits into from
Sep 25, 2023

Conversation

devmotion
Copy link
Member

This PR shows what I had in mind when commenting on #258.

Should fix #156 but is quickly typed on my mobile phone and untested.

@prbzrg
Copy link

prbzrg commented Sep 24, 2023

There's a way that already exist:

s = sum(log, d.σ)
return length(d) * (1 + oftype(s, log2π)) / 2 + s

Thanks for the idea, I updated my PR. my goal is the issue to be fixed; feel free to close my PR.

@devmotion
Copy link
Member Author

I'm currently AFK but I'll finalize the PR (and eg add tests) tonight. Then we should be able to merge and release the fix within the next few days.

Copy link
Member

@yebai yebai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @devmotion!

@devmotion devmotion merged commit b7c2184 into master Sep 25, 2023
14 of 15 checks passed
@delete-merged-branch delete-merged-branch bot deleted the dw/irrationals branch September 25, 2023 22:26
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.

Unwanted type promotion from Float32 to Float64 while calculating logpdf of TuringDiagMvNormal
3 participants