Opened 4 years ago

Closed 4 years ago

#13603 closed Bugs (fixed)

sinc_pi can be more precise with Horner's method

Reported by: minorlogic@… 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;

}

Change History (1)

comment:1 by John Maddock, 4 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.