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

exp(89.0f) is NaN #14

Open
reunanen opened this issue Aug 30, 2024 · 4 comments · May be fixed by #15
Open

exp(89.0f) is NaN #14

reunanen opened this issue Aug 30, 2024 · 4 comments · May be fixed by #15

Comments

@reunanen
Copy link

A comment in the header states:
exp(88.722839f) = inf ; 0x42b17218

This is indeed the result I'm seeing.

However, at least on my machine exp(89.0f) is NaN and not inf, and that's causing a problem in my use case.

@reunanen
Copy link
Author

NB: I'm not using Xbyak.

@reunanen
Copy link
Author

I think the problem is that here, limit is the input value (x) rounded to an integer (such as 89), and it's compared to 0x42b00000 that is a very large integer (so basically we never go to the clamping code guarded by this if statement). I think it's quite clear that this is an apples-to-oranges comparison... I think I understand what the general intent here has been, but to me it seems that there's just a simple bug.

reunanen added a commit to reunanen/fmath that referenced this issue Aug 30, 2024
@reunanen reunanen linked a pull request Aug 30, 2024 that will close this issue
@herumi
Copy link
Owner

herumi commented Sep 2, 2024

Thank you for the report.
I will merge the patches, but I'm busy at work now, so please wait a moment.

@reunanen
Copy link
Author

reunanen commented Sep 2, 2024

Yeah, no rush from my side!

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 a pull request may close this issue.

2 participants