Thomas Lumley 8/27/2014

O necessary sinpi

Read Original

The article analyzes the numerical accuracy of trigonometric functions like sin(x) in computing, explaining why power series can fail due to catastrophic cancellation for large x. It introduces the sinpi(), cospi(), and tanpi() functions, which compute sin(πx) directly by reducing x modulo 1, avoiding multiplication by π and loss of precision. The discussion includes R code examples and contrasts with standard library implementations.

O necessary sinpi

Comments

No comments yet

Be the first to share your thoughts!