Opened 4 years ago
Closed 4 years ago
#13603 closed Bugs (fixed)
sinc_pi can be more precise with Horner's method
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | math |
Version: | Boost 1.63.0 | Severity: | Optimization |
Keywords: | sinc_pi Horner | Cc: |
Description
double sinc1 = 1.0 + x2 * (-1.0 + x2 / 20.0) / 6.0;
double sinc2 = 1.0 - x2 /6.0 + x2*x2 / 120.0;
in some cases sinc1 provides better precision compared to sinc2
x generated with
double x = sqrt(sqrt(std::numeric_limits<double>::epsilon())); for (int i = 0; x > sqrt(std::numeric_limits<double>::epsilon()); i++) {
x *= 0.99876765378657564;
}
Note:
See TracTickets
for help on using tickets.
Thanks, applied in https://github.com/boostorg/math/commit/658945d50822adae83d77083a559e785ce18609c along with better tests.