Re: [Mesa-dev] [PATCH] glsl: improve the accuracy of the asin() builtin function.

2011-07-27 Thread Paul Berry
I forgot to mention: Fixes piglit tests {vs,fs}-asin-float and {vs,fs}-atan-* On 27 July 2011 15:15, Paul Berry wrote: > The previous formula for asin(x) was algebraically equivalent to: > > sign(x)*(pi/2 - sqrt(1-|x|)*(A + B|x| + C|x|^2)) > > where A, B, and C were arbitrary constants determine

[Mesa-dev] [PATCH] glsl: improve the accuracy of the asin() builtin function.

2011-07-27 Thread Paul Berry
The previous formula for asin(x) was algebraically equivalent to: sign(x)*(pi/2 - sqrt(1-|x|)*(A + B|x| + C|x|^2)) where A, B, and C were arbitrary constants determined by a curve fit. This formula had a worst case absolute error of 0.00448, an unbounded worst case relative error, and a disconti