Uh oh!
There was an error while loading. Please reload this page.
rem_pio2: actually return medium value for x ~ 2pi/2 - #165
Conversation
m1el
commented
May 13, 2019
Adding the |
alexcrichton
commented
May 13, 2019
Thanks! Can a test be added for this since it presumably wasn't caught by the existing tests? |
m1el
commented
May 13, 2019
I'll try to find a test case for this, but it might be the case that this is an optimization for this specific range. Although it should be obvious from the code that currently the return value of |
m1el
commented
May 13, 2019
Added tests for this change, public interface |
m1el
commented
May 13, 2019
The reason general tests didn't catch it: this difference only affects some values in range |
alexcrichton
commented
May 13, 2019
@bors: r+ Hm ok, perhaps the random generation for floats could be updated to have a low-probability path to generate values near pi and/or multiples of pi? |
m1el
commented
May 13, 2019
@alexcrichton RNG that generates "interesting" numbers more often is definitely doable, that's a great idea. It should probably be implemented under a different issue/PR. |
rem_pio2: actually return medium value for x ~ 2pi/2
There's a discrepancy between musl's rem_pio2 and libm's rem_pio2:
The calculation result for medium case is not used for x ~ pi/2..2pi/2