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

suggest ldexp() for x*2^y #328

Open
berthubert opened this issue Aug 8, 2020 · 1 comment
Open

suggest ldexp() for x*2^y #328

berthubert opened this issue Aug 8, 2020 · 1 comment

Comments

@berthubert
Copy link

Hi,

Thank you for Herbie, I think this will be very useful, if only to educate people that even double precision floating point is not magic!

In many contexts of Global Navigation Satellite Systems (GNSS), it is common to get parameters as integers which then need to be multiplied by 2^-47, for example. It turns out that IEEE 754 can do such multiplications natively on the exponent, and for this reason, POSIX provides a primitive called ldexp(x, y) where the result is x * 2^y, both for positive and negative y.

Using it enhances precision and speed, so it might be worthwhile to add it to Herbie.

@pavpanchekha
Copy link
Contributor

Good suggestion. We don't have ldexp right now because it takes an integer argument—that doesn't work for complicated and uninteresting reasons—but we should be able to do it soon.

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

No branches or pull requests

2 participants