Use of C99 extra long double math functions after r236148
Stephen Montgomery-Smith
stephen at missouri.edu
Sun Aug 12 23:12:46 UTC 2012
On 07/22/2012 01:19 AM, Bruce Evans wrote:
>> 2. I have thought more about the problem of computing clog(z) when
>> |z| is close to 1. I now think it might even require precision that
>> is 3 times better than double precision.
>> It is possible that you could, by chance, pick x and y so that |z| = 1
>> + 1e30. (I wrote a test program, and this did
> e-30 here and elsewhere
>> actually happen a few times.) So when you compute x^2+y^2-1, if you
>> do it using double double precision, you will get 2e30, but only the
>> most significant digits will be accurate. The ULP will be about
>> 1e15. You need triple double precision to get ULP's close to 1.
>
> Hmm, I'm not seeing such cases except when |x| or |y| is 1 and the other
> is tiny.
That was my mistake. I didn't have enough precision in mpfr to use it
as a proper reference! Now I tested my code, and I seem to be getting
ULP's consistently less than 2!
I am attaching my clog code and my test code. I go in and manually
change the test code to test around a different range of values.
More information about the freebsd-numerics
mailing list