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

Support dist^integer for negative values #2235

Merged
merged 2 commits into from Aug 21, 2023
Merged

Conversation

berekuk
Copy link
Collaborator

@berekuk berekuk commented Aug 20, 2023

Fixes #2052.

normal(-100, 1) ^ 2 -> ok
normal(-100, 1) ^ 2.5 -> complex number error

@berekuk berekuk requested a review from OAGr as a code owner August 20, 2023 00:45
@changeset-bot
Copy link

changeset-bot bot commented Aug 20, 2023

🦋 Changeset detected

Latest commit: 3254b77

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@quri/squiggle-lang Patch
@quri/squiggle-components Patch
@quri/prettier-plugin-squiggle Patch
vscode-squiggle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@berekuk berekuk temporarily deployed to Preview August 20, 2023 00:45 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Aug 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
quri-hub ⬜️ Ignored (Inspect) Visit Preview Aug 20, 2023 1:04am
quri-ui ⬜️ Ignored (Inspect) Visit Preview Aug 20, 2023 1:04am
squiggle-components ⬜️ Ignored (Inspect) Visit Preview Aug 20, 2023 1:04am
squiggle-website ⬜️ Ignored (Inspect) Visit Preview Aug 20, 2023 1:04am

@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Merging #2235 (1114d57) into main (803e27c) will increase coverage by 0.14%.
Report is 2 commits behind head on main.
The diff coverage is n/a.

❗ Current head 1114d57 differs from pull request most recent head 3254b77. Consider uploading reports for the commit 3254b77 to get more accurate results

@@            Coverage Diff             @@
##             main    #2235      +/-   ##
==========================================
+ Coverage   72.90%   73.04%   +0.14%     
==========================================
  Files         107      107              
  Lines        5347     5349       +2     
  Branches     1008     1026      +18     
==========================================
+ Hits         3898     3907       +9     
+ Misses       1442     1434       -8     
- Partials        7        8       +1     

see 6 files with indirect coverage changes

@berekuk berekuk temporarily deployed to Preview August 20, 2023 01:03 — with GitHub Actions Inactive
@berekuk
Copy link
Collaborator Author

berekuk commented Aug 20, 2023

Huh, it doesn't fail, but the output doesn't look correct either: https://squiggle-website-git-complex-erro-08a1ca-quantified-uncertainty.vercel.app/playground#code=eNqrVkpJTUsszSlxzk9JVbJSyssvyk3M0TDQMdRUiFMwUtJRKs7ILw8uzc1NLKpUsiopKk2tBQDGohFr

This looks like rendering issue, because samples bar is fine, so probably log KDE?

// ok when power is integer
testEvalToBe("normal(-100, 1) ^ 2", "Sample Set Distribution");
// fails when power is not an integer
testEvalToBe(
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know why this fails when it's not an integer? It works fine in the JS console. (3 ** 2.3)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It fails when base is negative, which shouldn't be surprising; consider (-1) ^ 0.5.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, makes sense

@OAGr
Copy link
Contributor

OAGr commented Aug 20, 2023

This looks like rendering issue, because samples bar is fine, so probably log KDE?
Yea, that seems very possible to me. Pity. It doesn't seem to happen too often, at least.

@berekuk berekuk merged commit 04c5577 into main Aug 21, 2023
8 checks passed
@berekuk berekuk deleted the complex-error-on-power-fix branch August 21, 2023 02:37
@github-actions github-actions bot mentioned this pull request Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Exponent returns bad error message about exponent
2 participants