Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Aug 2012 17:03:34 -0500
From:      Stephen Montgomery-Smith <stephen@missouri.edu>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        freebsd-numerics@freebsd.org
Subject:   Re: Complex arg-trig functions
Message-ID:  <501D9C36.2040207@missouri.edu>
In-Reply-To: <20120805030609.R3101@besplex.bde.org>
References:  <5017111E.6060003@missouri.edu> <501C361D.4010807@missouri.edu> <20120804165555.X1231@besplex.bde.org> <501D51D7.1020101@missouri.edu> <20120805030609.R3101@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?501D9C36.2040207>