Use of C99 extra long double math functions after r236148

Bruce Evans brde at optusnet.com.au
Sun Aug 12 23:10:24 UTC 2012


On Fri, 20 Jul 2012, Stephen Montgomery-Smith wrote:

> On 07/20/2012 11:25 AM, Bruce Evans wrote:
>> On Fri, 20 Jul 2012, Stephen Montgomery-Smith wrote:
>
>
>> %             x0 = (float)x;
>> %             x1 = x - x0;
>> %             y0 = (float)y;
>> %             y1 = y - y0;
>> 
>> A good way to do the hi+lo decompositions.
>
> That was the way I tried first.  But it didn't work for me!
>
> But I see you changed things further down, so that is probably why it works 
> for you.

I didn't understand what was happening before, but think I can explain it
now:
- the above gives correct hi+lo decompositions.  Both hi and lo are usually
   nonzero.  The code below did't really understand hi+lo decompositions,
   and often increases the final error (relative to naive code).
- your code often gives null but backwards hi+lo decompositions, with hi = 0
   and lo = full value.  The code below did't really understand hi+lo
   decompositions.  But when hi = 0, it is especially easy to add and
   multiply it exactly, so the final error isn't increased so often.

Bruce


More information about the freebsd-numerics mailing list