Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The polynomial/rational approximation mentioned by you is valid only for a small range of the possible input arguments

I was assuming that as part of the table stakes of the conversation.

Let's look at something basic and traditional like Cephes: https://github.com/jeremybarnes/cephes/blob/master/cmath/sin...

We start of with a range reduction to [0, pi/4] (presumably this would be [0, 1/8] in cycles), and then the polynomial happens.

If cycles really were that better, why isn't this implemented as starting with a conversion to cycles, then removal of the interval part, and then a division by 8, followed by whatever the appropriate polynomial/rational function is?

> adding or subtracting Pi or its submultiples cannot be done exactly.

I was also assuming that we've been talking about floating point this whole time.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: