Complex arg-trig functions
Stephen Montgomery-Smith
stephen at missouri.edu
Sat Aug 4 22:03:42 UTC 2012
On 08/04/2012 03:45 PM, Bruce Evans wrote:
> On Sat, 4 Aug 2012, Stephen Montgomery-Smith wrote:
>
>> On 08/04/2012 03:49 AM, Bruce Evans wrote:
>>> On Fri, 3 Aug 2012, Stephen Montgomery-Smith wrote:
>>
>>> I made good progress with clog[fl](). The accuracy problems near 0
>>> are long solved and proved to be solved.
>>
>> I would be interested to see how you solved this. Would you be
>> willing to post your code somewhere?
I am starting to go through your code.
What is the purpose of the macros norm and spadd?
Also, the proof you provided (which I haven't gone through in detail
yet) - do you intend to put them as comments in the code?
For example, when you write:
% EXTRACT_WORDS(hx, lx, ax);
% bits = ((uint64_t)hx << 32) | lx;
% bits += 0x04000000;
% hx = bits >> 32;
% lx = bits & 0xf8000000;
% INSERT_WORDS(xh, hx, lx);
% xl = ax - xh;
it would be very helpful to include a comment like
% /*
* xh is ax rounded to nearest 26 bit floating point.
* xl is such that x = xh + xl.
* Because xh is rounded and not truncated to 26 bits,
* only the top 26 bits (not 27=53-26) of the mantissa of
* xl can be non-zero.
*/
because while that can be deduced from reading the code, it is by no
means obvious.
By the way, that rounding to the nearest 26 bits is a very smart idea.
More information about the freebsd-numerics
mailing list