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

Typo in s_exp2f function comment #1127

Closed
wants to merge 1 commit into from
Closed

Conversation

hchataing
Copy link
Contributor

No description provided.

@bsdimp
Copy link
Member

bsdimp commented Apr 12, 2024

This is an actual math error in the comment. It's also present in s_exp2.c as well. I fixed that and wrote up a more verbose commit message, as well as confirming the basic math with the original paper (which I put into the commit message).

@bsdimp bsdimp closed this Apr 12, 2024
@bsdimp bsdimp added the merged label Apr 12, 2024
freebsd-git pushed a commit that referenced this pull request Apr 12, 2024
x = k + y for some integer k and |y| < 1/2
exp2(x) = exp2(k + y) = exp2(k) * exp2(y)
which can be written as 2**k * exp2(y)

The original had x = 2**k + y, which is has an extra 2** in it which
isn't correct.

Confirmed by forumula 2 in Gal and Bachelis referenced in the comments
for the source of this method
	https://dl.acm.org/doi/pdf/10.1145/103147.103151

The actual code is correct.

Reviewed by: imp (who added s_exp2.c and wrote the commit message)
Pull Request: #1127
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Aug 7, 2024
x = k + y for some integer k and |y| < 1/2
exp2(x) = exp2(k + y) = exp2(k) * exp2(y)
which can be written as 2**k * exp2(y)

The original had x = 2**k + y, which is has an extra 2** in it which
isn't correct.

Confirmed by forumula 2 in Gal and Bachelis referenced in the comments
for the source of this method
	https://dl.acm.org/doi/pdf/10.1145/103147.103151

The actual code is correct.

Reviewed by: imp (who added s_exp2.c and wrote the commit message)
Pull Request: freebsd/freebsd-src#1127
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Aug 8, 2024
x = k + y for some integer k and |y| < 1/2
exp2(x) = exp2(k + y) = exp2(k) * exp2(y)
which can be written as 2**k * exp2(y)

The original had x = 2**k + y, which is has an extra 2** in it which
isn't correct.

Confirmed by forumula 2 in Gal and Bachelis referenced in the comments
for the source of this method
	https://dl.acm.org/doi/pdf/10.1145/103147.103151

The actual code is correct.

Reviewed by: imp (who added s_exp2.c and wrote the commit message)
Pull Request: freebsd/freebsd-src#1127
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants