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

Ryu: Question about Step 0 in section 3.4 of the PLDI paper #233

Open
Ariel-Burton opened this issue Mar 13, 2024 · 0 comments
Open

Ryu: Question about Step 0 in section 3.4 of the PLDI paper #233

Ariel-Burton opened this issue Mar 13, 2024 · 0 comments

Comments

@Ariel-Burton
Copy link

In Section 3.4 of your PLDI paper you write:

For each possible value of e2 that is greater than or equal to zero, we determine q as max (0, floor(e2 log10(2)) − 1) (Lemma 3.2), and then use B0 to determine a legal value for k as (B0 + floor(log2(5^q))) (Lemma 3.3). We compute (floor(2^k/5^q) + 1) using arbitrary precision arithmetic --- its result has no more than B0 bits --- and store it in a lookup table TABLE_GTE indexed by q.

For e2 == 0, q must be 0..
Thus, 5^q must be 1, and log2(5^0)) is 0,
so k == (B0 + log2(5^0)) == (B0 + log2(1)) == B0.

Therefore, when e2 == 0, we have q == 0, and k == B0.

Now consider how many bits there must be in floor(2^k / 5^q) + 1 when q == 0 and k == B0:
floor(2^k / 5^q ) + 1 == floor(2^B0 / 1) + 1
== 2^B0 + 1.

The number of bits in 2^B0 + 1 is B0 + 1.

However, this contradicts the statement that the result of floor(2^k . 5^q) + 1 "has no more bits than B0", since we need B0 + 1 bits for the case when e2 == 0.

Can you explain what you mean?

Thanks!

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

1 participant