This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: weird optimization in sin+cos, x86 backend


On 2012-02-18 14:38:01 +0000, James Courtier-Dutton wrote:
> Would it be useful to have some lib functions:
> remainder_2pi(x, &remainder)     /* returns remainder of x / 2Pi */
> remainder_pi2(x, &remainder, &quotient)  /* returns remainder of x /
> (Pi/2)  with a quotient returned so you can tell where in the range [0
> , 2Pi] it would fall.    */
> remainder_pi4(x, &remainder, &quotient)  /* returns remainder of x /
> (Pi/4), with a quotient returned.

For high accuracy (including correct rounding), since range reduction
isn't exact, one needs the remainder in a higher precision. The needed
precision can be more than twice the precision of the system.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]