Use of C99 extra long double math functions after r236148
Stephen Montgomery-Smith
stephen at missouri.edu
Sun Aug 12 23:10:28 UTC 2012
On 07/20/2012 09:33 PM, Bruce Evans wrote:
> 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.
Yes. That was my intention. But I will go with whatever works best - I
am not sold on one solution over another.
More information about the freebsd-numerics
mailing list