|
|
|
|
|
by mockery
1171 days ago
|
|
Can someone shed light on these two steps in the approximation? * since cos(x+y) ~ cos(x) - sin(x)*y
* ~ cos(x) - x*y,
For the first, maybe it's an approximate identity I'd never heard of?For the second, it seems like it relies on X being small, but in this code... Y might be small enough for sin==identity approximation, but X isn't, is it? |
|
The second line, I believe, is not relying on x being small, but rather relying on sin(x)*y being small. The whole result of the sin(x)*y term is approximately on the order of the LSB of the result, and the relative error of approximating sin(x) using 1 is better than using 0, so this term will help produce more accurate rounding of the bottom bits.