Faster floating point comparisons#814
Conversation
6c3977f to
d5baadc
Compare
|
@NAThompson Since you got this to work previously for 128 bit float do you see anything obvious I am missing? Error for incomplete type here. |
IIRC, this was something I looked up in the quadmath manual. I couldn't find it though . . . |
2c2b13a to
86b0dbd
Compare
|
@NAThompson This is good for review. I pulled 128 bit support into it's own header otherwise you would have to link quadmath anytime you used |
|
Any updates on this? |
|
Here are the before and after benchmarks @NAThompson : |
|
|
||
| BOOST_MATH_ASSERT(fast_float_distance(float_advance(val, 4), val) == -4); | ||
| BOOST_MATH_ASSERT(fast_float_distance(float_advance(val, -4), val) == 4); | ||
| if(std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::has_denorm == std::denorm_present)) |
There was a problem hiding this comment.
Doesn't the fast float distance unconditionally require denorm support?
There was a problem hiding this comment.
It's just type punning so as long as the floating point and fixed width integer are the same number of bits you should be fine. I don't know of a platform without denorm support to test on.
|
@mborland : Does it need a @jzmaddock : This is looking like it's about ready to go; might want to take a look. |
The float and double cases improve upon the current implementation. I could not get the |
Wait, I thought we had to link |
Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Could we use a judicious Also, 99% of the value will be from |
|
Having the include isn't enough in this case. You have to explicitly link to -lquadmath. |
|
@jzmaddock Can you please take a look at this one? @NAThompson hit me up about merging this. |
No description provided.