Hacker News new | ask | show | jobs
by bostonpete 2659 days ago
The linked NASA article points out that with 40 digits of pi you could compute the circumference of the visible universe to an accuracy equal to the diameter of a hydrogen atom. I'm gonna say there's no practical application that would require even 40 digits, never mind a few hundred
1 comments

You need more digits than that to accurately compute double-precision trigonometric functions (if the input is close to pi, you need enough accurate digits left after performing range reduction).

This paper claims you need 2/pi accurate to 1144 bits which is about 345 decimal digits: https://www.csee.umbc.edu/~phatak/645/supl/Ng-ArgReduction.p...

As a counterpoint, no real computation I've performed on a computer needed to compute the cos of 2^1023 radians. I can't imagine such a scenario either.
You can either implement the functions accurately or inaccurately. Implementing them inaccurately is a slippery slope. Intel botched the hardware implementations in their processors not only for large inputs but also for inputs nearish to multiples of pi:

http://notabs.org/fpuaccuracy/index.htm