简体   繁体   中英

Range reduction for trigonometric functions

I'm trying to implement range reduction for trigonometric functions. I found this paper http://www.computer.org/csdl/proceedings/pcspa/2010/4180/00/4180b048-abs.html which talks about using 64-bit integer arithmetic.

The idea presented should work but there seems to be some problem with equations in the paper. Is this efficient than the one implemented in fdlibm ?

[edit] Sorry i did not see this as a 2012 question but a 2013 one.

This does not fit as a comment, so posted here. I understand it does not directly answer OP's post, but I strongly see it as a prerequisite to the issue.

Should you want to to perform a complete floating point range reduction, consult KC Ng's "ARGUMENT REDUCTION FOR HUGE ARGUMENTS: Good to the Last Bit" readily findable on the web.

The salient issue is that to do range reduction on standard trig functions such as sine(x), where x is in radians, one must do a precise mod operation involving Pi. The mod needs to extend 4/Pi out to enough factional bit places to have a meaningful result. This paper details that process and how far one needs to go. Turns out, it is potential 100s of bits, but not millions of bits. Possible you are aware of this issue, but if not, it is what you need to know to make a good reduction using 64-bit routines or whatever.

as @eh9 says, could you post some info on the behind-the-wall link and the problems you face?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM