On 2/16/2010 4:20 AM, Christoph Groth wrote:
As you are concerned about low order bits (and, you say, portability), and you said you wished to avoid 387 functions,I can avoid this inconsistency while staying portable by computing cos(x) as sqrt(1 - sin(x)^2).
double tmp = sin(x); .... sqrt((1+tmp)*(1-tmp))... would be more often accurate.I haven't heard of satisfactory solution of the question of SSE2 math functions for glibc, but that goes further off topic.
-- Tim Prince