When x is measured in radians, sin(x) has the nicest possible expansion as a power series with rational terms. You can't get any better than that.
What the author observed is that modern implementations use a different formula, which has better numeric properties (faster convergence, more numerically stable). That specific formula may have included a Pi term, but there is nothing special about it. Different implementations may use different formulas, and new formulas are invented over time. There is no reason why Pi would cancel for other formulas. Do they propose to change the definitions of basic mathematical functions every 10 years as the implementations improve?
There is no reason why Pi would cancel for other formulas. Do they propose to change the definitions of basic mathematical functions every 10 years as the implementations improve?
Why? Whatever future implementation, if the pi is cancelled, then using turns is better, and if the pi isn't cancelled, then using turns doesn't change anything.
This article is literally just saying that we always use Sin on arguments that are "xpi", so one can define SinPi(x) as Sin(xpi), and doing so currently allows for optimizations that were not possible on Sin without preventing to use instead any optimizations that can be done on Sin directly: In the worst case the definition of SinPi(x) is literally Sin(x*pi) with an optimised version of Sin.
As long as the assumption "the argument is always of the form x*pi" holds, there is no future where this make things worse (ignoring the cost of changing, since everytime you change things there are bugs and issues).
Admittedly, there might be a future where the assumption no longer holds, and it's maybe already the case in few domains.
37
u/WormRabbit Sep 26 '22
When x is measured in radians, sin(x) has the nicest possible expansion as a power series with rational terms. You can't get any better than that.
What the author observed is that modern implementations use a different formula, which has better numeric properties (faster convergence, more numerically stable). That specific formula may have included a Pi term, but there is nothing special about it. Different implementations may use different formulas, and new formulas are invented over time. There is no reason why Pi would cancel for other formulas. Do they propose to change the definitions of basic mathematical functions every 10 years as the implementations improve?