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

Hyperbolic function returns incorrect result #9460

Closed
Michael-Daugherty opened this issue Feb 3, 2021 · 6 comments
Closed

Hyperbolic function returns incorrect result #9460

Michael-Daugherty opened this issue Feb 3, 2021 · 6 comments
Labels
Issue-Bug Something isn't working Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. Run-Plugin Things that relate with PowerToys Run's plugin interface

Comments

@Michael-Daugherty
Copy link

Michael-Daugherty commented Feb 3, 2021

ℹ Computer information

  • PowerToys version: v0.31.1
  • PowerToy Utility: Run
  • Running PowerToys as Admin: Yes
  • Windows build number: 2004 (OS Build 21301.1010)
    📝 Provide detailed reproduction steps:
    Alt Space sinh(.9999999999999999999)
    ✔️ Expected result:
    1.175201193
    ❌ Actual result:
    0.0038758297
@Michael-Daugherty Michael-Daugherty added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Feb 3, 2021
@enricogior enricogior added Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface labels Feb 5, 2021
@crutkas
Copy link
Member

crutkas commented Feb 5, 2021

I cut and paste and got the correct result. Even just hitting .9s Eventually you'll hit a precision issue with the mage plugin but that is a known issue.
image

@crutkas crutkas closed this as completed Feb 5, 2021
@crutkas crutkas reopened this Feb 5, 2021
@crutkas crutkas added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Feb 5, 2021
@crutkas
Copy link
Member

crutkas commented Feb 5, 2021

@Michael-Daugherty can you take a screenshot?

@Michael-Daugherty
Copy link
Author

Michael-Daugherty commented Feb 6, 2021

Sorry, It needs one more nine to produce the error as follows:
📝 Provide detailed reproduction steps:
Alt Space sinh(.99999999999999999999)
✔️ Expected result:
1.175201193
❌ Actual result:
0.0777408905

Screen Shot

@ghost ghost added Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Feb 6, 2021
@Michael-Daugherty
Copy link
Author

Michael-Daugherty commented Feb 6, 2021

I know 20 digits of precision is stupid. But that's not the point. Something is wrong with the algorithm causing this discontinuous result. Possibly, truncate the input at 19 before doing the trig function. I'm a mechanical engineer, not a computer scientist or mathematician.

@crutkas
Copy link
Member

crutkas commented Feb 19, 2021

it is a floating point precision issue. We don't control the calc library and just blindly send data to it. Once the precision gets above a precision, you get what is basically a casting error. Betting it casts to float vs double.

When we shift to the calculator's engine, this (famous last words) should be fixed.

@crutkas
Copy link
Member

crutkas commented Feb 19, 2021

#2265 is the tracking item for calc engine

@crutkas crutkas closed this as completed Feb 19, 2021
@crutkas crutkas added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Team-Response An issue author responded so the team needs to follow up Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. Run-Plugin Things that relate with PowerToys Run's plugin interface
Projects
None yet
Development

No branches or pull requests

3 participants