-
Notifications
You must be signed in to change notification settings - Fork 226
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
Can boost::math::float_distance be sped up? #359
Comments
Thats interesting! Does it pass the tests? |
@jzmaddock : Yes; here's some background on the trick. |
OK, but as pointed out in the article, your trick fails when the two inputs differ in sign (this includes when one input is zero). I also get a negative rather than positive result for say |
@jzmaddock : Yeah, the fact that The wins for float128 are pretty huge: Without the fast float distance:
with it:
Implementation:
I couldn't get it to work with |
|
In the AGM PR, I have found that ~90% of the runtime is spent computing float distances. However, at least for
float
anddouble
, the following trivial modification drops the runtime to a negligible fraction of the total runtime:It seems like
boost::math::float_distance
is considerably more general than this, but can we dive through a happy path to extract performance in the trivial cases?The text was updated successfully, but these errors were encountered: