IssueRaiser

You are absolutely right.

You are absolutely right. I am afraid there is no good solution for the problem except for performing symbolic calculations or simplifications. A hacky solution could be to round the output of sin(x) to a given internal precision. This would only hide the real internal numerical problem, though. It seems that other calculators suffer from the same issue: https://www.google.de/search?q=sin(1e10*pi) For now, I have increased the internal precision to 30 significant digits and updated the value of Pi to be more precise than that. Of course, this doesn't really solve the problem... just shifts it by a few orders of magnitude :-) Edit: Also, note that everything is fine if the answer is not zero (due to the rounding in the output): > sin(pi)+1 1

Posted by sharkdp on Mar 20, 2017, 7:06 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

hackernews (EdTech)

You are absolutely right.

sharkdpMar 20, 2017, 7:06 PM

You are absolutely right. I am afraid there is no good solution for the problem except for performing symbolic calculations or simplifications. A hacky solution could be to round the output of sin(x) to a given internal precision. This would only hide the real internal numerical problem, though. It seems that other calculators suffer from the same issue: https://www.google.de/search?q=sin(1e10*pi) For now, I have increased the internal precision to 30 significant digits and updated the value of Pi to be more precise than that. Of course, this doesn't really solve the problem... just shifts it by a few orders of magnitude :-) Edit: Also, note that everything is fine if the answer is not zero (due to the rounding in the output): > sin(pi)+1 1

Comments (0)

No comments yet. Start the discussion.

Comment on this issue