Re: [Mesa-dev] [PATCH] glsl 1.30: Fix numerical instabilities in asinh

2011-09-27 Thread Eric Anholt
On Mon, 26 Sep 2011 16:19:55 -0700, Paul Berry wrote: > The formula we were previously using for asinh: > > asinh x = ln(x + sqrt(x * x + 1)) > > is numerically unstable: when x is a large negative value, the quantity > > x + sqrt(x * x + 1) > > is a small positive value (on the order

Re: [Mesa-dev] [PATCH] glsl 1.30: Fix numerical instabilities in asinh

2011-09-27 Thread Kenneth Graunke
On 09/26/2011 04:19 PM, Paul Berry wrote: The formula we were previously using for asinh: asinh x = ln(x + sqrt(x * x + 1)) is numerically unstable: when x is a large negative value, the quantity x + sqrt(x * x + 1) is a small positive value (on the order of 1/(2|x|)). Since the lo

Re: [Mesa-dev] [PATCH] glsl 1.30: Fix numerical instabilities in asinh

2011-09-27 Thread Paul Berry
On 27 September 2011 10:12, Chad Versace wrote: > On 09/26/2011 04:19 PM, Paul Berry wrote: > >> The formula we were previously using for asinh: >> >> asinh x = ln(x + sqrt(x * x + 1)) >> >> is numerically unstable: when x is a large negative value, the quantity >> >> x + sqrt(x * x + 1)

Re: [Mesa-dev] [PATCH] glsl 1.30: Fix numerical instabilities in asinh

2011-09-27 Thread Chad Versace
On 09/26/2011 04:19 PM, Paul Berry wrote: The formula we were previously using for asinh: asinh x = ln(x + sqrt(x * x + 1)) is numerically unstable: when x is a large negative value, the quantity x + sqrt(x * x + 1) is a small positive value (on the order of 1/(2|x|)). Since the lo

[Mesa-dev] [PATCH] glsl 1.30: Fix numerical instabilities in asinh

2011-09-26 Thread Paul Berry
The formula we were previously using for asinh: asinh x = ln(x + sqrt(x * x + 1)) is numerically unstable: when x is a large negative value, the quantity x + sqrt(x * x + 1) is a small positive value (on the order of 1/(2|x|)). Since the logarithm function is very sensitive in this ran