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

Update overflow bound in log1p(f) #606

Merged
merged 1 commit into from
Dec 6, 2024
Merged

Conversation

blapie
Copy link
Collaborator

@blapie blapie commented Dec 5, 2024

Checklist

  • I have read the contributing guidelines.
  • I have considered portability of my change across platforms and architectures.
  • I have self-reviewed my code.
  • I have commented my code where necessary.
  • I have updated the documentation accordingly.
  • I have added tests that prove my fix is effective or that my feature works.

What is the purpose of this pull request?

  • Fix a bug and add test to catch such issue in the future

What changes did you make?

This PR consists in fix overflow behaviour in log1p(f) scalar and SIMD.

Does this PR relate to any existing issue?

Fixes #473
Relates to #600 (where it is also reported)

Is there anything you would like reviewers to focus on?

Please on focus on method chosen to fix approximation between old oflow threshold and max float/double.
Interval was thoroughly tested for log1pf and log1p, but testing is always as good as it gets to double precision.

And add tests in this region.

Fix functions in region between previous
overflow bound and maximum float.

Accuracy is maintained by relying on high
accuracy log (in branch), however performance
drops slightly. Ideally the core approximation
should also work above threshold.
@blapie
Copy link
Collaborator Author

blapie commented Dec 6, 2024

Note that performance drops only slightly due to introduction of branch, INFINITY case is now delegated to log.

@blapie blapie merged commit ccd4fd4 into shibatch:master Dec 6, 2024
36 checks passed
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.

FP32 log1pf_u10 and FP64 log1p_u10 are infinitely inaccurate for large inputs
1 participant