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

[Question] Question Thread #5

Closed
sirinath opened this issue Dec 3, 2020 · 8 comments
Closed

[Question] Question Thread #5

sirinath opened this issue Dec 3, 2020 · 8 comments

Comments

@sirinath
Copy link

sirinath commented Dec 3, 2020

How are cache and error numbers generated?

How are the cache numbers (this and this) and error (this) numbers generated?

These numbers are different from what is found in the dragonbox repo.

@jk-jeon
Copy link
Owner

jk-jeon commented Dec 3, 2020

Yes, the tables in this repo is a strict superset of that in the Dragonbox repo. The reason is because tables in this repo includes additional entries for the reverse (decimal-to-binary) conversion. (The tables in this repo is the union of the entries required for Dragonbox and the entries required for the reverse conversion.)

The source code for the table generation is in this directory: https://github.com/jk-jeon/fp/tree/master/subproject/meta/source.

The code is somewhat non-intuitive, because it involves validity check of cache precision, which is explained in Section 6 of this paper and Section 4 of this paper. It would be very hard to read the code without a fair amount of understanding of the background theory. But I believe it may continue to work also for different formats you probably have in mind with only some minor corrections.

(I closed this because it is more of a question than an issue. Please add follow-up questions in this thread; I will respond to my best.)

@jk-jeon jk-jeon closed this as completed Dec 3, 2020
@sirinath sirinath changed the title [Question] How are cache and error numbers generated? [Question] Question Thread Dec 3, 2020
@sirinath
Copy link
Author

Since there ha been some commits to both dragonbox and fp with fixes, are the 2 repos now consistent with each other?

Also there has hardly been any improvements to either algorithms lately.

@jk-jeon
Copy link
Owner

jk-jeon commented Jan 30, 2021

The fix in the dragonbox repo should be ported here as well. But I expected to get some feedback on jk-jeon/dragonbox#11 (comment), so I decided to do the patch after updating the code according to the feedback. So far, it seems nobody has been interested in giving some feedback on that...

@sirinath
Copy link
Author

Also the implementations of policies in both the repos are complicated. Perhaps it can be simplified to be simple.

@sirinath
Copy link
Author

Ideally the 2 repos should be made consistent on merged commits. Additional changes also can be applied when they happen.

@jk-jeon
Copy link
Owner

jk-jeon commented Jan 31, 2021

Also the implementations of policies in both the repos are complicated. Perhaps it can be simplified to be simple.

Do you have any idea on that?

@sirinath
Copy link
Author

sirinath commented Jan 31, 2021

At the moment I am not sure. But there is an alternate simplified implementation here: https://github.com/abolz/Drachennest/blob/master/src/dragonbox.cc

I believe in this case the policy options are hard coded.

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