diff options
author | James Benton <[email protected]> | 2012-04-05 20:34:11 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2012-04-05 20:34:11 +0100 |
commit | cf68959f99f372ef1c4f647e7a7438ab478314c9 (patch) | |
tree | a83b6cc0c611884dd833f181301cb8c97b657553 /src/gallium/auxiliary/gallivm/f.cpp | |
parent | 7c639feb2f6697b5da94e81e7901436ce1620c66 (diff) |
gallivm: Updated lp_build_log2_approx to use a more accurate polynomial.
Tested with lp_test_arit with 100% passes and piglit tests with 100%
pass for log but some tests still fail for pow.
Signed-off-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/f.cpp')
-rw-r--r-- | src/gallium/auxiliary/gallivm/f.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/gallivm/f.cpp b/src/gallium/auxiliary/gallivm/f.cpp index 7cb50f16c0f..4b33e49b477 100644 --- a/src/gallium/auxiliary/gallivm/f.cpp +++ b/src/gallium/auxiliary/gallivm/f.cpp @@ -41,11 +41,11 @@ * * and take the coefficients from the P = { ... } array. * - * - To compute log2 5th order polynomial between [1, 2] do: + * - To compute log2 4th order polynomial between [0, 1/9] do: * * variant 1 - * range 1 2 - * order 5 0 + * range 0 0.111111112 + * order 4 0 * step 200 * info * @@ -77,7 +77,7 @@ boost::math::ntl::RR f(const boost::math::ntl::RR& x, int variant) return exp2(x); case 1: - return log2(x)/(x - 1.0); + return log2((1.0 + sqrt(x))/(1.0 - sqrt(x)))/sqrt(x); } return 0; |