Mark Dickinson <dicki...@gmail.com> added the comment: I think that recipe is meant more as a simple example of what's possible than as a bullet-proof library function. Can you suggest changes that would improve accuracy while also keeping the recipe clear and simple?
The usual method for sin/cos is to do an initial reduction by an integral multiple of pi/2 so that the argument lies in [-pi/4, pi/4]. (Though that's still problematic for very large arguments, where pi needs to be computed to many more places than the desired output accuracy.) Perhaps it would be best to just add a note to the docstring indicating that this is an implementation that's suitable for small arguments; for large arguments, more sophisticated algorithms are needed. ---------- nosy: +rhettinger _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7770> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com