Use rem2pi and rem with BigFloats in _quadrant#633
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #633 +/- ##
==========================================
- Coverage 82.92% 82.43% -0.50%
==========================================
Files 26 26
Lines 2173 2277 +104
==========================================
+ Hits 1802 1877 +75
- Misses 371 400 +29 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thx for looking into this! I will need to have a close look at the reference you provided as I know nothing about this topic. Nota bene: at first glance Section 11.3.2 seems to give us a way to estimate the required number of guard digits, denoted by |
I fully agree; it is much smaller the actual guard bits needed. Yet, I thought it was a bit more messy to get the minimum precision, compute whatever for that precision, and go back, than simply check that the BigFloat precision is large enough. |
This PR proposes to use
rem2piandremwithBigFloats, instead of the same methods for the specificAbsrtracFloats. The reason is that, in order to guarantee the precision one needs more "guard digits" than the actual precision; see J-M Muller, "Elementary Functions: Algorithms and implementations", Birkhäuser, 3rd ed (2005), chap. 11. While the solution to useBigFloats should have a performance impact, it seems to be at least safe, without implementing more elaborate range reduction methods.The following illustrates such a case:
As far as I have checked, or the tests show, there haven't been any issues with this change.
This approach could be adapted for the
mod(or should it berem?) function; cf #129, #145 and #178).